From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:c345:0:0:0:0:0 with SMTP id t66csp281538lff; Tue, 10 Dec 2019 23:58:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzBXBZuiVYhxkbvVjuDNau5ATWP/Mlj6xVUS0p0jvvqZWqYJWKmA9aLrs8t0gUFR4Zq1KJB X-Received: by 2002:a05:6830:124b:: with SMTP id s11mr1273196otp.333.1576051136642; Tue, 10 Dec 2019 23:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576051136; cv=none; d=google.com; s=arc-20160816; b=0ydA4i4f+0GTFLqtVQrJ1TJzyECVLSRobfwtuOqKntZw/SX4zFyHTY/5zQP2oUOpCs eLuRGcceBgmcTW6N8RY1nvOePyiB8rR+aARArOh6HzBhx290LD2DiMLLb4r4bGTVwfjy DIYXL2AnapzKk+cjdcQqJsxBi7Ae8PtXib/NZFzcoxOH51chqd0GU+YfawdZTd9hMT0k F4FzmhZUOQoy6YWo5b7HNXN6/asLFnUH64oTy/0XRl8UMOQy30mTwZCWV2v++n1ogADN udeIc7ohMZDtexCUtT8jEbIZAIrQDZ2+7SoYLm0+t9MQ/Og5JVMW/Az0fTjPN2d6pvPz /6cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:subject:to:from:date :dkim-signature; bh=JDT20aKapIGgJpnIA22MqTVehQMyQBhxq1PMqwGtE3M=; b=giiWyJjMehQgw0mrhc84qxtjspPBVT+2f+3rDXRGYwZrdBAOcEHgyTGgpG8fXNfWse WTw6I22OJZbuA8tJshVtmkoWHnWyg0A/l8g3Xn8ohVczrVQN6Ix4OxwR06F7vKGeZxXG xzuSdr82ULM13vhTXEwejmN+GWViun4HjhvBdOR53sUHtQbL/h0SYRT72eZsJo257A4d pSvBCyiV/BL06agku1Au6q0CkqUp42NufkTe3jQ/7CuX3z45m20CUfEd5FGpifm8cMKN /hcXc6mC1espCHIgI1ApjyQ3UJ0M2q5eQ8f5A7VH19hqZYJ/ulVPCukwld4/WJnK1jzK R9UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=J+Kdknet; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k17si679497oiw.238.2019.12.10.23.58.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2019 23:58:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=J+Kdknet; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:39674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iewtb-0001ta-Ra for alex.bennee@linaro.org; Wed, 11 Dec 2019 02:58:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58963) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iewsP-00010P-Lt for qemu-devel@nongnu.org; Wed, 11 Dec 2019 02:57:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iewsO-0000Dx-9z for qemu-devel@nongnu.org; Wed, 11 Dec 2019 02:57:41 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:49579 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iewsO-0000Bo-4u for qemu-devel@nongnu.org; Wed, 11 Dec 2019 02:57:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576051059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JDT20aKapIGgJpnIA22MqTVehQMyQBhxq1PMqwGtE3M=; b=J+KdknetLJEKZ/SdPEmNRRxISbSmL/3RQqWuocx9aw1hra1m1fYCnlK5vMO2gSK54alW++ f5KoM3RlhAIEfoJ4KFuosrcNC/7lmtRWSDbVAMUJbKOAAyEyorKfNdH2ip98X7Q0Bm2p2i CqZlZifsfH3Ibg4YgXxPE5O9dbWR9cE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-HMXTjCAgMHOkVVSiRx10uQ-1; Wed, 11 Dec 2019 02:57:36 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75A7F18543A0; Wed, 11 Dec 2019 07:57:34 +0000 (UTC) Received: from localhost (unknown [10.43.2.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1DAC60BAB; Wed, 11 Dec 2019 07:57:29 +0000 (UTC) Date: Wed, 11 Dec 2019 08:57:27 +0100 From: Igor Mammedov To: Shameerali Kolothum Thodi Subject: Re: [PATCH 0/5] ARM virt: Add NVDIMM support Message-ID: <20191211085727.1ab9564e@redhat.com> In-Reply-To: References: <20191004155302.4632-1-shameerali.kolothum.thodi@huawei.com> <441c818f24084b4191315cf2a6267cef@huawei.com> <20191125164541.3f0a593f@redhat.com> <444efcb441fe42e5aff58b3af3ab14b4@huawei.com> <20191126095655.27227f59@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: HMXTjCAgMHOkVVSiRx10uQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "peter.maydell@linaro.org" , "drjones@redhat.com" , "xiaoguangrong.eric@gmail.com" , Auger Eric , "qemu-devel@nongnu.org" , Linuxarm , "shannon.zhaosl@gmail.com" , "qemu-arm@nongnu.org" , "xuwei \(O\)" , "lersek@redhat.com" Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: uMgcX+w+X1kF On Mon, 9 Dec 2019 17:39:15 +0000 Shameerali Kolothum Thodi wrote: > Hi Igor/ xiaoguangrong, > > > -----Original Message----- > > From: Shameerali Kolothum Thodi > > Sent: 28 November 2019 12:36 > > To: 'Igor Mammedov' ; > > xiaoguangrong.eric@gmail.com > > Cc: peter.maydell@linaro.org; drjones@redhat.com; > > shannon.zhaosl@gmail.com; qemu-devel@nongnu.org; Linuxarm > > ; Auger Eric ; > > qemu-arm@nongnu.org; xuwei (O) ; > > lersek@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 > > > Cc: peter.maydell@linaro.org; drjones@redhat.com; > > > xiaoguangrong.eric@gmail.com; shannon.zhaosl@gmail.com; > > > qemu-devel@nongnu.org; Linuxarm ; Auger Eric > > > ; qemu-arm@nongnu.org; xuwei (O) > > > ; lersek@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. Sorry, I don't have capacity to debug this right now, but I'd prefer if 'why' question was answered first. Anyways, if something is unclear in how concrete AML code is build/works, feel free to ask and I'll try to explain and guide you. > Thanks, > Shameer > > >