All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	xen-devel@lists.xen.org, keir@xen.org, roger.pau@citrix.com
Subject: Re: [PATCH v3] x86/HVM: Merge HVM and PVH hypercall tables
Date: Fri, 18 Dec 2015 17:16:40 +0000	[thread overview]
Message-ID: <56743F78.30609@citrix.com> (raw)
In-Reply-To: <56744C2502000078000C16E0@prv-mh.provo.novell.com>

On 18/12/15 17:10, Jan Beulich wrote:
>>>> On 18.12.15 at 17:59, <andrew.cooper3@citrix.com> wrote:
>> On 18/12/15 16:37, 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.
>> Any domain needing to construct PV domains needs to be able to make
>> these hypercalls against the target domain.
>>
>> Therefore, the only valid check is whether XSM will permit 'current' to
>> issue the hypercall against 'd', irrespective of whether current is the
>> control domain, the hardware domain, or something else.
>>
>> I think all that is needed is xsm_mmuext_op(XSM_TARGET, d, pg_owner)
> Which, as Boris has just pointed out, is already there.

So it is.  That is good.

> But which also allows the d to issue such operations on itself.

For safely sake, it is probably having either do_mmuext_op() or the XSM
hook bail early if d is not a PV guest.

I would hesitate at putting that check inside the hvm conditional at
this point.

~Andrew

  reply	other threads:[~2015-12-18 17:16 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
2015-12-18 16:59     ` Andrew Cooper
2015-12-18 17:10       ` Jan Beulich
2015-12-18 17:16         ` Andrew Cooper [this message]
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=56743F78.30609@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dgdegra@tycho.nsa.gov \
    --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.