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

Re: [PATCH v3 03/10] xen/arm: smmuv3: Ensure queue is read after updating prod pointer


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Mon, 5 Sep 2022 16:49:50 +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=astuJcRJ4TaYXeCiH+Cc4vRFAdkcIwqCPz+W13vNrrI=; b=msdKuoGKKlmHak9ZD3AOC4G7tcyVD7f8s/y5aAv5O36ttdwWzyCUzE+g8+fC6lBmTvfUgez+NUdTx3P2TPzaNUzZ/6st8AHvTMMJM2gDIBqj+PaNpo/NRGncWegotRR19sFXg05rnyxHzfr18JOyqAfJwNHGR1WMxGBrDfMbnWmynjv9csPCi9skz9QvsHvqmG57XHKIjf8TEP/I3QG864I9M+BLcsgIcSQIRKLE92aN1IR1/usxm0jmo/XimsSwnjvaQdIFTQsGpB9d3zdw39VbJzCw8XYEUK15mj7W2hnvNSRgLOSibI6gO4Wb/vFAimlbSUVoFAiwuEb3fcwvxw==
  • 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=astuJcRJ4TaYXeCiH+Cc4vRFAdkcIwqCPz+W13vNrrI=; b=DNf0pI3JkAzUAC2xanO2n4LCCruLIiX78qeAmkZONjj5n1/ftlVz+9LNgpIvt9jdp62AtHOOAo26sJugPFewXfmdE1iXtzQjBZfL+u9rC+99RNv7uSIV0aL1ZjTydhQ5fMf1k8itRq+nD0IYLBiJYRaGwtGtx4xgok3UoRCOLzWBvgGuyMHpGN/jMAXB8P+PCQxDzl/sWNv1FeTsR4O8HRpd0gxEg2J+G+BtwVUmaFvngxU/AmvVGpu4Hdx+SGRz4uGU2pDeJBZRWjd8OZkgYW1nHmGSmv9wrUzuN1MzY99B2JfSuJ1q9SazTK8CSqMYU+p459Z1l4FPj1EOlcBq3w==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Ns16w31PCAYT3J3bG8/NiIcq/INHb3WF9w9IiXHq4DcUeqkFOlM05QnfZsnsWEOo+zgW+U3Tn06zQxfvXAhihe0a91HUd8pDIpSl+4jD2hiXMeeGrQOpg3WVCLSO3V8xpv5epT/heNNQ4VPV3Nl6DmfayCqw1tm9dcRb9C/ptu8OCuNV6jBgIdJwaIp327zRabIclAWeNRPA7SyRIvi5LzCpQEXGCS2Gu4EqNM9YYQTDdw5tRRk6kOyXhD/+fq9CEOKpr1UQsc6opomz8VoARzsId4QPqKzIGJHUmGhX+p//mzI6PFZ4WHu7uJt1cIDSaMhHDe6i861ac3j+mdojsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzrCKBZY/9MBrce+2vLzeXClEjmqas4TAk+MroyGjEgfnfTz5fCQ8/ysqa2RgR7jmvP+iOmI+TY6zZue6sBcZC5Ty7ZhwrM6k51DLJpGvJJZJ67qmZU7QxsJFo7xlkMjz5HWMt3GNm36Gl7X6Tk2Vswy1IvNHdGGn+gciUJ08eZgQLf2YvSM0BqZGxxfsQi9Z3Fn5PxNmGzSPAJC/d0Ln3YKPXBiuzD6723Yv2jVE6S1dpjBo3sWLFyAH+3hX5AbKMOFnTawyYPd6CZYO9dp37HcRNhnBsSJeriy0RGiq+6H+L/imll+aoTSdQ5nUsUmyyz6iRpRbG6ibd1rgArHZQ==
  • 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>, Zhou Wang <wangzhou1@xxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Will Deacon <will@xxxxxxxxxx>
  • Delivery-date: Mon, 05 Sep 2022 16:50:16 +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: AQHYwUUf4E2j4BiT+ESEZERmzSI0nK3RCQUAgAADdQA=
  • Thread-topic: [PATCH v3 03/10] xen/arm: smmuv3: Ensure queue is read after updating prod pointer

Hi Julien,

> On 5 Sep 2022, at 5:37 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 05/09/2022 17:30, Rahul Singh wrote:
>> From: Zhou Wang <wangzhou1@xxxxxxxxxxxxx>
>> Backport Linux commit a76a37777f2c. Rename __iomb to iomb() while
>> merging to get in sync with other Xen definitions.
>> Reading the 'prod' MMIO register in order to determine whether or
>> not there is valid data beyond 'cons' for a given queue does not
>> provide sufficient dependency ordering, as the resulting access is
>> address dependent only on 'cons' and can therefore be speculated
>> ahead of time, potentially allowing stale data to be read by the
>> CPU.
>> Use readl() instead of readl_relaxed() when updating the shadow copy
>> of the 'prod' pointer, so that all speculated memory reads from the
>> corresponding queue can occur only from valid slots.
>> Signed-off-by: Zhou Wang <wangzhou1@xxxxxxxxxxxxx>
>> Link: 
>> https://lore.kernel.org/r/1601281922-117296-1-git-send-email-wangzhou1@xxxxxxxxxxxxx
>> [will: Use readl() instead of explicit barrier. Update 'cons' side to match.]
>> Signed-off-by: Will Deacon <will@xxxxxxxxxx>
>> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
>> a76a37777f2c
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>> Changes in v3:
>>  - rename __iomb() to iomb() and also move it from common file to
>>    smmu-v3.c file
> 
> Hmmm... Quoting Bertrand:
> 
> "We need the __iomb as “linux compatibility” in fact so I would suggest for 
> now to only introduce it at the beginning of smmu-v3.c with other linux 
> compatibility stuff to prevent adding this to Xen overall."
> 
> Which I also agreed. I couldn't a more recent conversation explaining your 
> approach. Can you outline why you didn't follow the approached discussed?
>   

I am really sorry that I missed the naming and when I made the patch in my mind 
there was a comment from Stefano to
rename the __iomb() to iomb(). I will send only this patch after fixing or do 
you want me to send the whole series?

Regards,
Rahul

 


Rackspace

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