All of lore.kernel.org
 help / color / mirror / Atom feed
* NPT and EPT question
@ 2008-11-17 13:23 bo ma
  2008-11-17 13:41 ` Tim Deegan
  0 siblings, 1 reply; 4+ messages in thread
From: bo ma @ 2008-11-17 13:23 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 355 bytes --]

hi,everyone

Recent I read AMD specification about NPT,and met with a question about a
sentence.

The sentence is : Note that host table walks for guest page tables are
always treated as data writes.I don't know why treated as data writes?

In intel EPT ,is it the same? or treated as data reads?

Thanks a lot for any help or resource for the aquestion.

[-- Attachment #1.2: Type: text/html, Size: 523 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NPT and EPT question
  2008-11-17 13:23 NPT and EPT question bo ma
@ 2008-11-17 13:41 ` Tim Deegan
  2008-11-17 22:27   ` Wei Huang
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Deegan @ 2008-11-17 13:41 UTC (permalink / raw)
  To: bo ma; +Cc: xen-devel

Hi,

At 21:23 +0800 on 17 Nov (1226957017), bo ma wrote:
> Recent I read AMD specification about NPT,and met with a question about a
> sentence.
> 
> The sentence is : Note that host table walks for guest page tables are
> always treated as data writes.I don't know why treated as data writes?

Possibly because the guest-table walker might have to set the A and D
bits, and the hardware doesn't know whether it will do that until
_after_ it's done the host-table walk.

Maybe someone from AMD can clarify. 

> In intel EPT ,is it the same? or treated as data reads?

My impression is that EPT only requires write permissions if it actually
writes back an A or D bit, but I'm not sure.   It should be easy to check.

Cheers,

Tim

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NPT and EPT question
  2008-11-17 13:41 ` Tim Deegan
@ 2008-11-17 22:27   ` Wei Huang
  2008-11-18  1:13     ` bo ma
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Huang @ 2008-11-17 22:27 UTC (permalink / raw)
  To: Tim Deegan; +Cc: bo ma, xen-devel

I think Tim is right. On my spec (24593, Dec 2005), it is explained as 
the following:

"Table walks for guest page tables are always treated as user writes at 
the host level. For this reason,
* the page must be writable by user at the host level, or else a 
#VMEXIT(NPF) is raised, and
* the dirty and accessed bits are always set in the host page table 
entries that were touched during nested page table walks for guest page 
table entries"

As explained in the second one, CPU needs to update guest table entries 
(A and D bits, especially A bit) when it walks through guest table. That 
is why the dirty and accessed bits are set in host table.

-Wei



Tim Deegan wrote:
> Hi,
> 
> At 21:23 +0800 on 17 Nov (1226957017), bo ma wrote:
>> Recent I read AMD specification about NPT,and met with a question about a
>> sentence.
>>
>> The sentence is : Note that host table walks for guest page tables are
>> always treated as data writes.I don't know why treated as data writes?
> 
> Possibly because the guest-table walker might have to set the A and D
> bits, and the hardware doesn't know whether it will do that until
> _after_ it's done the host-table walk.
> 
> Maybe someone from AMD can clarify. 
> 
>> In intel EPT ,is it the same? or treated as data reads?
> 
> My impression is that EPT only requires write permissions if it actually
> writes back an A or D bit, but I'm not sure.   It should be easy to check.
> 
> Cheers,
> 
> Tim
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NPT and EPT question
  2008-11-17 22:27   ` Wei Huang
@ 2008-11-18  1:13     ` bo ma
  0 siblings, 0 replies; 4+ messages in thread
From: bo ma @ 2008-11-18  1:13 UTC (permalink / raw)
  To: Wei Huang; +Cc: xen-devel, Tim Deegan


[-- Attachment #1.1: Type: text/plain, Size: 1581 bytes --]

thank you ,Tim and Huang

2008/11/18 Wei Huang <wei.huang2@amd.com>

> I think Tim is right. On my spec (24593, Dec 2005), it is explained as the
> following:
>
> "Table walks for guest page tables are always treated as user writes at the
> host level. For this reason,
> * the page must be writable by user at the host level, or else a
> #VMEXIT(NPF) is raised, and
> * the dirty and accessed bits are always set in the host page table entries
> that were touched during nested page table walks for guest page table
> entries"
>
> As explained in the second one, CPU needs to update guest table entries (A
> and D bits, especially A bit) when it walks through guest table. That is why
> the dirty and accessed bits are set in host table.
>
> -Wei
>
>
>
>
> Tim Deegan wrote:
>
>> Hi,
>>
>> At 21:23 +0800 on 17 Nov (1226957017), bo ma wrote:
>>
>>> Recent I read AMD specification about NPT,and met with a question about a
>>> sentence.
>>>
>>> The sentence is : Note that host table walks for guest page tables are
>>> always treated as data writes.I don't know why treated as data writes?
>>>
>>
>> Possibly because the guest-table walker might have to set the A and D
>> bits, and the hardware doesn't know whether it will do that until
>> _after_ it's done the host-table walk.
>>
>> Maybe someone from AMD can clarify.
>>
>>> In intel EPT ,is it the same? or treated as data reads?
>>>
>>
>> My impression is that EPT only requires write permissions if it actually
>> writes back an A or D bit, but I'm not sure.   It should be easy to check.
>>
>> Cheers,
>>
>> Tim
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 2314 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-18  1:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 13:23 NPT and EPT question bo ma
2008-11-17 13:41 ` Tim Deegan
2008-11-17 22:27   ` Wei Huang
2008-11-18  1:13     ` bo ma

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.