From: "Han, Huaitong" <huaitong.han@intel.com>
To: "tjd@phlegethon.org" <tjd@phlegethon.org>
Cc: "wei.liu2@citrix.com" <wei.liu2@citrix.com>,
"george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"george.dunlap@citrix.com" <george.dunlap@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"jbeulich@suse.com" <jbeulich@suse.com>,
"keir@xen.org" <keir@xen.org>
Subject: Re: [PATCH V6 4/5] xen/mm: Clean up pfec handling in gva_to_gfn
Date: Wed, 27 Jan 2016 07:22:24 +0000 [thread overview]
Message-ID: <1453879352.4038.12.camel@intel.com> (raw)
In-Reply-To: <20160126143002.GB24854@deinos.phlegethon.org>
On Tue, 2016-01-26 at 14:30 +0000, Tim Deegan wrote:
> Hi,
>
> At 15:30 +0800 on 19 Jan (1453217458), Huaitong Han wrote:
> > At the moment, the pfec argument to gva_to_gfn has two functions:
> >
> > * To inform guest_walk what kind of access is happenind
> >
> > * As a value to pass back into the guest in the event of a fault.
> >
> > Unfortunately this is not quite treated consistently: the
> > hvm_fetch_*
> > function will "pre-clear" the PFEC_insn_fetch flag before calling
> > gva_to_gfn; meaning guest_walk doesn't actually know whether a
> > given
> > access is an instruction fetch or not. This works now, but will
> > cause
> > issues when pkeys are introduced, since guest_walk will need to
> > know
> > whether an access is an instruction fetch even if it doesn't return
> > PFEC_insn_fetch.
> >
> > Fix this by making a clean separation for in and out
> > functionalities
> > of the pfec argument:
> >
> > 1. Always pass in the access type to gva_to_gfn
> >
> > 2. Filter out inappropriate access flags before returning from
> > gva_to_gfn.
>
> This seems OK. But can you please:
> - Add this new adjustment once, in paging_gva_to_gfn(), instead of
> adding it to each implementation; and
> - Adjust the comment above the declaration of paging_gva_to_gfn() in
> paging.h to describe this new behaviour.
Although adding adjustment in paging_gva_to_gfn can reduce code
duplication, adding it to each implementation is more readable, becasue
other sections of pfec are handled in each implementation.
>
> Cheers,
>
> Tim.
next prev parent reply other threads:[~2016-01-27 7:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 7:30 [PATCH V6 0/5] x86/hvm: pkeys, add memory protection-key support Huaitong Han
2016-01-19 7:30 ` [PATCH V6 1/5] x86/hvm: pkeys, disable pkeys for guests in non-paging mode Huaitong Han
2016-01-19 7:30 ` [PATCH V6 2/5] x86/hvm: pkeys, add pkeys support for guest_walk_tables Huaitong Han
2016-01-25 15:46 ` Jan Beulich
2016-01-27 3:18 ` Han, Huaitong
2016-01-27 10:20 ` Jan Beulich
2016-01-19 7:30 ` [PATCH V6 3/5] x86/hvm: pkeys, add xstate support for pkeys Huaitong Han
2016-01-25 15:48 ` Jan Beulich
2016-01-19 7:30 ` [PATCH V6 4/5] xen/mm: Clean up pfec handling in gva_to_gfn Huaitong Han
2016-01-25 15:56 ` Jan Beulich
2016-01-26 14:30 ` Tim Deegan
2016-01-27 7:22 ` Han, Huaitong [this message]
2016-01-27 9:34 ` Tim Deegan
2016-01-27 10:13 ` Han, Huaitong
2016-01-19 7:30 ` [PATCH V6 5/5] x86/hvm: pkeys, add pkeys support for cpuid handling Huaitong Han
2016-01-19 9:19 ` Wei Liu
2016-01-25 16:04 ` Jan Beulich
2016-01-25 15:25 ` [PATCH V6 0/5] x86/hvm: pkeys, add memory protection-key support Jan Beulich
2016-01-26 8:06 ` Han, Huaitong
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=1453879352.4038.12.camel@intel.com \
--to=huaitong.han@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=tjd@phlegethon.org \
--cc=wei.liu2@citrix.com \
--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.