All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: Tamas K Lengyel <tamas.k.lengyel@gmail.com>,
	Jan Beulich <jbeulich@suse.com>
Cc: "kevin.tian@intel.com" <kevin.tian@intel.com>,
	"sstabellini@kernel.org" <sstabellini@kernel.org>,
	"wl@xen.org" <wl@xen.org>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"george.dunlap@eu.citrix.com" <george.dunlap@eu.citrix.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
	"tim@xen.org" <tim@xen.org>,
	"julien.grall@arm.com" <julien.grall@arm.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"roger.pau@citrix.com" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v1] x86/altp2m: Add hypercall to create a new view and set sve bits
Date: Wed, 23 Oct 2019 09:11:54 +0000	[thread overview]
Message-ID: <41a47abf-ec6f-1b19-8803-099b7d54b5bd@bitdefender.com> (raw)
In-Reply-To: <CABfawhmYs4SBJZ6u4b7+ymdrTtLzLC+VMQwHovSVDNtw3c7vHg@mail.gmail.com>



On 03.09.2019 20:24, Tamas K Lengyel wrote:
> On Tue, Sep 3, 2019 at 9:53 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 02.09.2019 10:11, Alexandru Stefan ISAILA wrote:
>>> @@ -1355,6 +1355,23 @@ void p2m_init_altp2m_ept(struct domain *d, unsigned int i)
>>>       ept = &p2m->ept;
>>>       ept->mfn = pagetable_get_pfn(p2m_get_pagetable(p2m));
>>>       d->arch.altp2m_eptp[i] = ept->eptp;
>>> +
>>> +    if ( set_sve )
>>> +    {
>>> +        unsigned long gfn = 0, max_gpfn = domain_get_maximum_gpfn(d);
>>> +
>>> +        for( ; gfn < max_gpfn; ++gfn )
>>> +        {
>>> +            mfn_t mfn;
>>> +            p2m_access_t a;
>>> +            p2m_type_t t;
>>> +
>>> +            altp2m_get_effective_entry(p2m, _gfn(gfn), &mfn, &t, &a,
>>> +                                       AP2MGET_query);
>>> +            p2m->set_entry(p2m, _gfn(gfn), mfn, PAGE_ORDER_4K, t, a, true);
>>> +
>>> +        }
>>> +    }
>>>   }
>>
>> How long is this loop going to take for a huge guest? IOW how
>> come there's no preemption in here, or some other mechanism
>> to bound execution time?
> 
> Also, looks to me you should check whether the mfn is valid before
> calling p2m->set_entry.

I agree, I will check the mfn in the next version.

> 
>>
>>> --- a/xen/include/public/hvm/hvm_op.h
>>> +++ b/xen/include/public/hvm/hvm_op.h
>>> @@ -244,6 +244,7 @@ struct xen_hvm_altp2m_view {
>>>       /* Create view only: default access type
>>>        * NOTE: currently ignored */
>>>       uint16_t hvmmem_default_access; /* xenmem_access_t */
>>> +    uint8_t set_sve; /* bool value */
>>>   };
>>
>> This interface is, given the right configuration, available to
>> guests. Hence you can't simply add a field here. Just consider
>> what happens for an existing caller when there is random data
>> in the field you now assign a meaning.
> 
> Perhaps instead of extending the HVMOP it would make more sense to
> just add a xl config option that defines the "default" sve bit for
> altp2m views in the domain?
> 

Adding a xl config option will not work for systems that do use xl. 
There is a need that this will work in all cases.

Thanks and sorry for replying so late,

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

  reply	other threads:[~2019-10-23  9:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02  8:11 [Xen-devel] [PATCH v1] x86/altp2m: Add hypercall to create a new view and set sve bits Alexandru Stefan ISAILA
2019-09-03 15:52 ` Jan Beulich
2019-09-03 17:24   ` Tamas K Lengyel
2019-10-23  9:11     ` Alexandru Stefan ISAILA [this message]
2019-10-23 11:58       ` Roger Pau Monné
2019-10-25 14:36         ` Alexandru Stefan ISAILA
2019-10-25 14:40           ` Alexandru Stefan ISAILA
2019-09-04 11:51   ` Alexandru Stefan ISAILA
2019-09-04 12:14     ` Jan Beulich
2019-09-04 13:04       ` Alexandru Stefan ISAILA
2019-09-04 13:17         ` Jan Beulich
2019-09-04 14:14           ` Alexandru Stefan ISAILA
2019-09-04 14:26             ` Jan Beulich
2019-09-05  8:02 ` Julien Grall

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=41a47abf-ec6f-1b19-8803-099b7d54b5bd@bitdefender.com \
    --to=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas.k.lengyel@gmail.com \
    --cc=tim@xen.org \
    --cc=wl@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 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.