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

[PATCH][4.17] kexec: restore hypercall 1st arg's type


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Nov 2022 16:09:13 +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=szw5kFsGTSOmjgpURbNvhhMr2iPPJJmIgQjLJijPsLE=; b=djpctp75vnNVXvTrv8wY4/uIYMa+dc/Gv3IfXXY2S2CatEGGtuBHEHt77EFvZSTDP1ICdnMdDu429LKXVxnYQpEzrrQfGLdmKpimoAS9b16PWEVexFpm14GE7cydig9vqmVjNJk1PZ1m4nTgXdaOEgEOvh2g0KXkBsbV9hEoIk3ixtiwvUvbCIFeT8/kDnljC6fsvvkAERyDTDBXHicYC02G3ElBybVIZPsfeYhdEontoJ0AWJ0TwP+LnjQrehIuzLoQTzdjTnHb1pDVz0z/EdgqXCDPZ6FFnrl3TR29NwsTcOtxW8YlluFa6XfymPZYT5C2cIMtLtBa6X/gEA94Vw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y9LOfQ9iAiXbyXpsZXX2mI/4yLS3vss3npSMOyCXrrAlTPYLFmRYR0cZab2Ad83o4DTNqy+FXlDbiLaavJ8h4FUGGbxg34TXoEGs6AHXqPahs2tvAIX76y3W9gnOFdxHbI2GP3T7iwoBIl7pW+mh7MpSto02RI7cBpOELvefb7x2s0AH2XW+h/uccfSogb0mQ4i9Pp/ywGy+Ci7DEQN49SKwor0e7X3ya5t2gqvqxFWL7w+LwRI0lnA36u8QBAPt/d/lyzMpmdMQY5ZasA8QSu1AfoTTqV8DwU3O0WexpxrJQorqXTO2dIeLPfj8/uxhP/dwSTwV9ex55v2YhPkP1Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Mon, 07 Nov 2022 15:09:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This reverts a small part of 7e21b25059ed ("xen: harmonize return types
of hypercall handlers"). The change from "unsigned long" to "unsigned
int" for the native handler function meant that previously invalid
values became valid. While perhaps not a significant issue, strictly
speaking that's still a change to the ABI. Don't go as far as restoring
the compat entry point's type though: That one can't have values passed
which don't fit in 32 bits.

Note that as a side effect this fixes the invocation of
hypercall_create_continuation(), which by mistake wasn't adjusted by the
earlier change.

Also take the opportunity and correct the respective comment in the
public header. (The way it was it really supports that it probably was
pointless to use "long", but that's the way the hypercall was
introduced.)

Requested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1213,7 +1213,7 @@ static int kexec_status(XEN_GUEST_HANDLE
     return !!test_bit(bit, &kexec_flags);
 }
 
-static int do_kexec_op_internal(unsigned int op,
+static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool_t compat)
 {
@@ -1265,7 +1265,7 @@ static int do_kexec_op_internal(unsigned
     return ret;
 }
 
-long do_kexec_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(void) uarg)
+long do_kexec_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) uarg)
 {
     return do_kexec_op_internal(op, uarg, 0);
 }
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -117,9 +117,6 @@ callback_op(int cmd, const void *arg)
 #ifdef CONFIG_ARGO
 argo_op(unsigned int cmd, void *arg1, void *arg2, unsigned long arg3, unsigned 
long arg4)
 #endif
-#ifdef CONFIG_KEXEC
-kexec_op(unsigned int op, void *uarg)
-#endif
 #ifdef CONFIG_PV
 iret()
 nmi_op(unsigned int cmd, void *arg)
@@ -149,6 +146,9 @@ update_va_mapping_otherdomain(unsigned i
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
 platform_op(compat_platform_op_t *u_xenpf_op)
 #endif
+#ifdef CONFIG_KEXEC
+kexec_op(unsigned int op, void *uarg)
+#endif
 #endif /* CONFIG_COMPAT */
 
 #if defined(CONFIG_PV) || defined(CONFIG_ARM)
@@ -181,6 +181,9 @@ update_descriptor(uint64_t gaddr, seg_de
 update_va_mapping(unsigned long va, uint64_t val64, unsigned long flags)
 update_va_mapping_otherdomain(unsigned long va, uint64_t val64, unsigned long 
flags, domid_t domid)
 #endif
+#ifdef CONFIG_KEXEC
+kexec_op(unsigned long op, void *uarg)
+#endif
 #ifdef CONFIG_IOREQ_SERVER
 dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs)
 #endif
--- a/xen/include/public/kexec.h
+++ b/xen/include/public/kexec.h
@@ -64,7 +64,7 @@
 
 /*
  * Prototype for this hypercall is:
- *  int kexec_op(int cmd, void *args)
+ *  int kexec_op(unsigned long cmd, void *args)
  * @cmd  == KEXEC_CMD_...
  *          KEXEC operation to perform
  * @args == Operation-specific extra arguments (NULL if none).



 


Rackspace

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