[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] x86/alternatives: adjust alternative_vcall0()
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 17 Nov 2021 09:00:46 +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=v97bW+vQJx1D0j8h3u6Qf9S2JVDKpRDR1gplq3wrWHU=; b=g4+NnDZHpgRC5MqiadkDctY9jPQifMVMPRIz/XxcXc1KBJYpCVttcTHA/K555wppdG7+MSQbjTM9p0CpiL4I2VXa/9SRQZlCkBuQ9peQ+WSgfiZgDnk0MJnaou6H3/bYQrjNNVH0C+nhjsAO4yNFpKiN+WdeRfPp4AuK5zV1lJ2YfSnX2fI8UeqrQDzUnb+uuYul5NXeeMYkTiwly9Tani+4UlLbRFtdHdd3pRsoMT4QsYorY6QL7Ak0kwksseFxx1QTVbmbRv7z4Yyfn1O2eA10l0xT/SPxhIQMtCc3wfsc+xGQbZrxOIsQEysFzuNdGx7H7xYrCq/lbo4s6dld4Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DFQ0x6sWZeLU76k14tJMqo3PvBkrd2Ylxu4Lc2vIi06D8zVvFq/aWXxCfwEYwvjbPACtv50hWwLOqGvEVc7JZkMbtKsCZ24DFUiFmKJm58FTJBv53ismmv7oL1VCToj+SczWdKifwPIGEXmLdFR+XQC+IimvX/CAw6m3v7+1hiAuGZNGFm2atghgbNCgZFbO/LJ+TpVX7ydcXPm7DAHz3ZiC9qouoSgNF2nysLMusBK6efZ+5gYj8YsTHc+yTxqqRzk1pbHuAs3Lx/2MpTs20maRsrtUAkb1VfwBqnDknuZW6PjK7ZzjEWQruWW04o7jw5Qfh5CG56Bn4W2RLVU1aw==
- Authentication-results: dkim=none (message not signed) header.d=none;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: Wed, 17 Nov 2021 08:01:12 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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) ({ \
|