Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1415955ybl; Mon, 2 Dec 2019 03:12:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzfh63oCFn75ZgXxRrQiblAaX3x00qgxKMkxF0zDLvZJgT8WygW6WHkPsTsHRQQiYlLQJrV X-Received: by 2002:aa7:df09:: with SMTP id c9mr41057923edy.133.1575285163581; Mon, 02 Dec 2019 03:12:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575285163; cv=none; d=google.com; s=arc-20160816; b=G198Uv5X/FSX6PNaLbuu8ukQM2XP3zDR2U74Mt4jWd6JAltigMeKHKYlSmemDUoDXa NUG6ADjHk2zg1KsEwxjFPytROGdmleISupCke1HaW+xmmGOtXW8H5g4EumQwEQOOMlmB xJ4J/x2LCSO8KKwhPwOwsM85Dc/Y6pSvPqKalZlUftj8lh1RzepPjezyzPP/SvgotVxk SAfXRQRbgsuGdMwceJS2lewdsFX6NATfMc9Mx3O/MpHxGS7U8lOxLj1bmvS+4U71IgWE Zx9hPjRzh95T3h+0aLjl4PWtEqO/l43dzqibLW7PvagO7SwrJqdNf+0pyiB65R1mZcBX iwgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=2GTgE/SW5/48tpbCNPTU+vUAburVt4DLPtzlngyFcmM=; b=M29oa11DX+QypxUulJCfXGjsqz7m/XqoWXmlL5VHX0r48FUaePzXMpDU7fzOVi7DxQ dGAQjoMZ+0QvcSMv5evUpV6RfnlEB8T08m7PRXa9S5fhcS5TRZj0o1HKgBLKmTmN2D6k Abg6sJECJYKdfTSYdb7Vp0hLzgKEMf6oRiSVfQuyDbU4LGedx6tcebMpK93JRXZUy9hQ 8twkLxxmpWKZ1s4TzxE1GXFG9Bc6rmlvJbHn8ZqTYI4HJSQBdWeRaxDborePG8D0axa6 F0dDIot0UZxD1wH2lYlEXy+jSBGy9Zc/d6jdJQfdvfimFsFvidfd1SuFCDg4E26JTCL1 dpNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22si15028587edp.246.2019.12.02.03.12.19; Mon, 02 Dec 2019 03:12:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727398AbfLBLIH (ORCPT + 99 others); Mon, 2 Dec 2019 06:08:07 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:42566 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727354AbfLBLIH (ORCPT ); Mon, 2 Dec 2019 06:08:07 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E5EFE93BAA5E17831125; Mon, 2 Dec 2019 19:08:04 +0800 (CST) Received: from [127.0.0.1] (10.133.216.73) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Mon, 2 Dec 2019 19:07:59 +0800 Subject: Re: [PATCH] irq/gic-its: gicv4: set VPENDING table as inner-shareable To: Marc Zyngier CC: , , "Thomas Gleixner" , Jason Cooper References: <20191130073849.38378-1-guoheyi@huawei.com> <20191201180434.1dba3116@why> From: Guoheyi Message-ID: Date: Mon, 2 Dec 2019 19:07:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191201180434.1dba3116@why> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.133.216.73] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2019/12/2 2:04, Marc Zyngier ะด??: > On Sat, 30 Nov 2019 15:38:49 +0800 > Heyi Guo wrote: > >> There is no special reason to set virtual LPI pending table as >> non-shareable. If we choose to hard code the shareability without >> probing, inner-shareable will be a better choice, for all the other >> ITS/GICR tables prefer to be inner-shareable. > One of the issues is that we have strictly no idea what the caches are > Inner Shareable with (I've been asking for such clarification for years > without getting anywhere). You can have as many disconnected inner > shareable domains as you want! Hisilicon HIP07 and HIP08 are compliant with ARM SBSA and have only one inner shareable domain in the whole system. What will happen if a system has multiple inner shareable domains? Will Linux still work on such system? Can we declare that Linux only supports one single inner shareable domain? > > I suspect that in the grand scheme of things, the redistributors > ought to be in the same inner shareable domain, and that with a bit of > luck, the CPUs are there as well. Still, that's a massive guess. > >> What's more, on Hisilicon hip08 it will trigger some kind of bus >> warning when mixing use of different shareabilities. > Do you have more information about what the bus is complaining about? > Is that because the CPUs have these pages mapped as inner shareable? Actually HIP08 L3 Cache will complain on any non-shareable cache entry, for the data coherence cannot be guarenteed for such configuration. This also implies VPENDING table will be allocated and snooped in L3 cache. > > I'll give it a go on D05 (HIP07) to find out what changes there. Thanks, HG > > Thanks, > > M. > >> Signed-off-by: Heyi Guo >> Cc: Thomas Gleixner >> Cc: Jason Cooper >> Cc: Marc Zyngier >> --- >> drivers/irqchip/irq-gic-v3-its.c | 2 +- >> include/linux/irqchip/arm-gic-v3.h | 3 +++ >> 2 files changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c >> index 787e8eec9a7f..d31e863bc9ef 100644 >> --- a/drivers/irqchip/irq-gic-v3-its.c >> +++ b/drivers/irqchip/irq-gic-v3-its.c >> @@ -2831,7 +2831,7 @@ static void its_vpe_schedule(struct its_vpe *vpe) >> val = virt_to_phys(page_address(vpe->vpt_page)) & >> GENMASK_ULL(51, 16); >> val |= GICR_VPENDBASER_RaWaWb; >> - val |= GICR_VPENDBASER_NonShareable; >> + val |= GICR_VPENDBASER_InnerShareable; >> /* >> * There is no good way of finding out if the pending table is >> * empty as we can race against the doorbell interrupt very >> diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h >> index 5cc10cf7cb3e..a184f875e451 100644 >> --- a/include/linux/irqchip/arm-gic-v3.h >> +++ b/include/linux/irqchip/arm-gic-v3.h >> @@ -289,6 +289,9 @@ >> #define GICR_VPENDBASER_NonShareable \ >> GIC_BASER_SHAREABILITY(GICR_VPENDBASER, NonShareable) >> >> +#define GICR_VPENDBASER_InnerShareable \ >> + GIC_BASER_SHAREABILITY(GICR_VPENDBASER, InnerShareable) >> + >> #define GICR_VPENDBASER_nCnB GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, nCnB) >> #define GICR_VPENDBASER_nC GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, nC) >> #define GICR_VPENDBASER_RaWt GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, RaWt) > >