From patchwork Thu Sep 1 03:27:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 12961700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79719ECAAD4 for ; Thu, 1 Sep 2022 03:29:36 +0000 (UTC) Received: from localhost ([::1]:56488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTatb-000275-EH for qemu-devel@archiver.kernel.org; Wed, 31 Aug 2022 23:29:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTaro-0008RN-CD for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:44 -0400 Received: from mga12.intel.com ([192.55.52.136]:17693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarl-0007uj-FC for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662002861; x=1693538861; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3HysGTG5BKJ/q3qUeWLum+k4xx1MNT2xlgtUg5jXhpQ=; b=VHNlX173U3f5Hoa5x1M1hE6cO2vtDrw6Et0aBSRb709En2hu/hnDaZNl sSkPnAqTKuU1xFIJYrrohde074c+se+hxqgjhifFr1kH6haqwb8NqBXji z9+bwn3VN22JK2Ht8QDfn1yIDaEfDJUw8jPML/d2oMbUrWuOnS5xGUNmX lrTKEGOu+LggQMOOn4lY1QI3cWJmC7dew058XmmGWfwmlYF076w+vamhb HEaS0Fx9EZ5WzHZQcKpMRN2ng6TY/RRww1hw5cOChPnU/9HNcu/pZNyVu FCyNuMVCZBPx1NrXJkiWJHd881cHM3Y7S8+fU+GsZIQJCQQ/8CtIVxJzd Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="275354004" X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="275354004" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 20:27:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="642142679" Received: from sqa-gate.sh.intel.com (HELO robert-clx2.tsp.org) ([10.239.48.212]) by orsmga008.jf.intel.com with ESMTP; 31 Aug 2022 20:27:28 -0700 From: Robert Hoo To: imammedo@redhat.com, mst@redhat.com, xiaoguangrong.eric@gmail.com, ani@anisinha.ca, dan.j.williams@intel.com, jingqi.liu@intel.com Cc: qemu-devel@nongnu.org, robert.hu@intel.com, Robert Hoo Subject: [PATCH v3 1/5] tests/acpi: allow SSDT changes Date: Thu, 1 Sep 2022 11:27:17 +0800 Message-Id: <20220901032721.1392482-2-robert.hu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901032721.1392482-1-robert.hu@linux.intel.com> References: <20220901032721.1392482-1-robert.hu@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=192.55.52.136; envelope-from=robert.hu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Robert Hoo Reviewed-by: Jingqi Liu --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..eb8bae1407 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,3 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/SSDT.dimmpxm", +"tests/data/acpi/q35/SSDT.dimmpxm", From patchwork Thu Sep 1 03:27:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 12961701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5AB1C0502C for ; Thu, 1 Sep 2022 03:29:36 +0000 (UTC) Received: from localhost ([::1]:56490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTatb-00027r-QV for qemu-devel@archiver.kernel.org; Wed, 31 Aug 2022 23:29:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarp-0008Re-GG for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:45 -0400 Received: from mga12.intel.com ([192.55.52.136]:17697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarn-0007w7-8l for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662002863; x=1693538863; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PsoLe8vgHzR+AwIMYbvv3iaU4zCz8BxOcycp5wGPxHg=; b=DUA0yIHcZVlrZ5DkzAYdKDfTVE/cnBFRH36UPxeX2ctqQf0prSfBqRzZ BtmTB4RXI3OuafGaNXW9WQC6aWLPRoCNgiK0Dzi4oA11fGb/WrkmaMewS arL3sZHBHS+cLqtuZWo4asBROHjM6z4Srz+tdNfPBHkYDNT8Sch84eN1G j9nRu5lauwHfj12OxdyUfCFYNRPuydGn2IUelnt4n2FD4jMYFxcD+XYDS J9FyL/vACKubEb83hw0TFgHaE/HYbC54SQUpOUfG1tnzWa0qlVB2Pgsvd zZfrcpVB9SZ7YUddlF0FmoiwCWZ6bfIMrh3qAltXP1yNWRrg0Cgr0L3lf g==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="275354010" X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="275354010" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 20:27:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="642142688" Received: from sqa-gate.sh.intel.com (HELO robert-clx2.tsp.org) ([10.239.48.212]) by orsmga008.jf.intel.com with ESMTP; 31 Aug 2022 20:27:31 -0700 From: Robert Hoo To: imammedo@redhat.com, mst@redhat.com, xiaoguangrong.eric@gmail.com, ani@anisinha.ca, dan.j.williams@intel.com, jingqi.liu@intel.com Cc: qemu-devel@nongnu.org, robert.hu@intel.com, Robert Hoo Subject: [PATCH v3 2/5] acpi/ssdt: Fix aml_or() and aml_and() in if clause Date: Thu, 1 Sep 2022 11:27:18 +0800 Message-Id: <20220901032721.1392482-3-robert.hu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901032721.1392482-1-robert.hu@linux.intel.com> References: <20220901032721.1392482-1-robert.hu@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=192.55.52.136; envelope-from=robert.hu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" In If condition, using bitwise and/or, rather than logical and/or. The result change in AML code: If (((Local6 == Zero) | (Arg0 != Local0))) ==> If (((Local6 == Zero) || (Arg0 != Local0))) If (((ObjectType (Arg3) == 0x04) & (SizeOf (Arg3) == One))) ==> If (((ObjectType (Arg3) == 0x04) && (SizeOf (Arg3) == One))) Fixes: 90623ebf603 ("nvdimm acpi: check UUID") Fixes: 4568c948066 ("nvdimm acpi: save arg3 of _DSM method") Signed-off-by: Robert Hoo Reviewed-by: Jingqi Liu Reviewed-by: Igor Mammedov --- hw/acpi/nvdimm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 31e46df0bd..201317c611 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -1037,7 +1037,7 @@ static void nvdimm_build_common_dsm(Aml *dev, uuid_invalid = aml_lnot(aml_equal(uuid, expected_uuid)); - unsupport = aml_if(aml_or(unpatched, uuid_invalid, NULL)); + unsupport = aml_if(aml_lor(unpatched, uuid_invalid)); /* * function 0 is called to inquire what functions are supported by @@ -1069,10 +1069,9 @@ static void nvdimm_build_common_dsm(Aml *dev, * in the DSM Spec. */ pckg = aml_arg(3); - ifctx = aml_if(aml_and(aml_equal(aml_object_type(pckg), + ifctx = aml_if(aml_land(aml_equal(aml_object_type(pckg), aml_int(4 /* Package */)) /* It is a Package? */, - aml_equal(aml_sizeof(pckg), aml_int(1)) /* 1 element? */, - NULL)); + aml_equal(aml_sizeof(pckg), aml_int(1)) /* 1 element? */)); pckg_index = aml_local(2); pckg_buf = aml_local(3); From patchwork Thu Sep 1 03:27:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 12961703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58554C0502C for ; Thu, 1 Sep 2022 03:34:25 +0000 (UTC) Received: from localhost ([::1]:42430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTayG-00066l-EV for qemu-devel@archiver.kernel.org; Wed, 31 Aug 2022 23:34:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarr-0008Sp-Ec for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:50 -0400 Received: from mga12.intel.com ([192.55.52.136]:17693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTaro-0007uj-KS for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662002864; x=1693538864; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HjBvEXpRDSUmainUOejjqublh4jt3/bIcS6XL2P8Pck=; b=gYC0RyY/fOWxYfLtsWkrFJBN5BTQ3Kqj4nSZrYRtX3j4p0diWXHldjWn L4mLwMEovhvIqcm6liJFqKzY1D0OufXQ0Ul02v+V0UoQHsFOqYR8jc1Yn uWYIcTKmqdh3jbv/frmBzhubsVQxvDj5BYbLpZ74QZ2PyyIOoAyJuTQc1 BSWJfo/AsWe50u4A9IK16tCX5i3eyIx/zVtzPV4dZxhvtF8WuMZkWknPr Ubw1+A/lBr0ruAIRoiALqfD8kHKdh04aWSTGUjs8WDWze447YFewE7WDk Xy84AmFWKtAy8zfiOyoDKyLawkgNtJ5aFxERQ2lD7fWUYravf3QQ8242m g==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="275354020" X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="275354020" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 20:27:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="642142700" Received: from sqa-gate.sh.intel.com (HELO robert-clx2.tsp.org) ([10.239.48.212]) by orsmga008.jf.intel.com with ESMTP; 31 Aug 2022 20:27:33 -0700 From: Robert Hoo To: imammedo@redhat.com, mst@redhat.com, xiaoguangrong.eric@gmail.com, ani@anisinha.ca, dan.j.williams@intel.com, jingqi.liu@intel.com Cc: qemu-devel@nongnu.org, robert.hu@intel.com, Robert Hoo Subject: [PATCH v3 3/5] acpi/nvdimm: define macro for NVDIMM Device _DSM Date: Thu, 1 Sep 2022 11:27:19 +0800 Message-Id: <20220901032721.1392482-4-robert.hu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901032721.1392482-1-robert.hu@linux.intel.com> References: <20220901032721.1392482-1-robert.hu@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=192.55.52.136; envelope-from=robert.hu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Since it will be heavily used in next patch, define macro NVDIMM_DEVICE_DSM_UUID for "4309AC30-0D11-11E4-9191-0800200C9A66", which is NVDIMM device specific method uuid defined in NVDIMM _DSM interface spec, Section 3. [1] No functional changes in this patch. [1] https://pmem.io/documents/IntelOptanePMem_DSM_Interface-V2.0.pdf Signed-off-by: Robert Hoo Reviewed-by: Jingqi Liu Reviewed-by: Igor Mammedov --- hw/acpi/nvdimm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 201317c611..afff911c1e 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -922,6 +922,7 @@ void nvdimm_init_acpi_state(NVDIMMState *state, MemoryRegion *io, #define NVDIMM_DSM_RFIT_STATUS "RSTA" #define NVDIMM_QEMU_RSVD_UUID "648B9CF2-CDA1-4312-8AD9-49C4AF32BD62" +#define NVDIMM_DEVICE_DSM_UUID "4309AC30-0D11-11E4-9191-0800200C9A66" static void nvdimm_build_common_dsm(Aml *dev, NVDIMMState *nvdimm_state) @@ -1029,8 +1030,7 @@ static void nvdimm_build_common_dsm(Aml *dev, /* UUID for QEMU internal use */), expected_uuid)); aml_append(elsectx, ifctx); elsectx2 = aml_else(); - aml_append(elsectx2, aml_store( - aml_touuid("4309AC30-0D11-11E4-9191-0800200C9A66") + aml_append(elsectx2, aml_store(aml_touuid(NVDIMM_DEVICE_DSM_UUID) /* UUID for NVDIMM Devices */, expected_uuid)); aml_append(elsectx, elsectx2); aml_append(method, elsectx); From patchwork Thu Sep 1 03:27:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 12961702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4CC7ECAAD1 for ; Thu, 1 Sep 2022 03:34:23 +0000 (UTC) Received: from localhost ([::1]:42420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTayE-00064k-ST for qemu-devel@archiver.kernel.org; Wed, 31 Aug 2022 23:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarq-0008SR-Oi for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:46 -0400 Received: from mga12.intel.com ([192.55.52.136]:17689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTaro-0007uc-P9 for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662002864; x=1693538864; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r41jw6gV8lsn24Xi4TOsG+w1pimVjPvASJ5XpcesKzE=; b=MSeswOrAyo09D+HOtBq8RhaC8leqTD923Xy7vCHGJate/bRRUcThIT74 y+STO4c5klSH+WTQhqfWYfa+k4kfjlifgR5kZPUqp7bOEwW6njklVz70+ XUfgI0ruFNlhw7C5Q0r/1v2PNCQIHCzTlDgjmGPWp0KDVVr/uXhpaM10f taGI2UzqtWx/YtxX30C/l6Iozl0GCvP5CmbUiM70R+1zAnPGjWQqqQQG1 CFpZbt8z3Atn86MEPzdpJZCq9GWXmXxMh1H9n+gxBE2eLuzK1NKGd+sne aL+d5T8QEtd5wSIs/Cyrqcs8Z3BUEVL6tIgAc61Utoa5wdrtQe01DwxsH w==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="275354028" X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="275354028" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 20:27:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="642142714" Received: from sqa-gate.sh.intel.com (HELO robert-clx2.tsp.org) ([10.239.48.212]) by orsmga008.jf.intel.com with ESMTP; 31 Aug 2022 20:27:36 -0700 From: Robert Hoo To: imammedo@redhat.com, mst@redhat.com, xiaoguangrong.eric@gmail.com, ani@anisinha.ca, dan.j.williams@intel.com, jingqi.liu@intel.com Cc: qemu-devel@nongnu.org, robert.hu@intel.com, Robert Hoo Subject: [PATCH v3 4/5] acpi/nvdimm: Implement ACPI NVDIMM Label Methods Date: Thu, 1 Sep 2022 11:27:20 +0800 Message-Id: <20220901032721.1392482-5-robert.hu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901032721.1392482-1-robert.hu@linux.intel.com> References: <20220901032721.1392482-1-robert.hu@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=192.55.52.136; envelope-from=robert.hu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Recent ACPI spec [1] has defined NVDIMM Label Methods _LS{I,R,W}, which deprecates corresponding _DSM Functions defined by PMEM _DSM Interface spec [2]. Since the semantics of the new Label Methods are same as old _DSM methods, the implementations here simply wrapper old ones. ASL form diff can be found in next patch of updating golden master binaries. [1] ACPI Spec v6.4, 6.5.10 NVDIMM Label Methods https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf [2] Intel PMEM _DSM Interface Spec v2.0, 3.10 Deprecated Functions https://pmem.io/documents/IntelOptanePMem_DSM_Interface-V2.0.pdf Signed-off-by: Robert Hoo Reviewed-by: Jingqi Liu --- hw/acpi/nvdimm.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index afff911c1e..516acfe53b 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -1243,6 +1243,7 @@ static void nvdimm_build_fit(Aml *dev) static void nvdimm_build_nvdimm_devices(Aml *root_dev, uint32_t ram_slots) { uint32_t slot; + Aml *method, *pkg, *field, *com_call; for (slot = 0; slot < ram_slots; slot++) { uint32_t handle = nvdimm_slot_to_handle(slot); @@ -1260,6 +1261,96 @@ static void nvdimm_build_nvdimm_devices(Aml *root_dev, uint32_t ram_slots) */ aml_append(nvdimm_dev, aml_name_decl("_ADR", aml_int(handle))); + /* + * ACPI v6.4: Section 6.5.10 NVDIMM Label Methods + */ + /* _LSI */ + method = aml_method("_LSI", 0, AML_SERIALIZED); + com_call = aml_call5(NVDIMM_COMMON_DSM, + aml_touuid(NVDIMM_DEVICE_DSM_UUID), + aml_int(1), aml_int(4), aml_int(0), + aml_int(handle)); + aml_append(method, aml_store(com_call, aml_local(0))); + + aml_append(method, aml_create_dword_field(aml_local(0), + aml_int(0), "STTS")); + aml_append(method, aml_create_dword_field(aml_local(0), aml_int(4), + "SLSA")); + aml_append(method, aml_create_dword_field(aml_local(0), aml_int(8), + "MAXT")); + + pkg = aml_package(3); + aml_append(pkg, aml_name("STTS")); + aml_append(pkg, aml_name("SLSA")); + aml_append(pkg, aml_name("MAXT")); + aml_append(method, aml_name_decl("RET", pkg)); + aml_append(method, aml_return(aml_name("RET"))); + + aml_append(nvdimm_dev, method); + + /* _LSR */ + method = aml_method("_LSR", 2, AML_SERIALIZED); + aml_append(method, aml_name_decl("INPT", aml_buffer(8, NULL))); + + aml_append(method, aml_create_dword_field(aml_name("INPT"), + aml_int(0), "OFST")); + aml_append(method, aml_create_dword_field(aml_name("INPT"), + aml_int(4), "LEN")); + aml_append(method, aml_store(aml_arg(0), aml_name("OFST"))); + aml_append(method, aml_store(aml_arg(1), aml_name("LEN"))); + + pkg = aml_package(1); + aml_append(pkg, aml_name("INPT")); + aml_append(method, aml_name_decl("PKG1", pkg)); + + com_call = aml_call5(NVDIMM_COMMON_DSM, + aml_touuid(NVDIMM_DEVICE_DSM_UUID), + aml_int(1), aml_int(5), aml_name("PKG1"), + aml_int(handle)); + aml_append(method, aml_store(com_call, aml_local(3))); + field = aml_create_dword_field(aml_local(3), aml_int(0), "STTS"); + aml_append(method, field); + field = aml_create_field(aml_local(3), aml_int(32), + aml_shiftleft(aml_name("LEN"), aml_int(3)), + "LDAT"); + aml_append(method, field); + aml_append(method, aml_name_decl("LSA", aml_buffer(0, NULL))); + aml_append(method, aml_to_buffer(aml_name("LDAT"), aml_name("LSA"))); + pkg = aml_package(2); + aml_append(pkg, aml_name("STTS")); + aml_append(pkg, aml_name("LSA")); + aml_append(method, aml_name_decl("RET", pkg)); + aml_append(method, aml_return(aml_name("RET"))); + aml_append(nvdimm_dev, method); + + /* _LSW */ + method = aml_method("_LSW", 3, AML_SERIALIZED); + aml_append(method, aml_store(aml_arg(2), aml_local(2))); + aml_append(method, aml_name_decl("INPT", aml_buffer(8, NULL))); + field = aml_create_dword_field(aml_name("INPT"), + aml_int(0), "OFST"); + aml_append(method, field); + field = aml_create_dword_field(aml_name("INPT"), + aml_int(4), "TLEN"); + aml_append(method, field); + aml_append(method, aml_store(aml_arg(0), aml_name("OFST"))); + aml_append(method, aml_store(aml_arg(1), aml_name("TLEN"))); + + aml_append(method, aml_concatenate(aml_name("INPT"), aml_local(2), + aml_name("INPT"))); + pkg = aml_package(1); + aml_append(pkg, aml_name("INPT")); + aml_append(method, aml_name_decl("PKG1", pkg)); + com_call = aml_call5(NVDIMM_COMMON_DSM, + aml_touuid(NVDIMM_DEVICE_DSM_UUID), + aml_int(1), aml_int(6), aml_name("PKG1"), + aml_int(handle)); + aml_append(method, aml_store(com_call, aml_local(3))); + field = aml_create_dword_field(aml_local(3), aml_int(0), "STTS"); + aml_append(method, field); + aml_append(method, aml_return(aml_to_integer(aml_name("STTS")))); + aml_append(nvdimm_dev, method); + nvdimm_build_device_dsm(nvdimm_dev, handle); aml_append(root_dev, nvdimm_dev); } From patchwork Thu Sep 1 03:27:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 12961704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DCBAECAAD2 for ; Thu, 1 Sep 2022 03:36:31 +0000 (UTC) Received: from localhost ([::1]:36626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTb0I-0008TK-7V for qemu-devel@archiver.kernel.org; Wed, 31 Aug 2022 23:36:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarz-0000FV-Mv for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:55 -0400 Received: from mga12.intel.com ([192.55.52.136]:17697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTarp-0007w7-Oj for qemu-devel@nongnu.org; Wed, 31 Aug 2022 23:27:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662002865; x=1693538865; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=//B9Et46IkTNA4liFhpc2ukBu1B2iGHUJzNNGzVHG68=; b=VfWHxSziWLFbLDuL/b7aqYv2x0aVS9HNofu6exrq5LAN6kiMUVJ0lvun dQ7wEJu8HxLXlGCyki5+Kk+Kgv5hPA8CINI470QOgqLQH5jU46E3VEJgn gJz+hA+dD3pBMcSP92vPUPBt3fVBLR2s67OkFVA5FKEV+qT3/j/jAWwBG 8V/nl2tb9hsAE1CMsvXPQkLPG/8WxirNiHVUf5auc+3CSLpogcNYSLVEW KECEOQXeJXr95zFm2vBJDWKiwcvCHcRoVZFDLvjLe4zJBDV4cvlVBbSYb q3v3xmOMUBBvq+HNW+Evtn1tkVEVoKnDq79a2WxhsvN9ylwJXpckoEewU g==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="275354039" X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="275354039" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 20:27:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,280,1654585200"; d="scan'208";a="642142725" Received: from sqa-gate.sh.intel.com (HELO robert-clx2.tsp.org) ([10.239.48.212]) by orsmga008.jf.intel.com with ESMTP; 31 Aug 2022 20:27:38 -0700 From: Robert Hoo To: imammedo@redhat.com, mst@redhat.com, xiaoguangrong.eric@gmail.com, ani@anisinha.ca, dan.j.williams@intel.com, jingqi.liu@intel.com Cc: qemu-devel@nongnu.org, robert.hu@intel.com, Robert Hoo Subject: [PATCH v3 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries Date: Thu, 1 Sep 2022 11:27:21 +0800 Message-Id: <20220901032721.1392482-6-robert.hu@linux.intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901032721.1392482-1-robert.hu@linux.intel.com> References: <20220901032721.1392482-1-robert.hu@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=192.55.52.136; envelope-from=robert.hu@linux.intel.com; helo=mga12.intel.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" And empty bios-tables-test-allowed-diff.h. Diff of ASL form, cited from qtest testlog.txt: --- /tmp/asl-0WHMR1.dsl 2022-08-30 11:38:09.406635934 +0800 +++ /tmp/asl-APDMR1.dsl 2022-08-30 11:38:09.403635663 +0800 @@ -1,30 +1,30 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180629 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/data/acpi/pc/SSDT.dimmpxm, Tue Aug 30 11:38:09 2022 + * Disassembly of /tmp/aml-1AEMR1, Tue Aug 30 11:38:09 2022 * * Original Table Header: * Signature "SSDT" - * Length 0x000002DE (734) + * Length 0x00000765 (1893) * Revision 0x01 - * Checksum 0x56 + * Checksum 0x36 * OEM ID "BOCHS " * OEM Table ID "NVDIMM" * OEM Revision 0x00000001 (1) * Compiler ID "BXPC" * Compiler Version 0x00000001 (1) */ DefinitionBlock ("", "SSDT", 1, "BOCHS ", "NVDIMM", 0x00000001) { Scope (\_SB) { Device (NVDR) { Name (_HID, "ACPI0012" /* NVDIMM Root Device */) // _HID: Hardware ID Method (NCAL, 5, Serialized) { Local6 = MEMA /* \MEMA */ @@ -49,52 +49,52 @@ ODAT, 32736 } If ((Arg4 == Zero)) { Local0 = ToUUID ("2f10e7a4-9e91-11e4-89d3-123b93f75cba") } ElseIf ((Arg4 == 0x00010000)) { Local0 = ToUUID ("648b9cf2-cda1-4312-8ad9-49c4af32bd62") } Else { Local0 = ToUUID ("4309ac30-0d11-11e4-9191-0800200c9a66") } - If (((Local6 == Zero) | (Arg0 != Local0))) + If (((Local6 == Zero) || (Arg0 != Local0))) { If ((Arg2 == Zero)) { Return (Buffer (One) { 0x00 // . }) } Return (Buffer (One) { 0x01 // . }) } HDLE = Arg4 REVS = Arg1 FUNC = Arg2 - If (((ObjectType (Arg3) == 0x04) & (SizeOf (Arg3) == One))) + If (((ObjectType (Arg3) == 0x04) && (SizeOf (Arg3) == One))) { Local2 = Arg3 [Zero] Local3 = DerefOf (Local2) FARG = Local3 } NTFI = Local6 Local1 = (RLEN - 0x04) If ((Local1 < 0x08)) { Local2 = Zero Name (TBUF, Buffer (One) { 0x00 // . }) Local7 = Buffer (Zero){} @@ -161,45 +161,234 @@ Else { If ((Local1 == Zero)) { Return (Local2) } Local3 += Local1 Concatenate (Local2, Local0, Local2) } } } Device (NV00) { Name (_ADR, One) // _ADR: Address + Method (_LSI, 0, Serialized) // _LSI: Label Storage Information + { + Local0 = NCAL (ToUUID ("4309ac30-0d11-11e4-9191-0800200c9a66"), One, 0x04, Zero, One) + CreateDWordField (Local0, Zero, STTS) + CreateDWordField (Local0, 0x04, SLSA) + CreateDWordField (Local0, 0x08, MAXT) + Name (RET, Package (0x03) + { + STTS, + SLSA, + MAXT + }) + Return (RET) /* \_SB_.NVDR.NV00._LSI.RET_ */ + } + + Method (_LSR, 2, Serialized) // _LSR: Label Storage Read + { + Name (INPT, Buffer (0x08) + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // ........ + }) + CreateDWordField (INPT, Zero, OFST) + CreateDWordField (INPT, 0x04, LEN) + OFST = Arg0 + LEN = Arg1 + Name (PKG1, Package (0x01) + { + INPT + }) + Local3 = NCAL (ToUUID ("4309ac30-0d11-11e4-9191-0800200c9a66"), One, 0x05, PKG1, One) + CreateDWordField (Local3, Zero, STTS) + CreateField (Local3, 0x20, (LEN << 0x03), LDAT) + Name (LSA, Buffer (Zero){}) + ToBuffer (LDAT, LSA) /* \_SB_.NVDR.NV00._LSR.LSA_ */ + Name (RET, Package (0x02) + { + STTS, + LSA + }) + Return (RET) /* \_SB_.NVDR.NV00._LSR.RET_ */ + } + + Method (_LSW, 3, Serialized) // _LSW: Label Storage Write + { + Local2 = Arg2 + Name (INPT, Buffer (0x08) + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // ........ + }) + CreateDWordField (INPT, Zero, OFST) + CreateDWordField (INPT, 0x04, TLEN) + OFST = Arg0 + TLEN = Arg1 + Concatenate (INPT, Local2, INPT) /* \_SB_.NVDR.NV00._LSW.INPT */ + Name (PKG1, Package (0x01) + { + INPT + }) + Local3 = NCAL (ToUUID ("4309ac30-0d11-11e4-9191-0800200c9a66"), One, 0x06, PKG1, One) + CreateDWordField (Local3, Zero, STTS) + Return (ToInteger (STTS)) + } + Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method { Return (NCAL (Arg0, Arg1, Arg2, Arg3, One)) } } ... // iterates in each NV devices Signed-off-by: Robert Hoo Reviewed-by: Jingqi Liu --- tests/data/acpi/pc/SSDT.dimmpxm | Bin 734 -> 1893 bytes tests/data/acpi/q35/SSDT.dimmpxm | Bin 734 -> 1893 bytes tests/qtest/bios-tables-test-allowed-diff.h | 2 -- 3 files changed, 2 deletions(-) diff --git a/tests/data/acpi/pc/SSDT.dimmpxm b/tests/data/acpi/pc/SSDT.dimmpxm index ac55387d57e48adb99eb738a102308688a262fb8..2316d8f959267a178b12379dbcb439a6306b0db5 100644 GIT binary patch literal 1893 zcmdUw&ubGw6vt#Ux>Qg^Hf4{3cfp%iPoBJaD0ufGcu?nUe@F{zMJT$5nKy6VzWvPiJ0!YZGVUZ0 z;wB2U;*>5{XG@BzvNb}eFjp_aoR&NDmR_*Tb#_V>%mojDFw(; z!KY^rZuj42irx3ho0sFSUAuoF%I9AU6@}qFq1VGmOg(Mb!AQ?|3I(2v z297QP7+nN1+5)uT(j)(2o5cOiHb=MG2)T5_^{5BLv;k*Y0a_Awf{7i6V2WI96lP>- zNrf0{?q1n(9lEgv$8pgX>><=?!rZ*;hE00UAv|)-EEFK8#_}NyxwKW%)p!U3FD$m& z2y40_p`4n~WW^Z5HCZ^n@27&5aq5hFT=BZn~LZd&Z)7!KxAHkSk8S8(o5b~sF0mP_(wu>{vSDS; z@w#E?kcV6dxm=mBwi>}owQdMWg4somo-QO1=n+LE&Wy7TBwU0T*QY1Pm}F4*3#b7o zoJ+&b>?G*nTQ#T#T0rB3yAkgNerrCy-!)djPh2Jw%p%?8m#>xD8wBg zbYVCp^58M#@Cl%xlUIy0*9)V}p0UUt63b1V!XFa*bA#lwFo?wd)}i8=JM@G3&?4dZ luKNb5nD}6)_~<4#t%(LAjJ^|Hw{uC>PEKQ(G&v)I zVKOVD5|2#vWcBP;?J7Z{ECp`N4Bcur;L=M?|Tn}duZdvHUqV#KkW}~~b+!9^Pq_aseZ&7e|H|%N4=(#l!+;zW ze0uiacJFOk>bzIpyqtLL+P!m8KL27!5=QofZWp86@YA{-jCTDx+V&UhV90NxP~f>} z;OG*7(M2GmO+X7SJn|p5NZj9SadfMNkV`jQk9t5%>u{zOpe1o9xVGaEOp%L?!i)?p zsSrbr-Ag;JLpQeII4;_PJ%ri~m>YN9utD!Rgh!5g~etI zVNEwglvNX&tQbSMD(eQK3oucr0fmkWz;Wq84k{vz?2e6Cix~<7Gz*5e{U{SMP`YV5 zD-N6k`wmkhhRlpjauFTFkwX}=H!b#Y3t3WLW7l zylxmeNb5nD}6)_~<4#t%(LAjJ^|Hw{uC>PEKQ(G&v)I zVKOVD5|2#vWc