[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 17 Feb 2022 10:24:15 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yeZVID7WEt1NNuALJjPNEUhUpiWtrNlfafwbYA/JAuI=; b=NKPwKK2fWzpRp3C1rhnMcYh1cO0BwzmtHqkmNIZ0xno+Ujz9car5gjOdnr+QLxd7BZihSnCcW6HNTCeZ3eBzON2AuVmJu/uKrZVl8JARuAY7XPTqX6ttFckQ/APRBHEg7IdTPofxot2UndJSjDgsd07MSP88+3JOFR66ln7AMSWQV3385nnOZMvEInAIdnzCcBMaUAl/dITmH82TosTunSKuSA+LkebKaROYC7GsFMHBsL0eZ2SCux7IpNOJPz8GhD/2I2x/FajGPfryKvvKhasuYoCKh6mxi4yoJ6Ej/1uGRDFrb9Bq+1vO9qc039HBovNpGz2Y9stM1D+b8oDhFg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KAQ5VSUFL/tdm9O/jaz3UtD/lVQWi84YRq2iQ61QZYMvzjSJRKbr4OQWwwNkxuY8gDHr1lwKgcUlpCmX2BRleIaTXokEQuZ8HkzoPbD6aQR0meb7UFapEYRQQql61VcDcsGa+lGZgfVoAMj8Zu+umzyC1oClDna9JkgA6eCrig7erdF8ApcqTVsbVnjFDl+BAtW2PGrbJ1pPVfekJ1N93Bqqfwn13A6s1LuVc2hVr3J2b52Ym325WHG3zsBJPKqsNb7WfFUFuFZ1+WZZbV3rRlEKJ4kSZboinvNG1RGhds0DavHXaDjb31umYzd0rCFCq8OxKw7GD0c+A66wanRdbQ==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.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:24:41 +0000
  • Ironport-data: A9a23:vdYaVaJb99DGLFcbFE+ROpIlxSXFcZb7ZxGr2PjKsXjdYENS0TdTm jBMXG3SOq2OZTT8f95wO4/kpBsPvcTSzNRqSFRlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUakideSc+EH170Ug6xLZg6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB2pgs5t1 sRpp6eialxwN5Dwlb0TYjNXRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsF2gcsuNo/zNZ43sXB81zDJS/0hRPgvRo2UuY8ChGlt2KiiG97FW 5YCTiB1SS3mbjBtM04NV6A8xu6B0yyXnzpw9wvO+PtfD3Lo5BN1+KjgNpzSYNPibdVYmAOUq 3zL+0z9AwoGL5qPxDyd6HWui+TT2yThV+o6Fre16/pri1273XEIBVsdUl7TifWmj1Hkc9NZJ VYd9icnoe417kPDczXmd0Tm+jje5EdaAocOVb1hgO2Q9kbKyyaEGHQaXxpTU84F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 0QDpSWa+eAc2SS7/yKmTVQeuxIqLLskNHKuQ6d9QYUcegDUdAe0+4TMHf8LqQZfngjOXJvf6 Dsmvav6gDQMUg/X4CePD0oTuLDr9rEmNbPZgMHPQcu7E2rgSmz4LD3PhCE1lNGOgk/i4sKwC zgqUjU96+ju/a0xlv10HLS1Y1fnJ/ExsFYDMKBp8AJInHHixquZq5mR7qe1QpF692H2RIPqp 3hsh0gN8N85zf4eXy0mwLk303a3DMn+xbZuCilqEqmhfa8aCMxCsJHi44cWADe8VAcsNZ117 8O936FtrJMZCmw0xjV1pztbVVHh0C0qX0tnao4lHpES7YTb7dXsMg24F5VKpEdByj3gbpXXN WGNPuspcq+TGnqL0ww5gJUsZ+RtzUIb1q7q3E5y4KoO2M8pgE686MarPZv6kvouqhNDqWs3N 60QpiAoos+O/P+XZgNddvpfvHHeVAlYSi8Rl56cm6XXZ3uBRr22uzKCfMOlaWXRKA=
  • Ironport-sdr: Zk2iAw4KOQ3yfOBqBCopQdhixhb2qjFL1HED2mkgIZUUzyColS8LuWtJAZH4AcIaLxpcuZAhK7 WIZKEacwa9g9tYHPrKSzYTTVel8vHLY72PmgA6DSPzde9hNsdxQm/jO5LImCSysIhugnCp0OKX 1jeGos/ylriM3aLjaLkHwkXGCPl/njG/fkbL8A9kstpFQlGE99S/9jljQfc31VhG3oM8RycIbr 0UTS5kj4RGwF0XxsS0GNHYYOl8CI0jopzFeQR4RJ9h/VlcHOceL9JuTKynkL4jlB+G+BIhdBu4 1PvO2fPBDrkapYR3yIB/02sB
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.
 */

Thanks, Roger.



 


Rackspace

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