qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Zhao Liu <zhao1.liu@intel.com>
Cc: Xiaoyao Li <xiaoyao.li@intel.com>,
	Chuang Xu <xuchuangxclwt@bytedance.com>,
	pbonzini@redhat.com, imammedo@redhat.com,
	xieyongji@bytedance.com, chaiwen.cc@bytedance.com,
	qemu-stable@nongnu.org, Guixiong Wei <weiguixiong@bytedance.com>,
	Yipeng Yin <yinyipeng@bytedance.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v6] i386/cpu: fixup number of addressable IDs for logical processors in the physical package
Date: Tue, 3 Dec 2024 15:29:28 +0000	[thread overview]
Message-ID: <Z08j2Ii-QuZk3lTY@redhat.com> (raw)
In-Reply-To: <Z060VQVV6ONK9Qd2@intel.com>

On Tue, Dec 03, 2024 at 03:33:41PM +0800, Zhao Liu wrote:
> > However, back to the patch, I think we cannot change it as this patch
> > directly. Instead, we need a compat_props for the changed behavior, because
> > this isn't a bug fix and it introduces guest-visible differences.
> 
> This is a fix, not a new feature, so compat_props is not needed.

Note from QEMU's POV, whether or not a change requires use of compat_props
is NOT determined by whether it is a bugfix or feature.

The decision is driven by whether a running guest OS will continue to
function correctly when it is live migrated between 2 QEMUs, before/after
the commit.

If the commit breaks a running guest, then toggling usage of the changed
code based on compat_props is required. Sometimes we can get away without
this for bug fixes, other bug fixes not so lucky.

My gut feeling is in this case we're probably safe-ish without compat_props,
as topology is the kind of info that's read once at OS startup and then
cached until reboot. So changing the logical processor per package
behind a running guest (probably) won't cause trouble.

One of the i386 maintainers should sanity check though, as this code isn't
my normal area of expertize

> 
> > For ancient Intel CPUs, EBX[23:16] did represent the number of Logical
> > processor per package. I believe this should be the reason why QEMU
> > implemented it as is:
> > 
> >   - on SDM version 013, EBX[23:16]: Number of logical processors per
> > physical processor; two for the Pentium 4 processor supporting
> > Hyper-Threading Technology.
> > 
> >   - on SDM version 015, it changed to: Number of initial APIC IDs reserved
> > for this physical package. Normally, this is the number of logical
> > processors per physical package.
> > 
> >   - on SDM version 016, it changed to: Maximum number of logical processors
> > in this physical package.
> > 
> >   - finally, starting from SDM version 026, it changed to what reads now:
> > Maximum number of addressable IDs for logical processors in this physical
> > package.
> 
> And this is an architecturally defined CPUID, so SDM ensures backward
> compatibility.
> 
> Regards,
> Zhao
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  parent reply	other threads:[~2024-12-03 15:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  3:56 [PATCH v6] i386/cpu: fixup number of addressable IDs for logical processors in the physical package Chuang Xu
2024-10-09  4:21 ` Zhao Liu
2024-10-12  7:13 ` Xiaoyao Li
2024-10-12  8:10   ` Chuang Xu
2024-10-12  8:32     ` Xiaoyao Li
2024-10-12  8:56       ` Zhao Liu
2024-10-12  8:21 ` Xiaoyao Li
2024-10-12  9:28   ` Zhao Liu
2024-10-12  9:35   ` Chuang Xu
2024-10-14  0:36     ` Xiaoyao Li
2024-10-14  1:32       ` Xiaoyao Li
2024-10-14  3:36       ` Zhao Liu
2024-10-17  8:18         ` Xiaoyao Li
2024-10-17  9:03           ` Zhao Liu
2024-10-28 16:07             ` Xiaoyao Li
2024-12-03  7:33               ` Zhao Liu
2024-12-03 15:04                 ` Xiaoyao Li
2024-12-03 15:35                   ` Zhao Liu
2024-12-03 15:29                 ` Daniel P. Berrangé [this message]
2024-12-03  7:36 ` Zhao Liu
2024-12-03  7:29   ` Chuang Xu

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=Z08j2Ii-QuZk3lTY@redhat.com \
    --to=berrange@redhat.com \
    --cc=chaiwen.cc@bytedance.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=weiguixiong@bytedance.com \
    --cc=xiaoyao.li@intel.com \
    --cc=xieyongji@bytedance.com \
    --cc=xuchuangxclwt@bytedance.com \
    --cc=yinyipeng@bytedance.com \
    --cc=zhao1.liu@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).