Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-10-31 12:36:54 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-10-31 23:28:39 +0100
commit83f89fa112263a74a0c9952b57931510e7f5c4e9 (patch)
treefc6e4393c43df3631bbbfc1d5410ab3442929d2c
parent4ea4c092f68a9c2561ed44b59c3692d5fe9ce022 (diff)
KVM: PPC: Book3S HV: Add 'online' register to ONE_REG interface
(bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-HV-Add-online-register-to-ONE_REG-int.patch76
-rw-r--r--series.conf1
2 files changed, 77 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-HV-Add-online-register-to-ONE_REG-int.patch b/patches.arch/KVM-PPC-Book3S-HV-Add-online-register-to-ONE_REG-int.patch
new file mode 100644
index 0000000000..b8cef6a08c
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-HV-Add-online-register-to-ONE_REG-int.patch
@@ -0,0 +1,76 @@
+From a1f158262a3e00fe396f2d21ef1cffdfc29226dc Mon Sep 17 00:00:00 2001
+From: Paul Mackerras <paulus@ozlabs.org>
+Date: Fri, 20 Apr 2018 15:33:21 +1000
+Subject: [PATCH] KVM: PPC: Book3S HV: Add 'online' register to ONE_REG
+ interface
+
+References: bsc#1061840
+Patch-mainline: v4.18-rc1
+Git-commit: a1f158262a3e00fe396f2d21ef1cffdfc29226dc
+
+This adds a new KVM_REG_PPC_ONLINE register which userspace can set
+to 0 or 1 via the GET/SET_ONE_REG interface to indicate whether it
+considers the VCPU to be offline (0), that is, not currently running,
+or online (1). This will be used in a later patch to configure the
+register which controls PURR and SPURR accumulation.
+
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/include/asm/kvm_host.h | 2 ++
+ arch/powerpc/include/uapi/asm/kvm.h | 1 +
+ arch/powerpc/kvm/book3s_hv.c | 6 ++++++
+ 3 files changed, 9 insertions(+)
+
+diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
+index 17498e9a26e4..9703f8f229c9 100644
+--- a/arch/powerpc/include/asm/kvm_host.h
++++ b/arch/powerpc/include/asm/kvm_host.h
+@@ -772,6 +772,8 @@ struct kvm_vcpu_arch {
+ u64 busy_preempt;
+
+ u32 emul_inst;
++
++ u32 online;
+ #endif
+
+ #ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h
+index 833ed9a16adf..1b32b56a03d3 100644
+--- a/arch/powerpc/include/uapi/asm/kvm.h
++++ b/arch/powerpc/include/uapi/asm/kvm.h
+@@ -633,6 +633,7 @@ struct kvm_ppc_cpu_char {
+ #define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd)
+
+ #define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)
++#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf)
+
+ /* Transactional Memory checkpointed state:
+ * This is all GPRs, all VSX regs and a subset of SPRs
+diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
+index 9963f65c212b..04bd71796098 100644
+--- a/arch/powerpc/kvm/book3s_hv.c
++++ b/arch/powerpc/kvm/book3s_hv.c
+@@ -1526,6 +1526,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
+ *val = get_reg_val(id, vcpu->arch.dec_expires +
+ vcpu->arch.vcore->tb_offset);
+ break;
++ case KVM_REG_PPC_ONLINE:
++ *val = get_reg_val(id, vcpu->arch.online);
++ break;
+ default:
+ r = -EINVAL;
+ break;
+@@ -1757,6 +1760,9 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
+ vcpu->arch.dec_expires = set_reg_val(id, *val) -
+ vcpu->arch.vcore->tb_offset;
+ break;
++ case KVM_REG_PPC_ONLINE:
++ vcpu->arch.online = set_reg_val(id, *val);
++ break;
+ default:
+ r = -EINVAL;
+ break;
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index 827b03b767..36f513c20c 100644
--- a/series.conf
+++ b/series.conf
@@ -16718,6 +16718,7 @@
patches.drivers/ALSA-usb-audio-Generic-DSD-detection-for-XMOS-based-
patches.drivers/ALSA-usb-audio-Remove-explicitly-listed-Mytek-device
patches.fixes/vhost-fix-info-leak-due-to-uninitialized-memory.patch
+ patches.arch/KVM-PPC-Book3S-HV-Add-online-register-to-ONE_REG-int.patch
patches.suse/ipv6-allow-PMTU-exceptions-to-local-routes.patch
patches.suse/net-dsa-add-error-handling-for-pskb_trim_rcsum.patch
patches.drivers/ixgbe-Fix-setting-of-TC-configuration-for-macvlan-ca.patch