From nobody Wed Apr 24 05:49:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1610528054; cv=none; d=zohomail.com; s=zohoarc; b=VvHpwtwsi9fO010MGfrhppPHRKpfU5J18p3gIGV3h7qAsDtBWeeyseb5TgokjGp49rgcZ850kL6yCjHhA1bnE4l+2ce7ckAk2LgHkq1e25ecg1FfgkRtrdQVcAjmYsVFaHHYZLdOzIXu9OGkhb68Zj1cVGVaQWsO708eQH44WHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610528054; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=dCbWAqtfs1Q7zFo8axP5+1FJ95pXtVdbgwS87vOgA6s=; b=aMB5k7cHTK3kicillJx/A8kr2WxyQS9RPYuLBHnnjiwPpd3+xd4EqzPC8didnQ3r4Tg+WiaG8ERQK7LZ0HdHigwrQZw3PUMyit6Ym4LuGlEzZGSSjN+dH6kzpEi4oGgYQGkYioFVlR6uVRV/F7/l1qOiLYxIXTcwowuMxfvAa6I= ARC-Authentication-Results: i=1; mx.zohomail.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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610528054381496.83552778205603; Wed, 13 Jan 2021 00:54:14 -0800 (PST) Received: from localhost ([::1]:56514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzbuu-0003bC-Qp for importer@patchew.org; Wed, 13 Jan 2021 03:54:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzbtv-00035b-DN for qemu-devel@nongnu.org; Wed, 13 Jan 2021 03:53:11 -0500 Received: from mga12.intel.com ([192.55.52.136]:53910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzbtr-00018S-51 for qemu-devel@nongnu.org; Wed, 13 Jan 2021 03:53:10 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 00:52:55 -0800 Received: from local-michael-cet-test.sh.intel.com ([10.239.159.172]) by orsmga008.jf.intel.com with ESMTP; 13 Jan 2021 00:52:53 -0800 IronPort-SDR: QwdA5+FA1KdXGtndSN5OtU4Cbu5NIgTUR9zFbgek6tJiPIDz55QKPUsv/NNN6ZRQd7OamIV1yH Aj1ntDQJHILA== X-IronPort-AV: E=McAfee;i="6000,8403,9862"; a="157354959" X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="157354959" IronPort-SDR: Dil8UGQTUnmbJbsLCHCXj9VZV3/KuQEzPycjetEhIUr6DZ+m4aApgTG+myHysXkR6lQzYfAYwZ hICDGhBOJJNQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="381765972" From: Yang Weijiang To: pbonzini@redhat.com, seanjc@google.com, qemu-devel@nongnu.org Subject: [Qemu-devel][PATCH] x86/cpu: Use max host physical address if -cpu max option is applied Date: Wed, 13 Jan 2021 17:04:30 +0800 Message-Id: <20210113090430.26394-1-weijiang.yang@intel.com> X-Mailer: git-send-email 2.17.2 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=192.55.52.136; envelope-from=weijiang.yang@intel.com; helo=mga12.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Weijiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" QEMU option -cpu max(max_features) means "Enables all features supported by the accelerator in the current host", this looks true for all the features except guest max physical address width, so add this patch to enable it. Signed-off-by: Yang Weijiang Tested-by: Nathan Chancellor --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 35459a38bb..b5943406f7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6673,7 +6673,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error= **errp) warned =3D true; } =20 - if (cpu->host_phys_bits) { + if (cpu->host_phys_bits || cpu->max_features) { /* The user asked for us to use the host physical bits */ cpu->phys_bits =3D host_phys_bits; if (cpu->host_phys_bits_limit && --=20 2.17.2