From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vaibhav Jain Date: Tue, 30 Mar 2021 08:50:13 +0000 Subject: Re: [PATCH] ppc/spapr: Add support for implement support for H_SCM_HEALTH Message-Id: <87tuotox3e.fsf@vajain21.in.ibm.com> List-Id: References: <20210329162259.536964-1-vaibhav@linux.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Shivaprasad G Bhat , qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, mst@redhat.com, imammedo@redhat.com, xiaoguangrong.eric@gmail.com Cc: aneesh.kumar@linux.ibm.com, bharata@linux.vnet.ibm.com, shivaprasadbhat@gmail.com, ehabkost@redhat.com, groug@kaod.org Hi Shiva, Thanks for reviweing this patch. My responses inline below; Shivaprasad G Bhat writes: >> >> +static target_ulong h_scm_health(PowerPCCPU *cpu, SpaprMachineState *spapr, >> + target_ulong opcode, target_ulong *args) >> +{ >> + uint32_t drc_index = args[0]; >> + SpaprDrc *drc = spapr_drc_by_index(drc_index); >> + NVDIMMDevice *nvdimm; >> + >> + if (drc && spapr_drc_type(drc) != SPAPR_DR_CONNECTOR_TYPE_PMEM) { >> + return H_PARAMETER; >> + } >> + > > > Please check if drc->dev is not NULL too. DRCs are created in advance > > and drc->dev may not be assigned if the device is not plugged yet. > > Sure, will address that in v2 >> + nvdimm = NVDIMM(drc->dev); >> + >> + /* Check if the nvdimm is unarmed and send its status via health bitmaps */ >> + args[0] = nvdimm->unarmed ? PAPR_PMEM_UNARMED_MASK : 0; > > > Please use object_property_get_bool to fetch the unarmed value. > > Sure I will switch to object_property_get_bool in v2. However I see nvdimm->unarmed being accessed in similar manner in nvdimm_build_structure_memdev() which probably needs an update too. -- Cheers ~ Vaibhav