[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/4] x86/hvm: Drop hvm_{get,set}_guest_bndcfgs() and use {get,set}_regs() instead
- To: Andrew Cooper <amc96@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 20 Jan 2022 09:20:18 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SVIK3q3Oud0kz3uUhJVhqPyT6WLzLJHxvBedrAC3yy4=; b=bdzy2Acj+efynAkpJTZPwsBHu6PLh5Z1zZJbMOwmuKdhipUDWFVyi2YlPzoEdMwLZkPgm91wxIyEbxrKcLPpcY2TfF8KfwVMZmaJZ7db30M+4YuqXgOCukxOKL9tbf2/qByR02+1HXVk9YfZZDGGQw0Rcj4W36mQxZnuqLXwu0GABRv8rcH5uNRPsq5zo955/WDsHdb+lsYF6UxkxSA+T40Pjn50YuSU0jgOuvBZN58uS/CN4JIB7DB0/W1PdsIvLCiMiokD+5IAtL30tVWiAc6tKAyjK9zNa3CTFPhddx569V1PT8LEIkJABUShEaEjlU1lA78Ih743KTztEhJyuQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eo2b1AH7EuDTX5CKlFl/+uo4zFU9X5X1/SB8qGwXKLGPZjeSD6YWF6sQpDyfCoooitbD63UTn7y+MH2dETV5gBobbJVJTnKB+YdC601f6R0LGB25kJhRjVoAraw4xrrAxF6ejR9UylDFDYT4Roll94rkVPailpsW86S7Pl+fZC+q567yPgsA2Sxq1PBV7HvIGVr24rN15pwzpgdC3G9M1yw/Oy/xYNrhaKkavg8vGlZbvuytm8GnL5FMaTPe4u6uWFZTfkJ33AHRLgheT5sFVUBxTtSmDp6slczmq+cA7GMmF/7bKV3n8pW/Ee2sc731/rANplnMCszfIHUQ1hpEKg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 20 Jan 2022 08:20:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 19.01.2022 17:53, Andrew Cooper wrote:
> On 19/01/2022 13:50, Jan Beulich wrote:
>> On 17.01.2022 20:25, Andrew Cooper wrote:
>>> @@ -323,10 +324,9 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t
>>> *val)
>>> break;
>>>
>>> case MSR_IA32_BNDCFGS:
>>> - if ( !cp->feat.mpx || !is_hvm_domain(d) ||
>>> - !hvm_get_guest_bndcfgs(v, val) )
>>> + if ( !cp->feat.mpx ) /* Implies Intel HVM only */
>> Wouldn't it make sense to accompany this comment by ...
>>
>>> goto gp_fault;
>>> - break;
>> ASSERT(is_hvm_domain(d));
>>
>> (and then the same on the "set" path)?
>
> So this is the reason for the default logic in the {get,set}_reg()
> path. The absence of MSR_BNDCFGS in the PV and SVM paths will cause the
> VM to be crashed cleanly. If you're on a VMX on a non-MPX capable
> system, the VMREAD/VMWRITE will hit a BUG (which in due course I want to
> downgrade to a domain crash).
>
> It's a bit more friendly than an ASSERT() (doesn't take the system
> down), is present in release builds too, and more precise as it excludes
> SVM too.
I see, makes sense.
Jan
|