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

[PATCH] x86/PV32: fix physdev_op_compat handling


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 8 Oct 2021 12:47:41 +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=9s2IautVYl4D5pfVLFGkSQ1cWlKhosK88UYdKSUX130=; b=N3CxdDc13o5Ba7V8J48cIQq/EXaO8ZB/m7Y0pzorXwSkgkVmNvuATNEE4LPRHL2oHMYD0n8vWnc72lOS4QahlA7mwSowJOHy1iXYBDdkH8Bw1VEwEDgVv18sPtjvTd3xZQFI52hrzX+9qCAxvNVb/cCgg5DFsQ20fg32LZBOI4Ym5ek5waP5hq3G3jGKYx510pUx+ie6ex08gvejeuNFDh7kZOlipFp0tHzveAoVTmrdI8Q8OpAHjIXkiRcRAwWGxVzLO+M6WQm3thwzBURBJ7/EWOFar49ORhmkJRW3MWt/MEghjfQeOLgnanLTXS4OSJYg/S2Ry6dZrO5BT1s/PQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHgJNgdklqD9gAmLSAOWS7OfRmyb8oIA6zZBeYRRBmhIsun23f/5xuf3Ot8BkInAY47OJjddXRFiziyTlpP+yokls1Z8BJq0zSO+IZsmEmS2RdJv0OeETkQd9XA256+XBLHOHiF6RWxaBnZymH2zBZAlqbkpP3JjPQqeQ5r9ZdLbsl49QenysRIqTNRKY7cGA/C+2mWDuUmNFPn1d1Vfq8ErUc8Qk3eUhYa1FhIAFBKTpT9ZLpYPZ669JCtMjQjh49DpA+LLSWAqsPcpmpXAauKHbZkg5QipTOeK8py88CI2bIV6cl1KNR+TMPUWXOtpDkqs8S84WWEFEpB0Q6gL/w==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 08 Oct 2021 10:48:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The conversion of the original code failed to recognize that the 32-bit
compat variant of this (sorry, two different meanings of "compat" here)
needs to continue to invoke the compat handler, not the native one.
Arrange for this and also remove the one #define that hasn't been
necessary anymore as of that change.

Affected functions (having existed prior to the introduction of the new
hypercall) are PHYSDEVOP_set_iobitmap and PHYSDEVOP_apic_{read,write}.
For all others the operand struct layout doesn't differ.

Fixes: 1252e2823117 ("x86/pv: Export pv_hypercall_table[] rather than working 
around it in several ways")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Additionally the XSA-344 fix causes guest register corruption afaict,
when EVTCHNOP_reset gets called through the compat function and needs a
continuation. While guests shouldn't invoke that function this way, I
think we would better have forced all pre-3.2-unavailable functions into
an error path, rather than forwarding them to the actual handler. I'm
not sure though how relevant we consider it to fix this (one way or
another).

--- a/xen/arch/x86/x86_64/compat.c
+++ b/xen/arch/x86/x86_64/compat.c
@@ -10,8 +10,8 @@ EMIT_FILE;
 
 #define physdev_op                    compat_physdev_op
 #define physdev_op_t                  physdev_op_compat_t
-#define do_physdev_op                 compat_physdev_op
 #define do_physdev_op_compat(x)       compat_physdev_op_compat(_##x)
+#define native                        compat
 
 #define COMPAT
 #define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)




 


Rackspace

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