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

Re: [PATCH 3/3] xen/pv: support selecting safe/unsafe msr accesses


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 26 Sep 2022 17:23:27 +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=aJJhoMOxaU4i/GNzKhMMmRVhdWHqmy7FcW5ttvMCuUs=; b=oPqsYLRgjzBE+mkqoFC7IM4oHk9spsKyeVKrjY63baVa4dbSRbHQdGaMO1EuPdeBQEPjUBJvxjz7qjebbOWmhdrg/ci3KEqQz014ZU47Vh1gSM0s1+/RVzU+gOn+aeCpbFyF7s0x+w2ysyZ8hJ2c3z23yf2G3Mekbq9gVAdMiBN7sP3l7A4BF8h/4OAI3P4kgIQKc3YTEdVy/72M4s752osr4HrCQQLNIypLyIHZp+CwWJOb1uibrxqDzKtVRGXqtRvp1S8kVL3vET/DJUKjuq8QEPFx44PmgfPtOJzpNOdIJ/dICfAyXyXAIS8E0FuKlYPA+47HbfvRSCGuvUuyew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SvGMWBGzys6WGgGw/3PTlTuRm5hM3ZDiBcQjWezLVpulYNDEwxXz5rNeJpLFAsdxFJMXs4bP0FE8k+i9iyj+lBaaTcI63Gy/DtAevnW2hB7k+iHHZhP/+ZPE5vesQfjIZdU7QhaZpwjsbx+bLbC/qmeQDvYNRSkkC9AvxwuB8aRT/7utM/Au9Uo57cdh/0msexKSIruBsoCleZpYQP2HLi88erWQB6sZgQjjzoob6CEEVMe9MA3N/mkiy+LPzYi2SO0wncwRHLPihuD9AZl5U+DNFH68Ah0EcyBaIrvs+lXiF8XZ0WSUsqHiYEFvEi5g7QRjO7cE0YrUzkmefUPn6w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jonathan Corbet <corbet@xxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • Delivery-date: Mon, 26 Sep 2022 15:23:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.09.2022 16:18, Juergen Gross wrote:
> --- a/arch/x86/xen/Kconfig
> +++ b/arch/x86/xen/Kconfig
> @@ -92,3 +92,12 @@ config XEN_DOM0
>       select X86_X2APIC if XEN_PVH && X86_64
>       help
>         Support running as a Xen Dom0 guest.
> +
> +config XEN_PV_MSR_SAFE
> +     bool "Always use safe MSR accesses in PV guests"
> +     default y

Is there any time line when this default will change, perhaps first to
DEBUG and later to N?

> @@ -1010,22 +1020,16 @@ static int xen_write_msr_safe(unsigned int msr, 
> unsigned int low,
>  
>  static u64 xen_read_msr(unsigned int msr)
>  {
> -     /*
> -      * This will silently swallow a #GP from RDMSR.  It may be worth
> -      * changing that.
> -      */
>       int err;
>  
> -     return xen_read_msr_safe(msr, &err);
> +     return xen_do_read_msr(msr, xen_msr_safe ? &err : NULL);
>  }

When we were talking at the session, I think I said that at least there
is no uninitialized value being passed back. But I did look at
xen_read_msr_safe() only, which indeed is okay. Whereas
native_read_msr_safe() isn't (nor is native_read_msr() afaict), so I
think part of this series should be to also eliminate the undefined-
ness from this code path (possible now only when xen_msr_safe is true,
but as per above that'll be the default at least for some time), where
the caller has no way to know that it shouldn't look at the value.

Jan



 


Rackspace

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