From nobody Mon Feb 9 10:58:09 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1582721285; cv=none; d=zohomail.com; s=zohoarc; b=O8/AH/Fg+C7BoNe8Yn831NWmCJ3fa3SPDDheXie8xBMRcOyyASoA7wyRmkU+IBaxEMIJmaCoZVukCqrnenwFDMMThtu1mLg1Jnfp04fdXmWnlPwjEYvAmP/ELvoLLbxDN5Bs9BWyKS18FEynqO+TFjmLtb1jm1WymHuvT3fCQtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582721285; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GFqMjhqrCqUxeA1mrD6J+O+VRwJz/8NKE4WqWFpGxsI=; b=gkLwdywSX+75QTAie7n6cEpHOUrfHeEXTu8idC5BoBH0Db88nqe+sMrTV18dGzY9EsjPHWaMsuTK5muaAU9RPXzggIaY3LM6Yw2AsWDRz0HpdXfVricZzMH2EgyCj6Mky0gogtUoYam9x6MKp2nHp/WKvdTQ1yx3GGDrLjd1QSk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1582721285357403.4451627436505; Wed, 26 Feb 2020 04:48:05 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6w5n-0002Ah-06; Wed, 26 Feb 2020 12:47:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6w5l-0002AX-KR for xen-devel@lists.xenproject.org; Wed, 26 Feb 2020 12:47:09 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 19ab1564-5896-11ea-a490-bc764e2007e4; Wed, 26 Feb 2020 12:47:09 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B2508AC6E; Wed, 26 Feb 2020 12:47:07 +0000 (UTC) X-Inumbo-ID: 19ab1564-5896-11ea-a490-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 26 Feb 2020 13:46:54 +0100 Message-Id: <20200226124705.29212-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200226124705.29212-1-jgross@suse.com> References: <20200226124705.29212-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v6 01/12] xen: allow only sizeof(bool) variables for boolean_param() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , Andrew Cooper , Ian Jackson , George Dunlap , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Support of other variable sizes than that of normal bool ones for boolean_parameter() don't make sense, so catch any other sized variables at build time. Fix the one parameter using a plain int instead of bool. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V6: - new patch --- xen/arch/x86/hvm/asid.c | 2 +- xen/include/xen/param.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/asid.c b/xen/arch/x86/hvm/asid.c index 8e00a28443..8b5bb86dfd 100644 --- a/xen/arch/x86/hvm/asid.c +++ b/xen/arch/x86/hvm/asid.c @@ -25,7 +25,7 @@ #include =20 /* Xen command-line option to enable ASIDs */ -static int opt_asid_enabled =3D 1; +static bool opt_asid_enabled =3D true; boolean_param("asid", opt_asid_enabled); =20 /* diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h index 75471eb4ad..d4578cd27f 100644 --- a/xen/include/xen/param.h +++ b/xen/include/xen/param.h @@ -2,6 +2,8 @@ #define _XEN_PARAM_H =20 #include +#include +#include =20 /* * Used for kernel command line parameter setup @@ -46,7 +48,8 @@ extern const struct kernel_param __param_start[], __param= _end[]; __kparam __setup_##_var =3D \ { .name =3D __setup_str_##_var, \ .type =3D OPT_BOOL, \ - .len =3D sizeof(_var), \ + .len =3D sizeof(_var) + \ + BUILD_BUG_ON_ZERO(sizeof(_var) !=3D sizeof(bool)), \ .par.var =3D &_var } #define integer_param(_name, _var) \ __setup_str __setup_str_##_var[] =3D _name; \ @@ -86,7 +89,8 @@ extern const struct kernel_param __param_start[], __param= _end[]; __rtparam __rtpar_##_var =3D \ { .name =3D _name, \ .type =3D OPT_BOOL, \ - .len =3D sizeof(_var), \ + .len =3D sizeof(_var) + \ + BUILD_BUG_ON_ZERO(sizeof(_var) !=3D sizeof(bool)), \ .par.var =3D &_var } #define integer_runtime_only_param(_name, _var) \ __rtparam __rtpar_##_var =3D \ --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel