Hi Igor/ xiaoguangrong, > -----Original Message----- > From: Shameerali Kolothum Thodi > Sent: 28 November 2019 12:36 > To: 'Igor Mammedov' <imamm...@redhat.com>; > xiaoguangrong.e...@gmail.com > Cc: peter.mayd...@linaro.org; drjo...@redhat.com; > shannon.zha...@gmail.com; qemu-devel@nongnu.org; Linuxarm > <linux...@huawei.com>; Auger Eric <eric.au...@redhat.com>; > qemu-...@nongnu.org; xuwei (O) <xuw...@huawei.com>; > ler...@redhat.com > Subject: RE: [PATCH 0/5] ARM virt: Add NVDIMM support > > > > > -----Original Message----- > > From: Qemu-devel > > > [mailto:qemu-devel-bounces+shameerali.kolothum.thodi=huawei.com@nongn > > u.org] On Behalf Of Igor Mammedov > > Sent: 26 November 2019 08:57 > > To: Shameerali Kolothum Thodi <shameerali.kolothum.th...@huawei.com> > > Cc: peter.mayd...@linaro.org; drjo...@redhat.com; > > xiaoguangrong.e...@gmail.com; shannon.zha...@gmail.com; > > qemu-devel@nongnu.org; Linuxarm <linux...@huawei.com>; Auger Eric > > <eric.au...@redhat.com>; qemu-...@nongnu.org; xuwei (O) > > <xuw...@huawei.com>; ler...@redhat.com > > Subject: Re: [PATCH 0/5] ARM virt: Add NVDIMM support > > [..] > > > > > 0xb8 Dirty No. -->Another read is attempted > > > > > [Qemu]NVDIMM:nvdimm_dsm_func_read_fit: read_fit_out buf size 0x8 > > > > func_ret_status 3 --> Error status returned > > > > > > > > status 3 means that QEMU didn't like content of NRAM, and there is only > > > > 1 place like this in nvdimm_dsm_func_read_fit() > > > > if (read_fit->offset > fit->len) { > > > > func_ret_status = NVDIMM_DSM_RET_STATUS_INVALID; > > > > goto exit; > > > > } > > > > > > > > so I'd start looking from here and check that QEMU gets expected data > > > > in nvdimm_dsm_write(). In other words I'd try to trace/compare > > > > content of DSM buffer (from qemu side). > > > > > > I had printed the DSM buffer previously and it looked same, I will double > check > > > that. > > Tried printing the buffer in both Qemu/AML code. > > On Amr64,
[...] > Attached the SSDT.dsl used for debugging. I am still not clear why on ARM64, > 2nd iteration case, the created buffer size in NCAL and RFIT methods have > additional 4 bytes!. > > CreateField (ODAT, Zero, Local1, OBUF) > Concatenate (Buffer (Zero){}, OBUF, Local7) > > Please let me know if you have any clue. > I couldn't figure out yet, why this extra 4 bytes are added by aml code on ARM64 when the nvdimm_dsm_func_read_fit() returns NvdimmFuncReadFITOut without any FIT data. ie, when the FIT buffer len (read_len) is zero. But the below will fix this issue, diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index f91eea3802..cddf95f4c1 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -588,7 +588,7 @@ static void nvdimm_dsm_func_read_fit(NVDIMMState *state, NvdimmDsmIn *in, nvdimm_debug("Read FIT: offset %#x FIT size %#x Dirty %s.\n", read_fit->offset, fit->len, fit_buf->dirty ? "Yes" : "No"); - if (read_fit->offset > fit->len) { + if (read_fit->offset >= fit->len) { func_ret_status = NVDIMM_DSM_RET_STATUS_INVALID; goto exit; } This will return error code to aml in the second iteration when there is no further FIT data to report. But, I am not sure why this check was omitted in the first place. Please let me know if this is acceptable and then probably I can look into a v2 of this series. Thanks, Shameer