[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h rem
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h removal |
Date: |
Tue, 19 Sep 2017 14:29:32 +0200 |
From: Roman Kagan <address@hidden>
All definitions related to Hyper-V emulation are now taken from the QEMU
own header, so the one imported from the kernel is no longer needed.
Unfortunately it's included by kvm_para.h.
So, until this is fixed in the kernel, teach the header harvesting
script to substitute kernel's hyperv.h with a dummy.
Signed-off-by: Roman Kagan <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/update-linux-headers.sh | 4 +++-
target/i386/hyperv-proto.h | 3 +++
target/i386/kvm.c | 17 +++++------------
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 2f906c4..ad80fe3 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -104,7 +104,9 @@ for arch in $ARCHLIST; do
cp "$tmpdir/include/asm/unistd-common.h"
"$output/linux-headers/asm-arm/"
fi
if [ $arch = x86 ]; then
- cp_portable "$tmpdir/include/asm/hyperv.h"
"$output/include/standard-headers/asm-x86/"
+ cat <<-EOF >"$output/include/standard-headers/asm-x86/hyperv.h"
+ /* this is a temporary placeholder until kvm_para.h stops including it
*/
+ EOF
cp "$tmpdir/include/asm/unistd_32.h" "$output/linux-headers/asm-x86/"
cp "$tmpdir/include/asm/unistd_x32.h" "$output/linux-headers/asm-x86/"
cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x86/"
diff --git a/target/i386/hyperv-proto.h b/target/i386/hyperv-proto.h
index 1b3fa6e..cb4d7f2 100644
--- a/target/i386/hyperv-proto.h
+++ b/target/i386/hyperv-proto.h
@@ -34,6 +34,8 @@
#define HV_VP_INDEX_AVAILABLE (1u << 6)
#define HV_RESET_AVAILABLE (1u << 7)
#define HV_REFERENCE_TSC_AVAILABLE (1u << 9)
+#define HV_ACCESS_FREQUENCY_MSRS (1u << 11)
+
/*
* HV_CPUID_FEATURES.EDX bits
@@ -44,6 +46,7 @@
#define HV_CPU_DYNAMIC_PARTITIONING_AVAILABLE (1u << 3)
#define HV_HYPERCALL_PARAMS_XMM_AVAILABLE (1u << 4)
#define HV_GUEST_IDLE_STATE_AVAILABLE (1u << 5)
+#define HV_FREQUENCY_MSRS_AVAILABLE (1u << 8)
#define HV_GUEST_CRASH_MSR_AVAILABLE (1u << 10)
/*
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 0498ab7..b1e32e9 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -639,21 +639,14 @@ static int hyperv_handle_properties(CPUState *cs)
env->features[FEAT_HYPERV_EAX] |= HV_APIC_ACCESS_AVAILABLE;
}
if (cpu->hyperv_time) {
-<<<<<<< HEAD
- env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE;
- env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_TIME_REF_COUNT_AVAILABLE;
- env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_REFERENCE_TSC_AVAILABLE;
-
- if (has_msr_hv_frequencies && tsc_is_stable_and_known(env)) {
- env->features[FEAT_HYPERV_EAX] |= HV_X64_ACCESS_FREQUENCY_MSRS;
- env->features[FEAT_HYPERV_EDX] |=
- HV_FEATURE_FREQUENCY_MSRS_AVAILABLE;
- }
-=======
env->features[FEAT_HYPERV_EAX] |= HV_HYPERCALL_AVAILABLE;
env->features[FEAT_HYPERV_EAX] |= HV_TIME_REF_COUNT_AVAILABLE;
env->features[FEAT_HYPERV_EAX] |= HV_REFERENCE_TSC_AVAILABLE;
->>>>>>> hyperv: add header with protocol definitions
+
+ if (has_msr_hv_frequencies && tsc_is_stable_and_known(env)) {
+ env->features[FEAT_HYPERV_EAX] |= HV_ACCESS_FREQUENCY_MSRS;
+ env->features[FEAT_HYPERV_EDX] |= HV_FREQUENCY_MSRS_AVAILABLE;
+ }
}
if (cpu->hyperv_crash && has_msr_hv_crash) {
env->features[FEAT_HYPERV_EDX] |= HV_GUEST_CRASH_MSR_AVAILABLE;
--
1.8.3.1
- [Qemu-devel] [PULL 26/50] kvm: require JOIN_MEMORY_REGIONS_WORKS, (continued)
- [Qemu-devel] [PULL 26/50] kvm: require JOIN_MEMORY_REGIONS_WORKS, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 23/50] memory: Rename queue to mrqueue (memory region queue), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 13/50] scsi: move non-emulation specific code to scsi/, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 33/50] hw/i386: Improve some of the warning messages, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 35/50] Convert single line fprintf(.../n) to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 38/50] target/mips: Convert VM clock update prints to warn_report, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 36/50] Convert multi-line fprintf() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 34/50] Convert remaining error_report() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 42/50] hyperv: add header with protocol definitions, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 37/50] General warn report fixups, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h removal,
Paolo Bonzini <=
- [Qemu-devel] [PULL 41/50] i386/cpu/hyperv: support over 64 vcpus for windows guests, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 45/50] target/i386: fix "info mem" for LA57 mode, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 39/50] Makefile: Remove libqemustub.a, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 40/50] Convert remaining single line fprintf() to warn_report(), Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 44/50] scripts: let checkpatch.pl process an entire GIT branch, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 48/50] osdep.h: Prohibit disabling assert() in supported builds, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 46/50] accel/hax: move hax-stub.c to accel/stubs/, Paolo Bonzini, 2017/09/19
- [Qemu-devel] [PULL 50/50] docker: fix creation of archives, Paolo Bonzini, 2017/09/19