From patchwork Thu Aug 24 01:42:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 805213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xd6WG5R7qz9t2K for ; Thu, 24 Aug 2017 11:43:04 +1000 (AEST) Received: from localhost ([::1]:46350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkhAi-0005aS-52 for incoming@patchwork.ozlabs.org; Wed, 23 Aug 2017 21:43:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkhAJ-0005aM-Pc for qemu-devel@nongnu.org; Wed, 23 Aug 2017 21:42:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkhAG-0000wk-Jr for qemu-devel@nongnu.org; Wed, 23 Aug 2017 21:42:35 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:30510 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkhAF-0000w8-Od for qemu-devel@nongnu.org; Wed, 23 Aug 2017 21:42:32 -0400 X-IronPort-AV: E=Sophos;i="5.41,419,1498492800"; d="scan'208";a="24598391" Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 24 Aug 2017 09:42:29 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 620144727AA7; Thu, 24 Aug 2017 09:42:31 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 24 Aug 2017 09:42:29 +0800 To: Igor Mammedov References: <1503372250-5092-1-git-send-email-douly.fnst@cn.fujitsu.com> <1503372250-5092-3-git-send-email-douly.fnst@cn.fujitsu.com> <20170823104051.36488fcb@nial.brq.redhat.com> <9b19623e-55e9-ebac-11d3-6ff5fff176fe@cn.fujitsu.com> <20170823144502.17203857@nial.brq.redhat.com> <20170823194734.518d5cb3@Igors-MacBook-Pro.local> From: Dou Liyang Message-ID: <033764b9-6098-1949-e4e7-a21cafcc6901@cn.fujitsu.com> Date: Thu, 24 Aug 2017 09:42:28 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170823194734.518d5cb3@Igors-MacBook-Pro.local> X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 620144727AA7.A7ADD X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 183.91.158.132 Subject: Re: [Qemu-devel] [PATCH v4 2/2] ACPI/unit-test: Add a new testcase for RAM allocation in numa node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, rth@twiddle.net, mst@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hi Igor, At 08/24/2017 01:47 AM, Igor Mammedov wrote: > On Wed, 23 Aug 2017 21:35:29 +0800 > Dou Liyang wrote: > >> Hi Igor, >> >> At 08/23/2017 08:45 PM, Igor Mammedov wrote: >>> On Wed, 23 Aug 2017 20:12:51 +0800 >>> Dou Liyang wrote: >>> >>>> Hi Igor, >>>> >>>> At 08/23/2017 04:40 PM, Igor Mammedov wrote: >>>>> On Tue, 22 Aug 2017 11:24:10 +0800 >>>>> Dou Liyang wrote: >>>>> >>>>>> As QEMU supports the memory-less node, it is possible that there is >>>>>> no RAM in the first numa node(also be called as node0). eg: >>>>>> ... \ >>>>>> -m 128,slots=3,maxmem=1G \ >>>>>> -numa node -numa node,mem=128M \ >>>>>> >>>>>> But, this makes it hard for QEMU to build a known-to-work ACPI SRAT >>>>>> table. Only fixing it is not enough. >>>>>> >>>>>> Add a testcase for this situation to make sure the ACPI table is >>>>>> correct for guest. >>>>>> >>>>>> Suggested-by: Eduardo Habkost >>>>>> Signed-off-by: Dou Liyang >>>>>> --- >>>>>> tests/acpi-test-data/pc/DSDT.numamem | Bin 0 -> 6463 bytes >>>>>> tests/acpi-test-data/pc/SLIT.numamem | Bin 0 -> 48 bytes >>>>>> tests/acpi-test-data/pc/SRAT.numamem | Bin 0 -> 264 bytes >>>>>> tests/acpi-test-data/q35/DSDT.numamem | Bin 0 -> 9147 bytes >>>>>> tests/acpi-test-data/q35/SLIT.numamem | Bin 0 -> 48 bytes >>>>>> tests/acpi-test-data/q35/SRAT.numamem | Bin 0 -> 264 bytes >>>>>> tests/bios-tables-test.c | 30 ++++++++++++++++++++++++++++++ >>>>>> 7 files changed, 30 insertions(+) >>>>>> create mode 100644 tests/acpi-test-data/pc/DSDT.numamem >>>>>> create mode 100644 tests/acpi-test-data/pc/SLIT.numamem >>>>>> create mode 100644 tests/acpi-test-data/pc/SRAT.numamem >>>>>> create mode 100644 tests/acpi-test-data/q35/DSDT.numamem >>>>>> create mode 100644 tests/acpi-test-data/q35/SLIT.numamem >>>>>> create mode 100644 tests/acpi-test-data/q35/SRAT.numamem >>>>> >>>>> >>>>> considering only SRAT table has been changed and the other >>>>> tables match with default blobs, I'd suggest to keep only >>>> >>>> >>>> Our testcase is: >>>> >>>> + test_acpi_one(" -m 128,slots=3,maxmem=1G" >>>> + " -numa node -numa node,mem=128" >>>> + " -numa dist,src=0,dst=1,val=21", >>>> + &data); >>>> >>>> The DSDT and SLIT don't match with default blobs. >>> do you actually need SLIT table /i.e. -numa dist/ for test at all? >>> it looks not relevant for the test case at the hand, >>> I'd suggest to drop '-numa dist' option for the test. >>> >> >> OK, Got it, will drop '-numa dist' option in next version. >> >>>> >>>> So, they can't be dropped. >>> >>> I wonder what's changed, could you post DSDT diff here? >>> >> >> Just like memory hot-plug cases, when we use the '-m 128 >> 128,slots=3,maxmem=1G' option, As the ACPI spec said, There may be some >> Memory Device in the DSDT table. > for your case '-numa node -numa node,mem=128', there is no need in enabling memory hotplug. Thank you very much for your kind explanation. Yes, I understood. > If I recall it correctly the default memory for x86 is 128Mb, > hence removing "-m" would probably make DSDT match default one. Yes, I removed the "-m": test_acpi_one(" -numa node -numa node,mem=128", &data); but, the DSDT didn't match the default one. because, if we support NUMA, the DSDT will give us "_PXM" to map the CPU to node. * OEM Revision 0x00000001 (1) @@ -783,6 +783,8 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPCDSDT", 0x00000001) { COST (Zero, Arg0, Arg1, Arg2) } + + Name (_PXM, Zero) // _PXM: Device Proximity } } } Thanks, dou. > > [...] > > > > --- a/tmp/asl-7QO54Y.dsl +++ b/tmp/asl-EWM54Y.dsl @@ -5,13 +5,13 @@ * * Disassembling to symbolic ASL+ operators * - * Disassembly of tests/acpi-test-data/pc/DSDT, Thu Aug 24 09:20:29 2017 + * Disassembly of /tmp/aml-1YM54Y, Thu Aug 24 09:20:29 2017 * * Original Table Header: * Signature "DSDT" - * Length 0x000013EA (5098) + * Length 0x000013F0 (5104) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0x78 + * Checksum 0x13 * OEM ID "BOCHS " * OEM Table ID "BXPCDSDT"