All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen: Make VPMU init message look less scary
@ 2016-08-02  6:43 ` Juergen Gross
  0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2016-08-02  6:43 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: boris.ostrovsky, david.vrabel, Juergen Gross

The default for the Xen hypervisor is to not enable VPMU in order to
avoid security issues. In this case the Linux kernel will issue the
message "Could not initialize VPMU for cpu 0, error -95" which looks
more like an error than a normal state.

Change the message to something less scary in case the hypervisor
returns EOPNOTSUPP when trying to activate VPMU.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2: modify error message as suggested by Konrad Wilk
---
 arch/x86/xen/pmu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c
index 32bdc2c..bfe8880 100644
--- a/arch/x86/xen/pmu.c
+++ b/arch/x86/xen/pmu.c
@@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
 	return;
 
 fail:
-	pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
-		cpu, err);
+	if (err == -EOPNOTSUPP)
+		pr_info_once("VPMU disabled by hypervisor.\n");
+	else
+		pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
+			cpu, err);
 	free_pages((unsigned long)xenpmu_data, 0);
 }
 
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] xen: Make VPMU init message look less scary
@ 2016-08-02  6:43 ` Juergen Gross
  0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2016-08-02  6:43 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: Juergen Gross, boris.ostrovsky, david.vrabel

The default for the Xen hypervisor is to not enable VPMU in order to
avoid security issues. In this case the Linux kernel will issue the
message "Could not initialize VPMU for cpu 0, error -95" which looks
more like an error than a normal state.

Change the message to something less scary in case the hypervisor
returns EOPNOTSUPP when trying to activate VPMU.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2: modify error message as suggested by Konrad Wilk
---
 arch/x86/xen/pmu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c
index 32bdc2c..bfe8880 100644
--- a/arch/x86/xen/pmu.c
+++ b/arch/x86/xen/pmu.c
@@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
 	return;
 
 fail:
-	pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
-		cpu, err);
+	if (err == -EOPNOTSUPP)
+		pr_info_once("VPMU disabled by hypervisor.\n");
+	else
+		pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
+			cpu, err);
 	free_pages((unsigned long)xenpmu_data, 0);
 }
 
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Xen-devel] [PATCH v2] xen: Make VPMU init message look less scary
  2016-08-02  6:43 ` Juergen Gross
@ 2016-08-02  7:10   ` Jan Beulich
  -1 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2016-08-02  7:10 UTC (permalink / raw)
  To: Juergen Gross; +Cc: david.vrabel, xen-devel, boris.ostrovsky, linux-kernel

>>> On 02.08.16 at 08:43, <JGross@suse.com> wrote:
> --- a/arch/x86/xen/pmu.c
> +++ b/arch/x86/xen/pmu.c
> @@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
>  	return;
>  
>  fail:
> -	pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
> -		cpu, err);
> +	if (err == -EOPNOTSUPP)
> +		pr_info_once("VPMU disabled by hypervisor.\n");
> +	else
> +		pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
> +			cpu, err);

I'm sorry for not already having thought about this for v1, but
what about older hypervisors, where the hypercall would return
-ENOSYS?

Jan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xen: Make VPMU init message look less scary
@ 2016-08-02  7:10   ` Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2016-08-02  7:10 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, boris.ostrovsky, david.vrabel, linux-kernel

>>> On 02.08.16 at 08:43, <JGross@suse.com> wrote:
> --- a/arch/x86/xen/pmu.c
> +++ b/arch/x86/xen/pmu.c
> @@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
>  	return;
>  
>  fail:
> -	pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
> -		cpu, err);
> +	if (err == -EOPNOTSUPP)
> +		pr_info_once("VPMU disabled by hypervisor.\n");
> +	else
> +		pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
> +			cpu, err);

I'm sorry for not already having thought about this for v1, but
what about older hypervisors, where the hypercall would return
-ENOSYS?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xen-devel] [PATCH v2] xen: Make VPMU init message look less scary
       [not found] ` <57A0636A0200007800101998@suse.com>
@ 2016-08-02  7:12     ` Juergen Gross
  0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2016-08-02  7:12 UTC (permalink / raw)
  To: Jan Beulich; +Cc: david.vrabel, xen-devel, boris.ostrovsky, linux-kernel

On 02/08/16 09:10, Jan Beulich wrote:
>>>> On 02.08.16 at 08:43, <JGross@suse.com> wrote:
>> --- a/arch/x86/xen/pmu.c
>> +++ b/arch/x86/xen/pmu.c
>> @@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
>>  	return;
>>  
>>  fail:
>> -	pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
>> -		cpu, err);
>> +	if (err == -EOPNOTSUPP)
>> +		pr_info_once("VPMU disabled by hypervisor.\n");
>> +	else
>> +		pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
>> +			cpu, err);
> 
> I'm sorry for not already having thought about this for v1, but
> what about older hypervisors, where the hypercall would return
> -ENOSYS?

I wasn't aware of that possibility. It should be covered, of course!

V3 will be sent soon...

Thanks for noticing now,


Juergen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xen: Make VPMU init message look less scary
@ 2016-08-02  7:12     ` Juergen Gross
  0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2016-08-02  7:12 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, boris.ostrovsky, david.vrabel, linux-kernel

On 02/08/16 09:10, Jan Beulich wrote:
>>>> On 02.08.16 at 08:43, <JGross@suse.com> wrote:
>> --- a/arch/x86/xen/pmu.c
>> +++ b/arch/x86/xen/pmu.c
>> @@ -547,8 +547,11 @@ void xen_pmu_init(int cpu)
>>  	return;
>>  
>>  fail:
>> -	pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
>> -		cpu, err);
>> +	if (err == -EOPNOTSUPP)
>> +		pr_info_once("VPMU disabled by hypervisor.\n");
>> +	else
>> +		pr_info_once("Could not initialize VPMU for cpu %d, error %d\n",
>> +			cpu, err);
> 
> I'm sorry for not already having thought about this for v1, but
> what about older hypervisors, where the hypercall would return
> -ENOSYS?

I wasn't aware of that possibility. It should be covered, of course!

V3 will be sent soon...

Thanks for noticing now,


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-02  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02  6:43 [PATCH v2] xen: Make VPMU init message look less scary Juergen Gross
2016-08-02  6:43 ` Juergen Gross
2016-08-02  7:10 ` [Xen-devel] " Jan Beulich
2016-08-02  7:10   ` Jan Beulich
     [not found] ` <57A0636A0200007800101998@suse.com>
2016-08-02  7:12   ` [Xen-devel] " Juergen Gross
2016-08-02  7:12     ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.