[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 07/20] spapr: Add NVDIMM device support
From: |
Peter Maydell |
Subject: |
Re: [PULL 07/20] spapr: Add NVDIMM device support |
Date: |
Tue, 25 Feb 2020 10:00:01 +0000 |
On Fri, 21 Feb 2020 at 03:37, David Gibson <address@hidden> wrote:
>
> From: Shivaprasad G Bhat <address@hidden>
>
> Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm
> device interface in QEMU to support virtual NVDIMM devices for Power.
> Create the required DT entries for the device (some entries have
> dummy values right now).
> +void spapr_nvdimm_validate_opts(NVDIMMDevice *nvdimm, uint64_t size,
> + Error **errp)
> +{
> + char *uuidstr = NULL;
> + QemuUUID uuid;
> +
> + if (size % SPAPR_MINIMUM_SCM_BLOCK_SIZE) {
> + error_setg(errp, "NVDIMM memory size excluding the label area"
> + " must be a multiple of %" PRIu64 "MB",
> + SPAPR_MINIMUM_SCM_BLOCK_SIZE / MiB);
> + return;
> + }
> +
> + uuidstr = object_property_get_str(OBJECT(nvdimm), NVDIMM_UUID_PROP,
> NULL);
> + qemu_uuid_parse(uuidstr, &uuid);
> + g_free(uuidstr);
> +
> + if (qemu_uuid_is_null(&uuid)) {
> + error_setg(errp, "NVDIMM device requires the uuid to be set");
> + return;
> + }
> +}
Hi -- Coverity thinks (CID 1419883) that it's suspicious that
this code doesn't check the return value of qemu_uuid_parse(),
because we check it everywhere else that we call that function
(it can return a failure code if the UUID doesn't validly parse).
thanks
-- PMM
- [PULL 00/20] ppc-for-5.0 queue 20200221, David Gibson, 2020/02/20
- [PULL 04/20] ppc: function to setup latest class options, David Gibson, 2020/02/20
- [PULL 01/20] spapr/rtas: Print message from "ibm,os-term", David Gibson, 2020/02/20
- [PULL 03/20] ppc/pnv: Fix PCI_EXPRESS dependency, David Gibson, 2020/02/20
- [PULL 02/20] qtest: Fix rtas dependencies, David Gibson, 2020/02/20
- [PULL 05/20] mem: move nvdimm_device_list to utilities, David Gibson, 2020/02/20
- [PULL 08/20] spapr: Add Hcalls to support PAPR NVDIMM device, David Gibson, 2020/02/20
- [PULL 06/20] nvdimm: add uuid property to nvdimm, David Gibson, 2020/02/20
- [PULL 09/20] target/ppc/cpu.h: Remove duplicate includes, David Gibson, 2020/02/20
- [PULL 07/20] spapr: Add NVDIMM device support, David Gibson, 2020/02/20
- Re: [PULL 07/20] spapr: Add NVDIMM device support,
Peter Maydell <=
- [PULL 12/20] pnv/phb3: Add missing break statement, David Gibson, 2020/02/20
- [PULL 10/20] pnv/phb3: Convert 1u to 1ull, David Gibson, 2020/02/20
- [PULL 16/20] target/ppc/cpu.h: Clean up comments in the struct CPUPPCState definition, David Gibson, 2020/02/20
- [PULL 17/20] ppc: free 'fdt' after reset the machine, David Gibson, 2020/02/20
- [PULL 13/20] spapr: Allow changing offset for -kernel image, David Gibson, 2020/02/20
- [PULL 18/20] spapr: Don't use spapr_drc_needed() in CAS code, David Gibson, 2020/02/20
- [PULL 11/20] pnv/phb4: Fix error path in pnv_pec_realize(), David Gibson, 2020/02/20
- [PULL 14/20] target/ppc: Fix typo in comments, David Gibson, 2020/02/20
- [PULL 15/20] target/ppc/cpu.h: Move fpu related members closer in cpu env, David Gibson, 2020/02/20