Bug 2028623

Summary: [9.0] machine types: 6.2: Fix prefer_sockets
Product: Red Hat Enterprise Linux 9 Reporter: Dr. David Alan Gilbert <dgilbert>
Component: qemu-kvmAssignee: Dr. David Alan Gilbert <dgilbert>
qemu-kvm sub component: Machine Types QA Contact: liunana <nanliu>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: cohuck, coli, jinzhao, juzhang, mrezanin, nanliu, thuth, virt-maint
Version: 9.0   
Target Milestone: rc   
Target Release: 9.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-6.2.0-4.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2029582 (view as bug list) Environment:
Last Closed: 2022-05-17 12:25:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2029582    

Description Dr. David Alan Gilbert 2021-12-02 19:51:24 UTC
Description of problem:
cohuck spotted that I'd missed the prefer_sockets line in the machine option compatibility for the x86 machine types; it looks like th_huth nailed it for s390.
(We'll also need this on 8.6, so probably need it for Power and hmm aarch?)

Version-Release number of selected component (if applicable):
6.2 rebase

How reproducible:
100%

Steps to Reproduce:
1. start a guest with -smp 8
2. lscpu


Actual results:
    Core(s) per socket:  8
    Socket(s):           1

Expected results:
    Core(s) per socket:  1
    Socket(s):           8


Additional info:

Comment 1 Dr. David Alan Gilbert 2021-12-08 15:28:50 UTC
Fixed in:
https://gitlab.com/redhat/rhel/src/qemu-kvm/qemu-kvm/-/merge_requests/85
(on top of rc3 rebase)

Comment 2 liunana 2021-12-09 07:15:29 UTC
(In reply to Dr. David Alan Gilbert from comment #1)
> Fixed in:
> https://gitlab.com/redhat/rhel/src/qemu-kvm/qemu-kvm/-/merge_requests/85
> (on top of rc3 rebase)

Hi,


Could you help to share if there will be different behaviour inside guests with different machine types?
I get the same result with 'q35' and 'pc' machine type with qemu-kvm-6.2.0-1.rc2.scrmod+el8.6.0+13458+219ac088.wrb211124.

1. Boot guest with '-smp 8'

2. check CPU topology inside the guest.
# lscpu
    Core(s) per socket:  8
    Socket(s):           1


Thanks.



Best regards
Liu Nana

Comment 3 Dr. David Alan Gilbert 2021-12-09 10:19:28 UTC
(In reply to liunana from comment #2)
> (In reply to Dr. David Alan Gilbert from comment #1)
> > Fixed in:
> > https://gitlab.com/redhat/rhel/src/qemu-kvm/qemu-kvm/-/merge_requests/85
> > (on top of rc3 rebase)
> 
> Hi,
> 
> 
> Could you help to share if there will be different behaviour inside guests
> with different machine types?
> I get the same result with 'q35' and 'pc' machine type with
> qemu-kvm-6.2.0-1.rc2.scrmod+el8.6.0+13458+219ac088.wrb211124.
> 
> 1. Boot guest with '-smp 8'
> 
> 2. check CPU topology inside the guest.
> # lscpu
>     Core(s) per socket:  8
>     Socket(s):           1
> 
> 
> Thanks.
> 
> 
> 
> Best regards
> Liu Nana

You should find the behaviour is the same on q35 and pc; but wihtout this patch it'll be like it shows you; on older qemu you sohuld find it shows socket(s) 8
With this patch it should also show Socket(s) 8

Comment 4 liunana 2021-12-20 03:32:37 UTC
Could you help to set the ITR so that I can set the ITM? Thanks.



Best regards
Liu Nana

Comment 7 Yanan Fu 2022-01-18 06:49:50 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 10 liunana 2022-01-24 15:11:16 UTC
Test Env:
    5.14.0-39.el9.x86_64+debug
    qemu-kvm-6.2.0-4.el9.x86_64
    amd-milan-11.khw1.lab.eng.bos.redhat.com
Guest: 5.14.0-44.el9.x86_64
    

Test steps:
  1. Boot guest with '-smp 8'
  2. lscpu inside guest.
# lscpu
    BIOS Model name:     RHEL-8.5.0 PC (Q35 + ICH9, 2009)
    CPU family:          25
    Model:               1
    Thread(s) per core:  1
    Core(s) per socket:  1
    Socket(s):           8

  3. check 'pc' machine type, get the same results:
# lscpu
    BIOS Model name:     RHEL 7.6.0 PC (i440FX + PIIX, 1996)
    CPU family:          25
    Model:               1
    Thread(s) per core:  1
    Core(s) per socket:  1
    Socket(s):           8



Please help to check this, if no more comments I will move this bug to VERIFIED, thanks.



Best regards
Liu Nana

Comment 11 Dr. David Alan Gilbert 2022-01-24 15:35:15 UTC
Yes, that's right - you see the 'smp 8' has turned into 8 sockets x 1 core.
I think if you try it with the 8.6.0 or 9.0.0 q35 machine type you'll see probably 1 socket, 8 cores.

Comment 12 liunana 2022-01-25 14:23:21 UTC
(In reply to Dr. David Alan Gilbert from comment #11)
> Yes, that's right - you see the 'smp 8' has turned into 8 sockets x 1 core.
> I think if you try it with the 8.6.0 or 9.0.0 q35 machine type you'll see
> probably 1 socket, 8 cores.


Yes, I can see the difference with 9.0.0 q35 machine type with qemu-kvm-6.2.0-5.el9.x86_64.
Inside guest:
#lscpu
   BIOS Model name:     RHEL-9.0.0 PC (Q35 + ICH9, 2009)
    Thread(s) per core:  1
    Core(s) per socket:  8
    Socket(s):           1


Move this bug to verified now, thanks.

Comment 14 errata-xmlrpc 2022-05-17 12:25:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: qemu-kvm), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2307