Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3722913pxb; Mon, 24 Jan 2022 16:20:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJy00FtjBj8hznUm7gItmpjZiOsEHN/KXrnl11pgPdBEwEsY3Nnr7QYBJusRYFUqRhqWjyv4 X-Received: by 2002:a17:90a:f89:: with SMTP id 9mr794009pjz.138.1643069936706; Mon, 24 Jan 2022 16:18:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069936; cv=none; d=google.com; s=arc-20160816; b=P347nCFHZdDWzjYaQUhOlj6hasohs7lt0Z7OYz0KtoNHxChF8qNpAi8de5wRbVceHQ igb2j1ZCwDk4JUjSUy6d/6uVKtQkrjKPdyx6SZiQJVDYP328zdMo9tjd6Vo0gRNLxbMA 9Px+i9dLjVGJJicg9Miy6iliror/os9rVs+7ionrQG8ffdr8QccP0TYsZuZuGvF7C4wu UwgOSgG2Oz3zNAgXX+Ziv84KrpV/eQendJSFizoN3xa8eNXnVtlDcUfWU3E4Xkr5aR9r EtaZs9Ec0kt30THninlgv5ifsuqVGYTTmWMQK6NaAqqrHYe7gqmBS98z6r+eFuERSwIs cUxg== 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=/3HfJLfDaIz04rv7InmR3+hiMVpATG7LIlGNRk4CO4k=; b=hos7aIdbqZ8cdHZdVGoagPcM/jccGRDhaDuKGfKUUzE5M6Cfx/XTLADUtV24UxzrAL NbGIJd2EZviTurr7/kO8ChvfM7pYhS/bIwc3RQMwufR2cxlso/SC3tX8kK/md+Xv20t1 p1VXq7doJG9BCumE4rqzslyWihQzxV3WH9JXit1fx0TkYzon2u80oQxiiZz07r2OceI2 6YB5cW4HcGacTnHZo+pRaSGejPbCZm8kLmwGlPDrU1EBbBhpZasc96hqoAC2NWwQk6oA 6p1UFUJ+F9dLJttoA5Jc9dzQq4BUlcdEUO6Z8e1aJ8wTluIzpd9QKyM8xnpcMM2sEvIK 6t2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OtubRWta; 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 d3si8676103plg.300.2022.01.24.16.18.44; Mon, 24 Jan 2022 16:18:56 -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=OtubRWta; 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 S2373402AbiAYANp (ORCPT + 99 others); Mon, 24 Jan 2022 19:13:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1583831AbiAXX2Q (ORCPT ); Mon, 24 Jan 2022 18:28:16 -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 DF09BC0A8848; Mon, 24 Jan 2022 13:32:59 -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 9A3D8B80FA1; Mon, 24 Jan 2022 21:32:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF2EFC340E4; Mon, 24 Jan 2022 21:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059977; bh=qYDOpIwbffRx83ZsylOR2lWYM5jvsut86DHKdCbumBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OtubRWtarnD6d5BeVX5XYOxByDMjTpRpDshYajqECoVfbR0tJFQ96y2pXGumT3kyA b9dkqDZqlvMlH21pONLKyV5kEA8dH/1Ixtz7rJfOnEkjirAfYYd6jfSIIS1A39gekv 4eVFPkDBu3uUwgdajYPdLmrYjF7Kqzin9dHkU4Nk= 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.16 0765/1039] irqchip/gic-v4: Disable redistributors view of the VPE table at boot time Date: Mon, 24 Jan 2022 19:42:34 +0100 Message-Id: <20220124184151.026668579@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 daec3309b014d..86397522e7864 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