xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Tim Deegan <tim@xen.org>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/2] x86/shadow: compile most write emulation code just once
Date: Thu, 10 Mar 2016 06:13:55 -0700	[thread overview]
Message-ID: <56E1812302000078000DB43F@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20160310121750.GB86157@deinos.phlegethon.org>

>>> On 10.03.16 at 13:17, <tim@xen.org> wrote:
> Hi,
> 
> At 03:13 -0700 on 10 Mar (1457579586), Jan Beulich wrote:
>> No need to compile all of this code three times, as most of it really
>> is guest mode independent. The savings are between 3k and 4k of binary
>> code in my builds.
> 
> Thanks for this.  This would have been _much_ easier to review as (at
> least) two patches, with one being motion-only.  As it is I had to
> effectively diff by eye to see the changes.

Well, a precisely code motion only patch wouldn't have worked -
some changes were unavoidable while moving, for the build to not
break.

>> No functional change (i.e. only formatting and naming changes)
> 
> There is one other change, that emulate_gva_to_mfn()'s call to
> gva_to_gfn() now indirects through the paging mode table.  I think
> that's fine, but it's not obvious from this description.

That's not a functional change (as it still results in the same function
getting called), but I've added a sentence to the earlier part of
description.

>> except
>> for
>> - sh_emulate_map_dest()'s user mode check corrected for the PV case
>>   (affecting debugging mode only, this isn't being split out)
>> - simplifying the vaddr argument to emulate_gva_to_mfn() for the second
>>   part in the cross page write case
> 
> Removing the mask with PAGE_MASK is fine, but please keep the '- 1' in
> calculating the final byte.  It is more clearly correct and can easily
> be folded with the earlier calculations.  If you want to make that
> change on committing, then
> 
> Reviewed-by: Tim Deegan <tim@xen.org>

Thanks. It didn't seem questionable to me that the code would be
correct with the "- 1" dropped, but I've added it back.

Jan


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

  parent reply	other threads:[~2016-03-10 13:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 10:06 [PATCH 0/2] x86/shadow: further code size reduction Jan Beulich
2016-03-10 10:13 ` [PATCH 1/2] x86/shadow: compile most write emulation code just once Jan Beulich
2016-03-10 11:40   ` Andrew Cooper
     [not found]   ` <20160310121750.GB86157@deinos.phlegethon.org>
2016-03-10 13:13     ` Jan Beulich [this message]
2016-03-10 10:13 ` [PATCH 2/2] x86/shadow: avoid extra local array variable Jan Beulich
2016-03-10 11:43   ` Andrew Cooper

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=56E1812302000078000DB43F@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=tim@xen.org \
    --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 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).