All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: Tamas K Lengyel <tamas@tklengyel.com>,
	Wei Liu <wei.liu2@citrix.com>, Adrian Pop <apop@bitdefender.com>,
	Sergej Proskurin <proskurin@sec.in.tum.de>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU
Date: Wed, 05 Sep 2018 03:27:31 -0600	[thread overview]
Message-ID: <5B8FA18302000078001E56A6@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <29aad5c1-d005-64da-e8c7-d583b17f1135@bitdefender.com>

>>> On 05.09.18 at 10:14, <rcojocaru@bitdefender.com> wrote:
> On 9/5/18 9:56 AM, Jan Beulich wrote:
>>>>> On 04.09.18 at 22:58, <rcojocaru@bitdefender.com> wrote:
>>> On 9/4/18 11:40 PM, Tamas K Lengyel wrote:
>>>> On Mon, Sep 3, 2018 at 10:59 PM Adrian Pop <apop@bitdefender.com> wrote:
>>>>> --- a/xen/arch/x86/hvm/hvm.c
>>>>> +++ b/xen/arch/x86/hvm/hvm.c
>>>>> @@ -4533,8 +4533,7 @@ static int do_altp2m_op(
>>>>>          return -EOPNOTSUPP;
>>>>>      }
>>>>>
>>>>> -    d = ( a.cmd != HVMOP_altp2m_vcpu_enable_notify ) ?
>>>>> -        rcu_lock_domain_by_any_id(a.domain) : rcu_lock_current_domain();
>>>>> +    d = rcu_lock_domain_by_any_id(a.domain);
>>>>
>>>> Does rcu_lock_domain_by_any_id work if its from the current domain? If
>>>> not, doesn't that change this function's accessibility to be from
>>>> exclusively usable only by the outside agent?
>>> The code says it should be safe:
>>>
>>>  633 struct domain *rcu_lock_domain_by_any_id(domid_t dom)
>>>  634 {
>>>  635     if ( dom == DOMID_SELF )
>>>  636         return rcu_lock_current_domain();
>>>  637     return rcu_lock_domain_by_id(dom);
>>>  638 }
>>>
>>> as long as dom == DOMID_SELF. I think the old behaviour assumed that
>>> HVMOP_altp2m_vcpu_enable_notify alone would only ever be used from the
>>> current domain, and this change expands its usability (Adrian should
>>> correct me if I'm wrong here).
>> 
>> But a guest exposed interface can't be changed like this: If a.domain
>> was ignored for this sub-op before, it needs to continue to be ignored.
> 
> Also, technically speaking a.domain is not currently ignored - it's just
> checked against DOMID_SELF:
> 
> 4596     case HVMOP_altp2m_vcpu_enable_notify:
> 4597     {
> 4598         struct vcpu *curr = current;
> 4599         p2m_type_t p2mt;
> 4600
> 4601         if ( a.u.enable_notify.pad || a.domain != DOMID_SELF ||
> 4602              a.u.enable_notify.vcpu_id != curr->vcpu_id )
> 4603         {
> 4604             rc = -EINVAL;
> 4605             break;
> 4606         }

Ah, yes, I think that's fine then.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-09-05  9:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  4:59 [PATCH v2] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU Adrian Pop
2018-09-04 20:40 ` Tamas K Lengyel
2018-09-04 20:58   ` Razvan Cojocaru
2018-09-05  6:56     ` Jan Beulich
2018-09-05  8:11       ` Razvan Cojocaru
2018-09-05  8:14       ` Razvan Cojocaru
2018-09-05  9:27         ` Jan Beulich [this message]
2018-09-05 16:28     ` Tamas K Lengyel
2018-09-05 16:40       ` Razvan Cojocaru
2018-09-05 18:40         ` Tamas K Lengyel
2018-09-05 18:45           ` Andrew Cooper
2018-09-05 22:27             ` Tamas K Lengyel
2018-09-20  8:11               ` Razvan Cojocaru
2018-09-20  8:14                 ` Wei Liu
2018-09-20  8:16                   ` Razvan Cojocaru
2018-09-20  8:22                 ` Jan Beulich
2018-09-20  8:31                   ` Wei Liu
2018-09-20  8:38                     ` Razvan Cojocaru
2018-09-20  8:33                 ` Jan Beulich
2018-09-05 18:53           ` Razvan Cojocaru
2018-09-20 14:42 ` George Dunlap
2018-09-20 14:55   ` Razvan Cojocaru
2018-09-20 15:28     ` George Dunlap

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=5B8FA18302000078001E56A6@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=apop@bitdefender.com \
    --cc=proskurin@sec.in.tum.de \
    --cc=rcojocaru@bitdefender.com \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.com \
    --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 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.