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

[PATCH] x86/hypercall: fix gnttab hypercall args conditional build on pvshim


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 8 Jan 2021 16:42:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=ioQvLmuZDFBIvpdNm1+N34wjN2JNIwr0H4alDw1pBkY=; b=eKYP1D6SuwdouLznHHQqR5r6ZLBzwT+4XX5isiIO66xkVBiNk8OL/KZsKMtyezYiHXFOKymMvuNO4SzjLgDM7vO2sXsucHsUpP8uPpgcJX/rTs0inG0r7MR6ootO3L0ofaA2hqhppg0ii89D6gXiXgA+6kTa08Q6BFf7H/BojN04ckUN5pnJcDZUXPRhtk0bXRYew0kpfvyFzly77jl+jwII6aWtHGl+fDvXh+vVlHEMxG6ohgXyIw0wLMs9noiZkkOmwGfPYJjRaX5mOkFMPKwv0V/PBdfv1ax805dwpyleysqASc4Fjpq4BaOV7UuohuTl6owWOffZ1ITxasDIvg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CM79NhvrqSHcreiMv4ZUxrz5rj1Qh8gxCrd5S79HIWbfbe2RaAq2TUyTmX5eiLKoooK4p+V+hHsr/EG6KUA85va1yjyjNKMHtbp4Rm3BWI2EcDFNmkMbXFcg5IFdovRMr3Q/PQP3aZW8nW+bztRQEeGySC8uAH6Fpr6ctZUgRWrLpdPNoMIxII/WZuKAXGYOqxxEumCZov6lhDpT+QHUxB1Cb00flPTp6npmlcj70RmRpMMN0VGmy9VOyP9GGnbA1W6dbbvqLoFn/cN9PoTZfyO+dfCiyWibYgV/T/Ykf1s/vqvF1koO9+9YLCgjCuNl6w5k8IQL+mV5aCbDjuEjRA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 08 Jan 2021 15:43:05 +0000
  • Ironport-sdr: JjGHQIxNuPDdRCZSpBaIPnet1/VdDZbFA+05YDXmrAkooj13g9OxxV4YNXRX6ZiUAj6d9PiqRK +VRiYN6xI7OVanWWoHpZsOOBoa3JCaLiFIq8+Y3zlEY8LGSE+gZ8CMnHc6BQQrUHx9pibU5hr1 U9ZU8tch83DFCeDSGrheTdqF5Xyqrbh2Cuegqkt8TZhthALsdgAcDWoNm68kNbyWfd74S74DEG B4b2ADbAM0+Stg5biqYsYSRGWTRuyJ/K1HahbGH/dPDuvnYq0M4pojlnLCyvLa5SEte0cPZMs8 ins=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

A pvshim build doesn't require the grant table functionality built in,
but it does require knowing the number of arguments the hypercall has
so the hypercall parameter clobbering works properly.

Instead of also setting the argument count for the gnttab case if PV
shim functionality is enabled, just drop all of the conditionals from
hypercall_args_table, as a hypercall having a NULL handler won't get
to use that information anyway.

Note this hasn't been detected by osstest because the tools pvshim
build is done without debug enabled, so the hypercall parameter
clobbering doesn't happen.

Fixes: d2151152dd2 ('xen: make grant table support configurable')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changesa since v1:
 - Drop all preprocessor conditionals
---
 xen/arch/x86/hypercall.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c
index dd00983005..14da9bc4ad 100644
--- a/xen/arch/x86/hypercall.c
+++ b/xen/arch/x86/hypercall.c
@@ -47,9 +47,7 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =
     ARGS(xen_version, 2),
     ARGS(console_io, 3),
     ARGS(physdev_op_compat, 1),
-#ifdef CONFIG_GRANT_TABLE
     ARGS(grant_table_op, 3),
-#endif
     ARGS(vm_assist, 2),
     COMP(update_va_mapping_otherdomain, 4, 5),
     ARGS(vcpu_op, 3),
@@ -65,17 +63,11 @@ const hypercall_args_t hypercall_args_table[NR_hypercalls] =
     ARGS(sysctl, 1),
     ARGS(domctl, 1),
     ARGS(kexec_op, 2),
-#ifdef CONFIG_ARGO
     ARGS(argo_op, 5),
-#endif
     ARGS(xenpmu_op, 2),
-#ifdef CONFIG_HVM
     ARGS(hvm_op, 2),
     ARGS(dm_op, 3),
-#endif
-#ifdef CONFIG_HYPFS
     ARGS(hypfs_op, 5),
-#endif
     ARGS(mca, 1),
     ARGS(arch_1, 1),
 };
-- 
2.29.2




 


Rackspace

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