xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, Wei Wang <wei.wang2@amd.com>
Cc: Keir Fraser <keir@xen.org>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/amd: Fix xen_apic_write warnings in Dom0
Date: Mon, 15 Oct 2012 13:09:38 +0100	[thread overview]
Message-ID: <CCA1BB92.41B09%keir.xen@gmail.com> (raw)
In-Reply-To: <507C0BA702000078000A15A9@nat28.tlf.novell.com>

On 15/10/2012 12:12, "Jan Beulich" <JBeulich@suse.com> wrote:

>>>> On 09.10.12 at 10:06, Wei Wang <wei.wang2@amd.com> wrote:
>> --- a/xen/arch/x86/cpu/amd.c
>> +++ b/xen/arch/x86/cpu/amd.c
>> @@ -485,6 +485,17 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
>> if (c->x86 > 0x11)
>> set_bit(X86_FEATURE_ARAT, c->x86_capability);
>> 
>> + /* 
>> +  * Prior to Family 0x14, perf counters are not reset during warm reboot.
>> +  * We have to reset them manually.
>> +  */
>> + if (c->x86 < 0x14) {
>> +  wrmsrl(MSR_K7_PERFCTR0, 0);
>> +  wrmsrl(MSR_K7_PERFCTR1, 0);
>> +  wrmsrl(MSR_K7_PERFCTR2, 0);
>> +  wrmsrl(MSR_K7_PERFCTR3, 0);
>> + }
> 
> This collides with the NMI watchdog setup: smp_callin() calls
> setup_local_APIC() _before_ calling smp_store_cpu_info(), and
> hence you write zero again to an MSR possibly already in use.
> Since setup_k7_watchdog() itself does the clearing of the MSRs
> in question already, I would think that the most simple
> adjustment to your patch would be to make the condition
> 
> if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
> 
> If you agree (and Keir doesn't object), I would commit it that way.

Sounds good.

Acked-by: Keir Fraser <keir@xen.org>

> Jan
> 
>> +
>> if (cpuid_edx(0x80000007) & (1 << 10)) {
>> rdmsr(MSR_K7_HWCR, l, h);
>> l |= (1 << 27); /* Enable read-only APERF/MPERF bit */
> 
> 

  reply	other threads:[~2012-10-15 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  8:06 [PATCH] x86/amd: Fix xen_apic_write warnings in Dom0 Wei Wang
2012-10-15 11:12 ` Jan Beulich
2012-10-15 12:09   ` Keir Fraser [this message]
2012-10-15 12:17     ` Wei Wang

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=CCA1BB92.41B09%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=wei.wang2@amd.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).