From nobody Sun Nov 24 20:51:16 2024 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=1720091980; cv=none; d=zohomail.com; s=zohoarc; b=AFLLagZI5iwRWTjf4JIWhXoLBgr0hF4C83Fnlu1nCcgJ1IZi34v/lyPNXigDBNCZ4zQ6u2rnQj5m0ZwgnYWKXos3KsYgnCQ46s4aJkgZlERTexIjhwzX6ZNmv2JwJd3gC1936wqN3Oyer0NnBd7LE7ICLl5A8flrwmHA6KpbVB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720091980; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+wyD45BEMumbcKSWjLTb6+5WGJlX7AOupNoOhRxITao=; b=V08/osFZLrlA7++hAZhnzJRb7XQBh/GUFy1HDffUI3xaiRW4oXayH6iarWu7Wlhxa305+sl1xpwD/1s3liSBzXX9ZDs0PLpWCvmv0Yv2VVKVBH+IUEFRQH7pq/+GlEm+1Y3xzvukTNZbjjhV4F6cR3Wrhq+d1iGXo35ynxHR1F4= 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 17200919804681004.8153588205486; Thu, 4 Jul 2024 04:19:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPKU5-0003ix-Hz; Thu, 04 Jul 2024 07:18:41 -0400 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 1sPKTz-0003iZ-UJ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 07:18:37 -0400 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 1sPKTx-0006RX-Jv for qemu-devel@nongnu.org; Thu, 04 Jul 2024 07:18:35 -0400 Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 04:18:30 -0700 Received: from lxy-clx-4s.sh.intel.com ([10.239.48.52]) by fmviesa008.fm.intel.com with ESMTP; 04 Jul 2024 04:18:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720091913; x=1751627913; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0xy6FaN1makrO+eqNj7Tn9kcQEZ/h1Qa/hmjtlFd3hQ=; b=hq91ttwo3IJKFqEh/MVWIywckJfv8S4Fa03D5QjxF4aupd6iKnstxPI2 WnBb9pjvPKbiZWzICISC8mDhJCQgFCKwooEXyFALrHIq1kzicQ8qfJ7mC layVlN++/+m1hg6JTQGT1yLx+3dWk8iSHeEkVYh3TmvmQ1HHXjgIojtqn Ozv7WBpRDB+QoXtBDJGuvT+vMOo933rtDHhs09bhlV3waPkF/wf11G68p BSr4y5kktUW8opEUhY8Bi7OJYofmzx1aNyelyb9dob/8H3Hc9h+rlq8o3 Sd4AayXRGRi3K62Y6w0ujXha8cj3z5jCpqNATJUmxoLRg2hgGAVTC3zZW w==; X-CSE-ConnectionGUID: kVh1YVTfTVebHmkA8LWEWg== X-CSE-MsgGUID: TxUEd8WKTQCP9LwNNcOfJg== X-IronPort-AV: E=McAfee;i="6700,10204,11122"; a="21176231" X-IronPort-AV: E=Sophos;i="6.09,183,1716274800"; d="scan'208";a="21176231" X-CSE-ConnectionGUID: OfFVhxFgRO2cqXPljkZXCg== X-CSE-MsgGUID: +GgAVA13RWCEb8GBSqmqRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,183,1716274800"; d="scan'208";a="46535003" From: Xiaoyao Li To: Paolo Bonzini Cc: qemu-devel@nongnu.org Subject: [PATCH] i386/cpu: Drop the check of phys_bits in host_cpu_realizefn() Date: Thu, 4 Jul 2024 07:12:31 -0400 Message-Id: <20240704111231.2881016-1-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.34.1 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=xiaoyao.li@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, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.001, RCVD_IN_DNSWL_MED=-2.3, 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: 1720091981766100001 Content-Type: text/plain; charset="utf-8" The check of cpu->phys_bits to be in range between [32, TARGET_PHYS_ADDR_SPACE_BITS] in host_cpu_realizefn() is duplicated with check in x86_cpu_realizefn(). Since the ckeck in x86_cpu_realizefn() is called later and can cover all teh x86 case. Remove the one in host_cpu_realizefn(). Signed-off-by: Xiaoyao Li Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu --- target/i386/host-cpu.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/i386/host-cpu.c b/target/i386/host-cpu.c index 8b8bf5afeccf..b109c1a2221f 100644 --- a/target/i386/host-cpu.c +++ b/target/i386/host-cpu.c @@ -75,17 +75,7 @@ bool host_cpu_realizefn(CPUState *cs, Error **errp) CPUX86State *env =3D &cpu->env; =20 if (env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM) { - uint32_t phys_bits =3D host_cpu_adjust_phys_bits(cpu); - - if (phys_bits && - (phys_bits > TARGET_PHYS_ADDR_SPACE_BITS || - phys_bits < 32)) { - error_setg(errp, "phys-bits should be between 32 and %u " - " (but is %u)", - TARGET_PHYS_ADDR_SPACE_BITS, phys_bits); - return false; - } - cpu->phys_bits =3D phys_bits; + cpu->phys_bits =3D host_cpu_adjust_phys_bits(cpu); } return true; } --=20 2.34.1