[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: Wed, 4 May 2022 10:49:59 +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=VUrGaD67QOs6TcY79KbZjv/R7D4tuZmtwnwyrSQu7xk=; b=IbEaDvPny4NXClL4DyNQT7S4oMtXE+DJNmL+Cmxtpp4aRB6Cu9sfHeoJ/rB+VMZI0RcQIpK/Nklokx/CcL1W75LPnWkDGhN06MZyvIYKeqCKSwme79Drt/XXcOMom6WQgsCKNYgoe3292jHlUEjx9q+4R6/uRlhufcCP+wWbSitaNFrdsHxzc30dlM64EAnp1L/6A0EyJbnc035EsuFZxnMwq4mCYO/7UTEC1mM0O9FO5qOxGIgezL09zsSZSKn3D1TKhUQI2QYi08igU8cD0a8mDU82sNa1+LQ7QgJhk8I7m9fawvgWhmiRvQ3yRIPjhkSUkzlImEJD9A+1EH+X6A==
  • 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=VUrGaD67QOs6TcY79KbZjv/R7D4tuZmtwnwyrSQu7xk=; b=MkAIgrJ6s8W+LpLEqbrwVLzRNhTfWTc0399NjCcHVb0cUpUc7TmXpkeqVNmGdJe9c+uFt4yayY9UsXxvxqT9HRlBHmbQ/HFfUh9fD8Gcanzi0WX/3YUk+ej8Q0HKTwK79tqDlWMUYYVOcnjVqcC+i/vhWTVoAhiq78GLry3YfXYTXrZA/PJboB7Vl7v4uOus2/Wyom5UDg4uBhy+YBCYAXj7fVhwPuK8pCXVcBp77YzZycSloAIMgeZj34Ql/UHQpv6xaDInrIKnnn46VBdd+CPUrRbgaDJA1GWOL3M/i6ZKjHkmXDO9kaB9Pk5nc4OMJYLBHSlxA5ZiW8KJFfstqg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=PfmHPMuklw+D5EA+VpEBhXSvyZQrh1T9LsOSRnwOXLEUuuWTGQVXzf6kyshspw7zZmvthMBxLEmD6V03CTslSoR3GOc5XMjt1/aVcjg7mcATdcmDtwBmZL6M4m5gbuScFx0t1LggbjHAcRf0rIj8XxXM9n6bnMQkkaPifQ6EupxbhE1Wx4cVacwudrzm5GecR/rAcLkDeFFkg7X96hAMbG35gPEq8owMhcibwLeSCpzHg0EwI+5+ro7StPNzDGEwDAWXT+wsfrGRXSwV4qLhMp4s8Wwpb49KiZVjQecxjm/QE3CP+lsyXvBJww1pM1aM0iy7UzN9UD5uXcatnjh7Pg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VxST/VwUEWvCKoooN+NTg92d9UYnCFmf4/89erFLXgukLPYl85AgIVH04CouQQF26M6wQXpbnUNZKidPwNqwAl3z1anhmnGWDLp0ujijGwMmES44ZvyWzI2VICEaccRpMrf1w7pmHcXoemWG53fid33SJdFzWJUf4XiGxssC2YcmDoTvXNVCiLT/B1b3N2/+EbLPKoCVndO+pjV17hwnDQyCq/K4YsWhViIl1P2pYF0s3hC6FSwqou7KsNeK9nR7CRi4spXnHTUHLQbiNDBT5Z+p3+vWhmQWtqJ1lCCHzTEZqYfI6st3mOuPCuznhtVN1I7U2Zhb9bjPpUuTjIfg1w==
  • 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: Wed, 04 May 2022 10:50:27 +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++noloAq0EDIIAgAEMUACAADIdgIAAFDQAgAf3yoCAAT3VgA==
  • Thread-topic: [PATCH] arm/its: enable LPIs before mapping the collection table

Hi Julien,

> On 3 May 2022, at 4:52 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 28/04/2022 15:11, Rahul Singh wrote:
>> Hi Julien,
> 
> Hi Rahul,
> 
>>> 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.
> 
> s/oberved/observed/
Ack. 
> 
>> 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.
> 
> Please add a quote from the GICv3 specification (see my previous reply).
Ok.

Regards,
Rahul




 


Rackspace

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