[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] x86/msr: Split MSR_SPEC_CTRL handling
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 14 Jan 2022 12:03:57 +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=vX4s1XTaRd3vZWE16I9OSw7I+ezIlLa+hzLe3Lseh8k=; b=DJg1g0YZDZRqvNtwrSTuJTbpES3BK9L90pC+38nmxCiqtroy6D6w3xEJaD7b9mbJN7qU/PQm8/U5caaAMvp+L2DQzOp94ualHeFcp3Qo9sW0dia5Z1BJ8XRtqpp2xZ6mX/7qTSalhIkSQMenp6gdvbP2oqRsUXTzRt1BbYWCa8cEkakjfKgOhalAdsjk+1xXTD2sGV6DeByixMInbL83wePOJM4INnoSqnpip2pNaSl1T1NdXNIyoMtP3fRZM4/hbQBQsMcjTb5X0AaOnlOw7Wfu6+8NSec0mPsNE06dhpgOywIjMiF26jJxFCVGrIDqMZgi4PFLGgQiY5QvxEmrAg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B7fmZOakfzOryZEjWUfiE4EI0rWBIZ0+gO/FiFtPajdvdrDXLidRYHlGt0CSeUFgVXZC5BnfSnY6IKOsiRC4cKmWOTj2gUroTUaCpVlbb/+jqb5vfyBrYosyreB1unYCSru36byzz+UsXw+6veVTfDy1WRyQQYs7V74fb1zt3uaPx2j5qwUIlT6GVDpkECZA0TviEZNdS1jjpYaZakaB8HJqW07rr6UoB3BASSf2ZD2csjB8M2GVBhERNxbX2bV5NyQ6JY1ugzC4WP7FNNCvt+s4qb90kFFlf1wwW2BVtUrIxhJgsuOz3B8hF2EbHKs4URFoKmNbAuriSxGdEhqATg==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Fri, 14 Jan 2022 11:04:22 +0000
- Ironport-data: A9a23:mwviRqD0neYr0xVW/8/kw5YqxClBgxIJ4kV8jS/XYbTApG53hTwBz zEeWm+EPP6OYGb3ctF0aoW1pBlXsJ/QnINhQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMo/u1Si6FatANl1ElvU2zbue6WL6s1hxZH1c+En940E47wYbVv6Yz6TSHK1LV0 T/Ni5W31G+Ng1aY5UpNtspvADs21BjDkGtwUm4WPJinj3eH/5UhN7oNJLnZEpfNatI88thW5 Qr05OrREmvxp3/BAz4++1rxWhVirrX6ZWBihpfKMkQLb9crSiEai84G2PQghUh/rDmDsPlWl 9x2lpGWGV4pPerXmdQEXEwNe81+FfUuFL7vJHG+tYqYzlHccmuqyPJrZK00FdRGoKAtWzgIr KFGbmBWBvyAr7veLLaTUO5ji95lNMD2FIgepmth3XfSCvNOrZXrHf+WvYEEjWpYasZmIMzaS OwGeAhTRy/jej0MOWsIMZgdtbL97pX4W2IB8w/EzUYt2EDMyCRh3b6rN8DaEvSob8hImkeTp krd4n/0RBodMbS32TeDt36hmOLLtSf6Q54JUq218OZwh1+ezXBVDwcZPWZXutHg1BT4AYgGb RVJpGx+9sDe6XBHUPHaUxeXiVnbtyU/VvwASu05rxqM+rPbtlPx6nc/chZNb9kvtckTTDMs1 0OUk96BOQGDoIF5WlrGqO7K8Gra1Tw9aDZbOHRaFVdtD8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mAdzI4dtmGg+eOuIPtYBYACRJiwA6SjQmw4Lq/NxSDxB8RXx5G3L9nqA H+4kHEz5Tml8v+5g7X1mfV4ZgTsNz9yuFbDMjJrsQOMD3jhiuheYwkcbyfuzIepv2p9T8R4Z PxiiZlG/42x2Laf2mzrxeo8w780Aw243un8lOciWuLm72OeBsKT+56wa5JeBrQ7EQt+Ptm1r hQ4m6fv51LSTvdgSXU/bHzJl9Xv3vxhUBnvf8YjnRZX4dbQqRWt5Yj8ERcF4pFND7m6bogDP JlAKjnlblrmGuhHjDkV1RUsZ+RtixZJGbFfqFCgL3Y79FupgE586NCr/Zv20vp9/oGOu55Dq r/Q+BVfYp1P7wrhJRGdZM8qPuMexzwqC33QRCvyHTcZeg60iH22tbKCItc3pDeRHVP9up0pK j8
- Ironport-sdr: DT2odk/Hy2YPAAVP+BD4yB4VPbSmZG4hxAdLkJ8EzAVQ4Ow3DcIq/KU9YcDZ7ejlCU+0PS0fXH 7ZbtIsVWNvn+CRmqh5Q9solDRb8nXAR/Dl+dnfBo2IsNsKYNCpMDmhAtAr/KY+82sRI+3wpwuq yZhj2HYZ6Se/TZyuh3d4KBZMePxJEPGU+XZ3rZX+MwHa4eWXYw/FktyY68MVngEikyKy6N8fGb mvYgpRX/pPfPGlSOWIGeauaejOYuWGxPon0loAq35eCulF0Ez4qXD/0WIjvyv3cXuLOFu2/vex Yws/m/MpUzEDc0E+Q5Q4UYND
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Jan 13, 2022 at 04:38:31PM +0000, Andrew Cooper wrote:
> In order to fix a VT-x bug, and support MSR_SPEC_CTRL on AMD, there will need
> to be three different access methods for where the guest's value lives.
> However, it would be better not to duplicate the #GP checking logic.
>
> guest_{rd,wr}msr() are always called first in the PV and HVM MSR paths, so we
> can repurpose X86EMUL_UNHANDLEABLE slightly for this. This is going to be a
> common pattern for other MSRs too in the future.
>
> Duplicate the msrs->spec_ctrl.raw accesses in the PV and VT-x paths for now.
> The SVM path is currently unreachable because of the CPUID policy.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
It feels a bit weird to have the checks separated from the actual
access to the MSR data, but that's likely better than to replicate the
checks in both the PV and HVM vendor paths.
Thanks, Roger.
|