qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 045644: target-i386: Remove unused X86CPUDefi


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 045644: target-i386: Remove unused X86CPUDefinition::xleve...
Date: Tue, 27 Sep 2016 17:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0456441b5eb6694a561ad5bb8dad52483e6a08d0
      
https://github.com/qemu/qemu/commit/0456441b5eb6694a561ad5bb8dad52483e6a08d0
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Remove unused X86CPUDefinition::xlevel2 field

No CPU model in builtin_x86_defs has xlevel2 set, so it is always
zero. Delete the field.

Note that this is not an user-visible change. It doesn't remove
the ability to set xlevel2 on the command-line, it just removes
an unused field in builtin_x86_defs.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 5e992a8e337e710ea2d02f35668ac55a80e15f99
      
https://github.com/qemu/qemu/commit/5e992a8e337e710ea2d02f35668ac55a80e15f99
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Add a marker to end of the region zeroed on reset

Instead of using cpuid_level, use an empty struct as a marker
(like we already did with {start,end}_init_save). This will avoid
accidentaly resetting the wrong fields if we change the field
ordering on CPUX86State.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 6efef58ed151f75bca29561bde6b8a65db43d4a2
      
https://github.com/qemu/qemu/commit/6efef58ed151f75bca29561bde6b8a65db43d4a2
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M tests/.gitignore
    M tests/Makefile.include
    A tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  tests: Add test code for CPUID level/xlevel handling

Add test code that will check if the automatic CPUID level
changes are working as expected.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: df3e9af8fd02f22d03871975daa23ecbfcd48490
      
https://github.com/qemu/qemu/commit/df3e9af8fd02f22d03871975daa23ecbfcd48490
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  tests: Test CPUID level handling for old machines

We're going to change the way level/xlevel/xlevel2 are handled
when enabling features, but we need to keep the old behavior on
existing machine types. Add test cases for that.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: c39c0edf9bb3b968ba95484465a50c7b19f4aa3a
      
https://github.com/qemu/qemu/commit/c39c0edf9bb3b968ba95484465a50c7b19f4aa3a
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M include/hw/i386/pc.h
    M target-i386/cpu.c
    M target-i386/cpu.h
    M tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  target-i386: Automatically set level/xlevel/xlevel2 when needed

Instead of requiring users and management software to be aware of
required CPUID level/xlevel/xlevel2 values for each feature,
automatically increase those values when features need them.

This was already done for CPUID[7].EBX, and is now made generic
for all CPUID feature flags. Unit test included, to make sure we
don't break ABI on older machine-types and don't mess with the
CPUID level values if they are explicitly set by the user.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 0c3d7c0051576d220e6da0a8ac08f2d8482e2f0b
      
https://github.com/qemu/qemu/commit/0c3d7c0051576d220e6da0a8ac08f2d8482e2f0b
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c
    M tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  target-i386: Enable CPUID[0x8000000A] if SVM is enabled

SVM needs CPUID[0x8000000A] to be available. So if SVM is enabled
in a CPU model or explicitly in the command-line, adjust CPUID
xlevel to expose the CPUID[0x8000000A] leaf.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: eab60fb9f5e7bb6738b0619cfd0057d3a9d21330
      
https://github.com/qemu/qemu/commit/eab60fb9f5e7bb6738b0619cfd0057d3a9d21330
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M include/sysemu/cpus.h
    M target-i386/cpu.c
    M target-ppc/translate_init.c

  Log Message:
  -----------
  linux-user: remove #define smp_{cores, threads}

Those are unneeded now that CPUState nr_{cores,threads} is always
initialized.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2d5312da566e4424a807d078da05f92ee7be3eec
      
https://github.com/qemu/qemu/commit/2d5312da566e4424a807d078da05f92ee7be3eec
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Move feature name arrays inside FeatureWordInfo

It makes it easier to guarantee the arrays are the right size,
and to find information when looking at the code.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 9646f4927faf68e8690588c2fd6dc9834c440b58
      
https://github.com/qemu/qemu/commit/9646f4927faf68e8690588c2fd6dc9834c440b58
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Don't try to enable PT State xsave component

The code that calculates the set of supported XSAVE components on
CPUID looks at ext_save_areas to find out which components should
be enabled. However, if there are zeroed entries in the
ext_save_areas array, the
  ((env->features[esa->feature] & esa->bits) == esa->bits)
check will always succeed and QEMU will unconditionally try to
enable the component.

Luckily this never caused any problems because the only missing
entry in ext_save_areas is the PT State component (bit 8), and
KVM currently doesn't support it (so it was cleared on ena_mask).
But the code was still incorrect and would break if KVM starts
returning CPUID[EAX=0xD,ECX=0].EAX[bit 8] as supported on
GET_SUPPORTED_CPUID.

Fix the problem by changing the code to not enable a XSAVE
component if ExtSaveArea::bits is zero.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4928cd6de6b4211a79f98c8dc39115be1e815c2b
      
https://github.com/qemu/qemu/commit/4928cd6de6b4211a79f98c8dc39115be1e815c2b
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: xsave: Calculate enabled components only once

Instead of checking both env->features and ena_mask at two
different places in the CPUID code, initialize ena_mask based on
the features that are enabled for the CPU, and then clear
unsupported bits based on kvm_arch_get_supported_cpuid().

The results should be exactly the same, but it will make it
easier to move the mask calculation elsewhare, and reuse
x86_cpu_filter_features() for the kvm_arch_get_supported_cpuid()
check.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 8057c621b1b17cbcb35fe67d1a09ada9055873a9
      
https://github.com/qemu/qemu/commit/8057c621b1b17cbcb35fe67d1a09ada9055873a9
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: xsave: Simplify CPUID[0xD,0].{EAX,EDX} calculation

Instead of assigning individual bits in a loop, just copy the
values from ena_mask.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 1fda6198e4126af9988754c8824cfc9928649890
      
https://github.com/qemu/qemu/commit/1fda6198e4126af9988754c8824cfc9928649890
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: xsave: Helper function to calculate xsave area size

Move the xsave area size calculation from cpu_x86_cpuid() inside
its own function. While doing it, change it to use the XSAVE area
struct sizes for the initial size, instead of the magic 0x240
number.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2ca8a8becc2eeb5262e478ce502f5daa53f3d0bc
      
https://github.com/qemu/qemu/commit/2ca8a8becc2eeb5262e478ce502f5daa53f3d0bc
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: xsave: Calculate set of xsave components on realize

Instead of doing complex calculations and calling
kvm_arch_get_supported_cpuid() inside cpu_x86_cpuid(), calculate
the set of required XSAVE components earlier, at realize time.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 96193c22ab39ea24f81e386ad7883260ff24f5fd
      
https://github.com/qemu/qemu/commit/96193c22ab39ea24f81e386ad7883260ff24f5fd
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Move xsave component mask to features array

This will reuse the existing check/enforce logic in
x86_cpu_filter_features() to check the xsave component bits
against GET_SUPPORTED_CPUID.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 1eabfce6d53cb02066dbb0ac8471f8593ff24a24
      
https://github.com/qemu/qemu/commit/1eabfce6d53cb02066dbb0ac8471f8593ff24a24
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386: Remove has_msr_mtrr global variable

The global variable is not necessary because we can check the CPU
feature flags directly.

Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2d5aa8728bc7d98baceffcfa62c23e13abcec4eb
      
https://github.com/qemu/qemu/commit/2d5aa8728bc7d98baceffcfa62c23e13abcec4eb
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386: Remove has_msr_hv_apic global variable

The global variable is not necessary because we can check
cpu->hyperv_vapic directly.

Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 3ddcd2edc8ca708ccd808a78424b9aadebd4f7c4
      
https://github.com/qemu/qemu/commit/3ddcd2edc8ca708ccd808a78424b9aadebd4f7c4
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386: Remove has_msr_hv_tsc global variable

The global variable is not necessary because we can check
cpu->hyperv_time directly.

We just need to ensure cpu->hyperv_time will be cleared if the
feature is not really being exposed to the guest due to missing
KVM_CAP_HYPERV_TIME capability.

Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: aec661de86894e914d2d82431d9cefa9a9a40213
      
https://github.com/qemu/qemu/commit/aec661de86894e914d2d82431d9cefa9a9a40213
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Clear KVM CPUID features if KVM is disabled

This will ensure all checks for features[FEAT_KVM] in the code
will be correct in case the KVM CPUID leaf is completely
disabled.

Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 55c911a58069e3742d35462d8c4e961dd6a2ba93
      
https://github.com/qemu/qemu/commit/55c911a58069e3742d35462d8c4e961dd6a2ba93
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386: Remove has_msr_* global vars for KVM features

The global variables are not necessary because we can check KVM
feature flags in X86CPU directly.

Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4f01a637795af77f1c191230b9f6e3a2547b0c28
      
https://github.com/qemu/qemu/commit/4f01a637795af77f1c191230b9f6e3a2547b0c28
  Author: David Gibson <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M hw/arm/sysbus-fdt.c
    M hw/core/machine.c
    M hw/core/platform-bus.c
    M hw/ppc/e500.c
    M hw/ppc/spapr.c
    M include/hw/sysbus.h

  Log Message:
  -----------
  sysbus: Remove ignored return value of FindSysbusDeviceFunc

Functions of type FindSysbusDeviceFunc currently return an integer.
However, this return value is always ignored by the caller in
find_sysbus_device().

This changes the function type to return void, to avoid confusion over
the function semantics.

Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 25930ed60aad49f1fdd7de05272317c86ce1275b
      
https://github.com/qemu/qemu/commit/25930ed60aad49f1fdd7de05272317c86ce1275b
  Author: Peter Maydell <address@hidden>
  Date:   2016-09-27 (Tue, 27 Sep 2016)

  Changed paths:
    M hw/arm/sysbus-fdt.c
    M hw/core/machine.c
    M hw/core/platform-bus.c
    M hw/ppc/e500.c
    M hw/ppc/spapr.c
    M include/hw/i386/pc.h
    M include/hw/sysbus.h
    M include/sysemu/cpus.h
    M target-i386/cpu.c
    M target-i386/cpu.h
    M target-i386/kvm.c
    M target-ppc/translate_init.c
    M tests/.gitignore
    M tests/Makefile.include
    A tests/test-x86-cpuid-compat.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into 
staging

x86 and machine queue, 2016-09-27

# gpg: Signature made Tue 27 Sep 2016 21:10:06 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-pull-request:
  sysbus: Remove ignored return value of FindSysbusDeviceFunc
  target-i386: Remove has_msr_* global vars for KVM features
  target-i386: Clear KVM CPUID features if KVM is disabled
  target-i386: Remove has_msr_hv_tsc global variable
  target-i386: Remove has_msr_hv_apic global variable
  target-i386: Remove has_msr_mtrr global variable
  target-i386: Move xsave component mask to features array
  target-i386: xsave: Calculate set of xsave components on realize
  target-i386: xsave: Helper function to calculate xsave area size
  target-i386: xsave: Simplify CPUID[0xD,0].{EAX,EDX} calculation
  target-i386: xsave: Calculate enabled components only once
  target-i386: Don't try to enable PT State xsave component
  target-i386: Move feature name arrays inside FeatureWordInfo
  linux-user: remove #define smp_{cores, threads}
  target-i386: Enable CPUID[0x8000000A] if SVM is enabled
  target-i386: Automatically set level/xlevel/xlevel2 when needed
  tests: Test CPUID level handling for old machines
  tests: Add test code for CPUID level/xlevel handling
  target-i386: Add a marker to end of the region zeroed on reset
  target-i386: Remove unused X86CPUDefinition::xlevel2 field

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/333ec4ca6a9f...25930ed60aad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]