[Qemu-devel] [PATCH 0/3] i386: improve output from "-cpu help" argument

Daniel P. Berrangé posted 3 patches 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180606165527.17365-1-berrange@redhat.com
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
target/i386/cpu.c | 57 ++++++++++++++++++++++++++++++-----------------
1 file changed, 37 insertions(+), 20 deletions(-)
[Qemu-devel] [PATCH 0/3] i386: improve output from "-cpu help" argument
Posted by Daniel P. Berrangé 5 years, 10 months ago
This short series is a set of improvements to the "-cpu help" output for
the x86 emulator. The patches describe what's change in each step, but
it is best visualized by looking at before/after state.

Before:

   Available CPUs:
   x86              486
   x86   Broadwell-IBRS  Intel Core Processor (Broadwell, IBRS)
   x86 Broadwell-noTSX-IBRS  Intel Core Processor (Broadwell, no TSX, IBRS)
   x86  Broadwell-noTSX  Intel Core Processor (Broadwell, no TSX)
   x86        Broadwell  Intel Core Processor (Broadwell)
   x86           Conroe  Intel Celeron_4x0 (Conroe/Merom Class Core 2)
   x86        EPYC-IBPB  AMD EPYC Processor (with IBPB)
   x86             EPYC  AMD EPYC Processor
   x86     Haswell-IBRS  Intel Core Processor (Haswell, IBRS)
   x86 Haswell-noTSX-IBRS  Intel Core Processor (Haswell, no TSX, IBRS)
   x86    Haswell-noTSX  Intel Core Processor (Haswell, no TSX)
   x86          Haswell  Intel Core Processor (Haswell)
   x86   IvyBridge-IBRS  Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)
   x86        IvyBridge  Intel Xeon E3-12xx v2 (Ivy Bridge)
   x86     Nehalem-IBRS  Intel Core i7 9xx (Nehalem Core i7, IBRS update)
   x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)
   x86       Opteron_G1  AMD Opteron 240 (Gen 1 Class Opteron)
   x86       Opteron_G2  AMD Opteron 22xx (Gen 2 Class Opteron)
   x86       Opteron_G3  AMD Opteron 23xx (Gen 3 Class Opteron)
   x86       Opteron_G4  AMD Opteron 62xx class CPU
   x86       Opteron_G5  AMD Opteron 63xx class CPU
   x86           Penryn  Intel Core 2 Duo P9xxx (Penryn Class Core 2)
   x86 SandyBridge-IBRS  Intel Xeon E312xx (Sandy Bridge, IBRS update)
   x86      SandyBridge  Intel Xeon E312xx (Sandy Bridge)
   x86 Skylake-Client-IBRS  Intel Core Processor (Skylake, IBRS)
   x86   Skylake-Client  Intel Core Processor (Skylake)
   x86 Skylake-Server-IBRS  Intel Xeon Processor (Skylake, IBRS)
   x86   Skylake-Server  Intel Xeon Processor (Skylake)
   x86    Westmere-IBRS  Westmere E56xx/L56xx/X56xx (IBRS update)
   x86         Westmere  Westmere E56xx/L56xx/X56xx (Nehalem-C)
   x86           athlon  QEMU Virtual CPU version 2.5+
   x86         core2duo  Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
   x86          coreduo  Genuine Intel(R) CPU           T2600  @ 2.16GHz
   x86            kvm32  Common 32-bit KVM processor
   x86            kvm64  Common KVM processor
   x86             n270  Intel(R) Atom(TM) CPU N270   @ 1.60GHz
   x86          pentium
   x86         pentium2
   x86         pentium3
   x86           phenom  AMD Phenom(tm) 9550 Quad-Core Processor
   x86           qemu32  QEMU Virtual CPU version 2.5+
   x86           qemu64  QEMU Virtual CPU version 2.5+
   x86             base  base CPU model type with no features enabled
   x86             host  KVM processor with all supported host features (only available in KVM mode)
   x86              max  Enables all features supported by the accelerator in the current host

   Recognized CPUID flags:
     fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 pn clflush ds acpi mmx fxsr sse sse2 ss ht tm ia64 pbe
     pni pclmulqdq dtes64 monitor ds-cpl vmx smx est tm2 ssse3 cid fma cx16 xtpr pdcm pcid dca sse4.1 sse4.2 x2apic movbe popcnt tsc-deadline aes xsave osxsave avx f16c rdrand hypervisor
     fsgsbase tsc-adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512ifma pcommit clflushopt clwb avx512pf avx512er avx512cd sha-ni avx512bw avx512vl
     avx512vbmi umip pku ospke avx512-vpopcntdq la57 rdpid
     avx512-4vnniw avx512-4fmaps spec-ctrl
     syscall nx mmxext fxsr-opt pdpe1gb rdtscp lm 3dnowext 3dnow
     lahf-lm cmp-legacy svm extapic cr8legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid-msr tbm topoext perfctr-core perfctr-nb
     invtsc
     ibpb
     xstore xstore-en xcrypt xcrypt-en ace2 ace2-en phe phe-en pmm pmm-en
     kvmclock kvm-nopiodelay kvm-mmu kvmclock kvm-asyncpf kvm-steal-time kvm-pv-eoi kvm-pv-unhalt kvm-pv-tlb-flush kvmclock-stable-bit

     npt lbrv svm-lock nrip-save tsc-scale vmcb-clean flushbyasid decodeassists pause-filter pfthreshold
     xsaveopt xsavec xgetbv1 xsaves
     arat

After:

   Available CPUs:
   x86 486
   x86 Broadwell             Intel Core Processor (Broadwell)
   x86 Broadwell-IBRS        Intel Core Processor (Broadwell, IBRS)
   x86 Broadwell-noTSX       Intel Core Processor (Broadwell, no TSX)
   x86 Broadwell-noTSX-IBRS  Intel Core Processor (Broadwell, no TSX, IBRS)
   x86 Conroe                Intel Celeron_4x0 (Conroe/Merom Class Core 2)
   x86 EPYC                  AMD EPYC Processor
   x86 EPYC-IBPB             AMD EPYC Processor (with IBPB)
   x86 Haswell               Intel Core Processor (Haswell)
   x86 Haswell-IBRS          Intel Core Processor (Haswell, IBRS)
   x86 Haswell-noTSX         Intel Core Processor (Haswell, no TSX)
   x86 Haswell-noTSX-IBRS    Intel Core Processor (Haswell, no TSX, IBRS)
   x86 IvyBridge             Intel Xeon E3-12xx v2 (Ivy Bridge)
   x86 IvyBridge-IBRS        Intel Xeon E3-12xx v2 (Ivy Bridge, IBRS)
   x86 Nehalem               Intel Core i7 9xx (Nehalem Class Core i7)
   x86 Nehalem-IBRS          Intel Core i7 9xx (Nehalem Core i7, IBRS update)
   x86 Opteron_G1            AMD Opteron 240 (Gen 1 Class Opteron)
   x86 Opteron_G2            AMD Opteron 22xx (Gen 2 Class Opteron)
   x86 Opteron_G3            AMD Opteron 23xx (Gen 3 Class Opteron)
   x86 Opteron_G4            AMD Opteron 62xx class CPU
   x86 Opteron_G5            AMD Opteron 63xx class CPU
   x86 Penryn                Intel Core 2 Duo P9xxx (Penryn Class Core 2)
   x86 SandyBridge           Intel Xeon E312xx (Sandy Bridge)
   x86 SandyBridge-IBRS      Intel Xeon E312xx (Sandy Bridge, IBRS update)
   x86 Skylake-Client        Intel Core Processor (Skylake)
   x86 Skylake-Client-IBRS   Intel Core Processor (Skylake, IBRS)
   x86 Skylake-Server        Intel Xeon Processor (Skylake)
   x86 Skylake-Server-IBRS   Intel Xeon Processor (Skylake, IBRS)
   x86 Westmere              Westmere E56xx/L56xx/X56xx (Nehalem-C)
   x86 Westmere-IBRS         Westmere E56xx/L56xx/X56xx (IBRS update)
   x86 athlon                QEMU Virtual CPU version 2.5+
   x86 core2duo              Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
   x86 coreduo               Genuine Intel(R) CPU           T2600  @ 2.16GHz
   x86 kvm32                 Common 32-bit KVM processor
   x86 kvm64                 Common KVM processor
   x86 n270                  Intel(R) Atom(TM) CPU N270   @ 1.60GHz
   x86 pentium
   x86 pentium2
   x86 pentium3
   x86 phenom                AMD Phenom(tm) 9550 Quad-Core Processor
   x86 qemu32                QEMU Virtual CPU version 2.5+
   x86 qemu64                QEMU Virtual CPU version 2.5+
   x86 base                  base CPU model type with no features enabled
   x86 host                  Enables all features supported by the accelerator in the current host
   x86 max                   Enables all features supported by the accelerator in the current host

   Recognized CPUID flags:
     3dnow 3dnowext 3dnowprefetch abm ace2 ace2-en acpi adx aes apic arat avx
     avx2 avx512-4fmaps avx512-4vnniw avx512-vpopcntdq avx512bitalg avx512bw
     avx512cd avx512dq avx512er avx512f avx512ifma avx512pf avx512vbmi
     avx512vbmi2 avx512vl avx512vnni bmi1 bmi2 cid clflush clflushopt clwb
     cmov cmp-legacy cr8legacy cx16 cx8 dca de decodeassists ds ds-cpl dtes64
     erms est extapic f16c flushbyasid fma fma4 fpu fsgsbase fxsr fxsr-opt
     gfni hle ht hypervisor ia64 ibpb ibs intel-pt invpcid invtsc kvm-asyncpf
     kvm-hint-dedicated kvm-mmu kvm-nopiodelay kvm-pv-eoi kvm-pv-tlb-flush
     kvm-pv-unhalt kvm-steal-time kvmclock kvmclock kvmclock-stable-bit la57
     lahf-lm lbrv lm lwp mca mce misalignsse mmx mmxext monitor movbe mpx msr
     mtrr nodeid-msr npt nrip-save nx ospke osvw osxsave pae pat pause-filter
     pbe pcid pclmulqdq pcommit pdcm pdpe1gb perfctr-core perfctr-nb
     pfthreshold pge phe phe-en pku pmm pmm-en pn pni popcnt pse pse36 rdpid
     rdrand rdseed rdtscp rtm sep sha-ni skinit smap smep smx spec-ctrl ss sse
     sse2 sse4.1 sse4.2 sse4a ssse3 svm svm-lock syscall tbm tce tm tm2
     topoext tsc tsc-adjust tsc-deadline tsc-scale umip vaes vmcb-clean vme
     vmx vpclmulqdq wdt x2apic xcrypt xcrypt-en xgetbv1 xop xsave xsavec
     xsaveopt xsaves xstore xstore-en xtpr

One possible change, that I didn't include in patch 2, is to sort the
CPU model names case insensitively. That would be a more natural way of
doing alphabetical sorting for human output. The flip side is that it is
quite nice that the "modern" CPU models are all upper case and so appear
"first" in the listing. Except "486" is first no matter what. Ho, Hum.

Daniel P. Berrangé (3):
  i386: improve alignment of CPU model listing
  i386: improve sorting of CPU model names
  i386: display known CPUID features linewrapped, in alphabetical order

 target/i386/cpu.c | 57 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 37 insertions(+), 20 deletions(-)

-- 
2.17.0


Re: [Qemu-devel] [PATCH 0/3] i386: improve output from "-cpu help" argument
Posted by Eduardo Habkost 5 years, 10 months ago
On Wed, Jun 06, 2018 at 05:55:24PM +0100, Daniel P. Berrangé wrote:
> This short series is a set of improvements to the "-cpu help" output for
> the x86 emulator. The patches describe what's change in each step, but
> it is best visualized by looking at before/after state.
[...]

Queue on x86-next, thanks!

-- 
Eduardo

Re: [Qemu-devel] [PATCH 0/3] i386: improve output from "-cpu help" argument
Posted by Kashyap Chamarthy 5 years, 7 months ago
On Mon, Jun 11, 2018 at 06:23:11PM -0300, Eduardo Habkost wrote:
> On Wed, Jun 06, 2018 at 05:55:24PM +0100, Daniel P. Berrangé wrote:
> > This short series is a set of improvements to the "-cpu help" output for
> > the x86 emulator. The patches describe what's change in each step, but
> > it is best visualized by looking at before/after state.
> [...]
> 
> Queue on x86-next, thanks!

Hi,

A gentle reminder to merge this.  A few x86 pull requests have gone out,
but I don't see this change included.

Thanks!

-- 
/kashyap

Re: [Qemu-devel] [PATCH 0/3] i386: improve output from "-cpu help" argument
Posted by Kashyap Chamarthy 5 years, 7 months ago
On Tue, Sep 18, 2018 at 04:23:19PM +0200, Kashyap Chamarthy wrote:
> On Mon, Jun 11, 2018 at 06:23:11PM -0300, Eduardo Habkost wrote:
> > On Wed, Jun 06, 2018 at 05:55:24PM +0100, Daniel P. Berrangé wrote:
> > > This short series is a set of improvements to the "-cpu help" output for
> > > the x86 emulator. The patches describe what's change in each step, but
> > > it is best visualized by looking at before/after state.
> > [...]
> > 
> > Queue on x86-next, thanks!
> 
> Hi,
> 
> A gentle reminder to merge this.  A few x86 pull requests have gone out,
> but I don't see this change included.

Oeps, it's already merged.  I mixed up cover letter summary with
individual Git commit messages when looking at the output of `git log`.

Sorry for the noise.

-- 
/kashyap