From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
KevinTian <kevin.tian@intel.com>, Tim Deegan <tim@xen.org>,
Jun Nakajima <jun.nakajima@intel.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] x86/paging: Rename paging_mark_pfn_dirty() and use pfn_t
Date: Wed, 14 Dec 2016 15:30:55 +0000 [thread overview]
Message-ID: <e4a3b89c-c971-089d-ad26-65a30cdbcaad@citrix.com> (raw)
In-Reply-To: <585171BB02000078001294CF@prv-mh.provo.novell.com>
On 14/12/16 15:22, Jan Beulich wrote:
>>>> On 14.12.16 at 15:26, <andrew.cooper3@citrix.com> wrote:
>> paging_mark_gfn_dirty() actually takes a pfn, even by paramter name. Rename
>> the function and alter the type to pfn_t to match.
>>
>> Push pfn_t into the LOGDIRTY_IDX() macros, and clean up a couple of local
>> variable types in paging_mark_pfn_dirty().
>>
>> Leave an explicit comment in vmx_vcpu_flush_pml_buffer() when we intentally
>> perform a straight conversion from gfn to pfn.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> with two remarks:
>
>> @@ -331,8 +331,8 @@ void paging_mark_gfn_dirty(struct domain *d, unsigned long pfn)
>> if ( changed )
>> {
>> PAGING_DEBUG(LOGDIRTY,
>> - "marked mfn %" PRI_mfn " (pfn=%lx), dom %d\n",
>> - mfn_x(mfn), pfn, d->domain_id);
>> + "marked mfn %" PRI_mfn " (pfn %" PRI_pfn "), dom %d\n",
>> + mfn_x(mfn), pfn_x(pfn), d->domain_id);
> Mind making the domain part canonical (i.e. d%d), and perhaps
> even moving it to the front ("d%d: ...\n")?
Ok.
>
>> @@ -345,23 +345,23 @@ void paging_mark_gfn_dirty(struct domain *d, unsigned long pfn)
>> /* Mark a page as dirty */
>> void paging_mark_dirty(struct domain *d, mfn_t gmfn)
>> {
>> - unsigned long pfn;
>> + pfn_t pfn;
>>
>> if ( !paging_mode_log_dirty(d) || !mfn_valid(gmfn) ||
>> page_get_owner(mfn_to_page(gmfn)) != d )
>> return;
>>
>> /* We /really/ mean PFN here, even for non-translated guests. */
>> - pfn = get_gpfn_from_mfn(mfn_x(gmfn));
>> + pfn = _pfn(get_gpfn_from_mfn(mfn_x(gmfn)));
>>
>> - paging_mark_gfn_dirty(d, pfn);
>> + paging_mark_pfn_dirty(d, pfn);
>> }
> Looking at all of this, could patch 1 perhaps rename gmfn to mfn
> in this function?
This actually follows the shadow naming convention, of an mfn belonging
to a guest, and as checked in the first if clause.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-14 15:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 14:26 [PATCH 1/2] x86/paging: Update paging_mark_dirty() to use mfn_t Andrew Cooper
2016-12-14 14:26 ` [PATCH 2/2] x86/paging: Rename paging_mark_pfn_dirty() and use pfn_t Andrew Cooper
2016-12-14 15:22 ` Jan Beulich
2016-12-14 15:30 ` Andrew Cooper [this message]
2016-12-20 5:08 ` Tian, Kevin
2016-12-14 15:13 ` [PATCH 1/2] x86/paging: Update paging_mark_dirty() to use mfn_t Jan Beulich
2016-12-14 15:28 ` Andrew Cooper
2016-12-14 15:48 ` Konrad Rzeszutek Wilk
2016-12-14 15:36 ` 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=e4a3b89c-c971-089d-ad26-65a30cdbcaad@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=jun.nakajima@intel.com \
--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 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).