[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/35] spapr: Don't allow multiple active vCPUs at CAS
From: |
David Gibson |
Subject: |
[PULL 09/35] spapr: Don't allow multiple active vCPUs at CAS |
Date: |
Mon, 3 Feb 2020 17:10:57 +1100 |
From: Greg Kurz <address@hidden>
According to the description of "ibm,client-architecture-support" that
can found in LoPAPR "B.6.2.3 Root Node Methods":
If multiple partition processors or threads are active at the time of
the ibm,client-architecture-support method call, or an error is detected
in the format of the ibm,architecture.vec structure, the err? boolean
shall be TRUE; else FALSE.
We certainly don't want to temper with the platform or with the PCR of
the other vCPUs if they happen to be active. Ensure we have only one
active vCPU and fail CAS otherwise. This is just for conformance and
robustness, it doesn't fix any known bugs.
Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_hcall.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index ffb14641f9..b8bb66b5c0 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1676,6 +1676,18 @@ static target_ulong
h_client_architecture_support(PowerPCCPU *cpu,
Error *local_err = NULL;
bool raw_mode_supported = false;
bool guest_xive;
+ CPUState *cs;
+
+ /* CAS is supposed to be called early when only the boot vCPU is active. */
+ CPU_FOREACH(cs) {
+ if (cs == CPU(cpu)) {
+ continue;
+ }
+ if (!cs->halted) {
+ warn_report("guest has multiple active vCPUs at CAS, which is not
allowed");
+ return H_MULTI_THREADS_ACTIVE;
+ }
+ }
cas_pvr = cas_check_pvr(spapr, cpu, &addr, &raw_mode_supported,
&local_err);
if (local_err) {
--
2.24.1
- [PULL 00/35] ppc-for-5.0 queue 20200203, David Gibson, 2020/02/03
- [PULL 01/35] ppc/pnv: use QEMU unit definition MiB, David Gibson, 2020/02/03
- [PULL 03/35] ppc:virtex_ml507: remove unused arguments, David Gibson, 2020/02/03
- [PULL 02/35] ppc/pnv: improve error logging when a PNOR update fails, David Gibson, 2020/02/03
- [PULL 06/35] spapr: Fail CAS if option vector table cannot be parsed, David Gibson, 2020/02/03
- [PULL 05/35] target/ppc: Clarify the meaning of return values in kvm_handle_debug, David Gibson, 2020/02/03
- [PULL 09/35] spapr: Don't allow multiple active vCPUs at CAS,
David Gibson <=
- [PULL 14/35] spapr: Implement get_dt_compatible() callback, David Gibson, 2020/02/03
- [PULL 08/35] target/ppc: add support for Hypervisor Facility Unavailable Exception, David Gibson, 2020/02/03
- [PULL 17/35] hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config, David Gibson, 2020/02/03
- [PULL 07/35] target/ppc: Add privileged message send facilities, David Gibson, 2020/02/03
- [PULL 11/35] ppc/pnv: remove useless "core-pir" property alias., David Gibson, 2020/02/03
- [PULL 10/35] ppc/pnv: Add support for HRMOR on Radix host, David Gibson, 2020/02/03
- [PULL 12/35] ppc/pnv: Add support for "hostboot" mode, David Gibson, 2020/02/03
- [PULL 13/35] tpm: Move tpm_tis_show_buffer to tpm_util.c, David Gibson, 2020/02/03
- [PULL 16/35] tpm_spapr: Support suspend and resume, David Gibson, 2020/02/03
- [PULL 22/35] spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine, David Gibson, 2020/02/03