Skip to contentSkip to conversation

ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code

PATCH New Gregory CLEMENT 3 participants 5 messages Jul 7, 2017 – Jul 12, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code

As we already did for Armada XP switch from virt_to_phys() to __pa_symbol().

The reason for it was well explained by Mark Rutland so let's quote him:

"virt_to_phys() is intended to operate on the linear/direct mapping of RAM.

__pa_symbol() is intended to operate on the kernel mapping, which may not be in the linear/direct mapping on all architectures. e.g. arm64 and x86_64 map the kernel image and RAM separately.

On 32-bit ARM the kernel image mapping is tied to the linear/direct mapping, so that works, but as it's semantically wrong (and broken for generic code), the DEBUG_VIRTUAL checks complain."

Fixes db88977894ab ("arm: mvebu: support for SMP on 98DX3336 SoC")

---

Hi Chris,

with this patch I don't expect any regression, hover it would be nice if you can test it.

Thanks,

Gregory

 arch/arm/mach-mvebu/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mvebu/platsmp.c +1 -1
index e62273aacb43..4ffbbd217e82 100644
@@ -211,7 +211,7 @@ static int mv98dx3236_resume_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
 		return PTR_ERR(base);
 
 	writel(0, base + MV98DX3236_CPU_RESUME_CTRL_REG);
-	writel(virt_to_phys(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG);
+	writel(__pa_symbol(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG);
 
 	iounmap(base);
 
Signature · 1 line
2.13.2
#1 lore raw

PATCH 1/1 ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code

Hi Florian,

I forgot to CC you on this patch.

Gregory

Quoted 49 lines · Gregory CLEMENT

As we already did for Armada XP switch from virt_to_phys() to __pa_symbol().

The reason for it was well explained by Mark Rutland so let's quote him:

"virt_to_phys() is intended to operate on the linear/direct mapping of RAM.

__pa_symbol() is intended to operate on the kernel mapping, which may not be in the linear/direct mapping on all architectures. e.g. arm64 and x86_64 map the kernel image and RAM separately.

On 32-bit ARM the kernel image mapping is tied to the linear/direct mapping, so that works, but as it's semantically wrong (and broken for generic code), the DEBUG_VIRTUAL checks complain."

Fixes db88977894ab ("arm: mvebu: support for SMP on 98DX3336 SoC")

---

Hi Chris,

with this patch I don't expect any regression, hover it would be nice if you can test it.

Thanks,

Gregory

 arch/arm/mach-mvebu/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mvebu/platsmp.c +1 -1
index e62273aacb43..4ffbbd217e82 100644
@@ -211,7 +211,7 @@ static int mv98dx3236_resume_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
 		return PTR_ERR(base);
 
 	writel(0, base + MV98DX3236_CPU_RESUME_CTRL_REG);
-	writel(virt_to_phys(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG);
+	writel(__pa_symbol(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG);
 
 	iounmap(base);
 
Signature · 1 line
2.13.2
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code

Quoted 27 lines · Gregory CLEMENT

Hi Florian,

I forgot to CC you on this patch.

Gregory

Quoted 19 lines · Gregory CLEMENT

As we already did for Armada XP switch from virt_to_phys() to __pa_symbol().

The reason for it was well explained by Mark Rutland so let's quote him:

"virt_to_phys() is intended to operate on the linear/direct mapping of RAM.

__pa_symbol() is intended to operate on the kernel mapping, which may not be in the linear/direct mapping on all architectures. e.g. arm64 and x86_64 map the kernel image and RAM separately.

On 32-bit ARM the kernel image mapping is tied to the linear/direct mapping, so that works, but as it's semantically wrong (and broken for generic code), the DEBUG_VIRTUAL checks complain."

Fixes db88977894ab ("arm: mvebu: support for SMP on 98DX3336 SoC")

Thanks!

Signature · 1 line
Florian
#3 lore raw

PATCH 1/1 ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code

In reply to Gregory CLEMENT
Quoted 19 lines · Gregory CLEMENT

As we already did for Armada XP switch from virt_to_phys() to __pa_symbol().

The reason for it was well explained by Mark Rutland so let's quote him:

"virt_to_phys() is intended to operate on the linear/direct mapping of RAM.

__pa_symbol() is intended to operate on the kernel mapping, which may not be in the linear/direct mapping on all architectures. e.g. arm64 and x86_64 map the kernel image and RAM separately.

On 32-bit ARM the kernel image mapping is tied to the linear/direct mapping, so that works, but as it's semantically wrong (and broken for generic code), the DEBUG_VIRTUAL checks complain."

Fixes db88977894ab ("arm: mvebu: support for SMP on 98DX3336 SoC")
Quoted 6 lines

---

Hi Chris,

with this patch I don't expect any regression, hover it would be nice if you can test it.

Works for me

#4 lore raw

PATCH 1/1 ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code

In reply to Gregory CLEMENT

Hi,

Quoted 12 lines · Gregory CLEMENT

As we already did for Armada XP switch from virt_to_phys() to __pa_symbol().

The reason for it was well explained by Mark Rutland so let's quote him:

"virt_to_phys() is intended to operate on the linear/direct mapping of RAM.

__pa_symbol() is intended to operate on the kernel mapping, which may not be in the linear/direct mapping on all architectures. e.g. arm64 and x86_64 map the kernel image and RAM separately.

Quoted 7 lines

On 32-bit ARM the kernel image mapping is tied to the linear/direct mapping, so that works, but as it's semantically wrong (and broken for generic code), the DEBUG_VIRTUAL checks complain."

Fixes db88977894ab ("arm: mvebu: support for SMP on 98DX3336 SoC")

Applied on mvebu/fixes with the tags from Chris and Floriant.

Gregory

Quoted 30 lines

---

Hi Chris,

with this patch I don't expect any regression, hover it would be nice if you can test it.

Thanks,

Gregory

 arch/arm/mach-mvebu/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mvebu/platsmp.c +1 -1
index e62273aacb43..4ffbbd217e82 100644
@@ -211,7 +211,7 @@ static int mv98dx3236_resume_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
 		return PTR_ERR(base);
 
 	writel(0, base + MV98DX3236_CPU_RESUME_CTRL_REG);
-	writel(virt_to_phys(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG);
+	writel(__pa_symbol(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG);
 
 	iounmap(base);
 
Signature · 1 line
2.13.2
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com