[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/6] x86/boot: Record MSR_ARCH_CAPS for the Raw and Host CPU policy
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 16 May 2023 14:53:46 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=Fj4WW3cDCNYbX2SRoGHsebVtFneF3IAQPw+XdPhZ/Ak=; b=Zn4WUQxn8wTJm4M/aIJUCoJDXsvOssCbon00QBymROnR+/JUpZZgYhU3NyBb7ipx2Dn/yCW8wHzTz/YkoIAAwZGFQUlY1/wNFcjhYBzIxFBikvS+b8BVA6RDktQuQzIRdUISPpQBGGTyeXay01+0FZLXMsFF/5STYUZMo/BwZ/liigiLpOn1lo5C9vfj1qSTeYHwrUDLTs7TDbu7m8mNBGUuNdAvrO7O8AzaPhbSBlNoOQ/baU85ix1Fyicm4NvH6bYubVI4/AJvP+M5VQelqBHX/Y6lD4ZAN9zdyVge4frRuzZfGLJUcSP9PAeFk7eGWAThSpdYdsTfrKkfoq0rOw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oThhyUkcMuB9Y9AWrSnLEhxwxREE4/L7FJEakfk0A0Xu+3dK+VmDHVuDV/sMKtqfdWXn0pcZiM1XbSjp1GD3NTr+e9Uu9bSM9wQhI9zgGHyeA72SyhuOv3wLcNRccDTIkiXbQJutB+cl3CtjqndFTfUQS/6z14zy9uy0v67CUi1zOanbWP6WC4fAtlsDC9MuftjjaTQoqZh9LiQqDmFUZrH702A9mxMI5LBNzr94p0ZaThFBHmcFiBgrc4wxJh1Um9ilm2UKBYncQezuOboITILbI4rGcVF8lq8ByjxY3+xXFa6mYB5InaV5NP1Pp4ZzdN3deefVG+z88Be0I0rILQ==
- 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>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 16 May 2023 12:54:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 15.05.2023 16:42, Andrew Cooper wrote:
> Extend x86_cpu_policy_fill_native() with a read of ARCH_CAPS based on the
> CPUID information just read, which removes the need handling it specially in
> calculate_raw_cpu_policy().
>
> Extend generic_identify() to read ARCH_CAPS into x86_capability[], which is
> fed into the Host Policy. This in turn means there's no need to special case
> arch_caps in calculate_host_policy().
>
> No practical change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
I have a question though, which I think would be nice if the description
had covered:
> --- a/xen/lib/x86/cpuid.c
> +++ b/xen/lib/x86/cpuid.c
> @@ -226,7 +226,12 @@ void x86_cpu_policy_fill_native(struct cpu_policy *p)
> p->hv_limit = 0;
> p->hv2_limit = 0;
>
> - /* TODO MSRs */
> +#ifdef __XEN__
> + /* TODO MSR_PLATFORM_INFO */
> +
> + if ( p->feat.arch_caps )
> + rdmsrl(MSR_ARCH_CAPABILITIES, p->arch_caps.raw);
> +#endif
What about non-Xen environments re-using this code? In particular the
test harnesses would be nice if they didn't run with the two fields
all blank at all times.
Jan
|