lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1361916782.1740.2.camel@leonhard>
Date:	Wed, 27 Feb 2013 07:13:02 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Kevin Hilman <khilman@...aro.org>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Mats Liljegren <mats.liljegren@...a.com>,
	linaro-dev@...ts.linaro.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC/PATCH 1/5] context tracking: conditionalize guest support
 based on CONFIG_KVM

2013-02-26 (화), 11:29 -0800, Kevin Hilman:
> Frederic Weisbecker <fweisbec@...il.com> 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 <khilman@...aro.org>
> >> ---
> >>  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 <linux/context_tracking.h>
> >> +#ifdef CONFIG_KVM
> >>  #include <linux/kvm_host.h>
> >> +#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
> <asm/kvm.h> or <asm/kvm_host.h>.
> 
> >>  #include <linux/rcupdate.h>
> >>  #include <linux/sched.h>
> >>  #include <linux/hardirq.h>
> >> @@ -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.

Thanks,
Namhyung

> 
> Kevin
> 
> 
> From 4444ce39eea21a5fc63b04a711addab2a5c63243 Mon Sep 17 00:00:00 2001
> From: Kevin Hilman <khilman@...aro.org>
> 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 <khilman@...aro.org>
> ---
>  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 <linux/context_tracking.h>
> +#if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE)
>  #include <linux/kvm_host.h>
> +#endif
>  #include <linux/rcupdate.h>
>  #include <linux/sched.h>
>  #include <linux/hardirq.h>
> @@ -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)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ