From patchwork Wed Feb 27 14:24:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 223611 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6D2642C0085 for ; Thu, 28 Feb 2013 01:29:44 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UAhvi-0002an-2R; Wed, 27 Feb 2013 14:24:22 +0000 Received: from mail-da0-f52.google.com ([209.85.210.52]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UAhvU-0002X2-Kc for linux-arm-kernel@lists.infradead.org; Wed, 27 Feb 2013 14:24:09 +0000 Received: by mail-da0-f52.google.com with SMTP id x33so320246dad.11 for ; Wed, 27 Feb 2013 06:24:06 -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 :content-transfer-encoding:x-gm-message-state; bh=RJkPraiUigmG/Irw6CFpa0WLXgZKN3q15eTPbPfNCvg=; b=B7B5YOF3anmNzkv+ie0u3BYaQyTDVSfub5F+fktbR0D+SMMEtWE1siRMlreyqfZTsZ XH/gNJFXLwBfpZnG7Egl235v0vOrpsupyPLbIy/9uNIJhCqH05sjTDk4FLgHGMa0mOiZ 9Z5UAsfUjlqy0nU2T26of4dlQkVmtc6IYaAoOc/5pwbGRvejoyN/Pd7VkmWkXQz63Eh4 dkKqdQBfFXMU67rRCzM75iobvyCUrE9xm39SSH5jnsaZ/5nGpCbczrsPeskglKS7RM7o oJc5SKXSZQXjVv6N3rSoKZPc3ewtnCL+cyQhvUcUnIzcATsmv0apk6beoTC2ZwZsoTA3 PdOA== X-Received: by 10.68.189.199 with SMTP id gk7mr3494743pbc.164.1361975046696; Wed, 27 Feb 2013 06:24:06 -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 in5sm4820059pbc.20.2013.02.27.06.24.04 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Feb 2013 06:24:05 -0800 (PST) From: Kevin Hilman To: Namhyung Kim 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> <87fw0izxe4.fsf@linaro.org> <1361916782.1740.2.camel@leonhard> Date: Wed, 27 Feb 2013 06:24:03 -0800 In-Reply-To: <1361916782.1740.2.camel@leonhard> (Namhyung Kim's message of "Wed, 27 Feb 2013 07:13:02 +0900") Message-ID: <87621dygvw.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlRDm1AlyNTj79Nc8eMb2QIpkX86xLtuL8ZKIaIYQFh0J2W8+123M94hS28iEgUiTDn5nSg X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130227_092408_763576_7727B4F2 X-CRM114-Status: GOOD ( 18.25 ) 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.210.52 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Frederic Weisbecker , 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.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Namhyung Kim writes: > 2013-02-26 (화), 11:29 -0800, Kevin Hilman: >> 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. > > This is what IS_ENABLED(CONFIG_KVM) is for. Right, updated patch below. Kevin From 61e35f069a64c03a2bce348487d41072aeb9f36b 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..fda6cd6 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -1,5 +1,7 @@ #include +#if IS_ENABLED(CONFIG_KVM) #include +#endif #include #include #include @@ -62,6 +64,7 @@ void user_exit(void) local_irq_restore(flags); } +#if IS_ENABLED(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 void context_tracking_task_switch(struct task_struct *prev, struct task_struct *next)