[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 11:25:42 +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=BxDbL4q+k1vsMqGCv/KwwhS2qPBsrfbNV+N/I0uoJos=; b=R6Ten7IUofX73Zry3gw6FAZQGpkk/voedbu7QEEkZeUVCmlOR8ZnH9nAebbKIFdr5fxDXmkxwaoZyWKYr6IUOHNTTcf1h55Bv62b6/ZCopHzoTvS+IxGdlBaSyMRw2KI+rs+W+fscdGVbmBIkXyiCxxev4F9IkD4N29HgkB06qjfT4SSMITkVnJnMumAyaBe9OegY+7UBbT7HYDf3fFHvP4hNs2A93Q6dXVEyluCzPYCLs5XIybvc6eZ0aDVtGYT5FIbSHZ2TTheJPw/ynhIbJkIRe+etAWgOLR904yNPvcLgWTzpdZu0PQ+APcGHu+LbLwYXcx3r8MEuDLG1P9Rzg==
  • 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=BxDbL4q+k1vsMqGCv/KwwhS2qPBsrfbNV+N/I0uoJos=; b=c2jyTVr9MnV/Axav9/iw8maJw5kS4ykjQoNabcoErREyg6J3JjR+mmBIqnvnUq5FG6exuNI1f39dC7AENwtCcxcErJv1VVFIx1qRo8DV9hgrqiaMW0ZNTzSvo6n575kLDvJ9o7RtuBbdz2+PfytqMZLJBsHc8uYrvMex7vJcR+Vx2f6VPSobXHDQIJ0WocURxHwSOU1Ck1t8cFFoC+TTX6XVU8yXdQNsMxjA7hPAFuuY1F7CyKvFzIOxn9N4KymfSFRkVn6teKBWQNwvvIbtzq2FL1AG3MonqUfulcc/8KQzFlpHXwjxxtM0pZd36wrCLOH6Kw0DApr8KA+Jy6HfeQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Nbq1Nk3qwQrTK+FGEKiUQcJAMEIGb9y46Zb/WYN79oTUVgxkuuxLj56Wv5Nu2w72TBNPSpGv9XqB5hKRF00kfYz9k0sK5HJLVXPEecL2Gloro29dwyWrd1GGl7qqa5Sb0iLmTXHKklJXj/paHzKK+9/qI98Sr9SrySHOdpJAAHHaQB9M/YbIrSrYsgKWpZK0/HrKqkrKOa14fOQyg8RJydS6erAmWdkOcGiUty2W4locS0j562A5artC+WmS7CwQZx45+wuixn4Ikf0q1L0RdKXKqx4xkKRH4ujQt7T7Zm+mAVCyYZVkPCxPrEG21ulRE/WQ+7oSP0QgSKDtf6l0Nw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EcyoQ3IfqK7tTFQOTB7a1f6cV26jCpRPq5YMuMpvRGPz5UIoNuPDPwMW/tAa+UEZp5vS3bJEyd6Z9fUrsQ8ovPH9+uPgkMqJRFw/KNNdXKKTpwiT0xSTI6Ek0Nsp2Dg1JSi8v+SbfDmbpajGnUpC16en+kwyJ/dT3pPFmMND6l9dOl/jcXSVZbx82ssVgh1roHU8HDll6IQ4cCW7VFE+KoNvwSm+YdIJjaSQsv/99322129i7pEPeHbW3O+xhlVcxeCBSLrVUo4YxHh4GQGJC5UiFShNpC0IlVetHl2xXkuwxSZ5k8THGWHNfleFsf3uDe5rN7n1P50jh60VXpYvww==
  • 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 11:26:09 +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++noloAq0NWJOAgAFGKQA=
  • Thread-topic: [PATCH] arm/its: enable LPIs before mapping the collection table

Hi Julien,

> On 3 May 2022, at 4:58 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
>> 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;
> 
> gicv3_enable_lpis() is using writel_relaxed(). So in theory, the write may 
> not be visible before gicv3_its_setup_collection() send the command.
Agree.
> 
> So I think we need to add an smp_wmb() to ensure the ordering with a comment 
> explaning why this is necessary.

Or maybe be we can change the writer_relaxed() to writel() that will also work.

-    writel_relaxed(val | GICR_CTLR_ENABLE_LPIS, GICD_RDIST_BASE + GICR_CTLR);
+    writel(val | GICR_CTLR_ENABLE_LPIS, GICD_RDIST_BASE + GICR_CTLR);
 


Regards,
Rahul 




 


Rackspace

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