Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 874033

Summary: Specify the number of cpu threads failed with cpu model Opteron_G3 Opteron_G4 and Opteron_G5
Product: Red Hat Enterprise Linux 6 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: acathrow, bsarathy, chayang, dyasny, flang, juzhang, michen, mkenneth, qzhang, shuang, shu, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-13 18:45:09 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:
Attachments:
Description Flags
guest x86info
none
guest cpuinfo information none

Description FuXiangChun 2012-11-07 10:47:34 UTC
Description of problem:
Boot rhel6.4 64bit guest with -smp 8,sockets=2,cores=2,threads=2,maxcpus=16 on AMD host.  Get "cpu cores" = 4 from cpuinfo inside guest. It should be 2. 

Since bug 689665 is fixed, So Intel host don't hit this issue. 


Version-Release number of selected component (if applicable):
host:
# uname -r
2.6.32-339.el6.x86_64
# rpm -qa|grep qemu
qemu-kvm-0.12.1.2-2.334.el6.x86_64

Additional, host cpu is AMD Seoul, and 16 cores.  

guest kernel:
# uname -r
2.6.32-339.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1./usr/libexec/qemu-kvm -M rhel6.4.0 -cpu Opteron_G5 -enable-kvm -m 2048 -smp 8,sockets=2,cores=2,threads=2,maxcpus=16 -usb -device usb-tablet,id=input0 -name Opteron_G5 -uuid 990ea161-6b67-47b2-b803-19fb01d30d31 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -drive file=/root/fuxc/rhel-6.4-2.qcow2,if=none,id=drive-ide-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device ide-drive,drive=drive-ide-disk0,id=ide-disk0 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=e1000-net-pci0,mac=00:1B:21:A8:0D:B1,bus=pci.0,addr=0x5 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5931,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.vram_size=67108864 -nodefaults -serial unix:/tmp/ttyS0,server,nowait -qmp tcp:0:6666,server,nowait -boot menu=on -monitor stdio -device sga -chardev socket,id=serial1,path=/var/test1,server,nowait -device isa-serial,chardev=serial1

2.check cpuinfo inside guest
physical id	: 1
siblings	: 4
core id		: 3
cpu cores	: 4

3.
  
Actual results:
cpu cores value is wrong

Expected results:
cpu cores value is 2

Additional info:

Comment 1 FuXiangChun 2012-11-07 10:48:17 UTC
Created attachment 639938 [details]
guest x86info

Comment 2 FuXiangChun 2012-11-07 10:49:02 UTC
Created attachment 639946 [details]
guest cpuinfo information

Comment 4 Eduardo Habkost 2012-11-13 18:45:09 UTC
The AMD CPU models don't support hyperthreading, so the only valid "threads" value for AMD CPU models is 1. cores=2,threads=2 will end up exposing 4 VCPUs per CPU package, and that will probably be interpreted by the guest as 4 cores, instead of 2 cores with 2 threads each (this seems to be the case in the x86info output you have attached).