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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Jun 2010 10:24:42 +0200
From:	Jes Sorensen <Jes.Sorensen@...hat.com>
To:	"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>
CC:	LKML <linux-kernel@...r.kernel.org>, kvm@...r.kernel.org,
	Avi Kivity <avi@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	Fr??d??ric Weisbecker <fweisbec@...il.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Cyrill Gorcunov <gorcunov@...il.com>,
	Lin Ming <ming.m.lin@...el.com>,
	Sheng Yang <sheng@...ux.intel.com>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	oerg Roedel <joro@...tes.org>, Gleb Natapov <gleb@...hat.com>,
	Zachary Amsden <zamsden@...hat.com>, zhiteng.huang@...el.com,
	tim.c.chen@...el.com
Subject: Re: [PATCH V2 4/5] ara virt interface of perf to support kvm guest
 os statistics collection in guest os

On 06/21/10 11:31, Zhang, Yanmin wrote:
> @@ -583,10 +584,20 @@ static void x86_pmu_disable_all(void)
>  	}
>  }
>  
> +#ifdef CONFIG_KVM_PERF
> +static int kvm_hw_perf_enable(void);
> +static int kvm_hw_perf_disable(void);
> +#endif

Please put these prototypes into a header ... and create dummy stubs for
them when CONFIG_KVM_PERF is not set.

>  void hw_perf_disable(void)
>  {
>  	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
>  
> +#ifdef CONFIG_KVM_PERF
> +	if (!kvm_hw_perf_disable())
> +		return;
> +#endif

If you stub them out we can avoid all the ugly #ifdefs

> @@ -810,6 +821,11 @@ void hw_perf_enable(void)
>  	struct hw_perf_event *hwc;
>  	int i, added = cpuc->n_added;
>  
> +#ifdef CONFIG_KVM_PERF
> +	if (!kvm_hw_perf_enable())
> +		return;
> +#endif

and here....

> @@ -1317,6 +1334,11 @@ void __init init_hw_perf_events(void)
>  
>  	pr_info("Performance Events: ");
>  
> +#ifdef CONFIG_KVM_PERF
> +	if (!kvm_init_hw_perf_events())
> +		return;
> +#endif

and again here :)

Cheers,
Jes


--
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