Bug 625333

Summary: qemu treatment of -nodefconfig and -readconfig problematic for debug
Product: Red Hat Enterprise Linux 6 Reporter: john cooper <john.cooper>
Component: qemu-kvmAssignee: john cooper <john.cooper>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: amit.shah, lihuang, michen, mkenneth, nobody, shuang, tburke, virt-maint
Target Milestone: beta   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.135.el6 Doc Type: Bug Fix
Doc Text:
Cause Currently -nodefconfig doesn't disable import of cpu-x86_64.conf. This combined with -readconfig imports occurring after cpudef_setup() disallow pointing qemu at an alternate cpu-x86_64.conf file. Consequence User effectively can't read in alternate cpu-x86_64.conf file impacting qemu debug and potentially end user local configuration. Workaround Requires moving/overwriting default config files by the user. Result -nodefconfig works as intended and intuitively expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:29:12 UTC Type: ---
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: 580953    
Attachments:
Description Flags
Example patch providing above fix. none

Description john cooper 2010-08-19 05:47:32 UTC
Created attachment 439585 [details]
Example patch providing above fix.

Description of problem:

    Currently -nodefconfig doesn't disable import of cpu-x86_64.conf.
    This combined with -readconfig imports occurring after cpudef_setup()
    disallow pointing qemu at an alternate cpu-x86_64.conf file.

    Notably, -readconfig support is broken.

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

    RHEL6.0-20100816.n.0-Server-x86_64

How reproducible:

  launch qemu with:

    -nodefconfig -readconfig ? -readconfig mydebug/cpu-x86_64.conf

  the definitions in the system installed:

    /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf

  are unconditionally imported while the:

    mydebug/cpu-x86_64.conf

  definitions are read in but have no effect due to occurring after the
  call to cpudef_setup() in the above example.


Steps to Reproduce:
(as stated above)

Actual results:

  can't read in alternate cpu-x86_64.conf file.

Expected results:

  should be able to use CLI as described above for debug.

Additional info:

1.  Broken -readconfig support went unnoticed as libvirt does not use this
option.  Given libvirt dependencies it may be necessary to entertain
another flag to disable import of cpu-x86_64.conf as libvirt assumes
this file is unconditionally imported.

2.  A patch is attached which includes import of cpu-x86_64.conf under
-nodefconfig and fixes the behavior of -readconfig.

3.  All of the above and related cpu config logic is subject to change
pending reconciling this rhel6 special functionality upstream.

Comment 8 Suqin Huang 2011-02-18 03:26:21 UTC
Remove "sse4a, abm, svm" from cpu64-rhel6 extfeature_ecx in my-cpu-x86_64.conf config file.
boot guest with -nodefconfig -readconfig ? -readconfig my-cpu-x86_64.conf -cpu cpu64-rhel6,check
on host lack "sse4a, abm, svm"

Result: fix on qemu-kvm-0.12.1.2-2.145.el6.x86_64

1. qemu-kvm-0.12.1.2-2.132.el6.x86_64

[root@amd-4450b-4-2 ~]# /usr/libexec/qemu-kvm -nodefconfig -readconfig ? -readconfig my-cpu-x86_64.conf -cpu cpu64-rhel6,check
parsed config file /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
parsed config file /root/cpu-x86_64.conf
warning: host cpuid 8000_0001:ecx flag restricted to guest 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]

2. qemu-kvm-0.12.1.2-2.145.el6.x86_64

1). /usr/libexec/qemu-kvm -nodefconfig -readconfig ? -readconfig my-cpu-x86_64.conf -cpu cpu64-rhel6,check
parsed config file /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
parsed config file /root/cpu-x86_64.conf
Using CPU model "cpu64-rhel6,check"

2). /usr/libexec/qemu-kvm -nodefconfig -readconfig ? -cpu cp4-rhel6,check
parsed config file /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
Using CPU model "cpu64-rhel6,check"
warning: host cpuid 8000_0001:ecx flag restricted to guest 'svm' [0x00000004]
warning: host cpuid 8000_0001:ecx lacks requested flag 'abm' [0x00000020]
warning: host cpuid 8000_0001:ecx lacks requested flag 'sse4a' [0x00000040]

Comment 10 Miya Chen 2011-03-10 02:32:27 UTC
move to verified based on comment#8

Comment 11 john cooper 2011-05-05 14:42:30 UTC
Added CCFR

Comment 12 john cooper 2011-05-05 14:42:30 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    Currently -nodefconfig doesn't disable import of cpu-x86_64.conf.
    This combined with -readconfig imports occurring after cpudef_setup()
    disallow pointing qemu at an alternate cpu-x86_64.conf file.

Consequence
    User effectively can't read in alternate cpu-x86_64.conf file impacting
    qemu debug and potentially end user local configuration.

Workaround
    Requires moving/overwriting default config files by the user.

Result
    -nodefconfig works as intended and intuitively expected.

Comment 13 errata-xmlrpc 2011-05-19 11:29:12 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

Comment 14 errata-xmlrpc 2011-05-19 12:47:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html