From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: kevin.tian@intel.com, suravee.suthikulpanit@amd.com,
andrew.cooper3@citrix.com, tim@xen.org,
dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org,
Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com,
dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v16 02/23] x86/VPMU: Don't globally disable VPMU if initialization fails.
Date: Thu, 18 Dec 2014 11:08:49 -0500 [thread overview]
Message-ID: <5492FC11.8010305@oracle.com> (raw)
In-Reply-To: <5492EE5C0200007800050AD9@mail.emea.novell.com>
On 12/18/2014 09:10 AM, Jan Beulich wrote:
>>>> On 17.12.14 at 16:38, <boris.ostrovsky@oracle.com> wrote:
>> The failure to initialize VPMU may be temporary so we shouldn'd disable VMPU
>> forever.
> Reported-by: Jan Beulich <jbeulich@suse.com>
> (or Suggested-by if you like that better)
>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> ---
>> xen/arch/x86/hvm/vpmu.c | 15 ++++++++-------
>> 1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
>> index 1df74c2..b43ea80 100644
>> --- a/xen/arch/x86/hvm/vpmu.c
>> +++ b/xen/arch/x86/hvm/vpmu.c
>> @@ -218,6 +218,7 @@ void vpmu_initialise(struct vcpu *v)
>> {
>> struct vpmu_struct *vpmu = vcpu_vpmu(v);
>> uint8_t vendor = current_cpu_data.x86_vendor;
>> + int ret;
>>
>> if ( is_pvh_vcpu(v) )
>> return;
>> @@ -230,21 +231,21 @@ void vpmu_initialise(struct vcpu *v)
>> switch ( vendor )
>> {
>> case X86_VENDOR_AMD:
>> - if ( svm_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
>> - opt_vpmu_enabled = 0;
>> + ret = svm_vpmu_initialise(v, opt_vpmu_enabled);
>> break;
>>
>> case X86_VENDOR_INTEL:
>> - if ( vmx_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
>> - opt_vpmu_enabled = 0;
>> + ret = vmx_vpmu_initialise(v, opt_vpmu_enabled);
>> break;
>>
>> default:
>> - printk("VPMU: Initialization failed. "
>> - "Unknown CPU vendor %d\n", vendor);
>> - opt_vpmu_enabled = 0;
>> + ret = -EINVAL;
>> + printk(XENLOG_G_WARNING "VPMU: Unknown CPU vendor %d\n", vendor);
>> break;
>> }
>> +
>> + if ( ret )
>> + printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
> Please avoid issuing two messages for the same problem. And the
> one in the default case probably doesn't make sense to be issued
> more than once (and then perhaps at boot time, if that doesn't
> happen already).
I see not doing this for default case but arch-specific inits may (at
least in principle) fail for some VCPUs and not for others so I think I
should keep warnings.
What I perhaps should do for default case (and in fact I do this in
patch 14 where I moved some of this stuff into __initcalls) is to
disable VPMU globally.
As for printing only once --- I often wondered whether we should have
something similar to Linux' WARN_ONCE().
-boris
next prev parent reply other threads:[~2014-12-18 16:08 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 15:38 [PATCH v16 00/23] x86/PMU: Xen PMU PV(H) support Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 01/23] common/symbols: Export hypervisor symbols to privileged guest Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 02/23] x86/VPMU: Don't globally disable VPMU if initialization fails Boris Ostrovsky
2014-12-18 14:10 ` Jan Beulich
2014-12-18 16:08 ` Boris Ostrovsky [this message]
2014-12-18 16:57 ` Jan Beulich
2014-12-17 15:38 ` [PATCH v16 03/23] x86/VPMU: Manage VPMU_CONTEXT_SAVE flag in vpmu_save_force() Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 04/23] x86/VPMU: Set MSR bitmaps only for HVM/PVH guests Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 05/23] x86/VPMU: Make vpmu macros a bit more efficient Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 06/23] intel/VPMU: Clean up Intel VPMU code Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 07/23] vmx: Merge MSR management routines Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 08/23] x86/VPMU: Handle APIC_LVTPC accesses Boris Ostrovsky
2014-12-18 14:12 ` Jan Beulich
2014-12-17 15:38 ` [PATCH v16 09/23] intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL should be initialized to zero Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 10/23] x86/VPMU: Add public xenpmu.h Boris Ostrovsky
2014-12-18 14:17 ` Jan Beulich
2014-12-17 15:38 ` [PATCH v16 11/23] x86/VPMU: Make vpmu not HVM-specific Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 12/23] x86/VPMU: Replace vcpu with vpmu as argument to some routines Boris Ostrovsky
2014-12-18 14:22 ` Jan Beulich
2014-12-17 15:38 ` [PATCH v16 13/23] x86/VPMU: Interface for setting PMU mode and flags Boris Ostrovsky
2014-12-18 14:45 ` Jan Beulich
2015-01-05 20:32 ` Daniel De Graaf
2014-12-17 15:38 ` [PATCH v16 14/23] x86/VPMU: Initialize VPMUs with __initcall Boris Ostrovsky
2014-12-18 14:52 ` Jan Beulich
2014-12-17 15:38 ` [PATCH v16 15/23] x86/VPMU: Initialize PMU for PV(H) guests Boris Ostrovsky
2015-01-05 20:32 ` Daniel De Graaf
2014-12-17 15:38 ` [PATCH v16 16/23] x86/VPMU: Save VPMU state for PV guests during context switch Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 17/23] x86/VPMU: When handling MSR accesses, leave fault injection to callers Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 18/23] x86/VPMU: Add support for PMU register handling on PV guests Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 19/23] x86/VPMU: Handle PMU interrupts for " Boris Ostrovsky
2014-12-18 14:57 ` Jan Beulich
2014-12-17 15:38 ` [PATCH v16 20/23] x86/VPMU: Merge vpmu_rdmsr and vpmu_wrmsr Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 21/23] x86/VPMU: Add privileged PMU mode Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 22/23] x86/VPMU: NMI-based VPMU support Boris Ostrovsky
2014-12-17 15:38 ` [PATCH v16 23/23] x86/VPMU: Move VPMU files up from hvm/ directory Boris Ostrovsky
2014-12-18 12:15 ` [PATCH v16 00/23] x86/PMU: Xen PMU PV(H) support Dietmar Hahn
2014-12-18 15:49 ` Boris Ostrovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5492FC11.8010305@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=dietmar.hahn@ts.fujitsu.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.