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

Re: [PATCH v2] xen/arm: smmu: Set s2cr to type fault when the devices are deassigned


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 23 Aug 2022 10:34:21 +0000
  • Accept-language: en-GB, 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=9ei3CUA46LlszbbGhslBtbz7x4GzxZs5jC5SmUadZR0=; b=Jj1tR7ypLrSHd/BINFHswPXUX5jCkD7SW5+sHOQBGiOK/iYkYyQPwRWxIjrnTyf3iMMidikuFHsorJm/oDxytVoTDF5KJUCmJJ0JqC+DgAGnJDakTZYR3ECZ7bc+gN4NuB5ztw//l/8oxB2ALTgdM/75TeeIU6g2amyLp2gJXp5Rul1y2VxL+71CQNpGRM+o5C3D4hQ4oNFXUMgletx8E8TNI+SuIYoIvJ0JKji9gTP6sQ6337Y3Nwcj4LrwB85/rkOXCw0kngE+YTtDghpQ1WaeuKG6GtrQ1Sg8WHCFrTUA3fp6wpSfM4+RIvLw6jsrx9NnddeQZfZELDyjLnqsVA==
  • 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=9ei3CUA46LlszbbGhslBtbz7x4GzxZs5jC5SmUadZR0=; b=PmGlq+xUShQJGw9hVSPr4cjb6t6RXiKLhO4UhmiSwMDPxeeA6SayJ/r++EK11ivcXu7GmoXFF6xNZgetloR/bPHM1wsqNCqPyAj81WvcmaoFldpFeA6y5uFER99t6HRhO235mW8W+Sukvj2aOpAA6WkCn+q24rKMY8Zd4yvQ6tfMSND8L+vxthjtJj0baesGXegbBD9UTYrQHCpJb475rZ9pgrTXnEeefQGBiNnefSgnlUFvre0yNip2F/c0OfI/zGVs3gKzDE7qdMQdHwAbNKgbHdEbzPID5T+fyadKhUB+HYOB2/nGr59hP5X4f9OiW6xPkYEyR3LTYFr90LrP/g==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=lQlYmxqPu93r3WJMz3dPuJsCHziyDmnANc9TJxD4cqRY1SS2zncUyq2YKP+ZZEY9kGTbmkg6XUJcVzQ2dwWCX56XEMR2rYu3HvzSCJmBBSc6Fh/GU8VFmyOfIfhngzIyn5y3H8aqDuY+Zy+NF/RmwMBNxnutp4PshNi5XD2lB3DE+NXL4t52NZP2JScTIWOmXy9prX5v5DtHIy7UlqYQOBSu1HZ84+RpynxCY0+ggQHgZvEn188j8KtndwWuqqUVKjgQTozX129LXuQOCgr/0DJOL/SZDxER5uAuJTCqR/4ir9knKq/bhT/I/4uKNtPPVvC8iqU6S5VsMMdzD1zL1g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSX1sTyx6A+4vPoVW1qVc6IhczkjhLzkwFDo0I+Q01BjCte9exSe+lLUy5mdgvlwLUjmdK32rnB4UsCk9FzW9pUZkSsmra+TTBSMRM/IEAdTxR8DZKhd80z/Z65v72jFE8V541TFkPWUR8Otjsx3waedvE/utFxIobyo60BB/LnR5kNrUcAlnRKBwC8EDHakcMXEqt1puY7XPr3Kn8Aqsn4yX1ySrzjpnpv0HwvPFeaMWgIrjWRhQ/48rOiaff4vgnSQCeFby0sGKvc4u23lGwqwvQcopmg+ZQadB4nTfPGYbspAeGSf0Fn53rG6jFm8MVCct8ytJfd+0S+rs/86pQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Rahul Singh <Rahul.Singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 23 Aug 2022 10:34:55 +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: AQHYrZj1WX2EfvXPyEi5kwWRf4bDsK2q/YiAgBFfFYA=
  • Thread-topic: [PATCH v2] xen/arm: smmu: Set s2cr to type fault when the devices are deassigned


> On 12 Aug 2022, at 10:17, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> On 11/08/2022 16:42, Rahul Singh wrote:
>> When devices are deassigned/assigned, SMMU global fault is observed
>> because SMEs are freed in detach function and not allocated again when
>> the device is assigned back to the guest.
>> Don't free the SMEs when devices are deassigned, set the s2cr to type
>> fault. This way the SMMU will generate a fault if a DMA access is done
>> by a device not assigned to a guest.
>> Remove the arm_smmu_master_free_smes() as this is not needed anymore,
>> arm_smmu_write_s2cr will be used to set the s2cr to type fault.
> 
> NIT: I would write arm_smmu_write_s2cr() so it is consistent with the line 
> above.
> 
>> Fixes: 0435784cc75d ("xen/arm: smmuv1: Intelligent SMR allocation")
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
> 
> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

@Julien: could you fix the NIT on commit ?

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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