[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] arm/its: enable LPIs before mapping the collection table


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Thu, 28 Apr 2022 14:11:44 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=77OWjqVdYfLEVpwINV7v8sHTg257aks75YpSleBQXNY=; b=R/y7QNnWVyA+QxLCTb+0PpOjxTd21xG9ofW5QapyC2TBJBFAaGOs90ZBG6/+wD3dn1mest9KBBGke5bgHsrzL5NfiyU/o3UrIYkbJxREmQbR9sWGM2pdbbqa1PEv7aiGXtv7rX2/CDm3IXwEyXEd1cy/G9K4k1ay/dsiJaFKWw+EazawdU9tZyK9sj8vneAnYmsabqgmYspP8o4STegPbyDFrRd4r/Thrax1FMHid9IRG0M0M8SHiRxiOdB9xuOzgaTxQnZGMaEiAEry/l54JPZytup8B4Ks+LALtCd6OoQ1YYX0skRzZPkWFymsJhZwftGaRA1mQllhdXf3yOb40w==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=77OWjqVdYfLEVpwINV7v8sHTg257aks75YpSleBQXNY=; b=JHKmMH2jOUQ2KXywFRMzpPj/Ax2NihMkPcRSmraqLjs8YxAyACB0PZxPTePRFE1ZdDVqVzh8x/Q6tCp/gpjiuCf3wGsSgLeyd8MVGwvCouabhYFDkiBUxS0iqiRXDC7Z9pPM6+OgPUCX0YJQqjPMfu502ofVj1qFTJLrqHGOipGSfNt23/GGsB/Fbr3vMp36BrGrg4Mtk9gIte/HEa1FvEjF/mnS2R6naHZwC2Vtpz3ndMFRWub3RwwxTnx0h9Qvbi8rl/AojpeTxHpPzfwuRa5RNlP3T6w8D6Eq8XwDPcxJf9WAy2IoFricZggCQY35bGN/+857haE7UjJgI18X8A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ebl/vFDBlQVmoc4HnV+1tuKBMsVpUHh28hZz/1U1QBh0cswPv2cHUIKeD4oIZMGYiXtLZsSZ9ngMqJqd8eQ+o6Ba7YSExjkvvXQY4Dh9sbjjBLCoSl07Ca5hXl6vnDK6Rwf0wEM34bo8XumokDIUnvnr4xGt3MkcIR9i9Y5M1y1GhAMQIscchjjLm4z/iP65j+KZBw3Vxf9UwBA8UgVB8JZ+x3560mTlK5A+zgKJtc7o3NoSf5Bzn1243V68p6+rEAEkQTq768YuSBcUkyHCWcii8z2yLAOL9pY1zIkBFA+HcY3sVAPup77U9E9OLC66YVLe75WkgoMMItrKB1/SKQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nT3hc6IW/grXr5ZVMtum5qK1dGQAwlD0mzLXmIfUvsfs3gGsQuy9GU1AGMVv6N5NXQ1XvHwBzHu7oPyj3sSUAQ8fTGhB22+wc9po/m0xCK0D6glXM+GCtlAm+jwgu4HPDTLikfOdL6RFqIfv2qgnVkl1XlICiHpsF1/MGlrG9VYwQkrvDRiHX38q479+MrJboUlpV11GsRcm9Bx+IYRURomJeKVIdxEGXPodoBC/4RUhVZutRvTGZwE1qxkV8xZ01wNLsYWWP73C1vTO1k+TKuX5LlA2pmOsloDj5Gt/ACFUbY26qYcqShyOd+DIy5lYCC5KiH9biYYZ4CJMObhPaw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 28 Apr 2022 14:12:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYWlHsf41jIOfeQ0mX6M++noloAq0EDIIAgAEMUACAADIdgIAAFDQA
  • Thread-topic: [PATCH] arm/its: enable LPIs before mapping the collection table

Hi Julien,

> On 28 Apr 2022, at 1:59 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 28/04/2022 11:00, Rahul Singh wrote:
>> Hi Julien,
>>> On 27 Apr 2022, at 6:59 pm, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> Hi Rahul,
>>> 
>>> On 27/04/2022 17:14, Rahul Singh wrote:
>>>> MAPC_LPI_OFF ITS command error can be reported to software if LPIs are
>>> 
>>> Looking at the spec (ARM IHI 0069H), I can't find a command error named 
>>> MAPC_LPI_OFF. Is it something specific to your HW?
>> I found the issue on HW that implements GIC-600 and GIC-600 TRM specify the 
>> MAPC_LPI_OFF its command error.
>> https://developer.arm.com/documentation/100336/0106/introduction/about-the-gic-600
>> {Table 3-15 ITS command and translation errors, records 13+ page 3-89}
> 
> Please provide a pointer to the spec in the commit message. This would help 
> the reviewer to know where MAPC_LPI_OFF come from.
Ok.
> 
>>> 
>>>> not enabled before mapping the collection table using MAPC command.
>>>> Enable the LPIs using GICR_CTLR.EnableLPIs before mapping the collection
>>>> table.
>>>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>>>> ---
>>>> xen/arch/arm/gic-v3.c | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
>>>> index 3c472ed768..8fb0014b16 100644
>>>> --- a/xen/arch/arm/gic-v3.c
>>>> +++ b/xen/arch/arm/gic-v3.c
>>>> @@ -812,11 +812,11 @@ static int gicv3_cpu_init(void)
>>>> /* If the host has any ITSes, enable LPIs now. */
>>>> if ( gicv3_its_host_has_its() )
>>>> {
>>>> + if ( !gicv3_enable_lpis() )
>>>> + return -EBUSY;
>>>> ret = gicv3_its_setup_collection(smp_processor_id());
>>>> if ( ret )
>>>> return ret;
>>>> - if ( !gicv3_enable_lpis() )
>>>> - return -EBUSY;
>>> 
>>> AFAICT, Linux is using the same ordering as your are proposing. It seems to 
>>> have been introduced from the start, so it is not clear why we chose this 
>>> approach.
>> Yes I also confirmed that before sending the patch for review. I think this 
>> is okay if we enable the enable LPIs before mapping the collection table.
> 
> In general, I expect change touching the GICv3 code based on the 
> specification rather than "we think this is okay". This reduce the risk to 
> make modification that could break other platforms (we can't possibly test 
> all of them).
> 
> Reading through the spec, the definition of GICR.EnableLPIs contains the 
> following:
> 
> "
> 0b0 LPI support is disabled. Any doorbell interrupt generated as a result of 
> a write to a virtual LPI register must be discarded, and any ITS translation 
> requests or commands involving LPIs in this Redistributor are ignored.
> 
> 0b1 LPI support is enabled.
> "
> 
> So your change is correct. But the commit message needs to be updated with 
> more details on which GIC HW the issue was seen and why your proposal is 
> correct (i.e. quoting the spec).

Ok. I will modify the commit msg as below.Please let me know if it is okay.

arm/its: enable LPIs before mapping the collection table

When Xen boots on the platform that implements the GIC 600, ITS
MAPC_LPI_OFF uncorrectable command error issue is oberved.

As per the GIC-600 TRM (Revision: r1p6) MAPC_LPI_OFF command error can
be reported if the ITS MAPC command has tried to map a collection to a core
that does not have LPIs enabled.

To fix this issue, enable the LPIs using GICR_CTLR.EnableLPIs before
mapping the collection table.

Regards,
Rahul


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.