From patchwork Fri Aug 12 11:45:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 596804 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp1495811maz; Fri, 12 Aug 2022 04:49:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6d8LUN3UqIX//W0zgK6fyLKaLC4ACpv61OGHYr12L9X/N9TnrIRtb9/22GIFJsy7L9UAPX X-Received: by 2002:a05:6214:2b09:b0:477:519:696d with SMTP id jx9-20020a0562142b0900b004770519696dmr2769662qvb.127.1660304974562; Fri, 12 Aug 2022 04:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660304974; cv=none; d=google.com; s=arc-20160816; b=LtWiLV8/Rt5Yo5deKiQO5k/xLspb5uM31VrFOa30CabbDCwC7fjrPeFCtZFiXTX3P6 1VXmWtl6x1WDhX+T7O+UdxdtLFizRzbr4vFbxDEpWhadV4kyiFl6lDq+P66btwbN7XDZ 5bAHiS4oD6S54goHXmyVIhXnoY7NmYYJTgDX2ykauXCNz2wNGTkt7GLDr5P/21IcTDkl 8ZvDEIeLBo1orIR3Il76NmkDX1ogh2hoFNUOqY0yj3rcYIx90IDRFmP231mg/go1eqJV B7MDgrRPS8JAfxbwxiRJBWcG++SuOolS3LiywOBqyJJ7iNqo972K7JVirO/7vSBbymvg OVgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Ce+a9h2NdhVEtI5y5oWvwzc5i/EiA02fVrOU8Twutdg=; b=bjmnCF2chKniuwUC3nXdWisn9qj2+bW9shgI99t0cz29lUkr9MdNweDjVs/W0F/+MI vNgebpvKLw9EZGigDeJF4aUnR6PQjKWlot++OhWsv6YCyOhN9bI0WAxpMCGK5BesMzai CQqfEgxzxC+RpuCUC4qLY+cwfyluIdreJQTnDtyP5bNP5545SWIiHlyBNWwByI5g4zo/ m4HtCGemJlzek7ugUssGzjyP/AZJ4vipg0Psx1+v5qUq2Z3Chyi8bZ1pLVkcQgNYOQKv EP96RzCUbZg2Em3+KWU8dZMaoBAPHFwuwFR3tXRQ07YYtpKqOsCUeVYi8GUiPyzy/bWP oY7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sIO8QMx/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l12-20020ac8458c000000b00343719d1d3fsi1118678qtn.655.2022.08.12.04.49.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Aug 2022 04:49:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sIO8QMx/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMTAT-0000Ss-VQ for patch@linaro.org; Fri, 12 Aug 2022 07:49:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMT6e-0000ND-RH for qemu-devel@nongnu.org; Fri, 12 Aug 2022 07:45:40 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:41754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMT6d-0002PT-3J for qemu-devel@nongnu.org; Fri, 12 Aug 2022 07:45:36 -0400 Received: by mail-wm1-x32b.google.com with SMTP id az6-20020a05600c600600b003a530cebbe3so434612wmb.0 for ; Fri, 12 Aug 2022 04:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=Ce+a9h2NdhVEtI5y5oWvwzc5i/EiA02fVrOU8Twutdg=; b=sIO8QMx/VkbIxT5PXGC23PKhsjbavkbcWKMCaGffVa0gcNPYNvZdSTyVTqnQj1pRp5 omN2OCXFOAZ8u2EmEy2GVkFo6HG525KwidnTa72Kl7/JFFJhhP6hYpGr4PSgVwPqqqak XDUlfV7XTJyuusPcbj4W09gr2JYDPQ1jeIka2PUjH3VogDu6KCR26hOLkqXRyVtkwrmt lSpB3ZlliZrkpdlaJ4FHvBrvRSanrdyUeFBTT9mlLbHZy2Rn5B8gvq3VTtG/5v5wnC5W B5C+DUN2gOZlhEeixnnm72HSrHe5Ux/gLE44SQIypTgi5RsjyR4+REpeqO/TK45ZDPE9 6l8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=Ce+a9h2NdhVEtI5y5oWvwzc5i/EiA02fVrOU8Twutdg=; b=SFZ/su0rOK1z8HD7U404+APUvdsvUAonx6FjQXi051PM6hKkkhzpI1nNnF0qYTQ4CL ErbpkKnfXGy85ZDmqrWvZw+L2U9a42/Ex8EMnVoQW7QIEUxvryaJYGKZKyM+Ebkwo39R kytR4FvOhM2iE4AThEdDiFT4/V6701XXDtUPBHKKtkxledL4Tm7AGpYzMBFiTsXakKhA sym8vJ/PC/JU9Mir/aXhoAIOduj+rhdRj85Tg1xPBp2EXxdyhkgosIFeqvz6rSOtPPXb s5BF8X99i5UmGWF0zYmwo5Ku/p78zrtqe8hx5uBjNCH845qdh80nxpQ5zYQy+fzsZgJb yyww== X-Gm-Message-State: ACgBeo1/rAnO27CZlGqG+nHT+OUvlDX2vRl8d2oZhpPmIM15TauIBOPP BurOVfanijW/y5pLWhPZ9dP6ANf9biUWpA== X-Received: by 2002:a05:600c:4ec9:b0:3a5:a567:137f with SMTP id g9-20020a05600c4ec900b003a5a567137fmr8728228wmq.46.1660304733742; Fri, 12 Aug 2022 04:45:33 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n8-20020a05600c3b8800b003a5418245b9sm11257797wms.19.2022.08.12.04.45.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 04:45:33 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 4/5] hw/arm/virt-acpi-build: Present the GICR structure properly for GICv4 Date: Fri, 12 Aug 2022 12:45:26 +0100 Message-Id: <20220812114527.1336370-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812114527.1336370-1-peter.maydell@linaro.org> References: <20220812114527.1336370-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Zenghui Yu With the introduction of the new TCG GICv4, build_madt() is badly broken as we do not present any GIC Redistributor structure in MADT for GICv4 guests, so that they have no idea about where the Redistributor register frames are. This fixes a Linux guest crash at boot time with ACPI enabled and '-machine gic-version=4'. While at it, let's convert the remaining hard coded gic_version into enumeration VIRT_GIC_VERSION_2 for consistency. Signed-off-by: Zenghui Yu Message-id: 20220812022018.1069-1-yuzenghui@huawei.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/virt-acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 449fab00805..9b3aee01bf8 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -732,7 +732,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) uint32_t pmu_interrupt = arm_feature(&armcpu->env, ARM_FEATURE_PMU) ? PPI(VIRTUAL_PMU_IRQ) : 0; - if (vms->gic_version == 2) { + if (vms->gic_version == VIRT_GIC_VERSION_2) { physical_base_address = memmap[VIRT_GIC_CPU].base; gicv = memmap[VIRT_GIC_VCPU].base; gich = memmap[VIRT_GIC_HYP].base; @@ -762,7 +762,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) build_append_int_noprefix(table_data, armcpu->mp_affinity, 8); } - if (vms->gic_version == 3) { + if (vms->gic_version != VIRT_GIC_VERSION_2) { build_append_gicr(table_data, memmap[VIRT_GIC_REDIST].base, memmap[VIRT_GIC_REDIST].size); if (virt_gicv3_redist_region_count(vms) == 2) {