All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	keir@xen.org
Cc: xen-devel@lists.xen.org, roger.pau@citrix.com
Subject: Re: [PATCH v3] x86/HVM: Merge HVM and PVH hypercall tables
Date: Fri, 18 Dec 2015 11:57:06 -0500	[thread overview]
Message-ID: <56743AE2.3070206@oracle.com> (raw)
In-Reply-To: <5674446D02000078000C1630@prv-mh.provo.novell.com>

On 12/18/2015 11:37 AM, Jan Beulich wrote:
>>>> On 18.12.15 at 17:28, <andrew.cooper3@citrix.com> wrote:
>> On 17/12/15 23:00, Boris Ostrovsky wrote:
>>> diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
>>> index a7767f8..871aca0 100644
>>> --- a/xen/arch/x86/mm.c
>>> +++ b/xen/arch/x86/mm.c
>>> @@ -3019,6 +3019,25 @@ long do_mmuext_op(
>>>               break;
>>>           }
>>>   
>>> +        if ( has_hvm_container_domain(d) )
>>> +        {
>>> +            switch ( op.cmd )
>>> +            {
>>> +            case MMUEXT_PIN_L1_TABLE:
>>> +            case MMUEXT_PIN_L2_TABLE:
>>> +            case MMUEXT_PIN_L3_TABLE:
>>> +            case MMUEXT_PIN_L4_TABLE:
>>> +            case MMUEXT_UNPIN_TABLE:
>>> +                if ( is_control_domain(d) )
>>> +                    break;
>> This needs to be an XSM check, rather than a dom0 check.  Consider the
>> usecase of a PVH/DMLite domain builder stubdomain.
> But wouldn't that be the control domain then? Afaict by making this
> an XSM check we'd also permit the hardware domain access to these,
> for no reason. In fact we should probably further restrict this to
> d != pg_owner.

We already do this at the top of do_mmuext_op():
     rc = xsm_mmuext_op(XSM_TARGET, d, pg_owner);

In fact, there is xsm_memory_pin_page() test under pin_page label so I 
wonder whether I need any test, including is_control_domain()? (Maybe 
for the UNPIN).

-boris

  reply	other threads:[~2015-12-18 16:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 23:00 [PATCH v3] x86/HVM: Merge HVM and PVH hypercall tables Boris Ostrovsky
2015-12-18 16:28 ` Andrew Cooper
2015-12-18 16:37   ` Jan Beulich
2015-12-18 16:57     ` Boris Ostrovsky [this message]
2015-12-18 16:59     ` Andrew Cooper
2015-12-18 17:10       ` Jan Beulich
2015-12-18 17:16         ` Andrew Cooper
2015-12-18 17:33           ` Boris Ostrovsky
2015-12-18 17:36             ` Andrew Cooper
2015-12-21 10:57             ` Jan Beulich

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=56743AE2.3070206@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=roger.pau@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.