qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 81e207: target-i386: kvm_cpu_fill_host(): Kil


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 81e207: target-i386: kvm_cpu_fill_host(): Kill unused code
Date: Thu, 06 Feb 2014 16:30:05 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 81e207707e7b6204f64451779d752f23777ed451
      
https://github.com/qemu/qemu/commit/81e207707e7b6204f64451779d752f23777ed451
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_cpu_fill_host(): Kill unused code

Those host_cpuid() calls are useless. They are leftovers from when the
old code using host_cpuid() was removed.

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


  Commit: 7171a3933f2ee8cb984fd64c59ca081f39b943a4
      
https://github.com/qemu/qemu/commit/7171a3933f2ee8cb984fd64c59ca081f39b943a4
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_cpu_fill_host(): No need to check level

There's no need to check level (CPUID[0].EAX) before calling
kvm_arch_get_supported_cpuid(s, 0x7, 0, R_EBX), because:

 * The kernel won't return any entry for CPUID 7 if CPUID[0].EAX is < 7
   on the host (See kvm_dev_ioctl_get_cpuid() on the kernel code);
 * kvm_arch_get_supported_cpuid() will return 0 if no entry is returned
   by the kernel for the requested leaf.

This will simplify the kvm_cpu_fill_host() code a little.

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


  Commit: b73dcfb16fc894041de553ac9f98b9e1640fcf06
      
https://github.com/qemu/qemu/commit/b73dcfb16fc894041de553ac9f98b9e1640fcf06
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_cpu_fill_host(): No need to check CPU vendor

There's no need to check CPU vendor before calling
kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX), because:

 * The kernel won't return any entry for 0xC0000000 if host CPU vendor
   is not Centaur (See kvm_dev_ioctl_get_cpuid() on the kernel code);
 * kvm_arch_get_supported_cpuid() will return 0 if no entry is returned
   by the kernel for the requested leaf.

This will simplify the kvm_cpu_fill_host() code a little.

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


  Commit: 803a932706e3ba335d4c98f3577a05cb000f1699
      
https://github.com/qemu/qemu/commit/803a932706e3ba335d4c98f3577a05cb000f1699
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_cpu_fill_host(): No need to check xlevel2

There's no need to check CPU xlevel2 before calling
kvm_arch_get_supported_cpuid(s, 0xC0000001, 0, R_EDX), because:

 * The kernel won't return any entry for 0xC0000000 if host CPU vendor
   is not Centaur (See kvm_dev_ioctl_get_supported_cpuid() on the kernel
   code)
 * Similarly, the kernel won't return any entry for 0xC0000001 if
   CPUID[0xC0000000].EAX is < 0xC0000001
 * kvm_arch_get_supported_cpuid() will return 0 if no entry is returned
   by the kernel for the requested leaf

For similar reasons, we can simply set x86_cpu_def->xlevel2 directly
instead of making it conditional, because it will be set to 0 CPU vendor
is not Centaur.

This will simplify the kvm_cpu_fill_host() code a little.

Signed-off-by: Eduardo Habkost <address@hidden>
[Remove unparseable comment. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 2a573259ebf8b1072707257d547603520d1ed236
      
https://github.com/qemu/qemu/commit/2a573259ebf8b1072707257d547603520d1ed236
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_cpu_fill_host(): Set all feature words at end of function

Reorder the code so all the code that sets x86_cpu_def->features is at
the end of the function.

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


  Commit: 2bc65d2b020887da3eb9043ae4f7d133ed85a7fe
      
https://github.com/qemu/qemu/commit/2bc65d2b020887da3eb9043ae4f7d133ed85a7fe
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_cpu_fill_host(): Fill feature words in a loop

Now that the kvm_cpu_fill_host() code is simplified, we can simply set
the feature word array using a simple loop.

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


  Commit: f0b9b11164482a8a2283dee25cecc4a4c531259e
      
https://github.com/qemu/qemu/commit/f0b9b11164482a8a2283dee25cecc4a4c531259e
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: kvm_check_features_against_host(): Kill feature word array

We don't need the ft[] array on kvm_check_features_against_host()
anymore, as we can simply use the feature_word_info[] array, that has
everything we need.

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


  Commit: 977c7b6d8909464eb3a510829f534451d0adb227
      
https://github.com/qemu/qemu/commit/977c7b6d8909464eb3a510829f534451d0adb227
  Author: Radim Krčmář <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M kvm-all.c

  Log Message:
  -----------
  kvm: print suberror on all internal errors

KVM introduced internal error exit reason and suberror at the same time,
and later extended it with internal error data.
QEMU does not report suberror on hosts between these two events because
we check for the extension. (half a year in 2009, but it is misleading)

Fix by removing KVM_CAP_INTERNAL_ERROR_DATA condition on printf.

(partially improved by bb44e0d12df70 and ba4047cf848a3 in the past)

Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 234cc64796557eea829544e4ff72ee99b6149187
      
https://github.com/qemu/qemu/commit/234cc64796557eea829544e4ff72ee99b6149187
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  KVM: fix coexistence of KVM and Hyper-V leaves

kvm_arch_init_vcpu's initialization of the KVM leaves at 0x40000100
is broken, because KVM_CPUID_FEATURES is left at 0x40000001.  Move
it to 0x40000101 if Hyper-V is enabled.

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


  Commit: 7bc3d711b45d6feacab96eda410c5655f4ddafcf
      
https://github.com/qemu/qemu/commit/7bc3d711b45d6feacab96eda410c5655f4ddafcf
  Author: Paolo Bonzini <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  kvm: make availability of Hyper-V enlightenments dependent on KVM_CAP_HYPERV

The MS docs specify HV_X64_MSR_HYPERCALL as a mandatory interface,
thus we must provide the MSRs even if the user only specified
features that, like relaxed timing, in principle don't require them.
And the MSRs are only there if the hypervisor has KVM_CAP_HYPERV.

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


  Commit: 1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac
      
https://github.com/qemu/qemu/commit/1c90ef2619dd6e5c4fec7e9e18c04c0a08e93aac
  Author: Vadim Rozenfeld <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

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

  Log Message:
  -----------
  kvm: make hyperv hypercall and guest os id MSRs migratable.

Signed-off-by: Vadim Rozenfeld <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 5ef68987e5671edf5f51f845d1bbf3e5759a8526
      
https://github.com/qemu/qemu/commit/5ef68987e5671edf5f51f845d1bbf3e5759a8526
  Author: Vadim Rozenfeld <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

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

  Log Message:
  -----------
  kvm: make hyperv vapic assist page migratable

Signed-off-by: Vadim Rozenfeld <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 48a5f3bcbbbe59a3120a39106bfda59fd1933fbc
      
https://github.com/qemu/qemu/commit/48a5f3bcbbbe59a3120a39106bfda59fd1933fbc
  Author: Vadim Rozenfeld <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M linux-headers/asm-x86/hyperv.h
    M linux-headers/linux/kvm.h
    M target-i386/cpu-qom.h
    M target-i386/cpu.c
    M target-i386/cpu.h
    M target-i386/kvm.c
    M target-i386/machine.c

  Log Message:
  -----------
  kvm: add support for hyper-v timers

http://msdn.microsoft.com/en-us/library/windows/hardware/ff541625%28v=vs.85%29.aspx

This code is generic for activating reference time counter or virtual reference 
time stamp counter

Signed-off-by: Vadim Rozenfeld <address@hidden>
Reviewed-by: Marcelo Tosatti <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c1f412260b4e0f309dba8da99482fb32d6098719
      
https://github.com/qemu/qemu/commit/c1f412260b4e0f309dba8da99482fb32d6098719
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Eliminate CONFIG_KVM #ifdefs

The compiler is already able to eliminate the kvm_arch_get_supported_cpuid()
calls in kvm_cpu_fill_host() and filter_features_for_kvm(), so we can
eliminate the CONFIG_KVM #ifdefs there.

Also, kvm_cpu_fill_host() and host_cpuid() don't need to check
CONFIG_KVM, as they don't have any KVM-specific function calls.

Tested to build successfully with CONFIG_KVM disabled, using the
following CFLAGS combinations: "-DNDEBUG", "-DNDEBUG -O', "-DNDEBUG
-O0", "-DNDEBUG -O1", "-DNDEBUG -O2".

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


  Commit: 82beb53633246d67d4b01a5e802f9edc80332f9d
      
https://github.com/qemu/qemu/commit/82beb53633246d67d4b01a5e802f9edc80332f9d
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Don't change x86_def_t struct on cpu_x86_register()

As eventually the x86_def_t data is going to be provided by the CPU
class, it's better to not touch it, and handle the special cases on the
X86CPU object itself.

Current behavior of the code should stay exactly the same.

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


  Commit: 7c08db30e6a43f7083a881eb07bfbc878e001e08
      
https://github.com/qemu/qemu/commit/7c08db30e6a43f7083a881eb07bfbc878e001e08
  Author: Eduardo Habkost <address@hidden>
  Date:   2014-02-03 (Mon, 03 Feb 2014)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Move KVM default-vendor hack to instance_init

As we will not have a cpu_x86_find_by_name() function anymore,
move the KVM default-vendor hack to instance_init.

Unfortunately we can't move that code to class_init because it depends
on KVM being initialized.

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


  Commit: bc1c72171ceb9a817138603fe381d64e7f8a9364
      
https://github.com/qemu/qemu/commit/bc1c72171ceb9a817138603fe381d64e7f8a9364
  Author: Peter Maydell <address@hidden>
  Date:   2014-02-06 (Thu, 06 Feb 2014)

  Changed paths:
    M kvm-all.c
    M linux-headers/asm-x86/hyperv.h
    M linux-headers/linux/kvm.h
    M target-i386/cpu-qom.h
    M target-i386/cpu.c
    M target-i386/cpu.h
    M target-i386/kvm.c
    M target-i386/machine.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kvm/uq/master' into staging

* remotes/kvm/uq/master:
  target-i386: Move KVM default-vendor hack to instance_init
  target-i386: Don't change x86_def_t struct on cpu_x86_register()
  target-i386: Eliminate CONFIG_KVM #ifdefs
  kvm: add support for hyper-v timers
  kvm: make hyperv vapic assist page migratable
  kvm: make hyperv hypercall and guest os id MSRs migratable.
  kvm: make availability of Hyper-V enlightenments dependent on KVM_CAP_HYPERV
  KVM: fix coexistence of KVM and Hyper-V leaves
  kvm: print suberror on all internal errors
  target-i386: kvm_check_features_against_host(): Kill feature word array
  target-i386: kvm_cpu_fill_host(): Fill feature words in a loop
  target-i386: kvm_cpu_fill_host(): Set all feature words at end of function
  target-i386: kvm_cpu_fill_host(): No need to check xlevel2
  target-i386: kvm_cpu_fill_host(): No need to check CPU vendor
  target-i386: kvm_cpu_fill_host(): No need to check level
  target-i386: kvm_cpu_fill_host(): Kill unused code

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


Compare: https://github.com/qemu/qemu/compare/26530780c20e...bc1c72171ceb

reply via email to

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