All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/3] arm64: kvm: support kvmtool to detect RAS extension feature
@ 2017-04-30  5:37 ` Dongjiu Geng
  0 siblings, 0 replies; 63+ messages in thread
From: Dongjiu Geng @ 2017-04-30  5:37 UTC (permalink / raw)
  To: james.morse, marc.zyngier, christoffer.dall, rkrcmar, linux,
	tbaicar, imammedo, zhaoshenglong, peter.maydell, pbonzini,
	qemu-devel, qemu-arm, lersek, ard.biesheuvel, mtsirkin, drjones,
	ben, kvm, linux-arm-kernel, kvmarm
  Cc: songwenjun, wuquanming, gengdongjiu, huangshaoyu, wangxiongfeng2

Handle kvmtool's detection for RAS extension, because sometimes
the APP needs to know the CPU's capacity

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
---
 arch/arm64/kvm/reset.c   | 11 +++++++++++
 include/uapi/linux/kvm.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index d9e9697..1004039 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -64,6 +64,14 @@ static bool cpu_has_32bit_el1(void)
 	return !!(pfr0 & 0x20);
 }
 
+static bool kvm_arm_support_ras_extension(void)
+{
+	u64 pfr0;
+
+	pfr0 = read_system_reg(SYS_ID_AA64PFR0_EL1);
+	return !!(pfr0 & 0x10000000);
+}
+
 /**
  * kvm_arch_dev_ioctl_check_extension
  *
@@ -87,6 +95,9 @@ int kvm_arch_dev_ioctl_check_extension(struct kvm *kvm, long ext)
 	case KVM_CAP_ARM_PMU_V3:
 		r = kvm_arm_support_pmu_v3();
 		break;
+	case KVM_CAP_ARM_RAS_EXTENSION:
+		r = kvm_arm_support_ras_extension();
+		break;
 	case KVM_CAP_SET_GUEST_DEBUG:
 	case KVM_CAP_VCPU_ATTRIBUTES:
 		r = 1;
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index f51d508..27fe556 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -883,6 +883,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_PPC_MMU_RADIX 134
 #define KVM_CAP_PPC_MMU_HASH_V3 135
 #define KVM_CAP_IMMEDIATE_EXIT 136
+#define KVM_CAP_ARM_RAS_EXTENSION 137
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2017-06-26  5:30 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-30  5:37 [PATCH v3 1/3] arm64: kvm: support kvmtool to detect RAS extension feature Dongjiu Geng
2017-04-30  5:37 ` Dongjiu Geng
2017-04-30  5:37 ` Dongjiu Geng
2017-04-30  5:37 ` [Qemu-devel] " Dongjiu Geng
2017-04-30  5:37 ` [PATCH v3 2/3] arm64: kvm: inject SError with virtual syndrome Dongjiu Geng
2017-04-30  5:37   ` Dongjiu Geng
2017-04-30  5:37   ` Dongjiu Geng
2017-04-30  5:37   ` [Qemu-devel] " Dongjiu Geng
2017-05-02  8:03   ` Christoffer Dall
2017-05-02  8:03     ` Christoffer Dall
2017-05-02  8:03     ` [Qemu-devel] " Christoffer Dall
2017-05-02 12:20     ` gengdongjiu
2017-05-02 12:20       ` gengdongjiu
2017-05-02 12:20       ` [Qemu-devel] " gengdongjiu
2017-05-02 12:20       ` gengdongjiu
2017-05-02 15:37   ` James Morse
2017-05-02 15:37     ` James Morse
2017-05-02 15:37     ` [Qemu-devel] " James Morse
2017-05-05 13:19     ` gengdongjiu
2017-05-05 13:19       ` gengdongjiu
2017-05-05 13:19       ` [Qemu-devel] " gengdongjiu
2017-05-12 17:24       ` James Morse
2017-05-12 17:24         ` James Morse
2017-05-12 17:24         ` [Qemu-devel] " James Morse
2017-05-21  9:08         ` gengdongjiu
2017-05-21  9:08           ` gengdongjiu
2017-05-21  9:08           ` [Qemu-devel] " gengdongjiu
2017-04-30  5:37 ` [PATCH v3 3/3] arm/arm64: signal SIBGUS and inject SEA Error Dongjiu Geng
2017-04-30  5:37   ` Dongjiu Geng
2017-04-30  5:37   ` Dongjiu Geng
2017-04-30  5:37   ` [Qemu-devel] " Dongjiu Geng
2017-05-02 15:41   ` James Morse
2017-05-02 15:41     ` James Morse
2017-05-02 15:41     ` [Qemu-devel] " James Morse
2017-05-02  7:56 ` [PATCH v3 1/3] arm64: kvm: support kvmtool to detect RAS extension feature Christoffer Dall
2017-05-02  7:56   ` Christoffer Dall
2017-05-02  7:56   ` [Qemu-devel] " Christoffer Dall
2017-05-02 11:05   ` gengdongjiu
2017-05-02 11:05     ` gengdongjiu
2017-05-02 11:05     ` gengdongjiu
2017-05-02 11:05     ` [Qemu-devel] " gengdongjiu
2017-05-02 12:15   ` gengdongjiu
2017-05-02 12:15     ` gengdongjiu
2017-05-02 12:15     ` gengdongjiu
2017-05-02 12:15     ` [Qemu-devel] " gengdongjiu
2017-05-02 15:48   ` Paolo Bonzini
2017-05-02 15:48     ` Paolo Bonzini
2017-05-02 15:48     ` [Qemu-devel] " Paolo Bonzini
2017-05-04  8:19     ` James Morse
2017-05-04  8:19       ` James Morse
2017-05-04  8:19       ` [Qemu-devel] " James Morse
2017-05-02 15:29 ` James Morse
2017-05-02 15:29   ` James Morse
2017-05-02 15:29   ` [Qemu-devel] " James Morse
2017-05-04 15:49   ` James Morse
2017-05-04 15:49     ` James Morse
2017-05-04 15:49     ` [Qemu-devel] " James Morse
2017-05-05 12:44     ` gengdongjiu
2017-05-05 12:44       ` gengdongjiu
2017-05-05 12:44       ` [Qemu-devel] " gengdongjiu
2017-06-26  5:22   ` gengdongjiu
2017-06-26  5:22     ` gengdongjiu
2017-06-26  5:22     ` [Qemu-devel] " gengdongjiu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.