From nobody Thu Jan 23 05:47:00 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1737471282; cv=none; d=zohomail.com; s=zohoarc; b=G9d6AgmXH0iTkEZkjhayABVY8orIEm/I0N94Med+cVxFpDKYawqIU9ec+kAwvIIzoKCoYQjDI/Z0Yv5KQvZm3zKaLNTrjbjJLYDkF66Z7/lQ5BAcua6A3UGqS2bIVD5F6f+cZFcO+hyt3MmRNa9jJL0rUFF5OhbMw6+yWLFyqZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737471282; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MsLLz2OkznoVzVfIhSI/4KktNOR6MhhSIt4fzxeY3vc=; b=LrIN2tysDXBC1fk+79b3pnqtQ0Xl9/p3JWyvUlaUTYWaMai95mNGBX7WoQfwt9ESwQ+mT2FEB35843mpyQqL94rEMGAntRtXZCywN0M8XFPJEheFZAvck57foAso2dSnwyNAZFOsDBE2BWiJ2AuA1q1VDsSamFgH4ZIA1Pzq+nQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1737471282569189.9189111492218; Tue, 21 Jan 2025 06:54:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFdy-0002Rz-E7; Tue, 21 Jan 2025 09:54:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFdw-0002RV-9a for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:54:16 -0500 Received: from mgamail.intel.com ([198.175.65.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFdu-0000Fh-JH for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:54:16 -0500 Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2025 06:54:12 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by fmviesa006.fm.intel.com with ESMTP; 21 Jan 2025 06:54:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737471255; x=1769007255; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hzkRQW1tMtQqA8HGZWYRR3sxXchMV0xu6kHeBEiv5xA=; b=etppdqAF1YPiCri8Vpeho9Q44Su3oGbLI1nRYRjQK4bEsPS7NuXfQNhZ I4O6pNkGp4hYUnSDLADYzhvbdP1laSOe4JCj0oIMvBWivnVftn+pvQhNn ft+6zA0t54F8sNcTsGid3dJb5BSgeG7Af70sPcu1ErDKKIUPyfq/b2LcS CjFgFSjrUJF1m9mYGwfw//scPgBOY6f/9rHsi7K0IWyduVmQT1wESE/ai hOkYJNcNgd2+sBSkDIcWXJH4Z4CSOv0jj2ltTlvM85ebvFIrOTFUkZP0i H7fdotho0ae+kojL2rLaPWTk7S41oX09/PoRbeBGD69jfyxfb9hsYm4Vo Q==; X-CSE-ConnectionGUID: rgpxHEimTESIqAEuGrZc+w== X-CSE-MsgGUID: ASwGQUppSs+uYtDABblb/g== X-IronPort-AV: E=McAfee;i="6700,10204,11322"; a="37763523" X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="37763523" X-CSE-ConnectionGUID: vVgDB5KfRSSKg+vKKs0BZg== X-CSE-MsgGUID: cqiVkptPQv29k05jKz+2cQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="106639891" From: Zhao Liu To: Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=83?= , Peter Maydell , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= Cc: qemu-devel@nongnu.org, Zhao Liu Subject: [PATCH v2 2/2] memattrs: Check the size of MemTxAttrs Date: Tue, 21 Jan 2025 23:13:22 +0800 Message-Id: <20250121151322.171832-3-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250121151322.171832-1-zhao1.liu@intel.com> References: <20250121151322.171832-1-zhao1.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.19; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -73 X-Spam_score: -7.4 X-Spam_bar: ------- X-Spam_report: (-7.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.996, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1737471283529019000 Make sure MemTxAttrs is packed into 8 bytes and does not exceed 8 bytes. Suggested-by: Philippe Mathieu-Daud=C3=83 Signed-off-by: Zhao Liu --- Changes since v1: * Since MemTxAttrs has been well pakced as 8 bytes, only check if it exceed 8 bytes. --- include/exec/memattrs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index 4fde4eee8439..060b7e713149 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -64,6 +64,8 @@ typedef struct MemTxAttrs { uint16_t _reserved2; } MemTxAttrs; =20 +QEMU_BUILD_BUG_ON(sizeof(MemTxAttrs) > 8); + /* Bus masters which don't specify any attributes will get this, * which has all attribute bits clear except the topmost one * (so that we can distinguish "all attributes deliberately clear" --=20 2.34.1