All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Julien Grall <julien@xen.org>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Luca Fancellu <Luca.Fancellu@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v5 4/5] xen/arm64: mm: Rework switch_ttbr()
Date: Mon, 30 Jan 2023 10:42:12 +0000	[thread overview]
Message-ID: <1A67BC62-95DE-41F4-ABA5-D473B9D27D60@arm.com> (raw)
In-Reply-To: <20230127195508.2786-5-julien@xen.org>

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

Hi Julien,

On 27 Jan 2023, at 20:55, Julien Grall <julien@xen.org> wrote:

From: Julien Grall <jgrall@amazon.com>

At the moment, switch_ttbr() is switching the TTBR whilst the MMU is
still on.

Switching TTBR is like replacing existing mappings with new ones. So
we need to follow the break-before-make sequence.

In this case, it means the MMU needs to be switched off while the
TTBR is updated. In order to disable the MMU, we need to first
jump to an identity mapping.

Rename switch_ttbr() to switch_ttbr_id() and create an helper on
top to temporary map the identity mapping and call switch_ttbr()
via the identity address.

switch_ttbr_id() is now reworked to temporarily turn off the MMU
before updating the TTBR.

We also need to make sure the helper switch_ttbr() is part of the
identity mapping. So move _end_boot past it.

The arm32 code will use a different approach. So this issue is for now
only resolved on arm64.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Tested-by: Luca Fancellu <luca.fancellu@arm.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com<mailto:bertrand.marquis@arm.com>>

Cheers
Bertrand


[-- Attachment #2: Type: text/html, Size: 1813 bytes --]

  parent reply	other threads:[~2023-01-30 10:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 19:55 [PATCH v5 0/5] xen/arm: Don't switch TTBR while the MMU is on Julien Grall
2023-01-27 19:55 ` [PATCH v5 1/5] xen/arm32: head: Widen the use of the temporary mapping Julien Grall
2023-01-28  4:22   ` Henry Wang
2023-01-30  8:58   ` Michal Orzel
2023-01-30 18:31     ` Julien Grall
2023-01-27 19:55 ` [PATCH v5 2/5] xen/arm64: Rework the memory layout Julien Grall
2023-01-30  9:08   ` Michal Orzel
2023-01-30 18:36     ` Julien Grall
2023-01-31  9:22       ` Michal Orzel
2023-02-23 14:09   ` Bertrand Marquis
2023-02-23 14:26     ` Bertrand Marquis
2023-01-27 19:55 ` [PATCH v5 3/5] xen/arm64: mm: Introduce helpers to prepare/enable/disable the identity mapping Julien Grall
2023-01-28  4:54   ` Henry Wang
2023-02-26 10:29     ` Julien Grall
2023-01-30  9:00   ` Julien Grall
2023-01-27 19:55 ` [PATCH v5 4/5] xen/arm64: mm: Rework switch_ttbr() Julien Grall
2023-01-30  9:17   ` Michal Orzel
2023-01-30 10:42   ` Bertrand Marquis [this message]
2023-01-27 19:55 ` [PATCH v5 5/5] xen/arm64: smpboot: Directly switch to the runtime page-tables Julien Grall
2023-02-23 14:06   ` Bertrand Marquis
2023-02-23 14:25     ` Bertrand Marquis

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=1A67BC62-95DE-41F4-ABA5-D473B9D27D60@arm.com \
    --to=bertrand.marquis@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=jgrall@amazon.com \
    --cc=julien@xen.org \
    --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.