[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/18] spapr_nvdimm.c: make 'label-size' mandatory
From: |
David Gibson |
Subject: |
[PULL 16/18] spapr_nvdimm.c: make 'label-size' mandatory |
Date: |
Thu, 7 May 2020 15:02:26 +1000 |
From: Daniel Henrique Barboza <address@hidden>
The pseries machine does not support NVDIMM modules without label.
Attempting to do so, even if the overall block size is aligned with
256MB, will seg fault the guest kernel during NVDIMM probe. This
can be avoided by forcing 'label-size' to always be present for
sPAPR NVDIMMs.
The verification was put before the alignment check because the
presence of label-size affects the alignment calculation, so
it's not optimal to warn the user about an alignment error,
then about the lack of label-size, then about a new alignment
error when the user sets a label-size.
Signed-off-by: Daniel Henrique Barboza <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_nvdimm.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c
index 25be8082d7..9abcdcc26b 100644
--- a/hw/ppc/spapr_nvdimm.c
+++ b/hw/ppc/spapr_nvdimm.c
@@ -37,6 +37,12 @@ void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm,
uint64_t size,
QemuUUID uuid;
int ret;
+ if (object_property_get_int(OBJECT(nvdimm), NVDIMM_LABEL_SIZE_PROP,
+ &error_abort) == 0) {
+ error_setg(errp, "NVDIMM device requires label-size to be set");
+ return;
+ }
+
if (size % SPAPR_MINIMUM_SCM_BLOCK_SIZE) {
error_setg(errp, "NVDIMM memory size excluding the label area"
" must be a multiple of %" PRIu64 "MB",
--
2.26.2
- [PULL 01/18] target/ppc: Improve syscall exception logging, (continued)
- [PULL 01/18] target/ppc: Improve syscall exception logging, David Gibson, 2020/05/07
- [PULL 04/18] ppc/pnv: Add support for NMI interface, David Gibson, 2020/05/07
- [PULL 02/18] spapr: Don't check capabilities removed between CAS calls, David Gibson, 2020/05/07
- [PULL 11/18] spapr: Don't allow unplug of NVLink2 devices, David Gibson, 2020/05/07
- [PULL 07/18] spapr: Drop CAS reboot flag, David Gibson, 2020/05/07
- [PULL 06/18] spapr/cas: Separate CAS handling from rebuilding the FDT, David Gibson, 2020/05/07
- [PULL 05/18] spapr: Simplify selection of radix/hash during CAS, David Gibson, 2020/05/07
- [PULL 09/18] target/ppc: Introduce a relocation bool in ppc_radix64_handle_mmu_fault(), David Gibson, 2020/05/07
- [PULL 15/18] target/ppc: Add support for Radix partition-scoped translation, David Gibson, 2020/05/07
- [PULL 08/18] target/ppc: Enforce that the root page directory size must be at least 5, David Gibson, 2020/05/07
- [PULL 16/18] spapr_nvdimm.c: make 'label-size' mandatory,
David Gibson <=
- [PULL 17/18] spapr_nvdimm: Tweak error messages, David Gibson, 2020/05/07
- [PULL 13/18] target/ppc: Extend ppc_radix64_check_prot() with a 'partition_scoped' bool, David Gibson, 2020/05/07
- [PULL 10/18] target/ppc: Assert if HV mode is set when running under a pseries machine, David Gibson, 2020/05/07
- [PULL 12/18] target/ppc: Introduce ppc_radix64_xlate() for Radix tree translation, David Gibson, 2020/05/07
- [PULL 14/18] target/ppc: Rework ppc_radix64_walk_tree() for partition-scoped translation, David Gibson, 2020/05/07
- [PULL 18/18] target-ppc: fix rlwimi, rlwinm, rlwnm for Clang-9, David Gibson, 2020/05/07
- Re: [PULL 00/18] ppc-for-5.1 queue 20200507, no-reply, 2020/05/07
- Re: [PULL 00/18] ppc-for-5.1 queue 20200507, Peter Maydell, 2020/05/07