From patchwork Thu Oct 21 15:25:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575589 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B21CC433F5 for ; Thu, 21 Oct 2021 15:28:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BEC5761130 for ; Thu, 21 Oct 2021 15:28:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BEC5761130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdZzC-0002h5-Tp for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:28:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZwy-0008Ls-O9 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:48 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:52975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZww-00024K-Ac for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:48 -0400 Received: by mail-pj1-x102a.google.com with SMTP id oa4so763833pjb.2 for ; Thu, 21 Oct 2021 08:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WUzDlOF0Yc4gl4PbUd03BYvQClkHCt6P4U6DTvGuA08=; b=xQ/WazDvsoeUw+/tH5O59dWUj6dpm6CzzYDyoYaJnZRBVJ4YvPMBbcW2eMOMZcehBk 7TRWy8dqmWhaA9nPaPtjdFotwSZmG/GaadH2i92MBk3CVqA577dVKLYM0+V6h/Dx6VEM 3Tg7VYms/kBiAlp5zhUd3gRzJYi/JK7ZD6yABTYspCpMa10VcRK85NI1hlpN2zdGa2ry b2JF8IE9ONYpc/ddnmHwd7w+O4bMAECA4/rcaOUI+zdUZPBc3ah1ejxpeI+94mg4+B85 Ku/o/1n5NhrK3lZnIZsjYc8rTHf7CzTO4pZSqaHYDveSc22VI0/856s+GT/2FFBhJI0O Gj+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WUzDlOF0Yc4gl4PbUd03BYvQClkHCt6P4U6DTvGuA08=; b=ljiFF387RkPR6rsXyUEg9WnMoatlVP+c0G2hmVx8tOvdkbm19XcuMe+MqL6lq0QrQJ j1SrhFdtCNS38ZECeoErkEoSdoOCyv0f/m8ftvzor6VYuiI/69bNUnTyOkwRXkEWgXIB epFCmSPMMBHXWlNx1XOb7fSPIUh0JjN9i4qzBN02etO1vCXSp0Q+IPK3iihDULJ7x0PO jCv6VWjnGd1lZ4EYiqqP5VgTg86uIco1pyvz/go5gnQdCCb187jUqvr2ZFUMIcP6RDo2 AmiY7lKa4pQn2NylcyeerQkTJxkBdHSnROIQ6wwRmVh9il3q1+dCf4RSKQu+S718M2RG vC7w== X-Gm-Message-State: AOAM5323qRdQT0u0yXcbhJpJOuSfskUjeoEhiznzm5s8ufUJQSRurroG GQ+hxIHe8AkPp3T3/BRd/2y6pcjPJxjxMQ== X-Google-Smtp-Source: ABdhPJxqdUhXoFyTkWHDuUBOKr4BjYBg+f+tfuVAW4w1+OLdtPe1HiSo0ScyMkSu3tb7Ol0swXqAzA== X-Received: by 2002:a17:902:a710:b0:13f:bf61:873f with SMTP id w16-20020a170902a71000b0013fbf61873fmr5745971plq.56.1634829942879; Thu, 21 Oct 2021 08:25:42 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/19] tests/acpi: Get prepared for IORT E.b revision upgrade Date: Thu, 21 Oct 2021 08:25:23 -0700 Message-Id: <20211021152541.781175-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Eric Auger , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Ignore IORT till reference blob for E.b spec revision gets added. Signed-off-by: Eric Auger Reviewed-by: Michael S. Tsirkin Message-Id: <20211014115643.756977-2-eric.auger@redhat.com> Signed-off-by: Richard Henderson --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..9a5a923d6b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/IORT", From patchwork Thu Oct 21 15:25:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575635 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83CE2C433EF for ; Thu, 21 Oct 2021 15:40:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0F32C611BD for ; Thu, 21 Oct 2021 15:40:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F32C611BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:36820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaAm-0002yy-4j for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:40:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx0-0008Pn-2A for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:50 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:46773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZww-00027c-Kl for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:49 -0400 Received: by mail-pl1-x632.google.com with SMTP id i1so628706plr.13 for ; Thu, 21 Oct 2021 08:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3uHaaL0MV3Lfbdvi6JXf/ib4D2pgKX/ajlDXIALVybM=; b=H7TRRxcyQEXMNnGqPU3DubJEK1XPVTMo+sme+sq3t3nXRsJjAh5I/ZYW+E5L1+GsN0 OBeggKV8z2yc49BgTp+vcOZU+UQ1gHyfvUIGhdxEdqAqALi2HlC3Sl4yP511V691fj0R AebhFax2aNrQyQ2P3HV0gHyhke/dbd0howJHwjcx+DWXj0C38Db3SFeKPS0FlBFukDiW J4d7yVmcNrVboDsS98vwMKT7+jrtb+l/cRM8UKQ7gaPKFoM0mOXgr84S3MheVT9xC8JH 2WIwAttEDDIc0RLpjs8BH9j/oRSmPuYb4nBKDH5fax5gGVX1C6Q+W9Yh8ysjsoMzGwrJ lM4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3uHaaL0MV3Lfbdvi6JXf/ib4D2pgKX/ajlDXIALVybM=; b=4y/bFNbCsXNCc4Dsyc8XcGbIgGvUoJczaZjDJ7A/YmH4YWLWNw1yRgmy8tNQzluHt7 buskwVGpf1REG55v47+BbzOF/QZWnVpXKl8/Hl42ljAJe9T/Wc6wb83BxVlPNQpu/Lbl C4ZgtBgbqPsZAeiIUIxBxvCOIukiFB81MCVoA3YU0RGKcxDZVAa3xGsnLawVJtLJDdbI lhI1p0LAy02xmZ4qf7M6vUeaNJimGZPphdxCsLb/Fa2D0gZkMxHDvs+Crpx/ZGtBEyVX mHRh/nRCSiVBP9i79NzbILtATADeuQvXYFMyixs9yBXnbcqpcIc7AfGYDRjDe72mwQSh 4rzA== X-Gm-Message-State: AOAM531EfdNbAdBw4CGTWuwZWpJ0yC//sTdSLaRfs+24mKVyykC77iuj ++2PCtxph/3jAiNReTaoNww7eqbCx3IEaQ== X-Google-Smtp-Source: ABdhPJwaPYr5MXyMdpjm4cwr4sTT5xo6ufyhkVO+nw2Vp/QLCsGYtljmp8/2SREvE7Co8/+oGAIsCA== X-Received: by 2002:a17:902:b095:b029:12c:de88:7d3b with SMTP id p21-20020a170902b095b029012cde887d3bmr5889023plr.15.1634829943804; Thu, 21 Oct 2021 08:25:43 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 02/19] hw/arm/virt-acpi-build: IORT upgrade up to revision E.b Date: Thu, 21 Oct 2021 08:25:24 -0700 Message-Id: <20211021152541.781175-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Eric Auger , Igor Mammedov , "Michael S . Tsirkin" , Jean-Philippe Brucker Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Upgrade the IORT table from B to E.b specification revision (ARM DEN 0049E.b). The SMMUv3 and root complex node have additional fields. Also unique IORT node identifiers are introduced: they are generated in sequential order. They are not cross-referenced though. Signed-off-by: Eric Auger Reviewed-by: Jean-Philippe Brucker Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Message-Id: <20211014115643.756977-3-eric.auger@redhat.com> Signed-off-by: Richard Henderson --- hw/arm/virt-acpi-build.c | 48 ++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 6cec97352b..9c4730f4ab 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -241,19 +241,20 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) #endif #define ID_MAPPING_ENTRY_SIZE 20 -#define SMMU_V3_ENTRY_SIZE 60 -#define ROOT_COMPLEX_ENTRY_SIZE 32 +#define SMMU_V3_ENTRY_SIZE 68 +#define ROOT_COMPLEX_ENTRY_SIZE 36 #define IORT_NODE_OFFSET 48 static void build_iort_id_mapping(GArray *table_data, uint32_t input_base, uint32_t id_count, uint32_t out_ref) { - /* Identity RID mapping covering the whole input RID range */ + /* Table 4 ID mapping format */ build_append_int_noprefix(table_data, input_base, 4); /* Input base */ build_append_int_noprefix(table_data, id_count, 4); /* Number of IDs */ build_append_int_noprefix(table_data, input_base, 4); /* Output base */ build_append_int_noprefix(table_data, out_ref, 4); /* Output Reference */ - build_append_int_noprefix(table_data, 0, 4); /* Flags */ + /* Flags */ + build_append_int_noprefix(table_data, 0 /* Single mapping (disabled) */, 4); } struct AcpiIortIdMapping { @@ -298,7 +299,7 @@ static int iort_idmap_compare(gconstpointer a, gconstpointer b) /* * Input Output Remapping Table (IORT) * Conforms to "IO Remapping Table System Software on ARM Platforms", - * Document number: ARM DEN 0049B, October 2015 + * Document number: ARM DEN 0049E.b, Feb 2021 */ static void build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) @@ -307,10 +308,11 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) const uint32_t iort_node_offset = IORT_NODE_OFFSET; size_t node_size, smmu_offset = 0; AcpiIortIdMapping *idmap; + uint32_t id = 0; GArray *smmu_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping)); GArray *its_idmaps = g_array_new(false, true, sizeof(AcpiIortIdMapping)); - AcpiTable table = { .sig = "IORT", .rev = 0, .oem_id = vms->oem_id, + AcpiTable table = { .sig = "IORT", .rev = 3, .oem_id = vms->oem_id, .oem_table_id = vms->oem_table_id }; /* Table 2 The IORT */ acpi_table_begin(&table, table_data); @@ -358,12 +360,12 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) build_append_int_noprefix(table_data, IORT_NODE_OFFSET, 4); build_append_int_noprefix(table_data, 0, 4); /* Reserved */ - /* 3.1.1.3 ITS group node */ + /* Table 12 ITS Group Format */ build_append_int_noprefix(table_data, 0 /* ITS Group */, 1); /* Type */ node_size = 20 /* fixed header size */ + 4 /* 1 GIC ITS Identifier */; build_append_int_noprefix(table_data, node_size, 2); /* Length */ - build_append_int_noprefix(table_data, 0, 1); /* Revision */ - build_append_int_noprefix(table_data, 0, 4); /* Reserved */ + build_append_int_noprefix(table_data, 1, 1); /* Revision */ + build_append_int_noprefix(table_data, id++, 4); /* Identifier */ build_append_int_noprefix(table_data, 0, 4); /* Number of ID mappings */ build_append_int_noprefix(table_data, 0, 4); /* Reference to ID Array */ build_append_int_noprefix(table_data, 1, 4); /* Number of ITSs */ @@ -374,19 +376,19 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE; smmu_offset = table_data->len - table.table_offset; - /* 3.1.1.2 SMMUv3 */ + /* Table 9 SMMUv3 Format */ build_append_int_noprefix(table_data, 4 /* SMMUv3 */, 1); /* Type */ node_size = SMMU_V3_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE; build_append_int_noprefix(table_data, node_size, 2); /* Length */ - build_append_int_noprefix(table_data, 0, 1); /* Revision */ - build_append_int_noprefix(table_data, 0, 4); /* Reserved */ + build_append_int_noprefix(table_data, 4, 1); /* Revision */ + build_append_int_noprefix(table_data, id++, 4); /* Identifier */ build_append_int_noprefix(table_data, 1, 4); /* Number of ID mappings */ /* Reference to ID Array */ build_append_int_noprefix(table_data, SMMU_V3_ENTRY_SIZE, 4); /* Base address */ build_append_int_noprefix(table_data, vms->memmap[VIRT_SMMU].base, 8); /* Flags */ - build_append_int_noprefix(table_data, 1 /* COHACC OverrideNote */, 4); + build_append_int_noprefix(table_data, 1 /* COHACC Override */, 4); build_append_int_noprefix(table_data, 0, 4); /* Reserved */ build_append_int_noprefix(table_data, 0, 8); /* VATOS address */ /* Model */ @@ -395,35 +397,43 @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) build_append_int_noprefix(table_data, irq + 1, 4); /* PRI */ build_append_int_noprefix(table_data, irq + 3, 4); /* GERR */ build_append_int_noprefix(table_data, irq + 2, 4); /* Sync */ + build_append_int_noprefix(table_data, 0, 4); /* Proximity domain */ + /* DeviceID mapping index (ignored since interrupts are GSIV based) */ + build_append_int_noprefix(table_data, 0, 4); /* output IORT node is the ITS group node (the first node) */ build_iort_id_mapping(table_data, 0, 0xFFFF, IORT_NODE_OFFSET); } - /* Table 16 Root Complex Node */ + /* Table 17 Root Complex Node */ build_append_int_noprefix(table_data, 2 /* Root complex */, 1); /* Type */ node_size = ROOT_COMPLEX_ENTRY_SIZE + ID_MAPPING_ENTRY_SIZE * rc_mapping_count; build_append_int_noprefix(table_data, node_size, 2); /* Length */ - build_append_int_noprefix(table_data, 0, 1); /* Revision */ - build_append_int_noprefix(table_data, 0, 4); /* Reserved */ + build_append_int_noprefix(table_data, 3, 1); /* Revision */ + build_append_int_noprefix(table_data, id++, 4); /* Identifier */ /* Number of ID mappings */ build_append_int_noprefix(table_data, rc_mapping_count, 4); /* Reference to ID Array */ build_append_int_noprefix(table_data, ROOT_COMPLEX_ENTRY_SIZE, 4); - /* Table 13 Memory access properties */ + /* Table 14 Memory access properties */ /* CCA: Cache Coherent Attribute */ build_append_int_noprefix(table_data, 1 /* fully coherent */, 4); build_append_int_noprefix(table_data, 0, 1); /* AH: Note Allocation Hints */ build_append_int_noprefix(table_data, 0, 2); /* Reserved */ - /* MAF: Note Memory Access Flags */ - build_append_int_noprefix(table_data, 0x3 /* CCA = CPM = DCAS = 1 */, 1); + /* Table 15 Memory Access Flags */ + build_append_int_noprefix(table_data, 0x3 /* CCA = CPM = DACS = 1 */, 1); build_append_int_noprefix(table_data, 0, 4); /* ATS Attribute */ /* MCFG pci_segment */ build_append_int_noprefix(table_data, 0, 4); /* PCI Segment number */ + /* Memory address size limit */ + build_append_int_noprefix(table_data, 64, 1); + + build_append_int_noprefix(table_data, 0, 3); /* Reserved */ + /* Output Reference */ if (vms->iommu == VIRT_IOMMU_SMMUV3) { AcpiIortIdMapping *range; From patchwork Thu Oct 21 15:25:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575637 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DD6FC433EF for ; Thu, 21 Oct 2021 15:41:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DCADF611CE for ; Thu, 21 Oct 2021 15:41:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DCADF611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaBp-0003W7-W8 for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:41:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx0-0008Ql-E0 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:50 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:33417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZww-0002AJ-Mz for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:50 -0400 Received: by mail-pg1-x535.google.com with SMTP id j190so677561pgd.0 for ; Thu, 21 Oct 2021 08:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=98AtLq12POOkkgBDQjXH5rla+dJgZ9VKEMUq3gPivrQ=; b=A3RqgKXdXK5i7YFzJ7cuNwGGbAkwhHQDVEKDChyDWRXyky2UQ0OItyxRZnEkN8AFqH Aei9BkeEcLSFPaiGcjGKBhZvvs2vWEw2dIUubXoYUJxWWoUJg+lNwwAYoWNgC5nx1I5h gK9LMGtZfHU7P817A4ERIOA6OwanS8De84Bnt6jkavaeJ/iuNBrVAJAckX4KVcGyTrgw RXK55GtxDX6LE1vrV/ZFDdNpc/Rw6jzU4w4SM0txw5r0pHtWXNgcdVCRF7sRTQP0WJHN +ZY91e57ErpB03UMoJ7abl/1/THG0ESHUgNKWeuVEguTNB6ySPKfZMrJgl3NJNw+hFY9 V2BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=98AtLq12POOkkgBDQjXH5rla+dJgZ9VKEMUq3gPivrQ=; b=rZAFsMMFVl/uVyBVf5xfvXI5E/w2ORJR3AFP8v35Azg/IaIQvJ2Yj0wdukgT6wIXog lipd+3+dDL2kbXlT6GatfmuIanbqclyu1fpdFc/CWl+fnzOL0z0Tn974uJLwJsiIKuBt hD3DR4+33MzHnhI0ieuIestoTSW2xq421rYnPB/vCU62dfdBwDMChiHE73napKmZyR4W 3LeXt4ECvSl898zA86MpQm5bEgtx46k2kXMpMOdBQoUJ2XL3gJOp7TqICf1A0+fH1iXd whek7A0IrDlYw3Y62dKYkTjfvekuTAMi39iGlH4zckLm+O0h81Hbn8lYouER8s40QFEe Gr+w== X-Gm-Message-State: AOAM531SEO5AoMN7uyVAnKpFR9jHCiGTiCGMbhJkROn5KU1eSqYl+kX1 SGC9lfKzK6C55CK3zQhmlnuVAqjCgGXfJw== X-Google-Smtp-Source: ABdhPJypys3K7ZuIjcckPYuc0ARE/CnmD6qmLT8yxLUueEId4efgpYXw5AivZ/4JRPzLGi0UH3GkcA== X-Received: by 2002:a05:6a00:14cc:b0:44d:ebab:2e16 with SMTP id w12-20020a056a0014cc00b0044debab2e16mr6250343pfu.23.1634829944567; Thu, 21 Oct 2021 08:25:44 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/19] tests/acpi: Generate reference blob for IORT rev E.b Date: Thu, 21 Oct 2021 08:25:25 -0700 Message-Id: <20211021152541.781175-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Eric Auger , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Re-generate reference blobs with rebuild-expected-aml.sh. Differences reported by "make check V=1" are listed below (IORT.numamem). Differences for other variants are similar. /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180629 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * - * Disassembly of tests/data/acpi/virt/IORT.numamem, Thu Oct 14 06:13:19 2021 + * Disassembly of /tmp/aml-K8L9A1, Thu Oct 14 06:13:19 2021 * * ACPI Data Table [IORT] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "IORT" [IO Remapping Table] -[004h 0004 4] Table Length : 0000007C -[008h 0008 1] Revision : 00 -[009h 0009 1] Checksum : 07 +[004h 0004 4] Table Length : 00000080 +[008h 0008 1] Revision : 03 +[009h 0009 1] Checksum : B3 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 4] Node Count : 00000002 [028h 0040 4] Node Offset : 00000030 [02Ch 0044 4] Reserved : 00000000 [030h 0048 1] Type : 00 [031h 0049 2] Length : 0018 -[033h 0051 1] Revision : 00 +[033h 0051 1] Revision : 01 [034h 0052 4] Reserved : 00000000 [038h 0056 4] Mapping Count : 00000000 [03Ch 0060 4] Mapping Offset : 00000000 [040h 0064 4] ItsCount : 00000001 [044h 0068 4] Identifiers : 00000000 [048h 0072 1] Type : 02 -[049h 0073 2] Length : 0034 -[04Bh 0075 1] Revision : 00 -[04Ch 0076 4] Reserved : 00000000 +[049h 0073 2] Length : 0038 +[04Bh 0075 1] Revision : 03 +[04Ch 0076 4] Reserved : 00000001 [050h 0080 4] Mapping Count : 00000001 -[054h 0084 4] Mapping Offset : 00000020 +[054h 0084 4] Mapping Offset : 00000024 [058h 0088 8] Memory Properties : [IORT Memory Access Properties] [058h 0088 4] Cache Coherency : 00000001 [05Ch 0092 1] Hints (decoded below) : 00 Transient : 0 Write Allocate : 0 Read Allocate : 0 Override : 0 [05Dh 0093 2] Reserved : 0000 [05Fh 0095 1] Memory Flags (decoded below) : 03 Coherency : 1 Device Attribute : 1 [060h 0096 4] ATS Attribute : 00000000 [064h 0100 4] PCI Segment Number : 00000000 -[068h 0104 1] Memory Size Limit : 00 +[068h 0104 1] Memory Size Limit : 40 [069h 0105 3] Reserved : 000000 -[068h 0104 4] Input base : 00000000 -[06Ch 0108 4] ID Count : 0000FFFF -[070h 0112 4] Output Base : 00000000 -[074h 0116 4] Output Reference : 00000030 -[078h 0120 4] Flags (decoded below) : 00000000 +[06Ch 0108 4] Input base : 00000000 +[070h 0112 4] ID Count : 0000FFFF +[074h 0116 4] Output Base : 00000000 +[078h 0120 4] Output Reference : 00000030 +[07Ch 0124 4] Flags (decoded below) : 00000000 Single Mapping : 0 -Raw Table Data: Length 124 (0x7C) +Raw Table Data: Length 128 (0x80) - 0000: 49 4F 52 54 7C 00 00 00 00 07 42 4F 43 48 53 20 // IORT|.....BOCHS + 0000: 49 4F 52 54 80 00 00 00 03 B3 42 4F 43 48 53 20 // IORT......BOCHS 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC 0020: 01 00 00 00 02 00 00 00 30 00 00 00 00 00 00 00 // ........0....... - 0030: 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................ - 0040: 01 00 00 00 00 00 00 00 02 34 00 00 00 00 00 00 // .........4...... - 0050: 01 00 00 00 20 00 00 00 01 00 00 00 00 00 00 03 // .... ........... - 0060: 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 // ................ - 0070: 00 00 00 00 30 00 00 00 00 00 00 00 // ....0....... + 0030: 00 18 00 01 00 00 00 00 00 00 00 00 00 00 00 00 // ................ + 0040: 01 00 00 00 00 00 00 00 02 38 00 03 01 00 00 00 // .........8...... + 0050: 01 00 00 00 24 00 00 00 01 00 00 00 00 00 00 03 // ....$........... + 0060: 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 // ........@....... + 0070: FF FF 00 00 00 00 00 00 30 00 00 00 00 00 00 00 // ........0....... ** Signed-off-by: Eric Auger Reviewed-by: Michael S. Tsirkin Message-Id: <20211014115643.756977-4-eric.auger@redhat.com> Signed-off-by: Richard Henderson --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/IORT | Bin 124 -> 128 bytes tests/data/acpi/virt/IORT.memhp | Bin 124 -> 128 bytes tests/data/acpi/virt/IORT.numamem | Bin 124 -> 128 bytes tests/data/acpi/virt/IORT.pxb | Bin 124 -> 128 bytes 5 files changed, 1 deletion(-) diff --git a/tests/data/acpi/virt/IORT b/tests/data/acpi/virt/IORT index 521acefe9ba66706c5607321a82d330586f3f280..7efd0ce8a6b3928efa7e1373f688ab4c5f50543b 100644 GIT binary patch literal 128 zcmebD4+?2uU|?Y0?Bwt45v<@85#X!<1dKp25F11@0kHuPgMkDCNC*yK93~3}W)K^M VRiHGGVg_O`aDdYP|3ers^8jQz3IPBB literal 124 zcmebD4+^Pa00MR=e`k+i1*eDrX9XZ&1PX!JAesq?4S*O7Bw!2(4Uz`|CKCt^;wu0# QRGb+i3L*dhhtM#y0PN=p0RR91 diff --git a/tests/data/acpi/virt/IORT.memhp b/tests/data/acpi/virt/IORT.memhp index 521acefe9ba66706c5607321a82d330586f3f280..7efd0ce8a6b3928efa7e1373f688ab4c5f50543b 100644 GIT binary patch literal 128 zcmebD4+?2uU|?Y0?Bwt45v<@85#X!<1dKp25F11@0kHuPgMkDCNC*yK93~3}W)K^M VRiHGGVg_O`aDdYP|3ers^8jQz3IPBB literal 124 zcmebD4+^Pa00MR=e`k+i1*eDrX9XZ&1PX!JAesq?4S*O7Bw!2(4Uz`|CKCt^;wu0# QRGb+i3L*dhhtM#y0PN=p0RR91 diff --git a/tests/data/acpi/virt/IORT.numamem b/tests/data/acpi/virt/IORT.numamem index 521acefe9ba66706c5607321a82d330586f3f280..7efd0ce8a6b3928efa7e1373f688ab4c5f50543b 100644 GIT binary patch literal 128 zcmebD4+?2uU|?Y0?Bwt45v<@85#X!<1dKp25F11@0kHuPgMkDCNC*yK93~3}W)K^M VRiHGGVg_O`aDdYP|3ers^8jQz3IPBB literal 124 zcmebD4+^Pa00MR=e`k+i1*eDrX9XZ&1PX!JAesq?4S*O7Bw!2(4Uz`|CKCt^;wu0# QRGb+i3L*dhhtM#y0PN=p0RR91 diff --git a/tests/data/acpi/virt/IORT.pxb b/tests/data/acpi/virt/IORT.pxb index 521acefe9ba66706c5607321a82d330586f3f280..7efd0ce8a6b3928efa7e1373f688ab4c5f50543b 100644 GIT binary patch literal 128 zcmebD4+?2uU|?Y0?Bwt45v<@85#X!<1dKp25F11@0kHuPgMkDCNC*yK93~3}W)K^M VRiHGGVg_O`aDdYP|3ers^8jQz3IPBB literal 124 zcmebD4+^Pa00MR=e`k+i1*eDrX9XZ&1PX!JAesq?4S*O7Bw!2(4Uz`|CKCt^;wu0# QRGb+i3L*dhhtM#y0PN=p0RR91 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 9a5a923d6b..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/IORT", From patchwork Thu Oct 21 15:25:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575653 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A35F9C4332F for ; Thu, 21 Oct 2021 15:43:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 665C061260 for ; Thu, 21 Oct 2021 15:43:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 665C061260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:45124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaE5-0000Fh-Fv for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:43:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx0-0008QR-9B for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:50 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:44900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZww-0002FD-PE for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:49 -0400 Received: by mail-pj1-x102c.google.com with SMTP id oa12-20020a17090b1bcc00b0019f715462a8so800025pjb.3 for ; Thu, 21 Oct 2021 08:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nBGj2XYtx0Tec+cPzA7IoclmH9d3Yk5987FTDu6jQCk=; b=msFIIW2NWUspCgD4WY8HpGWte9b4kzPAo9Lr2lJ+nk7axzEH9Sj66Y8A4vDH85RkgT a28zce0TVWviV971NxpYHGBYrgsBfejs6mmD/IdwKfjMh9AmLhtUh4ceJjaorlxU8/Yj MMAN4FlE8a/+exoc1bLSRc2mujwxxsBV57jC50vrXxHYcme7Utza266ZrsrY46FRzKPs ZUWzG8VHWPCbZGaBDRTtdOTC5/fL/DAUUxLDdHI/qL1hMzv9o1Fd2QGMG3k+dNyh1UnT YCN06/1TPsH+NzmKJn2VQEuv4klwCzsbYWphAOmhEG94y8gSRR1IJ7CLlOCMFCdsQ0fZ DTVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nBGj2XYtx0Tec+cPzA7IoclmH9d3Yk5987FTDu6jQCk=; b=ZOhsD2HrXxA0vvJO2+EY70y5lINYkthHkTR/uOYhEEe3aUOYehY8ZCPpkuHytPIMqb IDGpujpKs3nQdqJtGKDkL+/nNIODsqz9XGb7Va/tXe6nlQbVWksjOMAbpqOXZN4cPR5Q a/wUnywIfAgFEX8cMDB7IwfULYbV2skxy3AbGZvUcXzOrzOZG7phDObgeZsMPMkDyolV LXPB73bDzPitDvrxeEumeY2x/knL+v6jbUbKZqvUW+hNGEp+dvzCqHpHKikioVTX/ajE qT/CPRUl/dHhkhn6deKJCKU/uYCjKUq70N88jidpxdCbHm9/nhx0Kw9fPUdxEKASM184 KpUg== X-Gm-Message-State: AOAM532wwZOXAg/pkNTaLzRjNAxiPlKr8h83wsQ879E9FXdbMDasmVvc NynaRlNSaxv1XBQiG5N6y3d4nJqHvjtZSg== X-Google-Smtp-Source: ABdhPJxgskBuYOh/KK5SyJvpN2W9k2i2qePckkxs/0dk/76cuOiHfI0TUQLtqS2rxhRJxI9oMssa0A== X-Received: by 2002:a17:90a:4595:: with SMTP id v21mr7305301pjg.43.1634829945343; Thu, 21 Oct 2021 08:25:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/19] hw/arm/virt: Don't create device-tree node for empty NUMA node Date: Thu, 21 Oct 2021 08:25:26 -0700 Message-Id: <20211021152541.781175-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Andrew Jones , Gavin Shan Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Gavin Shan The empty NUMA node, where no memory resides, are allowed. For example, the following command line specifies two empty NUMA nodes. With this, QEMU fails to boot because of the conflicting device-tree node names, as the following error message indicates. /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64 \ -accel kvm -machine virt,gic-version=host \ -cpu host -smp 4,sockets=2,cores=2,threads=1 \ -m 1024M,slots=16,maxmem=64G \ -object memory-backend-ram,id=mem0,size=512M \ -object memory-backend-ram,id=mem1,size=512M \ -numa node,nodeid=0,cpus=0-1,memdev=mem0 \ -numa node,nodeid=1,cpus=2-3,memdev=mem1 \ -numa node,nodeid=2 \ -numa node,nodeid=3 : qemu-system-aarch64: FDT: Failed to create subnode /memory@80000000: FDT_ERR_EXISTS As specified by linux device-tree binding document, the device-tree nodes for these empty NUMA nodes shouldn't be generated. However, the corresponding NUMA node IDs should be included in the distance map. The memory hotplug through device-tree on ARM64 isn't existing so far and it's not necessary to require the user to provide a distance map. Furthermore, the default distance map Linux generates may even be sufficient. So this simply skips populating the device-tree nodes for these empty NUMA nodes to avoid the error, so that QEMU can be started successfully. Signed-off-by: Gavin Shan Reviewed-by: Andrew Jones Message-Id: <20211015124246.23073-1-gshan@redhat.com> Signed-off-by: Richard Henderson --- hw/arm/boot.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 57efb61ee4..74ad397b1f 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -599,10 +599,23 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, } g_strfreev(node_path); + /* + * We drop all the memory nodes which correspond to empty NUMA nodes + * from the device tree, because the Linux NUMA binding document + * states they should not be generated. Linux will get the NUMA node + * IDs of the empty NUMA nodes from the distance map if they are needed. + * This means QEMU users may be obliged to provide command lines which + * configure distance maps when the empty NUMA node IDs are needed and + * Linux's default distance map isn't sufficient. + */ if (ms->numa_state != NULL && ms->numa_state->num_nodes > 0) { mem_base = binfo->loader_start; for (i = 0; i < ms->numa_state->num_nodes; i++) { mem_len = ms->numa_state->nodes[i].node_mem; + if (!mem_len) { + continue; + } + rc = fdt_add_memory_node(fdt, acells, mem_base, scells, mem_len, i); if (rc < 0) { From patchwork Thu Oct 21 15:25:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575605 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3ECD9C433F5 for ; Thu, 21 Oct 2021 15:34:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D0C1561130 for ; Thu, 21 Oct 2021 15:34:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D0C1561130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mda57-0003sA-UA for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:34:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx3-000082-AR for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:53 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:55935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZwx-0002IF-9y for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:52 -0400 Received: by mail-pj1-x1032.google.com with SMTP id om14so744146pjb.5 for ; Thu, 21 Oct 2021 08:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XmPiuN7VGWQFXG0wvR4WMwlqOuQOorNdUMgDKtUti9Y=; b=YGjkYKoWc+KgioiDALCOk3ZggXpMrkMSC037IzEsjiCyHvBgN3KzURuuZUrDWYqeTK Bo72Wpp2FbK3kIf1MiJELRp8dGOOkCz8d53ms2ySd4Zn2o5RICt1tfksIOTV2LQLklbN 0pflAraOaL7oZPr0Fb1JXWR41kpWE0SoePyRwChXfyRPrYm5ZP2Y5fY2kUly0sLuRV5s x8Xq/rdsQf5XWSCi6QOIazLbUgoMlB+mjuvGxYoSyy7mTIcUSTqZsIT7j2qVf64xUXYE h7xusDKdfbdUQNRDCWEXNghXdJS1tdg+iPdRzeHJocRsSPwMW6uSazKFYfSWOsmExDhx O5RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XmPiuN7VGWQFXG0wvR4WMwlqOuQOorNdUMgDKtUti9Y=; b=3UxvmNbp46PccnDs6VaTG3fFFCF+d127d1GyGFzARRgjLfvGEqHR75V/dn7LlNj7B2 8LAd4HaWkEI6/cej5hCXpPtk5hQXW9I8caNX/B3KO+b1tiEGzDNVTxNBoARF8zHPp4va wuAbuRYDIj9e7Fk8vl5ceZN1I3lY/JD8zseCMJh+G6Z3MvfYgzYHl1p+brMgCmQpQGks vo9BhUnsXJRPfA0JMCSz0DEs7haBTTemA0kc4VL99Y+GD5epYxuejYdBgB1hn97jFW+U JL8xhczK12Lm20sVC90V8JwQuVap1yGSJF5ReL5x8TNg03cuGb2Pp32Oi2ME8avjaBQz MUVw== X-Gm-Message-State: AOAM532x+oS2mu3WT/+MMEOl7gRYZD4fc7V7EXFwV95m59884kZkLGoU Gv78dU0zwdgR+ypp5x6UVBUzxrOQhWAweg== X-Google-Smtp-Source: ABdhPJy4JVkj4OJqltS3ENP8/V60RjD9ugJjyE4lUEAa1EagZ0kOOrf2cdGR79PdZ+UDcs3S1F3I2g== X-Received: by 2002:a17:902:ce85:b0:13f:9678:ecd2 with SMTP id f5-20020a170902ce8500b0013f9678ecd2mr5870808plg.39.1634829945975; Thu, 21 Oct 2021 08:25:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/19] roms/edk2: Only init brotli submodule to build BaseTools Date: Thu, 21 Oct 2021 08:25:27 -0700 Message-Id: <20211021152541.781175-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Since EDK2 BaseTools only require the brotli submodule, we don't need to initialize other submodules to build it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Gerd Hoffmann Message-Id: <20211018105816.2663195-2-philmd@redhat.com> Signed-off-by: Richard Henderson --- roms/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roms/Makefile b/roms/Makefile index eeb5970348..b967b53bb7 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -143,7 +143,8 @@ build-efi-roms: build-pxe-roms # efirom # edk2-basetools: - cd edk2/BaseTools && git submodule update --init --force + cd edk2/BaseTools && git submodule update --init --force \ + Source/C/BrotliCompress/brotli $(MAKE) -C edk2/BaseTools \ PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \ EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \ From patchwork Thu Oct 21 15:25:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575655 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64447C433EF for ; Thu, 21 Oct 2021 15:43:49 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2CE556120C for ; Thu, 21 Oct 2021 15:43:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2CE556120C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:45684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaEO-0000dh-6t for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:43:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx2-00005I-I2 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:52 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:44902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZwy-0002LW-1q for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:52 -0400 Received: by mail-pj1-x102e.google.com with SMTP id oa12-20020a17090b1bcc00b0019f715462a8so800057pjb.3 for ; Thu, 21 Oct 2021 08:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mt5a7D+1CVHAxOqseVTcbDnwKe/J2TFbRKsmpUgULEQ=; b=dFPK/2vdLzATItyeIfFqrv3zJOcG0viMblzvs6AXMj/etJYy1bAg7pzJvR0uXemS/u /ILyuqW2+kpxizqAE0TxPDxWxpx2AfTocvXBDdJsA5f7wZWo3pbEL/uf15u4TankElde Wxrs3UzPpIv8kkpBfIHVwATf/TavA5WRsolzxSN3YqyxuwYnmCfKStacfkWnfeUJgy7P kIX24r54+p7EtCed99q4yapGrdCP9oiAosvjowJLKGsH7njH5JDDmht1IbjKROcg+Ieg jkIaoh+BBjxT0q+BW3H1s9cNblqq8fMh+eoC5ENOhWb8Zhpe+Lvx8mnZRM+6ltJIUYsH 7p1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mt5a7D+1CVHAxOqseVTcbDnwKe/J2TFbRKsmpUgULEQ=; b=mAYQsL8+9ydkgCVkc2ELwhP/SEMsRcEElVT++y0lRQS+6kBUFkhxhPdq6B3wyCbZpV IZffrCgkt25BlyPT9uQi+FXT952KMAsGzLOCASNYsVTU3Cffslqrj+JDhEtPngV3LUA5 w+vVbSwZlJQlTXpTkVmSQYezy4FXWW1k1CGmaGJ3cIcdEbSLug2V/KtSwRYCx3x6NE4I jJ1kV5BIUoDWwEqEdSWH+7M5TRNWA8efBoaCgcTne0FV0rxUSc4REBNr+TI55YkmBAnb toORR40rZm1Z8LhcjrqaC+xiuvnzMsLurDpZbYKhPRNTnprcX6/+UI63hE+iZqrMSVBj cXVQ== X-Gm-Message-State: AOAM53028MrqqF2bQ2Zhv2KTqXm8/6zBVXWXbSCEgKD+99/QXboVShGj ez0CGvpP7rzlOXcEb/wT+dxWiunaVRHbqw== X-Google-Smtp-Source: ABdhPJxZh5++k+Fm3d/sgjSkHeX1nP4J8rErxot+M3oulUjOM8eRPVFofxYwql8Q2AoqhIlxS2xYPA== X-Received: by 2002:a17:902:70c5:b0:13f:f941:9ad6 with SMTP id l5-20020a17090270c500b0013ff9419ad6mr4143486plt.28.1634829946558; Thu, 21 Oct 2021 08:25:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/19] roms/edk2: Only initialize required submodules Date: Thu, 21 Oct 2021 08:25:28 -0700 Message-Id: <20211021152541.781175-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The EDK2 firmware images built to test QEMU do not require the following submodules: - MdeModulePkg/Universal/RegularExpressionDxe/oniguruma - UnitTestFrameworkPkg/Library/CmockaLib/cmocka The only submodules required are: - ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 - BaseTools/Source/C/BrotliCompress/brotli - CryptoPkg/Library/OpensslLib/openssl - MdeModulePkg/Library/BrotliCustomDecompressLib/brotli Adapt the buildsys machinery to only initialize the required submodules. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann Message-Id: <20211018105816.2663195-3-philmd@redhat.com> Signed-off-by: Richard Henderson --- .gitlab-ci.d/edk2.yml | 6 +++++- roms/Makefile.edk2 | 7 ++++++- scripts/make-release | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.d/edk2.yml b/.gitlab-ci.d/edk2.yml index 62497ba47f..13d0f8b019 100644 --- a/.gitlab-ci.d/edk2.yml +++ b/.gitlab-ci.d/edk2.yml @@ -50,7 +50,11 @@ build-edk2: GIT_DEPTH: 3 script: # Clone the required submodules and build EDK2 - git submodule update --init roms/edk2 - - git -C roms/edk2 submodule update --init + - git -C roms/edk2 submodule update --init -- + ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 + BaseTools/Source/C/BrotliCompress/brotli + CryptoPkg/Library/OpensslLib/openssl + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1)) - echo "=== Using ${JOBS} simultaneous jobs ===" - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2 diff --git a/roms/Makefile.edk2 b/roms/Makefile.edk2 index a8ed325575..fdae0b511f 100644 --- a/roms/Makefile.edk2 +++ b/roms/Makefile.edk2 @@ -51,7 +51,12 @@ all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \ # make-release/tarball scripts. submodules: if test -d edk2/.git; then \ - cd edk2 && git submodule update --init --force; \ + cd edk2 && git submodule update --init --force -- \ + ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \ + BaseTools/Source/C/BrotliCompress/brotli \ + CryptoPkg/Library/OpensslLib/openssl \ + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli \ + ; \ fi # See notes on the ".NOTPARALLEL" target and the "+" indicator in diff --git a/scripts/make-release b/scripts/make-release index a2a8cda33c..05b14ecc95 100755 --- a/scripts/make-release +++ b/scripts/make-release @@ -27,7 +27,12 @@ git submodule update --init # don't necessarily have much control over how a submodule handles its # submodule dependencies, so we continue to handle these on a case-by-case # basis for now. -(cd roms/edk2 && git submodule update --init) +(cd roms/edk2 && \ + git submodule update --init -- \ + ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \ + BaseTools/Source/C/BrotliCompress/brotli \ + CryptoPkg/Library/OpensslLib/openssl \ + MdeModulePkg/Library/BrotliCustomDecompressLib/brotli) popd tar --exclude=.git -cjf ${destination}.tar.bz2 ${destination} rm -rf ${destination} From patchwork Thu Oct 21 15:25:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575633 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7454C433EF for ; Thu, 21 Oct 2021 15:39:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5E95761205 for ; Thu, 21 Oct 2021 15:39:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E95761205 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaA7-0001I5-HK for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:39:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx3-000097-QO for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:53 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:34386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZwy-0002PL-Tg for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:53 -0400 Received: by mail-pg1-x535.google.com with SMTP id h193so656705pgc.1 for ; Thu, 21 Oct 2021 08:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gwDCMsSCc9wL1Hr2zvm6dizELl6LEePS1y9rxyoipeg=; b=nEfzbXPYthWNsKHGKZgbnSMPkgV3wukroYxAecHKAqOcDz0TwLTrOaS/im8oIOjfYI 6iMsKeLRZtC8zQFUt3DSQktrcLMZuZFv+3fYr3IHsDuAaqq04cIhU1sWfDr8Q8OfXH3M vejnL3wq39jZpeSDWJ6H5PQS9Kiu10a45jnFwv+vmGjF1MTna7hN1cTSh2/m6zPCT8fZ 93NObPG8D3TRc0mhJUySWT2IijwDT681487aLlpZ99OXgIjrDljZIbZmxJNYCzyRpOeq DR86/nij6/bAPq7VyAH0a7LtEjY83NC1AKqm83RtXlCa6FAPgc+8lLCjeJXxx7K/utds mz3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gwDCMsSCc9wL1Hr2zvm6dizELl6LEePS1y9rxyoipeg=; b=PRaNNYmDWrfyKnaLk0bGvLmw5srVqt4E43tduXWLC/kAsL3TypOVnCAxUyTRCoXirR htItvPA7qX4aowOkWsajcUPAKYGg1fXXh/DTSz8pSBWRWtJVxHuKgyPzaPg0fonLE52N feVwV6hnoHwoqyziG+4llkwMftsBFmVjBbG59rTmZU0M3PVw4wiTPYKzbbov3hZmoAeP uW5atcSSUP0HxYpbEgxjfFQU2LEIrZ1tVzxJjJp/ZDz2hC5oVLINB6fIHb5lcI8URLRu ainlJabA39vldOHDBi6xzcrsS+NpNQu34CRmcyYGNaVuN2Ph29Bfs1i55kdFRPp8Rc0r WIXQ== X-Gm-Message-State: AOAM532LICaegFexouh7kuVKqFNzE8UCbfInistNYn9skCeUeFh0LCsM /FXPm4ZwuvTiOb7J2lWHHLOwdD+hlmxvrg== X-Google-Smtp-Source: ABdhPJwyjkagnNxMjq7lAaMcsecaO3n9f8HAqZwCkhyJPLlcz3oTUtWPLlgdz0s/tBBjv7Kn+FWi6g== X-Received: by 2002:a05:6a00:a10:b0:412:448c:89c7 with SMTP id p16-20020a056a000a1000b00412448c89c7mr6126501pfh.83.1634829947449; Thu, 21 Oct 2021 08:25:47 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/19] hw/arm/sbsa-ref: Fixed cpu type error message typo. Date: Thu, 21 Oct 2021 08:25:29 -0700 Message-Id: <20211021152541.781175-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= , Shuuichirou Ishii Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Shuuichirou Ishii Signed-off-by: Shuuichirou Ishii Reviewed-by: Alex Bennée Reviewed-by: Yanan Wang Message-Id: <20211008063604.670699-1-ishii.shuuichir@fujitsu.com> Signed-off-by: Richard Henderson --- hw/arm/sbsa-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 509c5f09b4..358714bd3e 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -670,7 +670,7 @@ static void sbsa_ref_init(MachineState *machine) int n, sbsa_max_cpus; if (!cpu_type_valid(machine->cpu_type)) { - error_report("mach-virt: CPU type %s not supported", machine->cpu_type); + error_report("sbsa-ref: CPU type %s not supported", machine->cpu_type); exit(1); } From patchwork Thu Oct 21 15:25:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575657 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D867C433EF for ; Thu, 21 Oct 2021 15:46:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 865E86120C for ; Thu, 21 Oct 2021 15:46:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 865E86120C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:51196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaGa-0004Nq-Dr for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:46:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx5-0000Ef-9a for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:55 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:35499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZwz-0002QJ-K0 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:54 -0400 Received: by mail-pl1-x631.google.com with SMTP id u6so678283ple.2 for ; Thu, 21 Oct 2021 08:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p7YWf2lujzAh/0d3UGKlGnAGxER9ViPbSHizUh6kk68=; b=knG80ZLfW4p/cPYojkdsGeK+PSx0YEOXX/1dAH6esqdSFUie3YS3BBHCdLSFzjIafm /MMt0cVW6cqwoysoX2yFLRZ3wXl0pd+6Zz+TeVfmc4gT4DeiP/VpPHUJ8v7FIluRU3eo C0QlzEqORgIh+8uXyzFrCdTjAthHIkeQ9hxLUNhU+xuhesWiyXs6p5C+z6ENYZD7iJl8 E0BCG6vgcP0ZRR+1npap7lFGaltfhIR3HVn+Bp17df2DNrJVJH74KfwU0bv2QOw+4bvX qMnATqxy8bPG45ixWfVi44LfYc5/F7EX9MLTYi3XAFDXLxnAE0lnH2AJ9NkIi3t0emOe Jmkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p7YWf2lujzAh/0d3UGKlGnAGxER9ViPbSHizUh6kk68=; b=hwtnPzzYfFSWFH6kzY5y5AyuT0IyoyRgwlFHzTXjl6X+pbAFZUG8qmLEaNwilu/QY/ fJSFnBYQJrweObQ/5C545x8ldqxXpxM1tnBqrH5RBWZu64zBRyS7iEygtwxD7q2ZH1KV b+lofzmFPIorQiYpBXqv4ct0P3DYjYO14KRZtK+DC0bwdydAIchU/PWUTmiEXHKqT1xT hHBtGXSMyQhxjnhRB+ya0rAkxXSmdZylq25+Ufo+9voI8BLiO6EaVIlTwLNeMbJvX/n6 Ohwq9s0uQXBOK0AB/K2P1rXDSE3c+0kbiHVcd72kiEepS/x6OQxNqSgAZzhCBh5Kunq+ hNiw== X-Gm-Message-State: AOAM5320FZq6qkYcLC0xfKsfxE0Oszz5eCWzDmoLnNdCEvWdvHDGmYiP EviC65xD+iErphMexTtikF3tz+u1Ig++Gw== X-Google-Smtp-Source: ABdhPJwaw1EFgyxtZHNn+FbGvVD36O9zJv321DrpwgkHSWazO37AdVqKk2bWXZVHenLjwsgTV8UEWw== X-Received: by 2002:a17:902:ff02:b0:140:512:4dda with SMTP id f2-20020a170902ff0200b0014005124ddamr2552717plj.44.1634829948110; Thu, 21 Oct 2021 08:25:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/19] hw/elf_ops.h: switch to ssize_t for elf loader return type Date: Thu, 21 Oct 2021 08:25:30 -0700 Message-Id: <20211021152541.781175-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Stefano Garzarella , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Luc Michel Until now, int was used as the return type for all the ELF loader related functions. The returned value is the sum of all loaded program headers "MemSize" fields. Because of the overflow check in elf_ops.h, trying to load an ELF bigger than INT_MAX will fail. Switch to ssize_t to remove this limitation. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Stefano Garzarella Message-Id: <20211014194325.19917-1-lmichel@kalray.eu> Signed-off-by: Richard Henderson --- include/hw/elf_ops.h | 27 ++++++++++---------- include/hw/loader.h | 58 +++++++++++++++++++++--------------------- hw/core/loader.c | 60 +++++++++++++++++++++++--------------------- 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 1c37cec4ae..995de8495c 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -312,25 +312,26 @@ static struct elf_note *glue(get_elf_note_type, SZ)(struct elf_note *nhdr, return nhdr; } -static int glue(load_elf, SZ)(const char *name, int fd, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, - int must_swab, uint64_t *pentry, - uint64_t *lowaddr, uint64_t *highaddr, - uint32_t *pflags, int elf_machine, - int clear_lsb, int data_swab, - AddressSpace *as, bool load_rom, - symbol_fn_t sym_cb) +static ssize_t glue(load_elf, SZ)(const char *name, int fd, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, + int must_swab, uint64_t *pentry, + uint64_t *lowaddr, uint64_t *highaddr, + uint32_t *pflags, int elf_machine, + int clear_lsb, int data_swab, + AddressSpace *as, bool load_rom, + symbol_fn_t sym_cb) { struct elfhdr ehdr; struct elf_phdr *phdr = NULL, *ph; - int size, i, total_size; + int size, i; + ssize_t total_size; elf_word mem_size, file_size, data_offset; uint64_t addr, low = (uint64_t)-1, high = 0; GMappedFile *mapped_file = NULL; uint8_t *data = NULL; - int ret = ELF_LOAD_FAILED; + ssize_t ret = ELF_LOAD_FAILED; if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr)) goto fail; @@ -482,7 +483,7 @@ static int glue(load_elf, SZ)(const char *name, int fd, } } - if (mem_size > INT_MAX - total_size) { + if (mem_size > SSIZE_MAX - total_size) { ret = ELF_LOAD_TOO_BIG; goto fail; } diff --git a/include/hw/loader.h b/include/hw/loader.h index 81104cb02f..4fa485bd61 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -90,7 +90,7 @@ int load_image_gzipped(const char *filename, hwaddr addr, uint64_t max_sz); #define ELF_LOAD_WRONG_ARCH -3 #define ELF_LOAD_WRONG_ENDIAN -4 #define ELF_LOAD_TOO_BIG -5 -const char *load_elf_strerror(int error); +const char *load_elf_strerror(ssize_t error); /** load_elf_ram_sym: * @filename: Path of ELF file @@ -128,48 +128,48 @@ const char *load_elf_strerror(int error); typedef void (*symbol_fn_t)(const char *st_name, int st_info, uint64_t st_value, uint64_t st_size); -int load_elf_ram_sym(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, - uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags, - int big_endian, int elf_machine, - int clear_lsb, int data_swab, - AddressSpace *as, bool load_rom, symbol_fn_t sym_cb); +ssize_t load_elf_ram_sym(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, + uint64_t *lowaddr, uint64_t *highaddr, + uint32_t *pflags, int big_endian, int elf_machine, + int clear_lsb, int data_swab, + AddressSpace *as, bool load_rom, symbol_fn_t sym_cb); /** load_elf_ram: * Same as load_elf_ram_sym(), but doesn't allow the caller to specify a * symbol callback function */ -int load_elf_ram(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, - uint64_t *highaddr, uint32_t *pflags, int big_endian, - int elf_machine, int clear_lsb, int data_swab, - AddressSpace *as, bool load_rom); +ssize_t load_elf_ram(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, + uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags, + int big_endian, int elf_machine, int clear_lsb, + int data_swab, AddressSpace *as, bool load_rom); /** load_elf_as: * Same as load_elf_ram(), but always loads the elf as ROM */ -int load_elf_as(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, - uint64_t *highaddr, uint32_t *pflags, int big_endian, - int elf_machine, int clear_lsb, int data_swab, - AddressSpace *as); +ssize_t load_elf_as(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, + uint64_t *highaddr, uint32_t *pflags, int big_endian, + int elf_machine, int clear_lsb, int data_swab, + AddressSpace *as); /** load_elf: * Same as load_elf_as(), but doesn't allow the caller to specify an * AddressSpace. */ -int load_elf(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, - uint64_t *highaddr, uint32_t *pflags, int big_endian, - int elf_machine, int clear_lsb, int data_swab); +ssize_t load_elf(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, + uint64_t *highaddr, uint32_t *pflags, int big_endian, + int elf_machine, int clear_lsb, int data_swab); /** load_elf_hdr: * @filename: Path of ELF file diff --git a/hw/core/loader.c b/hw/core/loader.c index c623318b73..c7f97fdce8 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -326,7 +326,7 @@ static void *load_at(int fd, off_t offset, size_t size) #define SZ 64 #include "hw/elf_ops.h" -const char *load_elf_strerror(int error) +const char *load_elf_strerror(ssize_t error) { switch (error) { case 0: @@ -402,12 +402,12 @@ fail: } /* return < 0 if error, otherwise the number of bytes loaded in memory */ -int load_elf(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, - uint64_t *highaddr, uint32_t *pflags, int big_endian, - int elf_machine, int clear_lsb, int data_swab) +ssize_t load_elf(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, + uint64_t *highaddr, uint32_t *pflags, int big_endian, + int elf_machine, int clear_lsb, int data_swab) { return load_elf_as(filename, elf_note_fn, translate_fn, translate_opaque, pentry, lowaddr, highaddr, pflags, big_endian, @@ -415,12 +415,13 @@ int load_elf(const char *filename, } /* return < 0 if error, otherwise the number of bytes loaded in memory */ -int load_elf_as(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, - uint64_t *highaddr, uint32_t *pflags, int big_endian, - int elf_machine, int clear_lsb, int data_swab, AddressSpace *as) +ssize_t load_elf_as(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, + uint64_t *highaddr, uint32_t *pflags, int big_endian, + int elf_machine, int clear_lsb, int data_swab, + AddressSpace *as) { return load_elf_ram(filename, elf_note_fn, translate_fn, translate_opaque, pentry, lowaddr, highaddr, pflags, big_endian, @@ -428,13 +429,13 @@ int load_elf_as(const char *filename, } /* return < 0 if error, otherwise the number of bytes loaded in memory */ -int load_elf_ram(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr, - uint64_t *highaddr, uint32_t *pflags, int big_endian, - int elf_machine, int clear_lsb, int data_swab, - AddressSpace *as, bool load_rom) +ssize_t load_elf_ram(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, + uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags, + int big_endian, int elf_machine, int clear_lsb, + int data_swab, AddressSpace *as, bool load_rom) { return load_elf_ram_sym(filename, elf_note_fn, translate_fn, translate_opaque, @@ -444,16 +445,17 @@ int load_elf_ram(const char *filename, } /* return < 0 if error, otherwise the number of bytes loaded in memory */ -int load_elf_ram_sym(const char *filename, - uint64_t (*elf_note_fn)(void *, void *, bool), - uint64_t (*translate_fn)(void *, uint64_t), - void *translate_opaque, uint64_t *pentry, - uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags, - int big_endian, int elf_machine, - int clear_lsb, int data_swab, - AddressSpace *as, bool load_rom, symbol_fn_t sym_cb) +ssize_t load_elf_ram_sym(const char *filename, + uint64_t (*elf_note_fn)(void *, void *, bool), + uint64_t (*translate_fn)(void *, uint64_t), + void *translate_opaque, uint64_t *pentry, + uint64_t *lowaddr, uint64_t *highaddr, + uint32_t *pflags, int big_endian, int elf_machine, + int clear_lsb, int data_swab, + AddressSpace *as, bool load_rom, symbol_fn_t sym_cb) { - int fd, data_order, target_data_order, must_swab, ret = ELF_LOAD_FAILED; + int fd, data_order, target_data_order, must_swab; + ssize_t ret = ELF_LOAD_FAILED; uint8_t e_ident[EI_NIDENT]; fd = open(filename, O_RDONLY | O_BINARY); From patchwork Thu Oct 21 15:25:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575641 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11874C433F5 for ; Thu, 21 Oct 2021 15:43:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C50A8611CE for ; Thu, 21 Oct 2021 15:43:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C50A8611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaDe-0007Fx-Ug for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx4-0000Au-9s for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:54 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:37585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx0-0002Qs-Cw for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:53 -0400 Received: by mail-pf1-x436.google.com with SMTP id q19so963288pfl.4 for ; Thu, 21 Oct 2021 08:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eLeCAn9UpCFXZ2tYI2+7Y5B4D+ZV0bPVvNpx+NghjAM=; b=mSgGZYMytADVCxFUrMR03PKo1vvpqVRCObGMual3qL2rxhwqAZQaga+L+IqYjD0BLi BJRbItfg6MHbrAtSCRRqU4NklxMATCDT7gCXhGy+YOxMnhgDdM08sp+8xjLLox39Eu2U qxUtQGggoao0aRBHwnWTrnhkgf+crggtY+rnGk17C3OKmdyfzh0w7VGqfw6dOVtUCzdC hnpWy2OMUphMSSbXcJmqlVcCWtNCpMI4M0jryKDKVAkWu45euesVpHCKrrB5m0EUMkFD RaQ0Wls7nTDllqsnaGl7lCSN9YKNffPhtDEM+NNBxIzmu52VJ4awywM2e/BBGZ1Zs0yH IeuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eLeCAn9UpCFXZ2tYI2+7Y5B4D+ZV0bPVvNpx+NghjAM=; b=WbSS+N9AgM/AbDZUrDyVyaDtwOEFO+LJ/I+8pLqzV8zMcrYNFBmKMNdiFjs+y9M10f Y1J8sTW01jbpblzWOeYjQiR7rs6y2I9IpJhKS78cfRo0+xwpcywv6mJOr5pLV6Z7+VLE KpuD1DxiMkLqKeqEP+XgQWMRBqi7qaigx7hFRNHeprMrfOAyqQ8Yb6rXIbGckI6EzuZy NfcG/harlmN+YyK9Gr7hxLPZz5oeV3577SX6LwVshA8MR/ASfiQka9AQWemMF0SuuVgC qFMtV7tQPEkgZaAONgv/lL5x9xaI6FevHWYfAeg/AHpC6Gv1P6ggrO3hZkDHaTPi3c3F UL1w== X-Gm-Message-State: AOAM53301BU0/z2fd/yonooucKAO+rZmLTWS9WMwMJUSYJRJJhxMUMDv jphXJEaOrd78dxfjRhZLaraXrpSKL2fXEg== X-Google-Smtp-Source: ABdhPJx5Ax2TrICLJnlsbFyHvoJN4g0qlW3M5bvCSmXam9ltAT5ZRaFltQ3ZAGe6X9I5/T2dmyiwIQ== X-Received: by 2002:a05:6a00:15c9:b0:44c:a998:b50d with SMTP id o9-20020a056a0015c900b0044ca998b50dmr6351341pfu.49.1634829948758; Thu, 21 Oct 2021 08:25:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/19] tests/acpi: Add void table for virt/DBG2 bios-tables-test Date: Thu, 21 Oct 2021 08:25:31 -0700 Message-Id: <20211021152541.781175-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Eric Auger , "Michael S . Tsirkin" , Igor Mammedov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Add placeholders for DBG2 reference table for virt tests and ignore till reference blob is added. Signed-off-by: Eric Auger Acked-by: Igor Mammedov Acked-by: Michael S. Tsirkin Message-Id: <20211019080037.930641-2-eric.auger@redhat.com> Signed-off-by: Richard Henderson --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/data/acpi/virt/DBG2 | 0 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/virt/DBG2 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..1910d154c2 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/DBG2", diff --git a/tests/data/acpi/virt/DBG2 b/tests/data/acpi/virt/DBG2 new file mode 100644 index 0000000000..e69de29bb2 From patchwork Thu Oct 21 15:25:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575639 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A35B1C433F5 for ; Thu, 21 Oct 2021 15:42:18 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 413B3611C7 for ; Thu, 21 Oct 2021 15:42:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 413B3611C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:40514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaCv-0005Yj-Dc for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:42:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx6-0000Gi-1I for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:56 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:42868) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx0-0002R3-Rm for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:55 -0400 Received: by mail-pg1-x534.google.com with SMTP id t7so617987pgl.9 for ; Thu, 21 Oct 2021 08:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ErF+8i/+0tR5/azRFLcQKZVn9pixjkrst7fCrRvD3X8=; b=MZjLG+i+saUFtjmsQsFIzwiDNzD+WePxKuXVC73B9xBP12qJqQ122jgEDRpqHFLKHH Ng9GFk/cHgw/a7XUunlxwoffGJibVwgXH+jr7aY+u+c6qEE99W/Ce3av6A3mcd1mv3k4 M0CyfO4KHhMBHZfGwR9MUd6dL+fAVRnsx9sM/dbjEnM9H8g1hV/FnzH2iWKhJ+ImZ1iV 5hkU7SzTPVHIIQLBB6Jubh73Wb87/YRawakZme/jt0oDf3Y+vh/nWEk5mwNuD+fXHiDf EXHq9UwsHVjc1+rlHHhTqqNXCz+gP7RPKzbDouGTTDw497yW3mYaRbhu3yafEgXYUBaY XsiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ErF+8i/+0tR5/azRFLcQKZVn9pixjkrst7fCrRvD3X8=; b=MGQxrUIk22QFURXG9aLcXEi9Ti2I0K0ZbgnvxPmJJoOx3l6jMhkd1tPJMn2zudU/u8 SqD4Egwf9+3UiystcctfMnWvdFirvTzUDx8c004WZyZYNx8PxHhmEyv6R3gDzFuUKAbq Ut4x59Pec/Yso4968C6Ntd0qowD5JyWXGXy7h5Q6YhiUobdGMkSSZjAirGt7Xry1JR+l ieZWakoAPrBl25T3YtRQMUs/ftyNmqHCoL9GO6xxZg/xP5KeQTbXUe9+v0oRlDRZd1Dh rbQHr4TztEivjZnEQejNQjoOx7IAyfvtjbzxUdi3U10A8oHDtCJHcM5Z8IF5yBLmgxG1 KBYg== X-Gm-Message-State: AOAM5323274CqI2SCdgU8yphqufk5eAfHOJ8Gy+AIkGSVdYD8NVsgrSs KCc2L9WOR2W/uINXYi7PupZxEl7jdPO0vw== X-Google-Smtp-Source: ABdhPJy5qbyPbKpnk/wYu4vf2mqmYxdAHk0G+utvptZpDV/M36Fon+qk0uZMIGnnzW04t6bKMPKV0w== X-Received: by 2002:a05:6a00:2301:b0:44d:8136:c0db with SMTP id h1-20020a056a00230100b0044d8136c0dbmr6663128pfh.43.1634829949479; Thu, 21 Oct 2021 08:25:49 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/19] hw/arm/virt_acpi_build: Generate DBG2 table Date: Thu, 21 Oct 2021 08:25:32 -0700 Message-Id: <20211021152541.781175-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Eric Auger , Andrew Jones , "Michael S . Tsirkin" , Igor Mammedov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger ARM SBBR specification mandates DBG2 table (Debug Port Table 2) since v1.0 (ARM DEN0044F 8.3.1.7 DBG2). The DBG2 table allows to describe one or more debug ports. Generate an DBG2 table featuring a single debug port, the PL011. The DBG2 specification can be found at "Microsoft Debug Port Table 2 (DBG2)" https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table?redirectedfrom=MSDN Signed-off-by: Eric Auger Reviewed-by: Andrew Jones Reviewed-by: Igor Mammedov Acked-by: Michael S. Tsirkin Message-Id: <20211019080037.930641-3-eric.auger@redhat.com> Signed-off-by: Richard Henderson --- hw/arm/virt-acpi-build.c | 63 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 9c4730f4ab..d3bb4cba3e 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -626,6 +626,64 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) acpi_table_end(linker, &table); } +/* Debug Port Table 2 (DBG2) */ +static void +build_dbg2(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) +{ + AcpiTable table = { .sig = "DBG2", .rev = 0, .oem_id = vms->oem_id, + .oem_table_id = vms->oem_table_id }; + int dbg2devicelength; + const char name[] = "COM0"; + const int namespace_length = sizeof(name); + + acpi_table_begin(&table, table_data); + + dbg2devicelength = 22 + /* BaseAddressRegister[] offset */ + 12 + /* BaseAddressRegister[] */ + 4 + /* AddressSize[] */ + namespace_length /* NamespaceString[] */; + + /* OffsetDbgDeviceInfo */ + build_append_int_noprefix(table_data, 44, 4); + /* NumberDbgDeviceInfo */ + build_append_int_noprefix(table_data, 1, 4); + + /* Table 2. Debug Device Information structure format */ + build_append_int_noprefix(table_data, 0, 1); /* Revision */ + build_append_int_noprefix(table_data, dbg2devicelength, 2); /* Length */ + /* NumberofGenericAddressRegisters */ + build_append_int_noprefix(table_data, 1, 1); + /* NameSpaceStringLength */ + build_append_int_noprefix(table_data, namespace_length, 2); + build_append_int_noprefix(table_data, 38, 2); /* NameSpaceStringOffset */ + build_append_int_noprefix(table_data, 0, 2); /* OemDataLength */ + /* OemDataOffset (0 means no OEM data) */ + build_append_int_noprefix(table_data, 0, 2); + + /* Port Type */ + build_append_int_noprefix(table_data, 0x8000 /* Serial */, 2); + /* Port Subtype */ + build_append_int_noprefix(table_data, 0x3 /* ARM PL011 UART */, 2); + build_append_int_noprefix(table_data, 0, 2); /* Reserved */ + /* BaseAddressRegisterOffset */ + build_append_int_noprefix(table_data, 22, 2); + /* AddressSizeOffset */ + build_append_int_noprefix(table_data, 34, 2); + + /* BaseAddressRegister[] */ + build_append_gas(table_data, AML_AS_SYSTEM_MEMORY, 8, 0, 1, + vms->memmap[VIRT_UART].base); + + /* AddressSize[] */ + build_append_int_noprefix(table_data, + vms->memmap[VIRT_UART].size, 4); + + /* NamespaceString[] */ + g_array_append_vals(table_data, name, namespace_length); + + acpi_table_end(linker, &table); +}; + /* * ACPI spec, Revision 5.1 Errata A * 5.2.12 Multiple APIC Description Table (MADT) @@ -885,7 +943,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) dsdt = tables_blob->len; build_dsdt(tables_blob, tables->linker, vms); - /* FADT MADT GTDT MCFG SPCR pointed to by RSDT */ + /* FADT MADT GTDT MCFG SPCR DBG2 pointed to by RSDT */ acpi_add_table(table_offsets, tables_blob); build_fadt_rev5(tables_blob, tables->linker, vms, dsdt); @@ -908,6 +966,9 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) acpi_add_table(table_offsets, tables_blob); build_spcr(tables_blob, tables->linker, vms); + acpi_add_table(table_offsets, tables_blob); + build_dbg2(tables_blob, tables->linker, vms); + if (vms->ras) { build_ghes_error_table(tables->hardware_errors, tables->linker); acpi_add_table(table_offsets, tables_blob); From patchwork Thu Oct 21 15:25:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575591 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC291C433EF for ; Thu, 21 Oct 2021 15:32:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 628C4610C8 for ; Thu, 21 Oct 2021 15:32:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 628C4610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:51454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mda3r-000230-40 for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:32:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx4-0000CE-KD for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:54 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:38887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx1-0002Sg-I3 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:54 -0400 Received: by mail-pj1-x102a.google.com with SMTP id o4-20020a17090a3d4400b001a1c8344c3fso1280670pjf.3 for ; Thu, 21 Oct 2021 08:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MN2J3vMWpFDS9vALOoHKYzaMrPkmzkSrC3GEzqF6qxU=; b=cYZT3A8t3ZmAD9mszOecnDYNoVM24+SFeMb6YIqLwTFAKxzOJgElGfVNVGaDX0nNLT Ra201vBzXRMm0XZ7w7/mQbhITELXqw+2+s3f3N40ODWQAMroRzI6zNCytZX2vL+0Bi3n vGI81zTk+AHAxgGI/LqX6dH7KvRwrzBBraw3ST3E9zRWfdAXdoHhz48e0zqVq4mcKwdO nnskRkc2S406po3GHPCX7jLPEq8XZ5MCI7SBUbE56WJIfYkUYjRJNDGLLKh9mtjbP+tK EadHoLgO+Z21G00Yh5NOJsiyngzghgLAyuTf/UiMnem8NkCiBNxCml8raqSd5WH7OzyY H9+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MN2J3vMWpFDS9vALOoHKYzaMrPkmzkSrC3GEzqF6qxU=; b=kjIt0p2gevl6ozpTHIe5iK4YU6Du1NxLRYR4g1MuiwWZz/hiN2Im5Ro8Y0MG8Y7dr2 tyQdXJcUv4+MIp33QTpGm4ICmF105GZ9CU6Al76YwRcI4ky9VotOiDA18MDH9NXt7W1f iW/yZ7P/zd0ODlZh+q+u7MU5m8do/NSW7vWzpR+S+X/wYyVTNgMjT2JibfQTwnZvUpfv 9OHAQpfjZSBpBxr7wFtGQgzLGb6UJwe5ulbhNpE9ZRIrOT+tCaEnmIYY8K1x0HsfCOmu /nkwpYISXiO/Af+2X+wbOSsyncpbTPmSdYrr5nKERsCIgr9V3j95Vf/pM9avIJPAr5te ieYg== X-Gm-Message-State: AOAM530NuTzAd5nj3GpECjsyw2DNee+J+WSA8JHVdgdR/sLa9XHz1ZuG S93XGBuegcPtOvEr9qNJ7202KZpwYRxZSA== X-Google-Smtp-Source: ABdhPJwGTtGZwLEn5eSbHKWqtR6ohtOlop1F0W7UvHRjE8i7eF383YzxERGT2//rkLLIZHk09r3rfA== X-Received: by 2002:a17:902:bc4a:b0:140:82c:646e with SMTP id t10-20020a170902bc4a00b00140082c646emr2091773plz.84.1634829950335; Thu, 21 Oct 2021 08:25:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/19] bios-tables-test: Generate reference table for virt/DBG2 Date: Thu, 21 Oct 2021 08:25:33 -0700 Message-Id: <20211021152541.781175-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Eric Auger , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Add the DBG2 table generated with tests/data/acpi/rebuild-expected-aml.sh Signed-off-by: Eric Auger Acked-by: Michael S. Tsirkin Message-Id: <20211019080037.930641-4-eric.auger@redhat.com> Signed-off-by: Richard Henderson --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/DBG2 | Bin 0 -> 87 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/virt/DBG2 b/tests/data/acpi/virt/DBG2 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..86e6314f7b0235ef8ed3e0221e09f996c41f5e98 100644 GIT binary patch literal 87 zcmZ>9ayJTR0D|*Q{>~o33QiFL&I&-l2owUbL9`AKgJ=eA21Zr}H4uw|p@A7lh%qQJ TFmQk+Il-a=3=Gcxz6J~c3~mVl literal 0 HcmV?d00001 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 1910d154c2..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/DBG2", From patchwork Thu Oct 21 15:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575667 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77657C433F5 for ; Thu, 21 Oct 2021 15:48:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 14D896109F for ; Thu, 21 Oct 2021 15:48:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 14D896109F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaIw-0000Oi-8B for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:48:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx6-0000Iv-E2 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:56 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:36362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx2-0002Wn-Nc for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:56 -0400 Received: by mail-pf1-x42f.google.com with SMTP id m26so966193pff.3 for ; Thu, 21 Oct 2021 08:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zq+vUL3+l8EwtzFQ0nupHEnvpxTTs/A/ZF3RDm4/SUA=; b=P864iVT3ZhO7qiP9K9ZMnWLKgOdh0EGZmmtWcg4ytTiBgtrFepdLTipbp6BNAOmWcD 6M36GV78S6/m8RhxWIaaBoLQhvcDOs11pJiz4WcUeNWoGzhuFbbgJ7+IrR0DGIhLF9Db 4G9IBa5t6vbCqrfgx7LB9P+o25PgCWKyCKUGj9XC8R85U0UQutYkqT3XJf+upQ8O7xaK JfnE604rqrPgBPDh27HA2SGmvCsKfSNloKpzUlD9cOLGlxIueNqdYbEs0Z9o+LodgZiB nUVdju+cg+AtqIMGVAjwW0gy1eOHKMJdhHpex4sCjVIXqWyjyla4NLlw5WhlM6xc1PuB N9qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zq+vUL3+l8EwtzFQ0nupHEnvpxTTs/A/ZF3RDm4/SUA=; b=ZuO9dWG5zMWv/I/j3+WFlrXyY+JScqKwqntODXZAIhrdrJMclBYyB7l4rruI8YsDjW HXQPwh/MoAsFj+128svXXlNabPr5YFHLJZWDHYR2lidJuFcX8SaJHfWQOvNbAopWxyDn NlGwi8CqzCXKFYCH2YxpHLxERi1IeVT2AWrh11IUbgvPkA/3rc+H8JuKRNGUvxnKXHO5 odpY9Wa0fPO7uwak1eeiv7mUaqxL3jbL4A/mJC5AyQ4zjsOejzmbm5Uq9IN7++r5LFf2 Tel0eYUQAEBBcep+v94O7pMURh+anqM0w0MbmukgqpOHbumwaw1qAiPipmRNiS1+McrZ Vv0Q== X-Gm-Message-State: AOAM532CDKnVXlzAhNK0BKk2EjtwUkm7j8YK3flnj6RDTkIkAHr45spa XM+2f0N79/dn1c7lO1ebfL1GUgLv6qpKCQ== X-Google-Smtp-Source: ABdhPJy3hzkD1BoswJ6tfg7xV9tStuRDpbeDYuVIlWmR9rXd3TfC9vI3UlPYsmkGJxAJPriAMk7bLQ== X-Received: by 2002:a62:9215:0:b0:44c:4de1:f777 with SMTP id o21-20020a629215000000b0044c4de1f777mr6144791pfd.31.1634829951350; Thu, 21 Oct 2021 08:25:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/19] hw/arm/virt: Only describe cpu topology since virt-6.2 Date: Thu, 21 Oct 2021 08:25:34 -0700 Message-Id: <20211021152541.781175-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Andrew Jones Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang On existing older machine types, without cpu topology described in ACPI or DT, the guest will populate one by default. With the topology described, it will read the information and set up its topology as instructed, but that may not be the same as what was getting used by default. It's possible that an user application has a dependency on the default topology and if the default one gets changed it will probably behave differently. Based on above consideration we'd better only describe topology information to the guest on 6.2 and later machine types. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Message-Id: <20211020142125.7516-2-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- include/hw/arm/virt.h | 4 +++- hw/arm/virt.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index b461b8d261..dc6b66ffc8 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -125,11 +125,13 @@ struct VirtMachineClass { bool claim_edge_triggered_timers; bool smbios_old_sys_ver; bool no_highmem_ecam; - bool no_ged; /* Machines < 4.2 has no support for ACPI GED device */ + bool no_ged; /* Machines < 4.2 have no support for ACPI GED device */ bool kvm_no_adjvtime; bool no_kvm_steal_time; bool acpi_expose_flash; bool no_secure_gpio; + /* Machines < 6.2 have no support for describing cpu topology to guest */ + bool no_cpu_topology; }; struct VirtMachineState { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 4160d49688..15e8d8cf4a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2816,6 +2816,7 @@ static void virt_machine_6_1_options(MachineClass *mc) virt_machine_6_2_options(mc); compat_props_add(mc->compat_props, hw_compat_6_1, hw_compat_6_1_len); mc->smp_props.prefer_sockets = true; + vmc->no_cpu_topology = true; /* qemu ITS was introduced with 6.2 */ vmc->no_tcg_its = true; From patchwork Thu Oct 21 15:25:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575631 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09D3CC433EF for ; Thu, 21 Oct 2021 15:38:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 88ECC611BD for ; Thu, 21 Oct 2021 15:38:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 88ECC611BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mda9T-000838-FC for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:38:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx5-0000Ft-Le for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:55 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:46773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx3-0002az-IT for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:55 -0400 Received: by mail-pl1-x631.google.com with SMTP id i1so629087plr.13 for ; Thu, 21 Oct 2021 08:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n/Pvx/0svSuMmT8RY9aB1ty9PqQ7g1AslPNBWP29bj4=; b=IZkgbko5fuzLbo+t9lofjVjBRx3O1FNT6lYKUHkO4DFgHcY2zFU1SHEXhwJbsQiE82 501peJCttK2CWxkblzku8Suqv6Dx5TPgh2O+vgQ21Rj+bBUR+Nom+MOYfXmauUu/fm+Y nJDJ96RD9dasfekVVE5BvJzhWeH05Bua9JcTI+HubEr8kq+3MyLZuFYwUxTe8/e7AcLd Q5FybFfFqiGbm3TS2Oc9Xh/4vXZXhFZ6UiC+4F8KHFVKWjEOTSjHqiL/f9icMTjpfErP UQo1yilSPUp0URy1Z3xhZ/z+o/ADeACJaouwS0Ce8nHFdjx3x2X+gIKmHNPCa2Ig5fY0 FaDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n/Pvx/0svSuMmT8RY9aB1ty9PqQ7g1AslPNBWP29bj4=; b=EcEUSWYN4GEo0tvC+F96ur05/zCvWO46cZZcqxV1M5YkMaoGcbC6D8sv6LFG7cLrj6 q3Yj/YmHe8UtdbHGEEzwsqP+YHvdL/WBla48T2IzhAcsGZC+3edUmyagZRaYjtSTKjo0 58sPP0H1klrowUeod+rbmfBfEP5RrF2Ghpl90Pqc/UI7f6R/JtxQMVu3eg/6+57kYEuI vDgoLcqeSEBrWZjPpjt18Eeke4T3tMP9Sw1M+B5NSqu1MnuBw64ggaAJ5QeAbkitNb76 ZXbFYNyhBz8efmc7QPiQXAsgEmF562foWFCJQZHgKg6fcv4exTr0JYXqFmu62XF0oZlg dxRQ== X-Gm-Message-State: AOAM531KId5P+A+5+wEMCV/0KOgkl24Sd9M0W2RoLttwOBMBVVKnFrS2 CJsZORmZiocF+qXREUem1QZ0t8ydp1HdTQ== X-Google-Smtp-Source: ABdhPJwo92IBhyhs6QSMFixTxM4tafxvtt4rjltSBAwnHtGlVWP4ti8CujKDJ0xabG4Ps605A1GsSw== X-Received: by 2002:a17:903:234d:b0:13f:3180:626a with SMTP id c13-20020a170903234d00b0013f3180626amr5869978plh.49.1634829952126; Thu, 21 Oct 2021 08:25:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/19] device_tree: Add qemu_fdt_add_path Date: Thu, 21 Oct 2021 08:25:35 -0700 Message-Id: <20211021152541.781175-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Andrew Jones , Alistair Francis , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang qemu_fdt_add_path() works like qemu_fdt_add_subnode(), except it also adds all missing subnodes from the given path. We'll use it in a coming patch where we will add cpu-map to the device tree. And we also tweak an error message of qemu_fdt_add_subnode(). Co-developed-by: Andrew Jones Signed-off-by: Yanan Wang Reviewed-by: David Gibson Reviewed-by: Andrew Jones Cc: David Gibson Cc: Alistair Francis Message-Id: <20211020142125.7516-3-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- include/sysemu/device_tree.h | 1 + softmmu/device_tree.c | 44 ++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index 8a2fe55622..ef060a9759 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -121,6 +121,7 @@ uint32_t qemu_fdt_get_phandle(void *fdt, const char *path); uint32_t qemu_fdt_alloc_phandle(void *fdt); int qemu_fdt_nop_node(void *fdt, const char *node_path); int qemu_fdt_add_subnode(void *fdt, const char *name); +int qemu_fdt_add_path(void *fdt, const char *path); #define qemu_fdt_setprop_cells(fdt, node_path, property, ...) \ do { \ diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c index b621f63fba..3965c834ca 100644 --- a/softmmu/device_tree.c +++ b/softmmu/device_tree.c @@ -540,8 +540,8 @@ int qemu_fdt_add_subnode(void *fdt, const char *name) retval = fdt_add_subnode(fdt, parent, basename); if (retval < 0) { - error_report("FDT: Failed to create subnode %s: %s", name, - fdt_strerror(retval)); + error_report("%s: Failed to create subnode %s: %s", + __func__, name, fdt_strerror(retval)); exit(1); } @@ -549,6 +549,46 @@ int qemu_fdt_add_subnode(void *fdt, const char *name) return retval; } +/* + * qemu_fdt_add_path: Like qemu_fdt_add_subnode(), but will add + * all missing subnodes from the given path. + */ +int qemu_fdt_add_path(void *fdt, const char *path) +{ + const char *name; + const char *p = path; + int namelen, retval; + int parent = 0; + + if (path[0] != '/') { + return -1; + } + + while (p) { + name = p + 1; + p = strchr(name, '/'); + namelen = p != NULL ? p - name : strlen(name); + + retval = fdt_subnode_offset_namelen(fdt, parent, name, namelen); + if (retval < 0 && retval != -FDT_ERR_NOTFOUND) { + error_report("%s: Unexpected error in finding subnode %.*s: %s", + __func__, namelen, name, fdt_strerror(retval)); + exit(1); + } else if (retval == -FDT_ERR_NOTFOUND) { + retval = fdt_add_subnode_namelen(fdt, parent, name, namelen); + if (retval < 0) { + error_report("%s: Failed to create subnode %.*s: %s", + __func__, namelen, name, fdt_strerror(retval)); + exit(1); + } + } + + parent = retval; + } + + return retval; +} + void qemu_fdt_dumpdtb(void *fdt, int size) { const char *dumpdtb = current_machine->dumpdtb; From patchwork Thu Oct 21 15:25:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575671 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77C69C433F5 for ; Thu, 21 Oct 2021 15:51:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 069CE611F2 for ; Thu, 21 Oct 2021 15:51:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 069CE611F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaM3-0004ye-3F for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx6-0000L5-Tl for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:56 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:38748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx4-0002eJ-Ex for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:56 -0400 Received: by mail-pg1-x52f.google.com with SMTP id e65so638132pgc.5 for ; Thu, 21 Oct 2021 08:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PUts9d+IaMxABVZC1wteSIPc85en1c9gLB8uoNMgezU=; b=HCmZMmvObhS0mAsWD6yvoV4gtKzpsso6VhbOEWYdqFXWlfmdY6/AOTidgvX9KNcu/Q YjEgOngdv4vO364zFcK7G+5hSSS54BLaX5cSJz7GLAFTXKtD52b/PCUEzR2ISfCnLAc2 3d1HeoBr/k2tnCu5WcPfiwvJDmsFcrYJwZvgdVZJQWb4Ncf4/xuCLV+yVWizFhdsVn7o I3oFQ+Fal7Pklxmy78Ea9chsNWz6EeVofD2UscMHY/hjTZ/W3RzvsIC5p4Lw4S1P1WpR g5/4bPCKQ0o+QTxQajrIXVXngOA4wAvr42u3l0DrbdmdayU8GJowccOfQFPEDSDIbtkS ZdLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PUts9d+IaMxABVZC1wteSIPc85en1c9gLB8uoNMgezU=; b=GB+uoMc5UvUUb4edgTZ7of8meNPPa9jshfZCa/6ta7rZraUdSC24HKt+OUkx30uJAi QNLva45uYKjG1b8JOyGg7CYVT6d2I6hFP2v8l9j83u/nhMcllaguSIvRb2gMTgodFk7m eqotRwI3NS4KrfGtscb3mq5iy/S82ydDqMgtRzwIot7phh8SsDSkn1nSO1m4XHZveiD8 0as+D12dZo/vqjTKS0Mtax4WqW/ZvkKBB8H5JRRiBk2vpKWAekUKW39k32rXUmdXOHyR F7s5jbcL09P4SkJ0kvDGdjke49kp7Gn4eLZCWVWfQMVXjSWz3y3LJGQ9F0x6bHSYl+U5 7xqg== X-Gm-Message-State: AOAM530N1MJ1Jx+NYbs0dD5tChQWRSkAjanD5AbEPG9zJxnodbg5F1mq 5EhYE8/n93mSkDRWZGUt5j2891RS2wxqow== X-Google-Smtp-Source: ABdhPJzYdTD71nfPBAeS7L85nZhBm7Of1AlKyP9+kYjwPYtCVWp0U9zFCim09eh9aH3NH3IBulByLA== X-Received: by 2002:a63:ef57:: with SMTP id c23mr4919295pgk.60.1634829952879; Thu, 21 Oct 2021 08:25:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 14/19] hw/arm/virt: Add cpu-map to device tree Date: Thu, 21 Oct 2021 08:25:36 -0700 Message-Id: <20211021152541.781175-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Andrew Jones Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Andrew Jones Support device tree CPU topology descriptions. In accordance with the Devicetree Specification, the Linux Doc "arm/cpus.yaml" requires that cpus and cpu nodes in the DT are present. And we have already met the requirement by generating /cpus/cpu@* nodes for members within ms->smp.cpus. Accordingly, we should also create subnodes in cpu-map for the present cpus, each of which relates to an unique cpu node. The Linux Doc "cpu/cpu-topology.txt" states that the hierarchy of CPUs in a SMP system is defined through four entities and they are socket/cluster/core/thread. It is also required that a socket node's child nodes must be one or more cluster nodes. Given that currently we are only provided with information of socket/core/thread, we assume there is one cluster child node in each socket node when creating cpu-map. Co-developed-by: Yanan Wang Signed-off-by: Andrew Jones Signed-off-by: Yanan Wang Message-Id: <20211020142125.7516-4-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- hw/arm/virt.c | 70 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 15e8d8cf4a..ca433adb5b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -351,20 +351,21 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) int cpu; int addr_cells = 1; const MachineState *ms = MACHINE(vms); + const VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); int smp_cpus = ms->smp.cpus; /* - * From Documentation/devicetree/bindings/arm/cpus.txt - * On ARM v8 64-bit systems value should be set to 2, - * that corresponds to the MPIDR_EL1 register size. - * If MPIDR_EL1[63:32] value is equal to 0 on all CPUs - * in the system, #address-cells can be set to 1, since - * MPIDR_EL1[63:32] bits are not used for CPUs - * identification. + * See Linux Documentation/devicetree/bindings/arm/cpus.yaml + * On ARM v8 64-bit systems value should be set to 2, + * that corresponds to the MPIDR_EL1 register size. + * If MPIDR_EL1[63:32] value is equal to 0 on all CPUs + * in the system, #address-cells can be set to 1, since + * MPIDR_EL1[63:32] bits are not used for CPUs + * identification. * - * Here we actually don't know whether our system is 32- or 64-bit one. - * The simplest way to go is to examine affinity IDs of all our CPUs. If - * at least one of them has Aff3 populated, we set #address-cells to 2. + * Here we actually don't know whether our system is 32- or 64-bit one. + * The simplest way to go is to examine affinity IDs of all our CPUs. If + * at least one of them has Aff3 populated, we set #address-cells to 2. */ for (cpu = 0; cpu < smp_cpus; cpu++) { ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(cpu)); @@ -407,8 +408,57 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) ms->possible_cpus->cpus[cs->cpu_index].props.node_id); } + if (!vmc->no_cpu_topology) { + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", + qemu_fdt_alloc_phandle(ms->fdt)); + } + g_free(nodename); } + + if (!vmc->no_cpu_topology) { + /* + * Add vCPU topology description through fdt node cpu-map. + * + * See Linux Documentation/devicetree/bindings/cpu/cpu-topology.txt + * In a SMP system, the hierarchy of CPUs can be defined through + * four entities that are used to describe the layout of CPUs in + * the system: socket/cluster/core/thread. + * + * A socket node represents the boundary of system physical package + * and its child nodes must be one or more cluster nodes. A system + * can contain several layers of clustering within a single physical + * package and cluster nodes can be contained in parent cluster nodes. + * + * Given that cluster is not yet supported in the vCPU topology, + * we currently generate one cluster node within each socket node + * by default. + */ + qemu_fdt_add_subnode(ms->fdt, "/cpus/cpu-map"); + + for (cpu = smp_cpus - 1; cpu >= 0; cpu--) { + char *cpu_path = g_strdup_printf("/cpus/cpu@%d", cpu); + char *map_path; + + if (ms->smp.threads > 1) { + map_path = g_strdup_printf( + "/cpus/cpu-map/socket%d/cluster0/core%d/thread%d", + cpu / (ms->smp.cores * ms->smp.threads), + (cpu / ms->smp.threads) % ms->smp.cores, + cpu % ms->smp.threads); + } else { + map_path = g_strdup_printf( + "/cpus/cpu-map/socket%d/cluster0/core%d", + cpu / ms->smp.cores, + cpu % ms->smp.cores); + } + qemu_fdt_add_path(ms->fdt, map_path); + qemu_fdt_setprop_phandle(ms->fdt, map_path, "cpu", cpu_path); + + g_free(map_path); + g_free(cpu_path); + } + } } static void fdt_add_its_gic_node(VirtMachineState *vms) From patchwork Thu Oct 21 15:25:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575661 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DC11C433F5 for ; Thu, 21 Oct 2021 15:47:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 282D760724 for ; Thu, 21 Oct 2021 15:47:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 282D760724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:53014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaHa-0005qT-9R for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:47:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx7-0000NQ-Fa for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:57 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:45647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx4-0002fN-VW for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:57 -0400 Received: by mail-pl1-x636.google.com with SMTP id s1so636940plg.12 for ; Thu, 21 Oct 2021 08:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ntlLu6jx+KTwzSkrUsKE+JzLZz72IPGPPdjKz27oBkU=; b=M51voO5g0DxYMDP8IZDRWYKV/4ohiXkkArbpQxnk60pJptHhMCD6xBA0pmdgDVZKd5 Cj6AMF8DmdfCOUfSAE701EfmGCzppuCVA22O8JpKlWrmXBKcXRzx/AaSk7xBhf/yncGW sSRQYYMUxPx79D8Ib6FpL709a6du/oAuqLWTzU0rdYOcavuvhbxtef/fYcDMfViTiX8A /Drt/QODiE5QN5VgjK0v7URpZw6Fsy8SDLZhbEdZAhyOcxtzej25Rh2V54j165rCo83h PevOFQ0FOrwz0/9GQcli+VeC/UFC8nURJEgb2jh37Q6OT+K6s/MctunmyN4wkNKaLpLr I4bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ntlLu6jx+KTwzSkrUsKE+JzLZz72IPGPPdjKz27oBkU=; b=TbOnEXCtNRp4GsOjbi4U9ZwJGDpc4Wi6QaCgWMYqqCxfY30oH7WMOBMUb78zJz0LbM ko45ksiRTQh5IHcyKV87K/NB9loPxzXdFYkcNE7lzEYIJnt5KijR/snRRmy+v7zqi9dP 3lmT6+jsyK0TvgC7OE6ZqU1v+Ly5k9juysBid/ASjgDsRl2JagrYjqvtvN9Qz2VvDyYN jLy9RwtXGrSFbatDg6eKs4yI4/gjmLCuyTdGbcZQih31anjsNZJEW+hi9RerHT7V4IED ST81WeNhr2OVr6h2A9BwswEggBo3E5NPAbXojaVmdZAGX5J9ZuJSrAA2zfQwDTEZCwVI cByg== X-Gm-Message-State: AOAM530bH2mlKOFhw3xMFJ+dsgmcFA5rL6gdxADods/lb+9hN6iVf03S e+9tUY5yTanp/bihjhKoUzUhCNida3p0dg== X-Google-Smtp-Source: ABdhPJxpMSImUmRCOeEE5X15SljI6Sqgp6AjuJO37VgAiK0a0FfZ2Ri+OLr+4LHcegPi5Ia46xskUQ== X-Received: by 2002:a17:902:f551:b0:13f:2b8:aff7 with SMTP id h17-20020a170902f55100b0013f02b8aff7mr5798229plf.89.1634829953621; Thu, 21 Oct 2021 08:25:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/19] hw/acpi/aml-build: Add Processor hierarchy node structure Date: Thu, 21 Oct 2021 08:25:37 -0700 Message-Id: <20211021152541.781175-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Andrew Jones , "Michael S . Tsirkin" , Yanan Wang , Eric Auger , Henglong Fan , Ying Fang Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang Add a generic API to build Processor hierarchy node structure (Type 0), which is strictly consistent with descriptions in ACPI 6.3: 5.2.29.1. This function will be used to build ACPI PPTT table for cpu topology. Co-developed-by: Ying Fang Co-developed-by: Henglong Fan Co-developed-by: Yanan Wang Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Michael S. Tsirkin Reviewed-by: Eric Auger Message-Id: <20211020142125.7516-5-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- hw/acpi/aml-build.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 76af0ebaf9..5195324585 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1964,6 +1964,36 @@ void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms, acpi_table_end(linker, &table); } +/* + * ACPI spec, Revision 6.3 + * 5.2.29.1 Processor hierarchy node structure (Type 0) + */ +static void build_processor_hierarchy_node(GArray *tbl, uint32_t flags, + uint32_t parent, uint32_t id, + uint32_t *priv_rsrc, + uint32_t priv_num) +{ + int i; + + build_append_byte(tbl, 0); /* Type 0 - processor */ + build_append_byte(tbl, 20 + priv_num * 4); /* Length */ + build_append_int_noprefix(tbl, 0, 2); /* Reserved */ + build_append_int_noprefix(tbl, flags, 4); /* Flags */ + build_append_int_noprefix(tbl, parent, 4); /* Parent */ + build_append_int_noprefix(tbl, id, 4); /* ACPI Processor ID */ + + /* Number of private resources */ + build_append_int_noprefix(tbl, priv_num, 4); + + /* Private resources[N] */ + if (priv_num > 0) { + assert(priv_rsrc); + for (i = 0; i < priv_num; i++) { + build_append_int_noprefix(tbl, priv_rsrc[i], 4); + } + } +} + /* build rev1/rev3/rev5.1 FADT */ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, const char *oem_id, const char *oem_table_id) From patchwork Thu Oct 21 15:25:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575673 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4304BC433F5 for ; Thu, 21 Oct 2021 15:52:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BE309611CE for ; Thu, 21 Oct 2021 15:52:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE309611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaMK-0005xA-It for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:52:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx8-0000S8-P6 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:58 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:39926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx5-0002k5-TJ for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:58 -0400 Received: by mail-pg1-x531.google.com with SMTP id g184so632054pgc.6 for ; Thu, 21 Oct 2021 08:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HMr9QBRkVrXrtQnoAy2rVMOzIhch4tI7pkgXe6e828Q=; b=DqDqkqdUlB5rl/K24R2vc/kFSa6Gwwa8DKMQyv82Bdjb7Le7zInKfMTLjkd19Zazts w23tqhcZ/OYyE5Bs55QYyTjOnRHaE7Pc7iHnsOKH4HIru2LAm7GaEqZdvLocTwbT6Vjg m4sdaVYZkhSYSr0/YeC5pMV5Syo1TX3bOOPXvJ55PZ/C2JkNRCK9q8FrQZutqt9i/3Yi KPgcoENhxkLLKQ4NOt6LdoeaPpaRvg1nj5+iV1lKjHAZzpkRZ7PCMK3zHIBHP8TvC7Ib orFiQLsXk6Zd2i3gv15TAwv+y69V+5W4dgU7EnBdNpuqxKdc1PtJBzWPttwvtmr/nvQl YOvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HMr9QBRkVrXrtQnoAy2rVMOzIhch4tI7pkgXe6e828Q=; b=Kl40dEAk3HVnannVg7kGlLTc+//vzB5osnf615l4LLu3eBY5F+DdDSSEsSg08kW54t tTJnkWYTQyhAh58gGbJ2+z6nOmSAqa+T/3xpOiwoplhkKejbjOMFoSuzPMj7F8jnDRdA eZGhs4vRsZIDTf+SCpPx4++dtFoxZlJGlurfVgsSg9oxenOWfQwGucLuwBAgerpNwyXj R4aWwg8SKiiQhsHRbKVFM3s1bOfj9lmVab1+1CieuRAvT4+oF09RiSM7HYha5Yo6O1Gu kp5jM6E8HBXQ1qYZx6jVEsnUn2oIZYglPZ21KNVGubjFqYbSP/0q38NDFG2x+Q1kVPrB WZ3Q== X-Gm-Message-State: AOAM531H/uyGG6XkTe7URjQuQkGsyc3wnv8V9XQMyjKpei2uBlAWi/4i Am+TvFK0k3VIxi8SAhxFqdfscXdOP+XTgQ== X-Google-Smtp-Source: ABdhPJzTvAIOxTSD0fwR3BKB8exXA/mAOSgZgRVUdoE7qsBfsqTFPBU1IAO5ie4DaZfYnpu1WnQfCQ== X-Received: by 2002:a05:6a00:1acc:b0:44d:98de:6ed6 with SMTP id f12-20020a056a001acc00b0044d98de6ed6mr6135842pfv.50.1634829954460; Thu, 21 Oct 2021 08:25:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 16/19] hw/acpi/aml-build: Add PPTT table Date: Thu, 21 Oct 2021 08:25:38 -0700 Message-Id: <20211021152541.781175-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Eric Auger , Andrew Jones , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Andrew Jones Add the Processor Properties Topology Table (PPTT) used to describe CPU topology information to ACPI guests. Note, a DT-boot Linux guest with a non-flat CPU topology will see socket and core IDs being sequential integers starting from zero, which is different from ACPI-boot Linux guest, e.g. with -smp 4,sockets=2,cores=2,threads=1 a DT boot produces: cpu: 0 package_id: 0 core_id: 0 cpu: 1 package_id: 0 core_id: 1 cpu: 2 package_id: 1 core_id: 0 cpu: 3 package_id: 1 core_id: 1 an ACPI boot produces: cpu: 0 package_id: 36 core_id: 0 cpu: 1 package_id: 36 core_id: 1 cpu: 2 package_id: 96 core_id: 2 cpu: 3 package_id: 96 core_id: 3 This is due to several reasons: 1) DT cpu nodes do not have an equivalent field to what the PPTT ACPI Processor ID must be, i.e. something equal to the MADT CPU UID or equal to the UID of an ACPI processor container. In both ACPI cases those are platform dependant IDs assigned by the vendor. 2) While QEMU is the vendor for a guest, if the topology specifies SMT (> 1 thread), then, with ACPI, it is impossible to assign a core-id the same value as a package-id, thus it is not possible to have package-id=0 and core-id=0. This is because package and core containers must be in the same ACPI namespace and therefore must have unique UIDs. 3) ACPI processor containers are not mandatorily required for PPTT tables to be used and, due to the limitations of which IDs are selected described above in (2), they are not helpful for QEMU, so we don't build them with this patch. In the absence of them, Linux assigns its own unique IDs. The maintainers have chosen not to use counters from zero, but rather ACPI table offsets, which explains why the numbers are so much larger than with DT. 4) When there is no SMT (threads=1) the core IDs for ACPI boot guests match the logical CPU IDs, because these IDs must be equal to the MADT CPU UID (as no processor containers are present), and QEMU uses the logical CPU ID for these MADT IDs. So in summary, with QEMU as the vendor for the guests, we simply use sequential integers starting from zero for the non-leaf nodes but with ID-valid flag unset, so that guest will ignore them and use table offsets as unique container IDs. And we use logical CPU IDs for the leaf nodes with the ID-valid flag set, which will be consistent with MADT. Currently the implementation of PPTT generation complies with ACPI specification 5.2.29 (Revision 6.3). The 6.3 spec can be found at: https://uefi.org/sites/default/files/resources/ACPI_6_3_May16.pdf Reviewed-by: Eric Auger Co-developed-by: Yanan Wang Signed-off-by: Andrew Jones Signed-off-by: Yanan Wang Reviewed-by: Michael S. Tsirkin Message-Id: <20211020142125.7516-6-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- include/hw/acpi/aml-build.h | 3 ++ hw/acpi/aml-build.c | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 3cf6f2c1b9..8346003a22 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -489,6 +489,9 @@ void build_srat_memory(GArray *table_data, uint64_t base, void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms, const char *oem_id, const char *oem_table_id); +void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms, + const char *oem_id, const char *oem_table_id); + void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, const char *oem_id, const char *oem_table_id); diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 5195324585..b3b3310df3 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1994,6 +1994,65 @@ static void build_processor_hierarchy_node(GArray *tbl, uint32_t flags, } } +/* + * ACPI spec, Revision 6.3 + * 5.2.29 Processor Properties Topology Table (PPTT) + */ +void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms, + const char *oem_id, const char *oem_table_id) +{ + int pptt_start = table_data->len; + int uid = 0; + int socket; + AcpiTable table = { .sig = "PPTT", .rev = 2, + .oem_id = oem_id, .oem_table_id = oem_table_id }; + + acpi_table_begin(&table, table_data); + + for (socket = 0; socket < ms->smp.sockets; socket++) { + uint32_t socket_offset = table_data->len - pptt_start; + int core; + + build_processor_hierarchy_node( + table_data, + /* + * Physical package - represents the boundary + * of a physical package + */ + (1 << 0), + 0, socket, NULL, 0); + + for (core = 0; core < ms->smp.cores; core++) { + uint32_t core_offset = table_data->len - pptt_start; + int thread; + + if (ms->smp.threads > 1) { + build_processor_hierarchy_node( + table_data, + (0 << 0), /* not a physical package */ + socket_offset, core, NULL, 0); + + for (thread = 0; thread < ms->smp.threads; thread++) { + build_processor_hierarchy_node( + table_data, + (1 << 1) | /* ACPI Processor ID valid */ + (1 << 2) | /* Processor is a Thread */ + (1 << 3), /* Node is a Leaf */ + core_offset, uid++, NULL, 0); + } + } else { + build_processor_hierarchy_node( + table_data, + (1 << 1) | /* ACPI Processor ID valid */ + (1 << 3), /* Node is a Leaf */ + socket_offset, uid++, NULL, 0); + } + } + } + + acpi_table_end(linker, &table); +} + /* build rev1/rev3/rev5.1 FADT */ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, const char *oem_id, const char *oem_table_id) From patchwork Thu Oct 21 15:25:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575669 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D56E1C433F5 for ; Thu, 21 Oct 2021 15:48:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9F76B611F2 for ; Thu, 21 Oct 2021 15:48:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F76B611F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:59060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaJK-0001Su-R0 for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:48:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx8-0000R4-Ft for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:58 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:39778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx6-0002n5-Ir for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:58 -0400 Received: by mail-pl1-x62d.google.com with SMTP id t21so660647plr.6 for ; Thu, 21 Oct 2021 08:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YRu/MDU+L2EeOsm4b1PTwNiPfEDkTApHO7aOs9wyn2k=; b=a5guZ69j8ejjmMtu0IGQNcQKVSEftT9fT8KQlorFtoyTeOlagZczCzvsdi1acIoI5E 7AgMat92Jrw6tXPRiiI7uBQuUhozX44Sd0LQCq64PQ2l7dHsxkEBFNDtuYjIfNWVan4T 1wYaWmt2P1cyKCywfcjq6URguq6b694LPqhyDvi8rF+kQ29seDEtTS7EHOkrJoLLC5+G k5l1p2+mXtUfMWhlhLznz4Eis4xvHhi2/LTJ6IYUDfjsMxRLOGy3Yr4namqyY834tbK9 Syt9GWtGNbrBZ5rN1FqJJdbbMV9Bu4NdLux1nM+Sm5Niw8rcHdHuP9yH7FUMQ8s3Wi0A 7ZuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YRu/MDU+L2EeOsm4b1PTwNiPfEDkTApHO7aOs9wyn2k=; b=UuxUQk3z4KAKdxL7cdA83t5lKUIPlw5ikhBFDcWvRJqQuoBOKsKVmZoD0RM1r/i0Fg 4l+fPDuibxHYWMT88OF/F5hGJlCcfU2D9cJOS9zUs7xJcjEmpfPu2wkRdV2C69YdlQkJ F2pC0l0U/hxy8H6TAsTKC8PxImNt2bcEQJ41h9xYCmi+i9/oC2/VmmqLikWrUqtV8Qzs bcLmnYGzvM7Uyfw7XiX3fLLRZ/ozHWC55mYcrm10A7D0jyrFfuMtwyVcT+v7LELWX6jr umV3HKd4P8Oqc/K9b60VDpNO9P3YY8/6DOalz1A3RWGn9wzhR4JMdqtokjayW06UP5Ey 1bHw== X-Gm-Message-State: AOAM5324AF5HlJNjd0oy/CW6YkNGhMai475JB2qX/G4kO2GL4rM0iou9 1bxDFd1fgZvoFDRBf7DpKM3wT7BPVFdlug== X-Google-Smtp-Source: ABdhPJxoFURlIn00R5ZX+tGV6lIGllfatDNZHXqCKriy30Yj4GDQpA8bANkSRBbBdoNzhWDA3TDO2Q== X-Received: by 2002:a17:902:904b:b0:13f:b0c9:3c5d with SMTP id w11-20020a170902904b00b0013fb0c93c5dmr6045631plz.26.1634829955164; Thu, 21 Oct 2021 08:25:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 17/19] tests/data/acpi/virt: Add an empty expected file for PPTT Date: Thu, 21 Oct 2021 08:25:39 -0700 Message-Id: <20211021152541.781175-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Eric Auger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang Add a generic empty binary file for the new introduced PPTT table under tests/data/acpi/virt, and list it as files to be changed in tests/qtest/bios-tables-test-allowed-diff.h Signed-off-by: Yanan Wang Reviewed-by: Eric Auger Message-Id: <20211020142125.7516-7-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/data/acpi/virt/PPTT | 0 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/virt/PPTT diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..cb143a55a6 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/PPTT", diff --git a/tests/data/acpi/virt/PPTT b/tests/data/acpi/virt/PPTT new file mode 100644 index 0000000000..e69de29bb2 From patchwork Thu Oct 21 15:25:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575677 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37BA6C433EF for ; Thu, 21 Oct 2021 15:53:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C78C860F50 for ; Thu, 21 Oct 2021 15:53:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C78C860F50 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:41866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaNt-0000cF-Oi for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:53:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZx9-0000XD-V9 for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:59 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:35500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx7-0002pr-4w for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:25:59 -0400 Received: by mail-pl1-x631.google.com with SMTP id u6so678597ple.2 for ; Thu, 21 Oct 2021 08:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ze+2H8eMmj+0SZIe7XjqhHKoxk2ZMkViz4Iz0m/Opao=; b=M0GVtYWHYuykXdWtPdDm+m6SS3G8e5dKY5wIJOlRIVyAVG3aFXWPfTmX4I1HT52J1a P+MdbLCFDYv2c7zmxt0P/1aTawMez9Jszn3wlJgMlZ2fPrcbG5GQKKQh76VyzwD4od0k Aeh2GPQnfFFrpl6q9ZLQsNfLpJ2dM1hSDEIDoH4vZ8gAgkbvz8uEgyOn5iN5jDsVaC3q /BjlCSDsH5yb/QhiyguTIAHu11IwuKkLlemlo3lomA1qyobOfijv5G8vSj/o5XiG0TqC c4Fku21u51wucB3LrLnijh9IcP8BP2gNS9K1PFjs0xnRTqTTiNjADfTIWNjJaDF18KQP 7rzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ze+2H8eMmj+0SZIe7XjqhHKoxk2ZMkViz4Iz0m/Opao=; b=oWSUPxIL6dliiQcjPh0ZLVWXOl1VGxg4cCKfZ4JyQkFVRHYHJ95UbL0tMcdd6OVEgu zrZbR/PDWt4HdLxvwhoNZWP73aV6WZ4APelTBYltxKfK6wyMtwZdeG1v4ueIWLvo+r5v 9ZTiZKtup7zXUkJAWdzbfFRW4dbILHw2e8ZvqUv+sOTIQKZkpGRQhB6PRFeULZc1iW2B 0s59siCItiuSvdhkqJP4XRoIysozUtkM2FnNiHyLtkH6taCtDhLgcAJeHnaGQzUjF9Qp 3XRSeHJv6umzRo3GKPGG3+VvVkqbBb0eodJjhAxBWhBrGJ6L/jdi2MOoTnGYiJH6y4U/ bBLQ== X-Gm-Message-State: AOAM5330O9PnS5OasZNauzHxANbJLgGyoPwmCPWNEq+aGeNrKF6SJe9I moNMgOaLZidZeXlaJGMEvQfcR8XFULo= X-Google-Smtp-Source: ABdhPJxqEvcZrJSmBJDHJxai6Nl9xLNZhdT1jyLs0M2TWtkCI92yWIfxhGJRfTszX3SZTPY6FT9EmQ== X-Received: by 2002:a17:90a:b296:: with SMTP id c22mr7301469pjr.13.1634829955792; Thu, 21 Oct 2021 08:25:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 18/19] hw/arm/virt-acpi-build: Generate PPTT table Date: Thu, 21 Oct 2021 08:25:40 -0700 Message-Id: <20211021152541.781175-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Eric Auger , Andrew Jones Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang Generate the Processor Properties Topology Table (PPTT) for ARM virt machines supporting it (>= 6.2). Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones Reviewed-by: Eric Auger Message-Id: <20211020142125.7516-8-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- hw/arm/virt-acpi-build.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index d3bb4cba3e..674f902652 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -943,13 +943,19 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) dsdt = tables_blob->len; build_dsdt(tables_blob, tables->linker, vms); - /* FADT MADT GTDT MCFG SPCR DBG2 pointed to by RSDT */ + /* FADT MADT PPTT GTDT MCFG SPCR DBG2 pointed to by RSDT */ acpi_add_table(table_offsets, tables_blob); build_fadt_rev5(tables_blob, tables->linker, vms, dsdt); acpi_add_table(table_offsets, tables_blob); build_madt(tables_blob, tables->linker, vms); + if (!vmc->no_cpu_topology) { + acpi_add_table(table_offsets, tables_blob); + build_pptt(tables_blob, tables->linker, ms, + vms->oem_id, vms->oem_table_id); + } + acpi_add_table(table_offsets, tables_blob); build_gtdt(tables_blob, tables->linker, vms); From patchwork Thu Oct 21 15:25:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12575679 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED10EC433EF for ; Thu, 21 Oct 2021 15:55:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8D72261056 for ; Thu, 21 Oct 2021 15:55:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D72261056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:46038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdaPs-0003Vz-JO for qemu-devel@archiver.kernel.org; Thu, 21 Oct 2021 11:55:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdZxA-0000Zo-IM for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:26:00 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:46778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdZx7-0002rp-OX for qemu-devel@nongnu.org; Thu, 21 Oct 2021 11:26:00 -0400 Received: by mail-pl1-x636.google.com with SMTP id i1so629248plr.13 for ; Thu, 21 Oct 2021 08:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wuSVT6Jeal3XVHWytRnTfXOtr84gMm7/3+2VSVYEgGI=; b=VYyna40uD+G+5YQbHm0OtsBX595D9R62bz9cGqaYR31/YzxhYvW61pBu5/cEqMqhs0 DWitsiElx53prKVnOs/5XtkX3KKZoQmpyJSmB0Mg/LHb39kCYzf2qPcAr52gL1g3OLRA SRL4RWN+dxYn7nNFNd88g5UclOIIoK9Zkggh/aOoYSOEDVtw2/0WeYMJ2qFi1rbCuZUD N4X5U2Y1O1bwi3k0xDK5FO8S5G9FaFCyd8k7+Umd5KqEyX7IL82MVct/NW+Lup8iqpvR E+WerXBnLVsvV3f8E4kb4uOrd0Ba5xS7zZ4NnHXGLfFcZf9bYT1qxI62l0hzbHb/qMcI 6eqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wuSVT6Jeal3XVHWytRnTfXOtr84gMm7/3+2VSVYEgGI=; b=FlsniU9YC8lh/0T4Tav+er72PqYy+zoS93ZAhLubkV9iCZb37JmY926nsVbWWNeNGu rXeIWcvXU/HF0rbBQbuctLYQleBvX3mYPJ/KUn/1TBBm8JiDEpd8g4DYuA6HPqGXLcae 0iPRe5U9g0Z6J/0wX0aJWelJPcR+0dZpadyBfIeehfHHD72V5Kq7RhPUjlI3HVg76bPB 8avLCcqqWYq/B5x/9CPBGxNezq28n1yS08SrRhYySBCe2ldOU9q8f6Dx1Ea7libf3uTo ECDWF1djkks+Pi3ud2yGOr8KNaUi3VHxacDo4G6MI9FYiACc3VS8g1YVyZmgEnacJDKm L2Dg== X-Gm-Message-State: AOAM533UfM5jYirMxnsVjzp1UK3CXW1t4Z1uB9GG4UPLHsnSHo01jZ+f 0kAMAWCX2zOh826eClY54/ctb4Nt6m4xfg== X-Google-Smtp-Source: ABdhPJwbPyhMzBLSHs5zRbqMdYBM8ii7jhYQcxM7rIGlABVJv0dPxjNeAnVRPRy5uw6dDMJopaFZ+Q== X-Received: by 2002:a17:902:7246:b0:138:a6ed:66cc with SMTP id c6-20020a170902724600b00138a6ed66ccmr5997416pll.22.1634829956467; Thu, 21 Oct 2021 08:25:56 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y3sm5676257pge.44.2021.10.21.08.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:25:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 19/19] tests/data/acpi/virt: Update the empty expected file for PPTT Date: Thu, 21 Oct 2021 08:25:41 -0700 Message-Id: <20211021152541.781175-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021152541.781175-1-richard.henderson@linaro.org> References: <20211021152541.781175-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Yanan Wang , Eric Auger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang Run ./tests/data/acpi/rebuild-expected-aml.sh from build directory to update PPTT binary. Also empty bios-tables-test-allowed-diff.h. Disassembled output of the updated new file: /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20180810 (64-bit version) * Copyright (c) 2000 - 2018 Intel Corporation * * Disassembly of tests/data/acpi/virt/PPTT, Fri Oct 8 10:12:32 2021 * * ACPI Data Table [PPTT] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "PPTT" [Processor Properties Topology Table] [004h 0004 4] Table Length : 0000004C [008h 0008 1] Revision : 02 [009h 0009 1] Checksum : A8 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 1] Subtable Type : 00 [Processor Hierarchy Node] [025h 0037 1] Length : 14 [026h 0038 2] Reserved : 0000 [028h 0040 4] Flags (decoded below) : 00000001 Physical package : 1 ACPI Processor ID valid : 0 [02Ch 0044 4] Parent : 00000000 [030h 0048 4] ACPI Processor ID : 00000000 [034h 0052 4] Private Resource Number : 00000000 [038h 0056 1] Subtable Type : 00 [Processor Hierarchy Node] [039h 0057 1] Length : 14 [03Ah 0058 2] Reserved : 0000 [03Ch 0060 4] Flags (decoded below) : 0000000A Physical package : 0 ACPI Processor ID valid : 1 [040h 0064 4] Parent : 00000024 [044h 0068 4] ACPI Processor ID : 00000000 [048h 0072 4] Private Resource Number : 00000000 Raw Table Data: Length 76 (0x4C) 0000: 50 50 54 54 4C 00 00 00 02 A8 42 4F 43 48 53 20 // PPTTL.....BOCHS 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC 0020: 01 00 00 00 00 14 00 00 01 00 00 00 00 00 00 00 // ................ 0030: 00 00 00 00 00 00 00 00 00 14 00 00 0A 00 00 00 // ................ 0040: 24 00 00 00 00 00 00 00 00 00 00 00 // $........... Reviewed-by: Eric Auger Signed-off-by: Yanan Wang Message-Id: <20211020142125.7516-9-wangyanan55@huawei.com> Signed-off-by: Richard Henderson --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/PPTT | Bin 0 -> 76 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/virt/PPTT b/tests/data/acpi/virt/PPTT index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7a1258ecf123555b24462c98ccbb76b4ac1d0c2b 100644 GIT binary patch literal 76 zcmWFt2nq3FU|?Wc;pFe^5v<@85#X!<1dKp25F11@h%hjKX%HI*fMQ%gwhD|7qyeJ> B2LS*8 literal 0 HcmV?d00001 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index cb143a55a6..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/PPTT",