Skip to contentSkip to conversation

Use CSR numbers instead of names

PATCH In review Andreas Schwab 5 participants 12 messages Aug 5, 2019 – Aug 7, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use CSR numbers instead of names

Fixes f6635f873a60 ("riscv: move switch_mm to its own file")
Fixes 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages")
---
 arch/riscv/mm/context.c | 7 +------
 arch/riscv/mm/init.c    | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)
arch/riscv/mm/context.c +1 -6
index 89ceb3cbe218..beeb5d7f92ea 100644
@@ -57,12 +57,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 	cpumask_clear_cpu(cpu, mm_cpumask(prev));
 	cpumask_set_cpu(cpu, mm_cpumask(next));
 
-	/*
-	 * Use the old spbtr name instead of using the current satp
-	 * name to support binutils 2.29 which doesn't know about the
-	 * privileged ISA 1.10 yet.
-	 */
-	csr_write(sptbr, virt_to_pfn(next->pgd) | SATP_MODE);
+	csr_write(CSR_SATP, virt_to_pfn(next->pgd) | SATP_MODE);
 	local_flush_tlb_all();
 
 	flush_icache_deferred(next);
arch/riscv/mm/init.c +1 -1
index 42bf939693d3..238fc4157f8d 100644
@@ -435,7 +435,7 @@ static void __init setup_vm_final(void)
 	clear_fixmap(FIX_PMD);
 
 	/* Move to swapper page table */
-	csr_write(sptbr, PFN_DOWN(__pa(swapper_pg_dir)) | SATP_MODE);
+	csr_write(CSR_SATP, PFN_DOWN(__pa(swapper_pg_dir)) | SATP_MODE);
 	local_flush_tlb_all();
 }
 
Signature · 12 lines
2.22.0


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Reviewed-by on v1 1/1
#1 lore raw
Quoted 61 lines

-----Original Message-----
From: linux-riscv <[email protected]> On Behalf Of Andreas Schwab
Sent: Monday, August 5, 2019 7:10 PM
To: [email protected]
Cc: [email protected]
Subject: [PATCH] Use CSR numbers instead of names

Fixes f6635f873a60 ("riscv: move switch_mm to its own file")
Fixes 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages")
---
 arch/riscv/mm/context.c | 7 +------
 arch/riscv/mm/init.c    | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)
arch/riscv/mm/context.c index renamed from arch/riscv/mm/context.c +0 -0

89ceb3cbe218..beeb5d7f92ea 100644

arch/riscv/mm/context.c +1 -6
@@ -57,12 +57,7 @@ void switch_mm(struct mm_struct *prev, struct
 mm_struct *next,
 	cpumask_clear_cpu(cpu, mm_cpumask(prev));
 	cpumask_set_cpu(cpu, mm_cpumask(next));
 
-	/*
-	 * Use the old spbtr name instead of using the current satp
-	 * name to support binutils 2.29 which doesn't know about the
-	 * privileged ISA 1.10 yet.
-	 */
-	csr_write(sptbr, virt_to_pfn(next->pgd) | SATP_MODE);
+	csr_write(CSR_SATP, virt_to_pfn(next->pgd) | SATP_MODE);
 	local_flush_tlb_all();
 
arch/riscv/mm/context.c +0 -0
 	flush_icache_deferred(next);
arch/riscv/mm/init.c index renamed from arch/riscv/mm/init.c +0 -0

42bf939693d3..238fc4157f8d 100644

arch/riscv/mm/init.c +1 -1
@@ -435,7 +435,7 @@ static void __init setup_vm_final(void)
 	clear_fixmap(FIX_PMD);
 
 	/* Move to swapper page table */
-	csr_write(sptbr, PFN_DOWN(__pa(swapper_pg_dir)) |
 SATP_MODE);
+	csr_write(CSR_SATP, PFN_DOWN(__pa(swapper_pg_dir)) |
 SATP_MODE);
 	local_flush_tlb_all();

}

--
2.22.0

--
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Quoted 4 lines

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

Looks good to me.

Regards,
Anup

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#3 lore raw
Quoted 2 lines · Christoph Hellwig

Looks good. I've been trying to get the same patch in for about two month now, maybe this one has more luck..

Thanks for your patience. If you have patches from one of your earlier series that you think should go in as fixes, it's helpful for us if you split them out from patches that are intended for the regular merge window.

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#4 lore raw
Quoted 10 lines · Paul Walmsley
Quoted 2 lines · Christoph Hellwig

Looks good. I've been trying to get the same patch in for about two month now, maybe this one has more luck..

Thanks for your patience. If you have patches from one of your earlier series that you think should go in as fixes, it's helpful for us if you split them out from patches that are intended for the regular merge window.

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Regards,
Bin

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#5 lore raw
Quoted 7 lines · Bin Meng
Quoted 6 lines · Paul Walmsley
Quoted 2 lines · Christoph Hellwig

Looks good. I've been trying to get the same patch in for about two month now, maybe this one has more luck..

Quoted 7 lines
Quoted 4 lines

Thanks for your patience. If you have patches from one of your earlier series that you think should go in as fixes, it's helpful for us if you split them out from patches that are intended for the regular merge window.

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Christoph's patch predates yours.

If all looks well with your patch, I'll update it to remove the overlap and queue it after his.

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#6 lore raw
Quoted 8 lines · Paul Walmsley
Quoted 3 lines

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Christoph's patch predates yours.

If all looks well with your patch, I'll update it to remove the overlap and queue it after his.

The one from Bin looks most comprehensive, so maybe go with that, plus the hunk from Andreas for the instance that was only recently introduced.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#7 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Paul Walmsley
Quoted 3 lines

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Quoted 7 lines
Quoted 4 lines

Christoph's patch predates yours.

If all looks well with your patch, I'll update it to remove the overlap and queue it after his.

The one from Bin looks most comprehensive, so maybe go with that, plus the hunk from Andreas for the instance that was only recently introduced.

Thanks Christoph.

I've included your SoB and Andreas's into my v2 patch which added the changes of arch/riscv/mm/init.c that was recently changed.
https://patchwork.kernel.org/patch/11082147/

Regards,
Bin

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#8 lore raw
Quoted 3 lines · Bin Meng

I've included your SoB and Andreas's into my v2 patch which added the changes of arch/riscv/mm/init.c that was recently changed.
https://patchwork.kernel.org/patch/11082147/

I don;t think you need mine at all, as you did the same change independently. And maybe well just keep the hunk from Andreas separate to keep it simple.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#9 lore raw
In reply to Bin Meng
Quoted 12 lines · Bin Meng
Quoted 11 lines · Christoph Hellwig
Quoted 8 lines · Paul Walmsley
Quoted 3 lines

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Christoph's patch predates yours.

If all looks well with your patch, I'll update it to remove the overlap and queue it after his.

Quoted 8 lines
Quoted 2 lines

The one from Bin looks most comprehensive, so maybe go with that, plus the hunk from Andreas for the instance that was only recently introduced.

Thanks Christoph.

I've included your SoB and Andreas's into my v2 patch which added the changes of arch/riscv/mm/init.c that was recently changed.
https://patchwork.kernel.org/patch/11082147/

Best not to add others' Signed-off-by:s unless they explicitly offer them. Adding a Signed-off-by: for the kernel denotes that that person has accepted the Developer's Statement of Origin here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n431

Could you please either convert those into Co-developed-by: lines or ask Christoph and Andreas for explicit Signed-off-by:s, Acked-by:s, or Reviewed-by:s ?

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#10 lore raw
Quoted 23 lines · Paul Walmsley
Quoted 12 lines · Bin Meng
Quoted 11 lines · Christoph Hellwig
Quoted 8 lines · Paul Walmsley
Quoted 3 lines

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Christoph's patch predates yours.

If all looks well with your patch, I'll update it to remove the overlap and queue it after his.

Quoted 8 lines
Quoted 2 lines

The one from Bin looks most comprehensive, so maybe go with that, plus the hunk from Andreas for the instance that was only recently introduced.

Thanks Christoph.

I've included your SoB and Andreas's into my v2 patch which added the changes of arch/riscv/mm/init.c that was recently changed.
https://patchwork.kernel.org/patch/11082147/

Quoted 7 lines

Best not to add others' Signed-off-by:s unless they explicitly offer them. Adding a Signed-off-by: for the kernel denotes that that person has accepted the Developer's Statement of Origin here:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n431

Could you please either convert those into Co-developed-by: lines or ask

Actually even Co-developed-by: lines require Signed-off-by:s as well:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n548

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#11 lore raw
In reply to Paul Walmsley
Quoted 28 lines · Paul Walmsley
Quoted 12 lines · Bin Meng
Quoted 11 lines · Christoph Hellwig
Quoted 8 lines · Paul Walmsley
Quoted 3 lines

I have already sent a similar patch (with more places fixed) on Jul 11.
https://patchwork.kernel.org/patch/11039421/

Christoph's patch predates yours.

If all looks well with your patch, I'll update it to remove the overlap and queue it after his.

Quoted 8 lines
Quoted 2 lines

The one from Bin looks most comprehensive, so maybe go with that, plus the hunk from Andreas for the instance that was only recently introduced.

Thanks Christoph.

I've included your SoB and Andreas's into my v2 patch which added the changes of arch/riscv/mm/init.c that was recently changed.
https://patchwork.kernel.org/patch/11082147/

Best not to add others' Signed-off-by:s unless they explicitly offer them. Adding a Signed-off-by: for the kernel denotes that that person has accepted the Developer's Statement of Origin here:

Quoted 5 lines

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n431

Could you please either convert those into Co-developed-by: lines or ask Christoph and Andreas for explicit Signed-off-by:s, Acked-by:s, or Reviewed-by:s ?

OK, I will remove these SoB tags.

Regards,
Bin

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv