Skip to contentSkip to conversation

ARM: align MVBAR on 32 byte boundary

PATCH New Masahiro Yamada 3 participants 5 messages Oct 7, 2013 – Dec 6, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: align MVBAR on 32 byte boundary

The lower 5 bit of MVBAR is UNK/SBZP.
So, Monitor Vector Base Address must be 32-byte aligned. On the other hand, the secure monitor handler does not need 32-byte alignment.

This commit moves ".algin 5" directive to the correct place.

---

BTW, I noticed the legacy license block is used in this file.

Because arch/arm/cpu/armv7/nonsec_virt.S is a newly added file, SPDX License Identifier should have been used...

 arch/arm/cpu/armv7/nonsec_virt.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/nonsec_virt.S +1 -1
index 358348f..ee36760 100644
@@ -30,6 +30,7 @@
 .arch_extension sec
 .arch_extension virt
 
+	.align	5
 /* the vector table for secure state and HYP mode */
 _monitor_vectors:
 	.word 0	/* reset */
@@ -48,7 +49,6 @@ _monitor_vectors:
  * to non-secure state.
  * We use only r0 and r1 here, due to constraints in the caller.
  */
-	.align	5
 _secure_monitor:
 	mrc	p15, 0, r1, c1, c1, 0		@ read SCR
 	bic	r1, r1, #0x4e			@ clear IRQ, FIQ, EA, nET bits
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 ARM: align MVBAR on 32 byte boundary

Quoted 9 lines · Masahiro Yamada

The lower 5 bit of MVBAR is UNK/SBZP.
So, Monitor Vector Base Address must be 32-byte aligned. On the other hand, the secure monitor handler does not need 32-byte alignment.

This commit moves ".algin 5" directive to the correct place.

Masahiro,

good catch, thanks for spotting!

I am wondering whether we need the alignment statements in the various start.S files also, because the lower 5 bits are reserved for VBAR too.

Quoted 5 lines

BTW, I noticed the legacy license block is used in this file.

Because arch/arm/cpu/armv7/nonsec_virt.S is a newly added file, SPDX License Identifier should have been used...

Right, will send a patch to address this.

Thanks,
Andre.

Quoted 25 lines
  arch/arm/cpu/armv7/nonsec_virt.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/nonsec_virt.S +1 -1
index 358348f..ee36760 100644
@@ -30,6 +30,7 @@
  .arch_extension sec
  .arch_extension virt
 
+	.align	5
  /* the vector table for secure state and HYP mode */
  _monitor_vectors:
  	.word 0	/* reset */
@@ -48,7 +49,6 @@ _monitor_vectors:
   * to non-secure state.
   * We use only r0 and r1 here, due to constraints in the caller.
   */
-	.align	5
  _secure_monitor:
  	mrc	p15, 0, r1, c1, c1, 0		@ read SCR
  	bic	r1, r1, #0x4e			@ clear IRQ, FIQ, EA, nET bits
#2 lore raw

PATCH 1/1 ARM: align MVBAR on 32 byte boundary

Hello Andre,

Quoted 6 lines

Masahiro,

good catch, thanks for spotting!

I am wondering whether we need the alignment statements in the various start.S files also, because the lower 5 bits are reserved for VBAR too.

I think start.o is always located at the begnning of .text section. So, we do not need explicitely align.

Best Regards
Masahiro Yamada

#3 lore raw

PATCH 1/1 ARM: align MVBAR on 32 byte boundary

Hello Albert.

Quoted 9 lines

The lower 5 bit of MVBAR is UNK/SBZP.
So, Monitor Vector Base Address must be 32-byte aligned. On the other hand, the secure monitor handler does not need 32-byte alignment.

This commit moves ".algin 5" directive to the correct place.

Could you apply this patch, please?

Best Regards
Masahiro Yamada

#4 lore raw

PATCH 1/1 ARM: align MVBAR on 32 byte boundary

In reply to Masahiro Yamada

Hi Masahiro,

Quoted 33 lines · Masahiro Yamada

The lower 5 bit of MVBAR is UNK/SBZP.
So, Monitor Vector Base Address must be 32-byte aligned. On the other hand, the secure monitor handler does not need 32-byte alignment.

This commit moves ".algin 5" directive to the correct place.

---

BTW, I noticed the legacy license block is used in this file.

Because arch/arm/cpu/armv7/nonsec_virt.S is a newly added file, SPDX License Identifier should have been used...

 arch/arm/cpu/armv7/nonsec_virt.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/nonsec_virt.S +1 -0
index 358348f..ee36760 100644
@@ -30,6 +30,7 @@
 .arch_extension sec
 .arch_extension virt
 
+	.align	5
 /* the vector table for secure state and HYP mode */
 _monitor_vectors:
 	.word 0	/* reset */

arch/arm/cpu/armv7/nonsec_virt.S _monitor_vectors: · line 54

Quoted 7 lines
arch/arm/cpu/armv7/nonsec_virt.S +0 -1
@@ -48,7 +49,6 @@ _monitor_vectors:
  * to non-secure state.
  * We use only r0 and r1 here, due to constraints in the caller.
  */
-	.align	5
 _secure_monitor:
 	mrc	p15, 0, r1, c1, c1, 0		@ read SCR
 	bic	r1, r1, #0x4e			@ clear IRQ, FIQ, EA, nET bits

Applied to u-boot-arm/master, thanks!

Amicalement,

Signature · 1 line
Albert.