All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	David Vrabel <david.vrabel@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH v3] docs: add PVH specification
Date: Mon, 22 Sep 2014 10:02:31 -0400	[thread overview]
Message-ID: <20140922140223.GA20515@konrad-lan.dumpdata.com> (raw)
In-Reply-To: <542009C9.7000503@citrix.com>

> >> +`CR0` has the following bits set by Xen:
> >> +
> >> +  * PE (bit 0): protected mode enable.
> >> +  * ET (bit 4): 387 or newer processor.
> >> +  * PG (bit 31): paging enabled.
> > 
> > Also TS (at least that is what the Linux code says:
> > 
> > /* Some of these are setup in 'secondary_startup_64'. The others:       
> > * X86_CR0_TS, X86_CR0_PE, X86_CR0_ET are set by Xen for HVM guests     
> > * (which PVH shared codepaths), while X86_CR0_PG is for PVH. */        
> > 
> > Perhaps it is incorrect?
> 
> I think this comment is outdated/incorrect. This is the CR0 value I see 
> on a FreeBSD PVH start-of-day:
> 
> 0x80000011 (PE, ET and PG bits set)
> 

Reading the code I see

construct_vmcs
	hvm_update_guest_cr(v, 0);
		vmx_update_guest_cr

Then this code:
	1234         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )                     
	1235         {                                                                       
	1236             if ( v != current )                                                 
	1237                 hw_cr0_mask |= X86_CR0_TS;                                      

	...
	1279         v->arch.hvm_vcpu.hw_cr[0] =                                             
	1280             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;                         
	1281         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);                        

Same logic on the AMD side, albeit less complicated.

But this is Monday morning so I must be missing something
as your values don't match with this.

  reply	other threads:[~2014-09-22 14:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 17:19 [PATCH v3] docs: add PVH specification Roger Pau Monne
2014-09-20 19:15 ` Konrad Rzeszutek Wilk
2014-09-22 11:16   ` Jan Beulich
2014-09-22 13:40     ` Konrad Rzeszutek Wilk
2014-09-22 11:36   ` Roger Pau Monné
2014-09-22 14:02     ` Konrad Rzeszutek Wilk [this message]
2014-09-22 14:08       ` Jan Beulich
2014-09-23  0:38 ` Mukesh Rathor
2014-09-23 13:16   ` Jan Beulich
2014-09-26  0:00     ` Mukesh Rathor
2014-09-26  6:32       ` Jan Beulich
2014-09-29 17:38       ` Roger Pau Monné
2014-09-29 17:45         ` David Vrabel

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=20140922140223.GA20515@konrad-lan.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=david.vrabel@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.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.