[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-4.16] x86/cpuid: prevent shrinking migrated policies max leaves
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 11 Nov 2021 15:04:20 +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=TaubetROC0v5/Oqbf0fLaoRM/IibhDZnWZFGvrlmQ0E=; b=TmgXiF7w8/U1BiR6Uq7xLY1G6ra+VRbznmlHKgTKSaDfNVF2SmCm1MTy7sixQ5rzi5Wt/O/42/GZnYbDTP8k63nMcV8eGT0pka1GicJ/rXNtfLmQdinvHY19siI5KYIRiaHTxGgjsKti5taZVGfNX8XMp2mntvyXCn+UyxNr2c6Jyv6ivllM+lLnM9ho04137LBR1ekZFkVBNsmjugRY24g63ER0P0NagM9UFryZ7gnweVT3oBR+Lb8I/7vCLR5DIqz2IBB7Dizhu6YugRXW4E62+m5/kBED3Tb/YP/cCyqzwYADUfEXWRp3mUIwVPB7oUGwG8H1/KQzxaVOFxnrjQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UzxMaBaksybSSn7Hy86XGWNCpzt8yIheKmLi9pmIZgWDntOUG7Fmq9E2bHMGLfcVybcDkMxVKEGuyKmx6vdZZ0EjIbv1cqbvhkSn3unFBQbMiu8Df4X96jaFSZ3Ucw6vr+N4jmg97J1J6ZyonniiqHS4kJrLsch9kPKZmrVfJI9c80glWu5x9OcgcDBfc8MtBuYptFRaGrhlyPVypXlg69neJFQovPtzVpKQQ/nef8CMf5SXfpHN1kxawmTVgppsgNb+jqP0lYB72gXD7F7Osk4aLx7b0geNsfhuI6XcvWPYr0BjAqYIP0daWANidMe7QqxoyK58Pvtx7nCdYydHew==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Andrew Cooper <amc96@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 11 Nov 2021 14:07:04 +0000
- Ironport-data: A9a23:frZX9anHYuPA0nKTP87J0rbo5gwVIURdPkR7XQ2eYbSJt1+Wr1Gzt xJOW2yBaP/bZWT0KthwYYi2oU8F65eDndRgS1Nkri1gQSMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BClVlxJVF/fngqoDUUYYoAQgsA187IMsdoUg7wbdg29cx2YHR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXee0v0XRYRQR4/ttmHozx+4 PtGmZPuVlwkB7LzvrkZeQZiTiUmH6ITrdcrIVDn2SCS50jPcn+qyPRyFkAme4Yf/46bA0kXq 6ZecmpUKEne2aTmm9pXScE17ignBNPsM44F/Glp0BnSDOo8QICFSKLPjTNd9Gpv2JgeRqaOD yYfQXlFY1f7b14MAFxUT58zhNvzil7YYyIN/Tp5ooJoujOOnWSdyoPFMtXPfceRbd5IhUver WXDl0z4HRMyJNGZ0SCC8H+nmqnIhyyTcJIfEvi0++BnhHWXx3cPE1sGWF2ju/67h0WiHdVFJ CQ8+CAjsKwz/0yDVcTmUluzp3vslhcZU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kvc3Jom52j+P xGws526faVslYssHFJo6HnBEClewKgyXcV2/hqAV7GZmjbUQSTXeRfBOfZslnd8mjFh5JgPM RbAtlD4b/LfCBHZK/BiWHSebtQo6jkgdCVbKXlvgxQpGlRGt9dBmxCe3+m+yNNNW577c1TLu vi2iMLnUvrRV0nKuCAQlUVVenKoNPG0LrgfB49HhYirC2Dlymh5rLWGwWRmk52aUIC/Z4StU z+1yDp7KSqtP+2jjfaym/o9pxT3P/s0MFKCsCggtUcbh/slgGrToJ8XKDqhkF5nMifrHIR1P XcqRYpOMp+r1vXY2GOuBPonzLt1T4/gkWSgGOwsD/Gm4jUVTg6A81OicZyaR3C8Xctu9l6ze Ziw3+Zn4A/N2KAoA3No/zzEz16nEu9pnQv1cQJiWZEbIcYYLhN6aQC4UJuFosaFi6S0vFoLA BXNrCe2B9qSyLZU5iA1VMfheBEH05DUStue3Jy+vB8iFNt7TREJ0hx/r1oop5PzuN7d3B+3Z W3Dk1frsA4ciYnV9MPOA4/e7rDNoXse2OFDIvAGyWtKEk4U0i936Ifpo9Fot2XRA==
- Ironport-sdr: /orqQY6Hj7q/LRy/+8Xx69at+lsgmO5ufC8L1bG5aav1KUlJOfeWc0icvALLzayqQc6jKumx+u 7Sksc9VgeCyhp5cWF44pBHP7nnmzDHf1NlvtDVqiDeLwrL7mV1mfOpMyPWtCzKgyKIieRl6c3t NusuB1xjoyVs1BJI3TOAh5LfTjUMThkvGa9u55rjXddXYfQ1U3Qcgf1pxp8kDovAiyUsulVSbu gWN4vrk3EKaXQATcbygVzNgu48pybAVsWeQ0V+BtTXBGmDfNs6xDcw+/6wYwN+rKKA87jSPJ4P F8MvRTRxISNDudCbUkwDd2pp
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Nov 11, 2021 at 10:26:29AM +0100, Jan Beulich wrote:
> On 10.11.2021 19:17, Andrew Cooper wrote:
> > On 10/11/2021 17:40, Roger Pau Monne wrote:
> >> diff --git a/tools/libs/guest/xg_cpuid_x86.c
> >> b/tools/libs/guest/xg_cpuid_x86.c
> >> index 198892ebdf..3ffd5f683b 100644
> >> --- a/tools/libs/guest/xg_cpuid_x86.c
> >> +++ b/tools/libs/guest/xg_cpuid_x86.c
> >> @@ -638,6 +638,13 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t
> >> domid, bool restore,
> >> }
> >> }
> >>
> >> + /*
> >> + * Do not try to shrink the policy if restoring, as that could cause
> >> + * guest visible changes in the maximum leaf fields.
> >> + */
> >> + if ( !restore )
> >> + x86_cpuid_policy_shrink_max_leaves(p);
> >
> > Nothing in xc_cpuid_apply_policy() changes any of the max leaves, so
> > this is dead logic.
>
> I guess you mean nothing there does anything which would result in
> shrinking of the max leaves by calling this function? Yet even if
> so, isn't the call here to take care of any earlier changes which
> might have resulted in fully blank tail leaves?
AFAICT the featureset (optionally) passed in as a parameter could
result in certain leaves being zeroed and thus allow for the max leaf
to shrink.
So while xc_cpuid_apply_policy doesn't change the max leaves fields,
it can potentially zero certain leaves allowing to shrink the reported
max leaf.
Thanks, Roger.
|