cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 5763ad32288d76433b01ce87f75cbf886f6f0e20 Mon Sep 17 00:00:00 2001
9ae3a8
From: Andrew Jones <drjones@redhat.com>
9ae3a8
Date: Tue, 14 Jan 2014 09:26:23 +0100
9ae3a8
Subject: [PATCH 14/16] enable pvticketlocks by default
9ae3a8
9ae3a8
RH-Author: Andrew Jones <drjones@redhat.com>
9ae3a8
Message-id: <1389691583-3060-1-git-send-email-drjones@redhat.com>
9ae3a8
Patchwork-id: 56650
9ae3a8
O-Subject: [RHEL7.0 qemu-kvm PATCH] enable pvticketlocks by default
9ae3a8
Bugzilla: 1052340
9ae3a8
RH-Acked-by: Rik van Riel <riel@redhat.com>
9ae3a8
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
RHEL-only
9ae3a8
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1052340
9ae3a8
Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6860390
9ae3a8
9ae3a8
Let's turn pvticketlocks on by default. We need to get them more exposed
9ae3a8
if we're ever going to make a final decision about them being on/off.
9ae3a8
So we turn them on now, and if we'll have any issues during our
9ae3a8
pre-release testing, then we'll just revert this patch. Since this is
9ae3a8
something of a test patch, we leave it as RHEL only for now. We can post
9ae3a8
an upstream patch later when we're sure it's the right way to go.
9ae3a8
9ae3a8
We only enable by default on rhel7 for now, not rhel6 and earlier,
9ae3a8
although rhel6 kernels wouldn't enable it anyway, as they don't have
9ae3a8
pvticketlocks. Tested by me.
9ae3a8
9ae3a8
Signed-off-by: Andrew Jones <drjones@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc_piix.c | 2 ++
9ae3a8
 target-i386/cpu.c | 6 ++++++
9ae3a8
 target-i386/cpu.h | 1 +
9ae3a8
 3 files changed, 9 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc_piix.c |    2 ++
9ae3a8
 target-i386/cpu.c |    6 ++++++
9ae3a8
 target-i386/cpu.h |    1 +
9ae3a8
 3 files changed, 9 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
9ae3a8
index 76d6e93..2961bc8 100644
9ae3a8
--- a/hw/i386/pc_piix.c
9ae3a8
+++ b/hw/i386/pc_piix.c
9ae3a8
@@ -902,6 +902,8 @@ static void pc_init_rhel650(QEMUMachineInitArgs *args)
9ae3a8
     x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX,
9ae3a8
                                 0, CPUID_EXT2_RDTSCP);
9ae3a8
 
9ae3a8
+    disable_kvm_pv_unhalt();
9ae3a8
+
9ae3a8
     rom_file_in_ram = false; 
9ae3a8
     has_acpi_build = false;
9ae3a8
     pc_init_rhel700(args);
9ae3a8
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
9ae3a8
index 42105aa..2959915 100644
9ae3a8
--- a/target-i386/cpu.c
9ae3a8
+++ b/target-i386/cpu.c
9ae3a8
@@ -253,6 +253,7 @@ static uint32_t kvm_default_features = (1 << KVM_FEATURE_CLOCKSOURCE) |
9ae3a8
         (1 << KVM_FEATURE_ASYNC_PF) |
9ae3a8
         (1 << KVM_FEATURE_STEAL_TIME) |
9ae3a8
         (1 << KVM_FEATURE_PV_EOI) |
9ae3a8
+        (1 << KVM_FEATURE_PV_UNHALT) |
9ae3a8
         (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT);
9ae3a8
 
9ae3a8
 void disable_kvm_pv_eoi(void)
9ae3a8
@@ -260,6 +261,11 @@ void disable_kvm_pv_eoi(void)
9ae3a8
     kvm_default_features &= ~(1UL << KVM_FEATURE_PV_EOI);
9ae3a8
 }
9ae3a8
 
9ae3a8
+void disable_kvm_pv_unhalt(void)
9ae3a8
+{
9ae3a8
+    kvm_default_features &= ~(1UL << KVM_FEATURE_PV_UNHALT);
9ae3a8
+}
9ae3a8
+
9ae3a8
 void host_cpuid(uint32_t function, uint32_t count,
9ae3a8
                 uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
9ae3a8
 {
9ae3a8
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
9ae3a8
index 9c55953..37ff264 100644
9ae3a8
--- a/target-i386/cpu.h
9ae3a8
+++ b/target-i386/cpu.h
9ae3a8
@@ -1281,6 +1281,7 @@ void do_smm_enter(CPUX86State *env1);
9ae3a8
 void cpu_report_tpr_access(CPUX86State *env, TPRAccess access);
9ae3a8
 
9ae3a8
 void disable_kvm_pv_eoi(void);
9ae3a8
+void disable_kvm_pv_unhalt(void);
9ae3a8
 
9ae3a8
 void x86_cpu_compat_set_features(const char *cpu_model, FeatureWord w,
9ae3a8
                                  uint32_t feat_add, uint32_t feat_remove);
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8