All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: 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, 4 Sep 2019 11:51:01 +0000	[thread overview]
Message-ID: <4ba2503f-20b2-3670-ba16-8b03e69f3937@bitdefender.com> (raw)
In-Reply-To: <71f44ba3-b436-128e-8585-62c731feb7f3@suse.com>



On 03.09.2019 18:52, Jan Beulich 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?

Because this is done for the initialization of a new view and the p2m is 
locked.

Alex

> 
>> --- 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.
> 
> Furthermore, according to common practice elsewhere, the new
> trailing padding field should be made explicit, and checked to
> hold zero on input.
> 
> Jan

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

  parent reply	other threads:[~2019-09-04 11:51 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
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 [this message]
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=4ba2503f-20b2-3670-ba16-8b03e69f3937@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=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.