public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Peter Collingbourne <pcc@google.com>
Subject: Re: linux-next: manual merge of the arm64 tree with the arm64-fixes tree
Date: Thu, 21 Jul 2022 20:45:17 +1000	[thread overview]
Message-ID: <20220721204517.53bab2a3@canb.auug.org.au> (raw)
In-Reply-To: <20220721094512.5419f75f@canb.auug.org.au>

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

Hi all,

On Thu, 21 Jul 2022 09:45:12 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the arm64 tree got a conflict in:
> 
>   arch/arm64/kernel/head.S
> 
> between commit:
> 
>   f7b4c3b82e7d ("arm64: set UXN on swapper page tables")
> 
> from the arm64-fixes tree and commits:
> 
>   e42ade29e3bc ("arm64: head: split off idmap creation code")
>   c3cee924bd85 ("arm64: head: cover entire kernel image in initial ID map")
> 
> from the arm64 tree.
> 
> I didn't know if the change from the former was still needed after the
> changes in the latter, so I left it out for now.

OK, so my arm64 defconfig build produced these errors:

arch/arm64/kernel/head.S: Assembler messages:
arch/arm64/kernel/head.S:334: Error: immediate cannot be moved by a single instruction
arch/arm64/kernel/head.S:343: Error: immediate cannot be moved by a single instruction
arch/arm64/kernel/head.S:354: Error: immediate cannot be moved by a single instruction
arch/arm64/kernel/head.S:379: Error: immediate cannot be moved by a single instruction
arch/arm64/mm/proc.S:296: Error: immediate cannot be moved by a single instruction

So I tried this patch:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 21 Jul 2022 20:21:36 +1000
Subject: [PATCH] fixup for "arm64: set UXN on swapper page tables"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/arm64/kernel/head.S | 8 ++++----
 arch/arm64/mm/proc.S     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index cefe6a73ee54..aa7c58689f68 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -331,7 +331,7 @@ SYM_FUNC_START_LOCAL(create_idmap)
 	adrp	x0, init_idmap_pg_dir
 	adrp	x3, _text
 	adrp	x6, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE
-	mov	x7, SWAPPER_RX_MMUFLAGS
+	mov_q	x7, SWAPPER_RX_MMUFLAGS
 
 	map_memory x0, x1, x3, x6, x7, x3, IDMAP_PGD_ORDER, x10, x11, x12, x13, x14, EXTRA_SHIFT
 
@@ -340,7 +340,7 @@ SYM_FUNC_START_LOCAL(create_idmap)
 	adrp	x2, init_pg_dir
 	adrp	x3, init_pg_end
 	bic	x4, x2, #SWAPPER_BLOCK_SIZE - 1
-	mov	x5, SWAPPER_RW_MMUFLAGS
+	mov_q	x5, SWAPPER_RW_MMUFLAGS
 	mov	x6, #SWAPPER_BLOCK_SHIFT
 	bl	remap_region
 
@@ -351,7 +351,7 @@ SYM_FUNC_START_LOCAL(create_idmap)
 	bfi	x22, x21, #0, #SWAPPER_BLOCK_SHIFT		// remapped FDT address
 	add	x3, x2, #MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE
 	bic	x4, x21, #SWAPPER_BLOCK_SIZE - 1
-	mov	x5, SWAPPER_RW_MMUFLAGS
+	mov_q	x5, SWAPPER_RW_MMUFLAGS
 	mov	x6, #SWAPPER_BLOCK_SHIFT
 	bl	remap_region
 
@@ -376,7 +376,7 @@ SYM_FUNC_START_LOCAL(create_kernel_mapping)
 	adrp	x3, _text			// runtime __pa(_text)
 	sub	x6, x6, x3			// _end - _text
 	add	x6, x6, x5			// runtime __va(_end)
-	mov	x7, SWAPPER_RW_MMUFLAGS
+	mov_q	x7, SWAPPER_RW_MMUFLAGS
 
 	map_memory x0, x1, x5, x6, x7, x3, (VA_BITS - PGDIR_SHIFT), x10, x11, x12, x13, x14
 
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 7837a69524c5..b4fe8e6e85cb 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -293,7 +293,7 @@ SYM_FUNC_START(idmap_kpti_install_ng_mappings)
 	isb
 
 	mov	temp_pte, x5
-	mov	pte_flags, #KPTI_NG_PTE_FLAGS
+	mov_q	pte_flags, #KPTI_NG_PTE_FLAGS
 
 	/* Everybody is enjoying the idmap, so we can rewrite swapper. */
 	/* PGD */
-- 
2.35.1

Which mostly worked, but produced this:

arch/arm64/mm/proc.S: Assembler messages:
arch/arm64/mm/proc.S:296: Error: bad expression
arch/arm64/mm/proc.S:296: Error: found '(', expected: ')'
arch/arm64/mm/proc.S:296: Error: found '(', expected: ')'
arch/arm64/mm/proc.S:296: Error: found '(', expected: ')'
arch/arm64/mm/proc.S:296: Error: junk at end of line, first unrecognized character is `('
arch/arm64/mm/proc.S:296: Error: bad expression
arch/arm64/mm/proc.S:296: Error: found '(', expected: ')'
arch/arm64/mm/proc.S:296: Error: found '(', expected: ')'
arch/arm64/mm/proc.S:296: Error: found '(', expected: ')'
arch/arm64/mm/proc.S:296: Error: junk at end of line, first unrecognized character is `('
arch/arm64/mm/proc.S:296: Error: bad expression at operand 2 -- `movz pte_flags,:abs_g3:#(((0)<<2)|((3<<0)|(1<<10)|(3<<8)|(1<<54)))'
arch/arm64/mm/proc.S:296: Error: bad expression at operand 2 -- `movk pte_flags,:abs_g2_nc:#(((0)<<2)|((3<<0)|(1<<10)|(3<<8)|(1<<54)))'
arch/arm64/mm/proc.S:296: Error: bad expression at operand 2 -- `movk pte_flags,:abs_g1_nc:#(((0)<<2)|((3<<0)|(1<<10)|(3<<8)|(1<<54)))'
arch/arm64/mm/proc.S:296: Error: bad expression at operand 2 -- `movk pte_flags,:abs_g0_nc:#(((0)<<2)|((3<<0)|(1<<10)|(3<<8)|(1<<54)))'

So I gave up and left arm64 broken for today :-(
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-07-21 10:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 23:45 linux-next: manual merge of the arm64 tree with the arm64-fixes tree Stephen Rothwell
2022-07-21 10:45 ` Stephen Rothwell [this message]
2022-07-21 16:14   ` Will Deacon
  -- strict thread matches above, loose matches on Subject: below --
2024-10-29 23:35 Stephen Rothwell
2021-10-06 22:42 Stephen Rothwell
2021-10-07  7:42 ` Will Deacon
2020-11-30 23:05 Stephen Rothwell
2020-12-01  8:37 ` Catalin Marinas
2019-06-26 23:35 Stephen Rothwell
2019-06-06 22:38 Stephen Rothwell
2018-03-27 23:19 Stephen Rothwell

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=20220721204517.53bab2a3@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=pcc@google.com \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox