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

Re: [PATCH 3/7] xen/arm64: head: Add missing isb in setup_fixmap()


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 21 Jun 2023 11:33:32 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • 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=56I0PA7VI7FRacKs1yQchkEW05z+Fh8rfKJevwzbOs8=; b=SO1gyIgA9WITTx2pIceOmEAqvPn60pp4L2LzpoDWPO2NrFOp4vwD2DP22ncX4XLj87eeq3IzcdP1EG+r6xmBlvnrn9K1DrlqjkGmspe+oM72Dl7vRqR311QJ2V3VPUxiUhesgXzANuvGX2rIO+ai+3qdL+qrxZOda09+Wfkfj+ep2j4Vz9A1xNfzevGMOSOurcq4UmfAEV0CPsY5UaIVuKbTQKAmn77C2sauWg+9xoihBwnY9XPIiQFDPMB05XlZPqpdfzzbjICqtJiG/HSSsmsnB0tbN3424VvnaGKdjrk3Bbn/Uq+SA9fayflGKzaV2Uvn7BTBySluOXCduIQ8JA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kSLfdA8YYREg4AnChIYJrYXhk2Dc6dfbO+8rb5rBzBSUd+qucA3/uJRwT8TXO9BTzYb9IxPgu2iLM/FwbOGH4xG/r/wBQrigP4UuVwf/S/eBoaX+LKeYEEoopnZf1d8rrQi7nraIaKMef4lM+rJMyHIfA+CrshLULDhF33Vf873anvS4KTEfCQj4jeKHl+w95eF3cdDWYcQkSDtykhXSe6CEtjQKlxf4/csUsS1Kcpi7ZeCEjFTPxNB8tlFMw2Ypo7NTIPTgcCnbgWxeltxPrOwgF11gFvZQ5kSXSadyT2xLJNT+SvfwLOxm/gh5zSlkO3fC1WBJ9KgGMTr458gv7Q==
  • Cc: <Luca.Fancellu@xxxxxxx>, <Henry.Wang@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Bertrand Marquis" <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 21 Jun 2023 09:33:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 19/06/2023 19:01, Julien Grall wrote:
> 
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> On older version of the Arm Arm (ARM DDI 0487E.a, B2-125) there were
> the following paragraph:
> 
> "DMB and DSB instructions affect reads and writes to the memory system
> generated by Load/Store instructions and data or unified cache
> maintenance instructions being executed by the PE. Instruction fetches
> or accesses caused by a hardware translation table access are not
> explicit accesses."
> 
> Newer revision (e.g. ARM DDI 0487J.a) doesn't have the second sentence
> (it might be somewhere else in the Arm Arm). But the interpretation is
> not much different.
> 
> In setup_fixmap(), we write the fixmap area and may be used soon after,
> for instance, to write to the UART. IOW, there could be hardware
> translation table access. So we need to ensure the 'dsb' has completed
> before continuing. Therefore add an 'isb'.
> 
> Fixes: 2b11c3646105 ("xen/arm64: head: Remove 1:1 mapping as soon as it is 
> not used")
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

I'm happy with the whole series but I do not see a point in flooding each patch 
with my tag
since you already got two (from Henry and Luca).

When it comes to essential isb() after dsb() in arm64 head.S, I can see that we 
are missing one in enable_mmu()
after TLB invalidation. On HW without FEAT_ETS the TLB is "guaranteed to be 
complete after the execution of
DSB by that PE, followed by a Context synchronization event", so I view isb as 
necessary there. We could also
introduce (just like for arm32) flush_xen_tlb_local macro and use it there + 
remove opencoding it.

~Michal



 


Rackspace

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