From patchwork Tue Feb 26 19:29:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 2187361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id CD7F33FCF2 for ; Tue, 26 Feb 2013 19:33:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1UAQE0-0005hz-Cs; Tue, 26 Feb 2013 19:30:04 +0000 Received: from mail-pa0-f47.google.com ([209.85.220.47]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1UAQDw-0005hG-Uv for linux-arm-kernel@lists.infradead.org; Tue, 26 Feb 2013 19:30:02 +0000 Received: by mail-pa0-f47.google.com with SMTP id bj3so2637329pad.6 for ; Tue, 26 Feb 2013 11:29:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type:x-gm-message-state; bh=q0xCmsTXBj182peDsbcyrWFeRGmnYQV5nOcyByspVBk=; b=eoUNWcA4yCQ4/IbWr8g1qbiWO7kjYhum4mGPT1glejKrbTzwsDsHSqmLoNVtJhXHzI +JlrmOgRe0jgBxVUZVGb+IubH8nNiya3VHIRjtP5aUgjg9T6MRt5l8hEuez+a5a/8oJl +KzzRUiFOzMuIklv+HTcywRtqOX87glOJX/tjnjL6BBYim1E0dhgtR5aNsKHkwcSEWqU /WLjL/jSwxtRfT5UtRnfJwgXQspNfRz0tpJWEuirrVFdreI1dzv9J5oX3T/gi3BtJ1zX IojKiPmv2JZCR9CP1IP4PNhOssFfqNraqru0pt+gOEL6tjRIZyZ4YSz6FZz5QwgbGZWM IbAg== X-Received: by 10.66.162.232 with SMTP id yd8mr3401246pab.100.1361906999164; Tue, 26 Feb 2013 11:29:59 -0800 (PST) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id d1sm2416707pav.6.2013.02.26.11.29.56 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 26 Feb 2013 11:29:57 -0800 (PST) From: Kevin Hilman To: Frederic Weisbecker Subject: Re: [RFC/PATCH 1/5] context tracking: conditionalize guest support based on CONFIG_KVM References: <1361389302-11968-1-git-send-email-khilman@linaro.org> <1361389302-11968-2-git-send-email-khilman@linaro.org> <20130222132750.GE17948@somewhere.redhat.com> Date: Tue, 26 Feb 2013 11:29:55 -0800 In-Reply-To: <20130222132750.GE17948@somewhere.redhat.com> (Frederic Weisbecker's message of "Fri, 22 Feb 2013 14:27:52 +0100") Message-ID: <87fw0izxe4.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmyE1SvtZYs3uJvI1S1eoTr7RXvyK+X1Jh5ziBcf2q513bmSNCZg6yXVCB9tlN/jb/9Zfcn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130226_143001_077757_58B0F758 X-CRM114-Status: GOOD ( 16.89 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.47 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mats Liljegren , linaro-dev@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Frederic Weisbecker writes: > On Wed, Feb 20, 2013 at 11:41:38AM -0800, Kevin Hilman wrote: >> So that it can build on !KVM systems too. >> >> Signed-off-by: Kevin Hilman >> --- >> kernel/context_tracking.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c >> index 74f68f4..6fe96b1 100644 >> --- a/kernel/context_tracking.c >> +++ b/kernel/context_tracking.c >> @@ -1,5 +1,7 @@ >> #include >> +#ifdef CONFIG_KVM >> #include >> +#endif > > The header should take care of the off-case, no need to ifdef its inclusion. In their current form, the headers will not build on platforms without KVM support. For example, these platforms (like ARM) don't even have or . >> #include >> #include >> #include >> @@ -62,6 +64,7 @@ void user_exit(void) >> local_irq_restore(flags); >> } >> >> +#ifdef CONFIG_KVM >> void guest_enter(void) >> { >> if (vtime_accounting_enabled()) >> @@ -79,6 +82,7 @@ void guest_exit(void) >> __guest_exit(); >> } >> EXPORT_SYMBOL_GPL(guest_exit); >> +#endif > > Kvm might be built as a module so we can't actually do this unfortunately. Ah, right. How bout using #if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE) for both conditionals above? Updated patch below. Kevin From 4444ce39eea21a5fc63b04a711addab2a5c63243 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Thu, 14 Feb 2013 10:17:37 -0800 Subject: [PATCH] context tracking: conditionalize guest support based on CONFIG_KVM So that it can build on !KVM systems too. Signed-off-by: Kevin Hilman --- kernel/context_tracking.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 74f68f4..d9c98dd 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -1,5 +1,7 @@ #include +#if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE) #include +#endif #include #include #include @@ -62,6 +64,7 @@ void user_exit(void) local_irq_restore(flags); } +#if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE) void guest_enter(void) { if (vtime_accounting_enabled()) @@ -79,6 +82,7 @@ void guest_exit(void) __guest_exit(); } EXPORT_SYMBOL_GPL(guest_exit); +#endif void context_tracking_task_switch(struct task_struct *prev, struct task_struct *next)