All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Huang <kai.huang@linux.intel.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"tim@xen.org" <tim@xen.org>, "keir@xen.org" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: PML (Page Modification Logging) design for Xen
Date: Fri, 13 Feb 2015 10:11:09 +0800	[thread overview]
Message-ID: <54DD5D3D.7000601@linux.intel.com> (raw)
In-Reply-To: <54DCB43A.7080609@citrix.com>


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


On 02/12/2015 10:10 PM, Andrew Cooper wrote:
> On 12/02/15 06:54, Tian, Kevin wrote:
>>>> which presumably
>>>> means that the PML buffer flush needs to be aware of which gfns are
>>>> mapped by superpages to be able to correctly set a block of bits in the
>>>> logdirty bitmap.
>>>>
>>> Unfortunately PML itself can't tell us if the logged GPA comes from
>>> superpage or not, but even in PML we still need to split superpages to
>>> 4K page, just like traditional write protection approach does. I think
>>> this is because live migration should be based on 4K page granularity.
>>> Marking all 512 bits of a 2M page to be dirty by a single write doesn't
>>> make sense in both write protection and PML cases.
>>>
>> agree. extending one write to superpage enlarges dirty set unnecessary.
>> since spec doesn't say superpage logging is not supported, I'd think a
>> 4k-aligned entry being logged if within superpage.
> The spec states that an gfn is appended to the log strictly on the
> transition of the D bit from 0 to 1.
>
> In the case of a 2M superpage, there is a single D bit for the entire 2M
> range.
>
>
> The plausible (working) scenarios I can see are:
>
> 1) superpages are not supported (not indicated by the whitepaper).
A better description would be -- PML doesn't check if it's superpage, it 
just operates with D-bit, no matter what page size.
> 2) a single entry will be written which must be taken to cover the
> entire 2M range.
> 3) an individual entry is written for every access.
Below is the reply from our hardware guy related to PML on superpage. It 
should have answered accurately.

"As noted in Section 1.3, logging occurs whenever the CPU would set an 
EPT D bit.

It does not matter whether the D bit is in an EPT PTE (4KB page), EPT 
PDE (2MB page), or EPT PDPTE (1GB page).

In all cases, the GPA written to the PML log will be the address of the 
write that causes the D bit in question to be updated, with bits 11:0 
cleared.

This means that, in the case in which the D bit is in an EPT PDE or an 
EPT PDPTE, the log entry will communicate which 4KB region within the 
larger page was being written.

Once the D bit is set in one of these entries, a subsequent write to the 
larger page will not generate a log entry, even if that write is to a 
different 4KB region within the larger page.  This is because log 
entries are created only when a D bit is being set and a write will not 
cause a D bit to be set if the page's D bit is already set.

The log entries do not communicate the level of the EPT paging-structure 
entry in which the D bit was set (i.e., it does not communicate the page 
size). "

Thanks,
-Kai


>
> Have I missed anything?
>
> ~Andrew
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


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

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

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

  parent reply	other threads:[~2015-02-13  2:11 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11  8:28 PML (Page Modification Logging) design for Xen Kai Huang
2015-02-11 11:52 ` Andrew Cooper
2015-02-11 13:13   ` Jan Beulich
2015-02-11 16:33     ` Andrew Cooper
2015-02-11 16:55       ` Jan Beulich
2015-02-12  2:35     ` Kai Huang
2015-02-12  6:25       ` Tian, Kevin
2015-02-12  6:45         ` Kai Huang
2015-02-12  7:08           ` Tian, Kevin
2015-02-12  7:34             ` Kai Huang
2015-02-12 12:42             ` Tim Deegan
2015-02-13  2:15               ` Kai Huang
2015-02-13  2:28               ` Tian, Kevin
2015-02-17 10:40                 ` Jan Beulich
2015-02-12  2:39   ` Kai Huang
2015-02-12  6:54     ` Tian, Kevin
2015-02-12  6:56       ` Kai Huang
2015-02-12  7:09         ` Tian, Kevin
2015-02-12  7:15           ` Kai Huang
2015-02-12 14:10       ` Andrew Cooper
2015-02-13  0:58         ` Bing
2015-02-13  2:11         ` Kai Huang [this message]
2015-02-13 10:57           ` Andrew Cooper
2015-02-13 14:32             ` Kai Huang
2015-02-13 15:28               ` Andrew Cooper
2015-02-13 15:52                 ` Kai Huang
2015-02-14  3:01                   ` Kai Huang
2015-02-16 11:44                     ` Andrew Cooper
2015-02-16 14:02                       ` Kai Huang
2015-02-17 10:37                       ` Jan Beulich
2015-02-17 10:19     ` Jan Beulich
2015-02-17 11:57       ` Tim Deegan
2015-03-11 10:59       ` George Dunlap
2015-03-11 11:11         ` Andrew Cooper
2015-03-11 15:53           ` George Dunlap
2015-03-12  7:36             ` Kai Huang
2015-03-12 11:19               ` Andrew Cooper
2015-03-14  3:04                 ` Kai Huang
2015-03-24  6:42       ` Kai Huang
2015-03-24  7:53         ` Jan Beulich
2015-03-24  8:06           ` Kai Huang
2015-03-24  8:14             ` Jan Beulich
2015-03-24  8:17               ` Kai Huang
2015-02-11 13:06 ` Jan Beulich
2015-02-12  2:49   ` Kai Huang
2015-02-12  5:16     ` Kai Huang
2015-02-12  7:02     ` Tian, Kevin
2015-02-12  7:04       ` Kai Huang
2015-02-17 10:23     ` Jan Beulich
2015-03-01 23:13       ` Kai Huang
2015-02-12 12:34 ` Tim Deegan
2015-02-13  2:50   ` Kai Huang
2015-02-16 14:01     ` Kai Huang
2015-02-16 18:19       ` Tim Deegan

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=54DD5D3D.7000601@linux.intel.com \
    --to=kai.huang@linux.intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=tim@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 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.