qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Nathan Chancellor <natechancellor@gmail.com>,
	Yang Weijiang <weijiang.yang@intel.com>
Cc: seanjc@google.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel][PATCH] x86/cpu: Use max host physical address if -cpu max option is applied
Date: Mon, 25 Jan 2021 11:42:43 +0100	[thread overview]
Message-ID: <7a1d69e7-a3e0-e4e8-b09b-3e904466cd97@redhat.com> (raw)
In-Reply-To: <20210125071052.GA307708@ubuntu-m3-large-x86>

On 25/01/21 08:10, Nathan Chancellor wrote:
>>> This patch as commit 5a140b255d ("x86/cpu: Use max host physical address
>>> if -cpu max option is applied") prevents me from using '-cpu host' while
>>> booting an i386_defconfig kernel.
>>>
>>> $ qemu-system-i386 \
>>> -append console=ttyS0 \
>>> -cpu host \
>>> -display none \
>>> -enable-kvm \
>>> -initrd rootfs.cpio \
>>> -kernel bzImage \
>>> -serial mon:stdio
>>> qemu-system-i386: phys-bits should be between 32 and 36  (but is 48)
>>>
>>> Am I expected to pass "-cpu host,host-phys-bits=false" now or did this
>>> do something unexpected?

Yes, it's setting the LM bit for a 32-bit guest.

Does this work for you?

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 72a79e6019..70df57337f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5081,6 +5081,11 @@ static uint64_t 
x86_cpu_get_supported_feature_word(FeatureWord w,
      } else {
          return ~0;
      }
+#ifdef TARGET_I386
+    if (wi->cpuid.eax = 0x80000001) {
+        r &= ~CPUID_EXT2_LM;
+    }
+#endif
      if (migratable_only) {
          r &= x86_cpu_get_migratable_flags(w);
      }


Paolo

>> Hi, Nathan,
>> Could you try Paolo's latest patch?
>>
>> [PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is applied
> 
> Hi Yang,
> 
> That is the version of the patch I tried, which has been pulled into the
> master branch.
> 
> Cheers,
> Nathan
> 



  reply	other threads:[~2021-01-25 10:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  9:04 [Qemu-devel][PATCH] x86/cpu: Use max host physical address if -cpu max option is applied Yang Weijiang
2021-01-13 10:06 ` Paolo Bonzini
2021-01-13 15:04   ` Yang Weijiang
2021-01-13 15:41     ` Paolo Bonzini
2021-01-24 21:08 ` Nathan Chancellor
2021-01-25  5:41   ` Yang Weijiang
2021-01-25  7:10     ` Nathan Chancellor
2021-01-25 10:42       ` Paolo Bonzini [this message]
2021-01-25 18:19         ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a1d69e7-a3e0-e4e8-b09b-3e904466cd97@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=natechancellor@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seanjc@google.com \
    --cc=weijiang.yang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).