All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 3/7] xen/arm64: head: Add missing isb in setup_fixmap()
Date: Mon, 19 Jun 2023 18:01:11 +0100	[thread overview]
Message-ID: <20230619170115.81398-4-julien@xen.org> (raw)
In-Reply-To: <20230619170115.81398-1-julien@xen.org>

From: Julien Grall <jgrall@amazon.com>

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@amazon.com>
---
 xen/arch/arm/arm64/head.S | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index f37133cf7ccd..4ea64e70997b 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -769,6 +769,11 @@ setup_fixmap:
         create_table_entry boot_second, xen_fixmap, x0, 2, x1, x2, x3
         /* Ensure any page table updates made above have occurred. */
         dsb   nshst
+        /*
+         * The fixmap area will be used soon after. So ensure no hardware
+         * translation happens before the dsb completes.
+         */
+        isb
 
         ret
 ENDPROC(setup_fixmap)
-- 
2.40.1



  parent reply	other threads:[~2023-06-19 17:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 17:01 [PATCH 0/7] xen/arm: Add some missing ISBs after updating the PTEs Julien Grall
2023-06-19 17:01 ` [PATCH 1/7] xen/arm32: head: Add missing isb in setup_fixmap() Julien Grall
2023-06-20  3:06   ` Henry Wang
2023-06-20 11:10   ` Luca Fancellu
2023-07-04 14:53   ` Bertrand Marquis
2023-06-19 17:01 ` [PATCH 2/7] xen/arm32: head: Add mising isb in switch_to_runtime_mapping() Julien Grall
2023-06-20  3:06   ` Henry Wang
2023-06-20 11:13   ` Luca Fancellu
2023-07-04 14:52   ` Bertrand Marquis
2023-06-19 17:01 ` Julien Grall [this message]
2023-06-20  3:06   ` [PATCH 3/7] xen/arm64: head: Add missing isb in setup_fixmap() Henry Wang
2023-06-20 11:14   ` Luca Fancellu
2023-06-21  9:33   ` Michal Orzel
2023-06-21 10:02     ` Julien Grall
2023-06-21 10:13       ` Michal Orzel
2023-06-24  7:49         ` Julien Grall
2023-07-04 14:48   ` Bertrand Marquis
2023-06-19 17:01 ` [PATCH 4/7] xen/arm: page: Consolidate write_pte() and clarify the documentation Julien Grall
2023-06-20  3:07   ` Henry Wang
2023-07-04 15:06   ` Bertrand Marquis
2023-07-04 19:04     ` Julien Grall
2023-06-19 17:01 ` [PATCH 5/7] xen/arm: pmap: Add missing ISB in arch_pmap_map() Julien Grall
2023-06-20  3:07   ` Henry Wang
2023-07-04 14:56   ` Bertrand Marquis
2023-06-19 17:01 ` [PATCH 6/7] xen/arm: mm: Add missing ISB in xen_pt_update() Julien Grall
2023-06-20  3:07   ` Henry Wang
2023-07-04 14:54   ` Bertrand Marquis
2023-06-19 17:01 ` [PATCH 7/7] xen/arm32: head: Widen the use of the temporary mapping Julien Grall
2023-06-20  3:07   ` Henry Wang
2023-07-04 15:07   ` Bertrand Marquis
2023-07-04 19:08 ` [PATCH 0/7] xen/arm: Add some missing ISBs after updating the PTEs Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230619170115.81398-4-julien@xen.org \
    --to=julien@xen.org \
    --cc=Henry.Wang@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jgrall@amazon.com \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.