[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/4] x86/spec-ctrl: Remove opencoded MSR_ARCH_CAPS check
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Fri, 19 May 2023 15:38:18 +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=Uim8DUTwIE8e6XEtU6M/QwUCTv6D5g0/K7GLMCIRjxU=; b=MLqsx+FhvePkaRAEqSfAYbGtW0Vqf4RLb96eLAN6EhkKP+uY3csGRpsKpXSEQHpqolu8VftPtwYNNROgtzpwK05ZdEmr6a/jIBITC4Ml54YEn/+0wCBRBqQboEpsN/yF41kPB18FtGQeMed2pefZVV/7w67oIVgvuU+ZDYM5eLmTejoCKzFIZXycgpjJcqXVMwxHs9/CbDLDe6HTXPPseeUcGwCWN+7MaGllU7iaN7h5cBoD5UG64lZenv4/z54XXOidrbd6/qBt9REqpiX+eBy+/fIVJEXt6YE+rSziVjisbtz12/YFW2Sv/lmF4cjRhJPtLXpl/AuRBPC0oKhmBQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gJ+pgxyJI4CpYQdRcbPDEGedwy0PysKyJmXZ7ETNq115GH6cqU6QslCnalXye99Lx+phOqM7XSZS1wQK4zrsl+SQad43cvkNtEvBMVVW58GllabAB62/eYa2gSmM8UPw65hC6TcQGQnXiQiTrhZA2WZcAgpNnhurVkYso4jY9BT1LcztpUp93W1LErOegqM+TMplcRLwafoakvczGXoD9jPolwipspOruF07caJKgidrTBzTe5dkHct/G+Viex87bTyODKFP/fRIyAoJUAhigfurf2FQLxmO62FiFcRBKO7L7tUM8v8b3igh/m7N0WuVkwTpgPPewaLFSvipD5vgog==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 19 May 2023 14:38:55 +0000
- Ironport-data: A9a23:EE/OeawNh2f1waMa+0d6t+caxyrEfRIJ4+MujC+fZmUNrF6WrkUHz WJNDGCBbPvfZmqme4xxOozi8UkH75fWnN5hGVZl/iAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EsHUMja4mtC5QRjPKET5jcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KT9hq fM4DwlUUjOS1tCX7IDgDcRomct2eaEHPKtH0p1h5RfwKK9/BLrlE+DN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjiVlVIguFTuGIO9ltiibMNZhEuH4 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAdhLT+blp6ACbFu7+lEyCh86RGqCmtqJyWKcftlBN UE19X97xUQ13AnxJjXnZDW6qnOZuh8XW/JLDvY3rgqKz8L8/AKxFmUCCDlbZ7QOpMIwADAny FKNt9foHiB09q2YT2qH8bWZpi/0PjIaRVLufgcBRAoBptPl8Ic6i0uWSs45SfDkyNroBTv33 jaG6jAkgKkehtIK0KP9+k3bhzWrpd7CSQtdChjrY19JJzhRPOaND7FEI3CBhRqcBO51lmW8g UU=
- Ironport-hdrordr: A9a23:VBQmJ6OMJ158R8BcT9z255DYdb4zR+YMi2TDiHoddfUFSKalfp 6V98jztSWatN/eYgBYpTnyAtjmfZq6z+8J3WBxB8bZYOCCggeVxe5ZnOjfKlHbakjDH6tmpN xdmstFeaPN5DpB7foSiTPQe7hA/DDEytHRuQ639QYTcegAUdAF0+4WMHf8LqQ7fnglOXJvf6 Dsmvav6gDQMUj+Ka+Adws4dtmGg+eOuIPtYBYACRJiwA6SjQmw4Lq/PwmE0gwYWzZvx65n1W TeiQT26oiqrvn+k3bnpiPuxqUTvOGk5spIBcSKhMRQAjLwijywbIAkd6yesCszqOSP7k9vtN XXuR8vM+l69nuUVGCophnG3RXmzV8VmjLf4G7dpUGmjd3yRTo8BcYErYVFciHB405lmN1nyq pE00+QqpISVHr77W7AzumNcysvulu/oHIkn+JWp3tDUbEGYLsUiYAE5ktaHLoJASq/woE6F+ tFCt3a+Z9tABinRkGcmlMq7M2nX3w1EBvDak8euvaN2zwTp3x9x1tw/r1pol4wsLYGD7VU7e XNNapl0JtUSNUNUK57DOAdBeOqF23kW3v3QSKvCGWiMJtCF2PGqpbx7rlwzvqtYoY0wJw7n4 mEeE9EtFQ1Z1nlBaS1rdx2Gyj2MSeAtAnWu4RjD8ATgMy5eFOrC1zMdLkWqbrinx1FaferHM paO/ptcovexCXVaMB0NjbFKupvwEklIbwoU+kAKiKzS+LwW/vXX7/gAb/uDYuoNwoYcUXCJV ZGdATPBax7nzWWsznD8VfsZ08=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 19/05/2023 7:00 am, Jan Beulich wrote:
> On 17.05.2023 18:35, Andrew Cooper wrote:
>> On 17/05/2023 3:47 pm, Jan Beulich wrote:
>>> On 16.05.2023 16:53, Andrew Cooper wrote:
>>>> @@ -401,6 +400,8 @@ static void __init print_details(enum ind_thunk thunk,
>>>> uint64_t caps)
>>>> cpuid_count(7, 2, &tmp, &tmp, &tmp, &_7d2);
>>>> if ( boot_cpu_data.extended_cpuid_level >= 0x80000008 )
>>>> cpuid(0x80000008, &tmp, &e8b, &tmp, &tmp);
>>>> + if ( cpu_has_arch_caps )
>>>> + rdmsrl(MSR_ARCH_CAPABILITIES, caps);
>>> Why do you read the MSR again? I would have expected this to come out
>>> of raw_cpu_policy now (and incrementally the CPUID pieces as well,
>>> later on).
>> Consistency with the surrounding logic.
> I view this as relevant only when the code invoking CPUID directly is
> intended to stay.
Quite the contrary. It stays because this patch, and changing the
semantics of the print block are unrelated things and should not be
mixed together.
>> Also because the raw and host policies don't get sorted until much later
>> in boot.
> identify_cpu(), which invokes init_host_cpu_policies(), is called
> ahead of init_speculation_mitigations(), isn't it?
What is init_host_cpu_policies() ?
I have a plan for what it's going to be if prior MSR work hadn't ground
to a halt, but it's a bit too late for that now.
(To answer the question properly, no the policies aren't set up until
just before building dom0, and that's not something that is trivial to
change.)
~Andrew
|