All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Alexandru Stefan ISAILA <aisaila@bitdefender.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 14:14:32 +0200	[thread overview]
Message-ID: <813b92ae-0f4a-22ec-db30-6c43be246708@suse.com> (raw)
In-Reply-To: <4ba2503f-20b2-3670-ba16-8b03e69f3937@bitdefender.com>

On 04.09.2019 13:51, Alexandru Stefan ISAILA wrote:
> 
> 
> 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.

Well, this makes handling this the way you want it close to
impossible, but is not an argument against the need for preemption
here. Just like it had turned out to be unreasonable to
preemptively handle other P2M adjustments (which is why
p2m-ept.c:resolve_misconfig() and p2m-pt.c:do_recalc() got
introduced), I'm afraid you'll have to use some other technique
here (possibly building on top of the mentioned functions).

Jan

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

  reply	other threads:[~2019-09-04 12:14 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
2019-09-04 12:14     ` Jan Beulich [this message]
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=813b92ae-0f4a-22ec-db30-6c43be246708@suse.com \
    --to=jbeulich@suse.com \
    --cc=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.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.