aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-02-24 13:46:54 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-03-02 19:27:37 +0000
commitdc8bc9d6574aa563ed2fcc0ff495e77a2a2a8faa (patch)
treec48b0bedda4e049e8ac7630bbb09c814520d5f77 /hw
parentef56c2425e5f3e5f14ac080b5f037e5c36a0abdc (diff)
target/arm: Report KVM's actual PSCI version to guest in dtb
When we're using KVM, the PSCI implementation is provided by the kernel, but QEMU has to tell the guest about it via the device tree. Currently we look at the KVM_CAP_ARM_PSCI_0_2 capability to determine if the kernel is providing at least PSCI 0.2, but if the kernel provides a newer version than that we will still only tell the guest it has PSCI 0.2. (This is fairly harmless; it just means the guest won't use newer parts of the PSCI API.) The kernel exposes the specific PSCI version it is implementing via the ONE_REG API; use this to report in the dtb that the PSCI implementation is 1.0-compatible if appropriate. (The device tree binding currently only distinguishes "pre-0.2", "0.2-compatible" and "1.0-compatible".) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-id: 20220224134655.1207865-1-peter.maydell@linaro.org
Diffstat (limited to 'hw')
-rw-r--r--hw/arm/boot.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 0eeef94ceb..a47f38dfc9 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -488,9 +488,8 @@ static void fdt_add_psci_node(void *fdt)
}
qemu_fdt_add_subnode(fdt, "/psci");
- if (armcpu->psci_version == QEMU_PSCI_VERSION_0_2 ||
- armcpu->psci_version == QEMU_PSCI_VERSION_1_1) {
- if (armcpu->psci_version == QEMU_PSCI_VERSION_0_2) {
+ if (armcpu->psci_version >= QEMU_PSCI_VERSION_0_2) {
+ if (armcpu->psci_version < QEMU_PSCI_VERSION_1_0) {
const char comp[] = "arm,psci-0.2\0arm,psci";
qemu_fdt_setprop(fdt, "/psci", "compatible", comp, sizeof(comp));
} else {