[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/22] x86/xstate: drop xstate_offsets[] and xstate_sizes[]
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 3 May 2021 17:10:28 +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=jH4UhUCJPHw7dk6mHkWcv0bMFFryveuWTTTIp1cX3c8=; b=cWr8R7kAQb3QyjR/cB4APLNQmyI+kqjeY9+hFT7RaunyVxmQiw4kUGggHrr4XqfT64URW7jtchzja6SOQ8qavFR8v0JmviL2TBdTitsDwubxG0M8QRV3E8srki9zi/EEIOrb97WGMS5LiDhBihjb7JxlgBLgwG1j7hpv8SE6ZAyaihtnBlfEMLRoz3Nw+/LpUdwrxM7M9pLCsSTm2Wzxm2MTR4t7W7b+nB1Ha6eZxKj0Jq9ElGa5C2ncNuAkg6jFdHt3ebQ9YnXytALw1NmPzRgwvYrPDPk33v+CtGjChHokuTz3hsu0jx12rH8snaeWkfTlpu7HuYQQuuS701HMkg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eb8ipjnEExQEPOyth807koJLyArm6peG/COPSaZYcHuiRRFW6oCDK+TSoyBpmXxqZyRlTEi+gzRnGxgkVEAVFMeJEO+fx40Sc4PpsiBK1qP7FmlfjN9I+DG0HAAhA6xrdbPPBM+yPCb99zpxaWuR1QgoFjw9dzlFqh/d9Vsluops7WTK6cGKQk+Fc/PxwnnvJgMFKz0KT6O3FyIn1ULzHne8hS15fiAxzhREiETWPERBfk7WlxR3slQnBM249B2nKbtRj2iEDt8V+fw4/pr2T2wF1CEwt9m/cgSIYj34I7eYXOazPJlLVWo4zIOUgHT86LJAjBCB1Yk9q0LMxrm5Rg==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 03 May 2021 16:13:27 +0000
- Ironport-hdrordr: A9a23:hBFHQak+GHJsWy0SLwKN3KaWzuHpDfPXimdD5ilNYBxZY6Wkvu izgfUW0gL1gj4NWHcm3euNIrWEXGm0z/NIyKMWOqqvWxSjhXuwIOhZnOzf6hDDOwm7zO5S0q 98b7NzYeebMXFWhdv3iTPWL/8O29+CmZrHuc7/yDNXQRhue+Vc6W5Ce2WmO2lXYCUDOpYjDp qb4aN81l6dUFAadN6yCHVAf8Wrnb32vanraxIHGBIrgTPm5V+VwYX3HBSC0hAVXykn+8ZBzU H/nxHk/aLmivmny3bnvFP71Yhcm9fq17J4damxo/USQw+Mti+YIL5PdpfHlzAzreGp5j8R4a XxiiZlBetfwTf8emm0pDHkxgXv1i0/gkWStmOwsD/YjuHSAB48FspdlaJVGyGplXYIjZVH/4 9gm0KfqpZNAhvLkE3Glqn1fiAvrGWYiz4Gs4co/hpieLpbUpB9h8gj2XkQN5E6ECfz+OkcYZ NTJfCZ3tl6WxendXzD11MfueCEbzAIMTqtZFMNgcCR2yg+pgEF82IogPYSmXoN7/sGOuF5zt WBNqxpkYdHRdMNYZR8A/8cQdC2Bnale2O2DF6v
- Ironport-sdr: Cj5dIroF/np1ujJQtIqMkcFXkSgdBP+xqZ4fcw5eqN0z+4wCECv18UO9l5BG4nAwAAnSYhw/nl l+gsdRMxmyHqT3+eDh1awDD6lcanZP/GhhJTWQiQceGsIWerN6sINkcUm8FV8RVBdxey4seFH3 PD8nQifflTmGXMHfKd4o0wSNbtoMTDF5dAm7rVIrPPFtrwVRIZh20DbHe6QIZPKNaGwJrFGqal BKroFSX3g9NebDG/kdvLmPJj+aTkOeV2zHlt59fCga3+xwd43w3FylrYrllVe9Clfj+52R1qEY YL8=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 22/04/2021 15:45, Jan Beulich wrote:
> They're redundant with respective fields from the raw CPUID policy; no
> need to keep two copies of the same data.
So before I read this patch of yours, I had a separate cleanup patch
turning the two arrays into static const.
> This also breaks
> recalculate_xstate()'s dependency on xstate_init(),
It doesn't, because you've retained the reference to xstate_align, which
is calculated in xstate_init(). I've posted "[PATCH 4/5] x86/cpuid:
Simplify recalculate_xstate()" which goes rather further.
xstate_align, and xstate_xfd as you've got later in the series, don't
need to be variables. They're constants, just like the offset/size
information, because they're all a description of the XSAVE ISA
instruction behaviour.
We never turn on states we don't understand, which means we don't
actually need to refer to any component subleaf, other than to cross-check.
I'm still on the fence as to whether it is better to compile in the
constants, or to just use the raw policy. Absolutely nothing good will
come of the constants changing, and one of my backup plans for dealing
with the size of cpuid_policy if it becomes a problem was to not store
these leaves, and generate them dynamically on request.
> allowing host CPUID
> policy calculation to be moved together with that of the raw one (which
> a subsequent change will require anyway).
While breaking up the host/raw calculations from the rest, we really
need to group the MSR policy calculations with their CPUID counterparts.
~Andrew
|