From: Wei Wang <wei.wang2@amd.com>
To: Keir Fraser <keir.xen@gmail.com>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/amd: Fix xen_apic_write warnings in Dom0
Date: Mon, 15 Oct 2012 14:17:40 +0200 [thread overview]
Message-ID: <507BFEE4.3090601@amd.com> (raw)
In-Reply-To: <CCA1BB92.41B09%keir.xen@gmail.com>
On 10/15/2012 02:09 PM, Keir Fraser wrote:
> 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>
Sounds good to me too. Acked
Thanks,
Wei
>> Jan
>>
>>> +
>>> if (cpuid_edx(0x80000007)& (1<< 10)) {
>>> rdmsr(MSR_K7_HWCR, l, h);
>>> l |= (1<< 27); /* Enable read-only APERF/MPERF bit */
>>
>>
>
>
>
prev parent reply other threads:[~2012-10-15 12:17 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
2012-10-15 12:17 ` Wei Wang [this message]
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=507BFEE4.3090601@amd.com \
--to=wei.wang2@amd.com \
--cc=JBeulich@suse.com \
--cc=keir.xen@gmail.com \
--cc=keir@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 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).