[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v1] x86/altp2m: Add hypercall to create a new view and set sve bits
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
- Date: Wed, 4 Sep 2019 11:51:01 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IiyEYHT9pCpNOfPZRxJKv/fou6QWRGB1LF1/tVyJVNQ=; b=S3DQ96tuREFMy1Pk7w4h41FLR1oXlTgIisRTEVy3ojJnEjX+bn5m6qSUeK7cII5HWFVjgPzYumWE2xnlIBQWqCUsPkEHzzWyLRr7lK0boCRcZNjuEhmpqM1M/RaTalFOYcwMJGEB0OeWGto6ejnN+x8UeMhWtjquxuO2VUxISl3U/RAnwOneSZtZYq7bayWyjgf5hB8AnCmD01Z4392/X8SiGJ+wlExhkoKG2EMI/oG72ym25R8Xx1gyXrtckTJedpSdfFNz9bppZg6sHb8s4I1dp6AMQZy8xE3NXzPTB45l2qod/pHnmc/v762R+ZRZ96mruzkOZAHF3c+rbjiiqw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTir0uVXXnTjsjqSQ5A4b6T8FGJNjmLnhz2NUph/JYRbx9GVZK0AuE7OKq7S25yqDjPE21ejKHZDGfpeYHNBfxS3UY+7e+9/by5OB975VnJltOo21r8kCnbCVqnWqGSzcJJWQBmLJOJ82K7Mb30p7jvNwe0hn6k1pykhIVeEnJB9/qmrErXbDgoLyfTHu38sVOuOx78cTOGtYKrsg3FWO/5JPdGBdQpzQYvHvg5sdUW+bYeUU//QQqr1ajEW3vNylC1OTBWdbRA9GEwtVsbxnCM5m3B3NZqBuotR/lytgRqJWWjbncysWxLxsHbfwebU5dlaSNQZQO6uGvv5K21o9Q==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
- Cc: "kevin.tian@xxxxxxxxx" <kevin.tian@xxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxxxxx" <george.dunlap@xxxxxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "ian.jackson@xxxxxxxxxxxxx" <ian.jackson@xxxxxxxxxxxxx>, "tim@xxxxxxx" <tim@xxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, "jun.nakajima@xxxxxxxxx" <jun.nakajima@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>
- Delivery-date: Wed, 04 Sep 2019 11:51:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVYWYIdb/r2yKq9kGUPnrK2APIqqcaHHgAgAFOwwA=
- Thread-topic: [PATCH v1] x86/altp2m: Add hypercall to create a new view and set sve bits
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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|