[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/5] x86/cpuid: add CPUID flag for Extended Destination ID support


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 17 Feb 2022 10:47:57 +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=fy0UePrlVTTNcJntfNiuSPcc8zS67fNtCIo5/uA/lf8=; b=Y7tvr4szsvXjFj55xwzPiavkhohTzFa/tRG3h2zRsf5W6VihijK8bHJfba57aK0/kWPtZPBYvcLGQ9H7YOpFbh6MC0QJRlmuarZhcXy67YyckoAxjJ+qnQ8EEy4xanIL9LdUZcSIQ9FeHeENC6B5S3loQki9OlBi+IuCd+WJF2QIZbiitZ9jlWTpPknl57leogwG5Za8n6cl+2n/670bT/e5QVbNcxeq2iV2AqURFnBiX/RMqA/TVxcKSwHOZFTcfX0e3MzkX+wZwThSOICb+9PH1rAE4OO6fC/alRZUz307O8ouDXYoA1zhpeTO0M75OTHOMOpjlb90YJfZsvqIkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kfobEzO/J7fn22vL2JK+36+j8aO3qumHXfOxyechFVTeAo/GO6ZKgEPNZT2aF4tH5lLtmnzQz0KkwX6WPz93IsjoxPoOXurvGoQTz9ds+YCsCcQ+8b30+N0dhApSGFokYQaySW9EZjvppBsnEL9OSpI0biQWhkKTMSLinWyVusRwety9KUcqsV7PgxFG8jbOSC5WjRMP+zDsoMIZZMpkHNvTXyuGT6UctpsbyZeHoRH5fIGzHbUG7H+a9MlS8L4JVMkZIJbgmMP+ubJUsuIZsd4DSkR0dUjIYduX7pslBIl3xZCM60xT8IkPRbjAqk3FawrpFeM+uMStXR/rOhnhZA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 17 Feb 2022 09:48:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.02.2022 10:24, Roger Pau Monné wrote:
> On Thu, Feb 17, 2022 at 09:52:51AM +0100, Jan Beulich wrote:
>> On 16.02.2022 17:08, David Woodhouse wrote:
>>> On Wed, 2022-02-16 at 16:43 +0100, Jan Beulich wrote:
>>>> On 16.02.2022 11:30, Roger Pau Monne wrote:
>>>>> --- a/xen/include/public/arch-x86/cpuid.h
>>>>> +++ b/xen/include/public/arch-x86/cpuid.h
>>>>> @@ -102,6 +102,12 @@
>>>>>  #define XEN_HVM_CPUID_IOMMU_MAPPINGS   (1u << 2)
>>>>>  #define XEN_HVM_CPUID_VCPU_ID_PRESENT  (1u << 3) /* vcpu id is present 
>>>>> in EBX */
>>>>>  #define XEN_HVM_CPUID_DOMID_PRESENT    (1u << 4) /* domid is present in 
>>>>> ECX */
>>>>> +/*
>>>>> + * Bits 55:49 from the IO-APIC RTE and bits 11:5 from the MSI address 
>>>>> can be
>>>>> + * used to store high bits for the Destination ID. This expands the 
>>>>> Destination
>>>>> + * ID field from 8 to 15 bits, allowing to target APIC IDs up 32768.
>>>>> + */
>>>>> +#define XEN_HVM_CPUID_EXT_DEST_ID      (1u << 5)
>>>>
>>>> Would the comment perhaps better include "in the absence of (guest
>>>> visible) interrupt remapping", since otherwise the layout / meaning
>>>> changes anyway? Apart from this I'd be fine with this going in
>>>> ahead of the rest of this series.
>>>
>>> No, this still works even if the guest has a vIOMMU with interrupt
>>> remapping. The Compatibility Format and Remappable Format MSI messages
>>> are distinct because the low bit of the Ext Dest ID is used to indicate
>>> Remappable Format.
>>
>> Well, yes, that was my point: With that bit set bits 55:49 / 11:5 change
>> meaning.
> 
> Bits 55:49/11:5 become reserved again with the interrupt format bit
> set to remappable.
> 
>> As an alternative to my initial proposal the comment could also
>> state that bit 48 / 4 needs to be clear for this feature to take effect.
> 
> I've always assumed that setting the IF to remappable invalidates
> extended destination ID, as the format of the interrupt is different
> then and there's no destination ID anymore, just a handle field. Maybe
> I could make it more explicit:
> 
> /*
>  * With interrupt format set to 0 (non-remappable) bits 55:49 from the
>  * IO-APIC RTE and bits 11:5 from the MSI address can be used to store
>  * high bits for the Destination ID. This expands the Destination ID
>  * field from 8 to 15 bits, allowing to target APIC IDs up 32768.
>  */

Yes, this disambiguates things enough to address my concern. Then
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
and I'd be fine making the adjustment while committing, if no other
concerns arise.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.