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

Re: [PATCH 2/2] x86/alternatives: adjust alternative_vcall0()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Thu, 18 Nov 2021 15:06:53 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=komqyoBXhTKnEseJYljA9LNOtqyhDG4nqHbtSQHMFeQ=; b=bM5thjRApN0n4MUJgDE4Io++v/EdPL1ztvvpAu9dJPjc3kalODxzCJmesGldA7/FlLSwuovcauOLx6QjbVZYeYj4UjKmwTk+fV/MJwwLAuSzxPylStevEBkFPa/tmOQwwy4YnFt3sxpfSoK8vYYZvYmzOz8lJAoyZtpqg9exRhHgVcQTbQrhKI/S/0rOuLUjByXZxfD8zp9NWKAcKwQfiooiPgXAtoFvn2IIzvToB1jojtZz0IonUbacJdZlhc0Nbu5AYCrBFVfv7q7nhh6Rm6FMJKZoPqwG68nt4acs1RgLAIusEbew2LraRz6aqnwjJQUFzdvSzOAN8klOF8s7+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m0npoRjAaxz1USGorVJ1POpL0MpDw0rosDveEm/01OdsAG1RdbW+jbabR1eh6oer5g/WWAyp33L54hg/gy3+LaNIiLfktsM7u0tFYafuNuDY8ySj6uPdR7aCu6Jc1WfyFjqsgZIg4Hf4w5vyrH8Jjw88g4HButC56z8/x5OTNn48s10fR8QYZZxIJI7vcmNm1jcDvq4FB7UJswiKNjXL34Hge4Xpenoek5EEDEFSLzH0Reqh4fXS6Lc8Hu7fKDjZppODVojtxBJdNIWDmySlXgoBsYkdDrBHBRk+1+zmXI99iDvHCwoNwhf8+a4EVzdWiGDewGQH8MQ1XhFemh5/iQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Nov 2021 07:07:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;



On 2021/11/17 16:00, Jan Beulich wrote:
I'm puzzled about two inconsistencies with other alternative_vcall<N>()
here: There's a check missing that the supplied function pointer is
actually pointing to a function taking no args. And there's a pointless
pair of parentheses. Correct both.

Fixes: 67d01cdb5518 ("x86: infrastructure to allow converting certain indirect calls 
to direct ones")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/asm-x86/alternative.h
+++ b/xen/include/asm-x86/alternative.h
@@ -218,7 +218,8 @@ extern void alternative_branches(void);
#define alternative_vcall0(func) ({ \
      ALT_CALL_NO_ARG1;                           \
-    ((void)alternative_callN(0, int, func));    \
+    (void)sizeof(func());                       \
+    (void)alternative_callN(0, int, func);      \
  })
#define alternative_call0(func) ({ \



Reviewed-by: Wei Chen <Wei.Chen@xxxxxxx>



 


Rackspace

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