[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/amd: Introduce and use X86_BUG_NULL_SEG


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Pu Wen <puwen@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 8 Sep 2021 17:06:57 +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; bh=Wzbd6DFR/SngT3RP4KdhWBcf+ymOUKJls4cDe7LsDGU=; b=MrdDDubrQ4khSVypUwGaR76SfuMT+Qj0IVQoCPjQRJVPPEqwjdCr2+nG8ptvMpG1U5ysWtrEt+9sjgTe0vYkybC/1Of4zVE68DwJIMMsbwmdzVwUMJwjZ9ys96OtIVK7Oet5Q16jfSmMKF8jd+3S9+WlxLANT8gnO1Ih0H4AXTBD89vuOSHTpxTwWqle3/VR7RHkYc9eyXGxEPn/7LiVhHwrAMwYT1zuCK1p/NkTjnHtaOlxRvHhW/5Vk7890eEcxXD8/8MEavH1sa7sOLgyv42tMA+Z51z82JZwELTRETOuoZeTZw3xUKB7v6TPDHwmYS4lolSAGEN1d9icCyeBdQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AWLp0uL7uz/CKhn+2MJkjQb5yNRzpDE+36HUOyAj7+aRosFdQIhr3Le1k4I3XoaL3E5W2te9t0NB6uiMRmMjH3SHtbU77nfwM+mlvD3K3lYGBHwvgklHZRu/5Tzsrg4EUXjaipyC3f0CvxEbVw/nUNVzvi6e1zEHr1wywrAVjv83E/x4rCjxBeckZ47BxF7BLwi2CxLq4CFo0E1M1gwzh35iv7UTE+jolK520tTKjqIdHWLtIpwke80EarrzpbN8srzwtvG11GmGOrgCwACEFXkZ5yRH39MvpDVSDhTcECfbaNwL2J3ZP01w+WSv0NGdy1ehZ4R8FAlQj5910wEKsQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 08 Sep 2021 15:07:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2021 15:59, Andrew Cooper wrote:
> AMD/Hygon processors before the Zen2 microarchitecture don't clear the base or
> limit fields when loading a NULL segment.
> 
> Express the logic in terms of cpu_bug_null_seg, and adjust the workaround in
> do_set_segment_base().
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit with a question (perhaps to Pu):

> --- a/xen/arch/x86/cpu/hygon.c
> +++ b/xen/arch/x86/cpu/hygon.c
> @@ -40,6 +40,13 @@ static void init_hygon(struct cpuinfo_x86 *c)
>           c->x86 == 0x18)
>               detect_zen2_null_seg_behaviour();
>  
> +     /*
> +      * Hygon CPUs before Zen2 don't clear segment bases/limits when
> +      * loading a NULL selector.
> +      */
> +        if (c == &boot_cpu_data && !cpu_has_nscb)
> +             setup_force_cpu_cap(X86_BUG_NULL_SEG);

Are there any affected CPUs in reality?

And actually (only noticing when seeing the malformed context
above) there look to be indentation issues in the changes to
both this file and amd.c.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.