Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3691041pxb; Mon, 24 Jan 2022 15:29:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaUOIj6IV3moJ68uocBW6dkwyqmwBXssKB1kf875ip6izEdmizbtCT8nntT46vMvcrqk67 X-Received: by 2002:a17:902:db02:b0:14b:5fe1:f800 with SMTP id m2-20020a170902db0200b0014b5fe1f800mr4311263plx.157.1643066954446; Mon, 24 Jan 2022 15:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066954; cv=none; d=google.com; s=arc-20160816; b=ERShcnXjBP9zKLX4lMVzABTkmGQE23/veZLLDO/BPdoirMFlPLx/CBlCBYQKz1IU9e olYjlPXG5vUuhkWHo25BlAIlaKMgxqaEHAxt+vRo/EalqaijEr4UMnBJ4BJ6yt1R6RL7 hN/DWje+MGnUSfb0g6cgTEB7Awme+NaXezc21UN0tEZWWDl9oSRD5alx9NNOWGGKSrd5 scPk4thLNCnvbQMV4P8YtetCKs4rA3QBGyXRE0umZRINp32zIrVlwRaUpTX5eWQvfk2U 1sxK3d4xDZ+66U01mQC5r2/6vRqquv83f9sIscYW1znSsv/ocinmlQaEMzH7T+PphE/O dxcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W2NUMAM3IlfTaZKCe79wAAy1DiYkuZhY/jUnjgdyvxY=; b=W1NcPbrs3NrokooqBd2g5MLeS8FSRNs5BmA/6m+gn5j9ENsrQETYZf1GFdiZK8wD4s gi5I2zL6oT/m2Ye73HOWbCPtTNeN3lAZcTrTVzy0/jcFvIPGRH1wlQKiZOg5i17k85rP dk384xOGJ//ZFiP+b37Orm4tYU8aRhfaabiUbgb0mO6gntF4vH5nsKqyhMuGeL5oX++v hZQM4ach83xs+f+xVrRVCEwJ865ZsExygedZLXjBRU7PWw8FMYKXOrDPDO3C325VEzTA f3tyGsP2sn4gkAj9XWzEgt3Pa5rLdEPuC6X8ohFxz/PoVv12vtupy258FnTmO+pe5cEO z7Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bn0BibNp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si12531053pla.537.2022.01.24.15.29.01; Mon, 24 Jan 2022 15:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bn0BibNp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1848520AbiAXXWj (ORCPT + 99 others); Mon, 24 Jan 2022 18:22:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350239AbiAXWNi (ORCPT ); Mon, 24 Jan 2022 17:13:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9641C0E260D; Mon, 24 Jan 2022 12:44:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6870B8121C; Mon, 24 Jan 2022 20:44:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C53CC340E5; Mon, 24 Jan 2022 20:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057043; bh=qSHAdX9uc0AHbgp4tUx3Otx5dAYl9F+lSQ3RPSFr8sE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bn0BibNpREuozh37s+QcjV2RcSUylmuIn3ng7nlvRYZm3aZ0vLifQTQnn4Xhv/kiP bdb7v7AdHRilcznFbATGqtzGX2MCm1zAJ0SpazO2c3IpJiG4XZniGAz15FjKimtT0j BYdHpMCR9vkLVkKvOKLkTCtJ0jcEB8f0Nhz7XiSI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jay Chen , Marc Zyngier , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH 5.15 651/846] irqchip/gic-v4: Disable redistributors view of the VPE table at boot time Date: Mon, 24 Jan 2022 19:42:48 +0100 Message-Id: <20220124184123.496115157@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier [ Upstream commit 79a7f77b9b154d572bd9d2f1eecf58c4d018d8e2 ] Jay Chen reported that using a kdump kernel on a GICv4.1 system results in a RAS error being delivered when the secondary kernel configures the ITS's view of the new VPE table. As it turns out, that's because each RD still has a pointer to the previous instance of the VPE table, and that particular implementation is very upset by seeing two bits of the HW that should point to the same table with different values. To solve this, let's invalidate any reference that any RD has to the VPE table when discovering the RDs. The ITS can then be programmed as expected. Reported-by: Jay Chen Signed-off-by: Marc Zyngier Cc: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20211214064716.21407-1-jkchen@linux.alibaba.com Link: https://lore.kernel.org/r/20211216144804.1578566-1-maz@kernel.org Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index fd4e9a37fea67..7bbccb13b896b 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -920,6 +920,22 @@ static int __gic_update_rdist_properties(struct redist_region *region, { u64 typer = gic_read_typer(ptr + GICR_TYPER); + /* Boot-time cleanip */ + if ((typer & GICR_TYPER_VLPIS) && (typer & GICR_TYPER_RVPEID)) { + u64 val; + + /* Deactivate any present vPE */ + val = gicr_read_vpendbaser(ptr + SZ_128K + GICR_VPENDBASER); + if (val & GICR_VPENDBASER_Valid) + gicr_write_vpendbaser(GICR_VPENDBASER_PendingLast, + ptr + SZ_128K + GICR_VPENDBASER); + + /* Mark the VPE table as invalid */ + val = gicr_read_vpropbaser(ptr + SZ_128K + GICR_VPROPBASER); + val &= ~GICR_VPROPBASER_4_1_VALID; + gicr_write_vpropbaser(val, ptr + SZ_128K + GICR_VPROPBASER); + } + gic_data.rdists.has_vlpis &= !!(typer & GICR_TYPER_VLPIS); /* RVPEID implies some form of DirectLPI, no matter what the doc says... :-/ */ -- 2.34.1