All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, tcgoetz@gmail.com
Cc: xen-devel@lists.xensource.com, Ian.Jackson@eu.citrix.com,
	Ian.Campbell@citrix.com, keir.fraser@eu.citrix.com
Subject: Re: [PATCH 3 of 6] xen/pat: After suspend re-write PAT if BIOS changed it
Date: Mon, 2 Apr 2012 11:28:30 -0400	[thread overview]
Message-ID: <20120402152830.GA30162@phenom.dumpdata.com> (raw)
In-Reply-To: <4F7049E3020000780007AD63@nat28.tlf.novell.com>

On Mon, Mar 26, 2012 at 09:50:11AM +0100, Jan Beulich wrote:
> >>> On 24.03.12 at 18:41, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > # HG changeset patch
> > # User Simon Graham <simon.graham@virtualcomputer.com>
> > # Date 1332610898 14400
> > # Node ID 75798a472b1a9121adda166b6fd05ba8473a44f0
> > # Parent  d097c3ba42f601af65b53a0c84973855aab64aa9
> > xen/pat: After suspend re-write PAT if BIOS changed it.
> > 
> > Certain AMD machines (this was a MSI or GigaBYTE BIOS) after resume
> > would reset the PAT MSR causing rather weird issues - where
> > the pages would (say they would be set to WC) would end up with the
> > wrong type (as they would use the BIOS PAT instead of the one set by
> > the hypervisor).
> 
> There's a write of the PAT MSR already at the end of
> restore_rest_processor_state() - are you saying this doesn't do
> what is needed? Also note that this is properly gated by a check
> of cpu_has_pat (other than the patch here does).

Let me double-check with folks at VirtualComputer - but they had
experienced this with Xen 4.0 (I think) and the c/s 19167 certainly
was in there.

> 
> > Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com>
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > 
> > diff -r d097c3ba42f6 -r 75798a472b1a xen/arch/x86/acpi/power.c
> > --- a/xen/arch/x86/acpi/power.c	Sat Mar 24 12:54:12 2012 -0400
> > +++ b/xen/arch/x86/acpi/power.c	Sat Mar 24 13:41:38 2012 -0400
> > @@ -41,8 +41,25 @@ static DEFINE_SPINLOCK(pm_lock);
> >  
> >  struct acpi_sleep_info acpi_sinfo;
> >  
> > +static void pat_resume(void);
> >  void do_suspend_lowlevel(void);
> >  
> > +static void
> > +pat_resume()
> > +{
> > +    u64 pat;
> > +
> > +    rdmsrl(MSR_IA32_CR_PAT, pat);
> > +    if (pat != host_pat) {
> > +	printk(KERN_INFO PREFIX "Found PAT MSR: 0x%lx\n", pat);
> > +	printk(KERN_INFO PREFIX "reseting to 0x%lx\n", host_pat);
> > +	wrmsrl(MSR_IA32_CR_PAT, host_pat);
> > +	rdmsrl(MSR_IA32_CR_PAT, pat);
> > +	if (pat != host_pat)
> > +	    printk(KERN_WARNING PREFIX "PAT MSR stuck on: 0x%lx\n", pat);
> 
> All the %lx format specifiers here would break the 32-bit build afaict.
> Further (if this code really is needed at all), please use %# instead
> of 0x%.

Right.

  reply	other threads:[~2012-04-02 15:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-24 17:41 [PATCH 0 of 6] Various patches - debug help, xend fixes and S3 resume fixes (v1) Konrad Rzeszutek Wilk
2012-03-24 17:41 ` [PATCH 1 of 6] linux-xencommons: Load xen-acpi-processor Konrad Rzeszutek Wilk
2012-03-27 13:39   ` Ian Jackson
2012-03-24 17:41 ` [PATCH 2 of 6] xen/vga: Add 'vga_delay' parameter to delay screen output by 2 second per screen output Konrad Rzeszutek Wilk
2012-03-26  8:43   ` Jan Beulich
2012-03-27 13:41   ` Ian Jackson
2012-03-24 17:41 ` [PATCH 3 of 6] xen/pat: After suspend re-write PAT if BIOS changed it Konrad Rzeszutek Wilk
2012-03-26  8:50   ` Jan Beulich
2012-04-02 15:28     ` Konrad Rzeszutek Wilk [this message]
2012-04-03 13:03       ` Tom Goetz
2012-03-24 17:41 ` [PATCH 4 of 6] xend: Don't crash due to weird PCI devices Konrad Rzeszutek Wilk
2012-03-27 13:39   ` Ian Jackson
2012-03-24 17:41 ` [PATCH 5 of 6] xend/xc: Implement a domain_set_e820_hole function to be used by python code Konrad Rzeszutek Wilk
2012-03-26  9:42   ` Ian Campbell
2012-04-02 15:59     ` Konrad Rzeszutek Wilk
2012-04-02 16:02       ` Ian Campbell
2012-03-24 17:41 ` [PATCH 6 of 6] xend: Add support for passing in the host's E820 for PCI passthrough Konrad Rzeszutek Wilk
2012-03-27 13:43   ` Ian Jackson
2012-04-02 16:00     ` Konrad Rzeszutek Wilk

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=20120402152830.GA30162@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=tcgoetz@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /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.