From nobody Tue Feb 10 22:17:58 2026 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=1770692432; cv=none; d=zohomail.com; s=zohoarc; b=nRUF5HbVJDQNZ08n+Mx4E/Md4MjTnffJpJBfNrcj093BLg9IUiWNdoef2vWAJE7gqSltyY+eEbeZP8DsEdab/deZTRIsp5DQrlRRDhmhKULfDW2qDVYg7z1w66gMODGXab2kYZbAvig3/3zTj8tgauYiUgZ/rDDRiVmomG8YA6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770692432; h=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=U/VVt3f48h62xJh6obLpEYmGhB6WHom4oUW3/fCWdtk=; b=OJBvpFznpHALkfGDpOoOfgXgUbAxrsT7SvdVl6dCzVSwGxGCLUJ4mi5ATH/keC0LwsyjmWiD3D1kROp8qEfOyIJN5pTSDGGrSalqLCqwmIaPDU0M+7aZbudoxax0HGX7gP27AGAdu5yD0ZEjysSiofQgAf8ngSWrT53sCmMFVXA= 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 1770692432082513.5416332076234; Mon, 9 Feb 2026 19:00:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vpdz7-0001dG-Lj; Mon, 09 Feb 2026 22:00:17 -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 1vpdyi-00015v-NP for qemu-devel@nongnu.org; Mon, 09 Feb 2026 21:59:53 -0500 Received: from mgamail.intel.com ([198.175.65.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vpdyZ-0004En-Hs for qemu-devel@nongnu.org; Mon, 09 Feb 2026 21:59:44 -0500 Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2026 18:59:42 -0800 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39]) by orviesa008.jf.intel.com with ESMTP; 09 Feb 2026 18:59:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1770692383; x=1802228383; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7fc/Brd+iTgkhX2nnl5fk6qLcnnHrIhJ0ubwi9AbENI=; b=YgXTpv66HHz2DxKa2TrhPxL0OuM4toljeGlStYu7Z+l7uDDEB9hblskq vdjPxEztjvSiBnIDXUWwAM5DJ6vsNQdoc9rvi0bKB+ccBBrCObRxdKXda 9/KUu9BVIv7q+Yn8P17q7+jld1ivyAwVdL9xlyUw3G6K3E3l5fOZkLSwU TflDd2j2VsJgH+z4XZWm5I5LhnrwH6axrxhOWeYv6qpKrnWyvMsXSdI02 kNp5vAhyRATRjOGog9uudUFbBnB3IavyqMYJzsW88cI/tftUM08BQqofP Cyyj2I72tAWH4KDBFG2DXFHVy49QIbBvBlFEPYBgO+12P/QKRqdV5pD1R A==; X-CSE-ConnectionGUID: +HZYu48+R/uILuB7QXnoTQ== X-CSE-MsgGUID: rXEqbhRfSj+21qIpIiPD9Q== X-IronPort-AV: E=McAfee;i="6800,10657,11696"; a="75660005" X-IronPort-AV: E=Sophos;i="6.21,283,1763452800"; d="scan'208";a="75660005" X-CSE-ConnectionGUID: cHUwYKuURsGKfCLLbCM3sQ== X-CSE-MsgGUID: /8oG5xduQgmV1dG/be5kFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,283,1763452800"; d="scan'208";a="211800786" From: Zhao Liu To: Paolo Bonzini , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Eduardo Habkost , Markus Armbruster , Thomas Huth , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Richard Henderson , Peter Maydell , "Michael S . Tsirkin" , BALATON Zoltan , Mark Cave-Ayland , Pierrick Bouvier , Zide Chen , Dapeng Mi , Zhao Liu , qemu-devel@nongnu.org, devel@lists.libvirt.org Subject: [PATCH v2 19/21] target/i386: remove redundant validation for lbr-fmt property Date: Tue, 10 Feb 2026 11:23:46 +0800 Message-Id: <20260210032348.987549-20-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260210032348.987549-1-zhao1.liu@intel.com> References: <20260210032348.987549-1-zhao1.liu@intel.com> MIME-Version: 1.0 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.14; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: qemu development 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: 1770692434362154100 Content-Type: text/plain; charset="utf-8" The 'lbr-fmt' property is defined via DEFINE_PROP_UINT64_CHECKMASK, utilizing PERF_CAP_LBR_FMT as the validation mask. This mechanism ensures that the property setter rejects any value attempting to set bits outside this mask. So cpu->lbr_fmt is guaranteed to be valid by the time x86_cpu_realizefn() executes. The manual validation inside the realize function is therefore redundant. Remove the unnecessary check. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c2f99b98014a..a594747f0030 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -9816,10 +9816,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Erro= r **errp) * with user-provided setting. */ if (cpu->lbr_fmt !=3D ~PERF_CAP_LBR_FMT) { - if ((cpu->lbr_fmt & PERF_CAP_LBR_FMT) !=3D cpu->lbr_fmt) { - error_setg(errp, "invalid lbr-fmt"); - return; - } env->features[FEAT_PERF_CAPABILITIES] &=3D ~PERF_CAP_LBR_FMT; env->features[FEAT_PERF_CAPABILITIES] |=3D cpu->lbr_fmt; } --=20 2.34.1