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

Re: [PATCH 2/2] x86/cpuid: support LFENCE always serializing CPUID bit


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 14 Apr 2021 14:05:17 +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-SenderADCheck; bh=gPZzrhmhXmUS62/S96Vum7xVOSM8+MXrgg2yVqqPLQw=; b=gpF26wz1Y5VxwP5sHU7u4M5tLpkAzONE5SPVnJ4PwP3RtOE6KZhFouUwmx3MRt8vgm2bR68N1t1v+WyR153S5d5/zaov4QJr2P4+EA3gR+kZaP4RA5PYM/yFfyrUp3M+HqeSZz53fUB+fA6mbF5ocu1CV1pSsghgqcn8AybcXddTzfdOBLA97ZYgBj4WA6DKSbl6UoEFPaXKaJw4Oxkv+g4ONcxmxiT3SmRoak4s/8ZagxZJ+K70x4Bnsby74bPSyhyw71TKvuFFylRzg8FnoPV7t/6UnIbMVt11nXNgJi/zTzTIjSQhYNS9ZNNN/2MQNBfk3UxkW6NBgest1UeH7w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z0WgOQAvkP/lNP1QaByBwvacIQ44rmTYi2GbVM5p78VIEFdZNdF60fLVnm8BH9tJCk8kMoX0DdgEMAdRaqBYpXAG5iAMwSLa+C3xlR4YTTUffQVPnbGPVaYbKaD7BwRrSKTloU5XDjqhQUCooPlfGpz8uBFffG9W6ym03FOelkp012ec0XEE/WIS5K3D4IT7pRY37RWixa84CQzdemrHswm6yG/a5Z72POeWvuEXBgtGcsK4H1Yss62HdXVDx3XcKZd5CqKPrtIHm7CVJ91SCjyXjoNWoG6QFKpr9nqci7cS3Nux7lkQF2ZzZbfDOApT3yJSJAf8Sd6TTpjIiMTw4g==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Wei Liu <wl@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 14 Apr 2021 13:05:37 +0000
  • Ironport-hdrordr: A9a23:Ns+Cf6gpOfik5fyMLxtAZgmDl3BQX3Vw3DAbvn1ZSRFFG/Gwv/ uF2NwGyB75jysQUnk8mdaGfJKNW2/Y6IQd2+csFJ+Ydk3DtHGzJI9vqbHjzTrpBjHk+odmup tIW5NVTOf9BV0St6rHySGlDtctx8SG+qi0heHYi0xgVx1udrsI1WdEIyywe3cGIzVuL5w/CZ aa+45jrz2vZXwYYq2Adwc4dsLEoMDGk4+jXAUPAAQp5BLLoTSj7rP7FBbw5GZgbxpkx7A+/W /Z1zHo/6nLiYDG9jbw9U/2q65Xltzo18dZCKW36/Q9Bz3whm+TFf9ccpKYujRdmpDX1H8Ll5 32rw4kL4BP7RrqDxyIiD/M/yWl7zo08X/lzjaj8AneiOj0XigzBcYEpa8xSGqg12MasNtx0L 1G0gui3vI9Z36w/1Welqz1fipnmUaurX0pnfR7tQ04baIkZKJMtotaxUtJEf47bVHHwbo6G+ pjBty03ocyTXqmaRnizw1S6eC3Um92NhmLRVVqgL3u7xFm2Fp9z0ce2fUFmGYB+J8XW/B/lp T5G5Utu7dUQsAMa6VhQM8HXMusE2TIBSnBKWSIPD3cZe86EkOIj6SyzKQ+5emsdpBN5JwumK 7ZWFcdkWIpYUrhBeCHwZUjyGGNfEyNGRDWju1O7ZlwvbPxAJDxNzeYdVwom8y8590CH8zyQZ +ISdBrKs6mCVGrNZdC3gX4VZUXA2IZStcpttEyXE/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1sf0Q Ht4tymAFaZuUyHMRB1u5kFzhlZ1rqrp0sV2SuUV8kCOf9gNEQHe/1MtDoIGu2RAN33jEteti3b f0LpaU97YN5xJaAPdGC/mDDo0q6P8RuRcabMgrRV2rXOiiVGOAxdIRBsuPGhFF/t7rN3Fqh870 HY7MMEa1ovpo5VGlEAahvw8beatfuzDn04LSNhti3mnJ4oP3MCQOltFMzM6W7+kz/WlvPL83VT e6A=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14/04/2021 13:57, Jan Beulich wrote:
> On 14.04.2021 13:04, Roger Pau Monne wrote:
>> @@ -264,6 +265,38 @@ struct cpuid_policy
>>              };
>>              uint32_t nc:8, :4, apic_id_size:4, :16;
>>              uint32_t /* d */:32;
>> +
>> +            uint64_t :64, :64; /* Leaf 0x80000009. */
>> +            uint64_t :64, :64; /* Leaf 0x8000000a - SVM rev and features. */
>> +            uint64_t :64, :64; /* Leaf 0x8000000b. */
>> +            uint64_t :64, :64; /* Leaf 0x8000000c. */
>> +            uint64_t :64, :64; /* Leaf 0x8000000d. */
>> +            uint64_t :64, :64; /* Leaf 0x8000000e. */
>> +            uint64_t :64, :64; /* Leaf 0x8000000f. */
>> +            uint64_t :64, :64; /* Leaf 0x80000010. */
>> +            uint64_t :64, :64; /* Leaf 0x80000011. */
>> +            uint64_t :64, :64; /* Leaf 0x80000012. */
>> +            uint64_t :64, :64; /* Leaf 0x80000013. */
>> +            uint64_t :64, :64; /* Leaf 0x80000014. */
>> +            uint64_t :64, :64; /* Leaf 0x80000015. */
>> +            uint64_t :64, :64; /* Leaf 0x80000016. */
>> +            uint64_t :64, :64; /* Leaf 0x80000017. */
>> +            uint64_t :64, :64; /* Leaf 0x80000018. */
>> +            uint64_t :64, :64; /* Leaf 0x80000019 - TLB 1GB Identifiers. */
>> +            uint64_t :64, :64; /* Leaf 0x8000001a - Performance related 
>> info. */
>> +            uint64_t :64, :64; /* Leaf 0x8000001b - IBS feature 
>> information. */
>> +            uint64_t :64, :64; /* Leaf 0x8000001c. */
>> +            uint64_t :64, :64; /* Leaf 0x8000001d - Cache properties. */
>> +            uint64_t :64, :64; /* Leaf 0x8000001e - Extd APIC/Core/Node 
>> IDs. */
>> +            uint64_t :64, :64; /* Leaf 0x8000001f - AMD Secure Encryption. 
>> */
>> +            uint64_t :64, :64; /* Leaf 0x80000020 - Platform QoS. */
>> +
>> +            /* Leaf 0x80000021 - Extended Feature 2 */
>> +            union {
>> +                uint32_t e21a;
>> +                struct { DECL_BITFIELD(e21a); };
>> +            };
>> +            uint32_t /* b */:32, /* c */:32, /* d */:32;
>>          };
>>      } extd;
> Due to the effect of this on what guests get to see, I think this
> wants to take my "x86/CPUID: shrink max_{,sub}leaf fields according
> to actual leaf contents" as a prereq, which in turn may better
> remain on top of "x86/CPUID: adjust extended leaves out of range
> clearing" (both are neighbors in that over 4 months old series,
> fair parts of which could imo go in irrespective of the unsettled
> dispute on xvmalloc() - unfortunately I had made that patch 2 of
> the series, not expecting it to be blocked for so long, and then
> presumably signaling to others that the rest of the series is also
> blocked).

There is no shrinking to be done in this case.  The bit is set across
the board on AMD/Hygon hardware, even on older parts.

What does need changing however is the logic to trim max_extd_leaf down
to what hardware supports, so the bit is visible on Rome/older
hardware.  I.e. after this change, all VMs should get 0x80000021 by
default on AMD hardware.

(A curious observation of Milan hardware is that it actually advertises
0x80000023 as max_extd_leaf, and has two leaves of zeros at the end. 
I've got an open query about this.)

~Andrew



 


Rackspace

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