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

Re: [PATCH 3/4] xen/version: Drop bogus return values for XENVER_platform_parameters


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 4 Jan 2023 17:40:23 +0100
  • 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=8tbsBPvURDFJUYLUmdtEznWOuWGi2HvZk8KWkzCBso8=; b=m8jhjXYThJHIWQ/6JWfhYofPvDT5sDEBbSbQvB459zjHg+W+psov+1cntd42j2Om2Z3UzUXe1Wj2SEQOwLKsNWiTK2uluTd4piz7kj+HsFz7Y5Xzrvt6bBgiYBSTSOgh85zjGnYqu4qFTIckMlEN4SBZeS+SaEfg1p/VzW/LuWZxmunM+VqFhIjih0CEiYJh69ECfRR11Ebf8K1wYvOme8L4MyrRXR7LlreNtUfE3/lTUwhweU/FzwsNG6ZxA8iGzi/h+auu5KimrCRM54WJXxZOZBeS2tYlaX6lTcXegSuZvdGka0ncIz0c+ksANKMyMD5E1bVZSjKNtLWBFdmYGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WbS+078ChGzJD9HY8Atp8m+3h4fMzx/IBArexLeGwSiT9RKtdrhdLTsGaOkbkjwkR9Vr6CBF4uRNnLKnHYgCWfF9Tcf6eRyeKpcdg8X96yKDNA+W+pGfmceQfVpYy8jTbZLkKnGNXKS/Zn3WaUQz4Ln2t7c29totqTFlZxNn3w+wcRjGCRsjepsQbeoQ1QclaB6Eb2RnKPh8K8Hec2OXhPQrHtfoG3rJMByxNyZybG4lS42FUUiD+5ED908VZ7AbzLwi/jLRHQENWKutr4dk4c9YiYddDj3fKXZX3FYKJ6MyEgnixTOy9hVW/TKqueakIaFl13Bk9soaEe3khq0GoQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 04 Jan 2023 16:40:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.01.2023 21:09, Andrew Cooper wrote:
> A split in virtual address space is only applicable for x86 PV guests.
> Furthermore, the information returned for x86 64bit PV guests is wrong.
> 
> Explain the problem in version.h, stating the other information that PV guests
> need to know.
> 
> For 64bit PV guests, and all non-x86-PV guests, return 0, which is strictly
> less wrong than the values currently returned.

I disagree for the 64-bit part of this. Seeing Linux'es exposure of the
value in sysfs I even wonder whether we can change this like you do for
HVM. Who knows what is being inferred from the value, and by whom.

> --- a/xen/include/public/version.h
> +++ b/xen/include/public/version.h
> @@ -42,6 +42,26 @@ typedef char xen_capabilities_info_t[1024];
>  typedef char xen_changeset_info_t[64];
>  #define XEN_CHANGESET_INFO_LEN (sizeof(xen_changeset_info_t))
>  
> +/*
> + * This API is problematic.
> + *
> + * It is only applicable to guests which share pagetables with Xen (x86 PV
> + * guests), and is supposed to identify the virtual address split between
> + * guest kernel and Xen.
> + *
> + * For 32bit PV guests, it mostly does this, but the caller needs to know 
> that
> + * Xen lives between the split and 4G.
> + *
> + * For 64bit PV guests, Xen lives at the bottom of the upper canonical range.
> + * This previously returned the start of the upper canonical range (which is
> + * the userspace/Xen split), not the Xen/kernel split (which is 8TB further
> + * on).  This now returns 0 because the old number wasn't correct, and
> + * changing it to anything else would be even worse.

Whether the guest runs user mode code in the low or high half (or in yet
another way of splitting) isn't really dictated by the PV ABI, is it? So
whether the value is "wrong" is entirely unclear. Instead ...

> + * For all guest types using hardware virt extentions, Xen is not mapped into
> + * the guest kernel virtual address space.  This now return 0, where it
> + * previously returned unrelated data.
> + */
>  #define XENVER_platform_parameters 5
>  struct xen_platform_parameters {
>      xen_ulong_t virt_start;

... the field name tells me that all that is being conveyed is the virtual
address of where the hypervisor area starts.

Jan



 


Rackspace

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