diff mbox series

[edk2,04/15] ArmVirtPkg/PrePi: remove bogus primary core check

Message ID 20171117160913.17292-5-ard.biesheuvel@linaro.org
State Superseded
Headers show
Series ArmVirtPkg: get rid of ArmPlatformLib | expand

Commit Message

Ard Biesheuvel Nov. 17, 2017, 4:09 p.m. UTC
QEMU and KVM based ARM/AARCH64 virtual machines only enter UEFI on
a single core, so ArmPlatformIsPrimaryCore() always returns true.
And even if it didn't, our code does absolutely nothing meaningful
based on its return value, so don't bother calling it, and remove
another frivolous dependency on ArmPlatformLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 7 -------
 ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S     | 7 -------
 2 files changed, 14 deletions(-)

-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek Nov. 21, 2017, 3:40 p.m. UTC | #1
On 11/17/17 17:09, Ard Biesheuvel wrote:
> QEMU and KVM based ARM/AARCH64 virtual machines only enter UEFI on

> a single core, so ArmPlatformIsPrimaryCore() always returns true.

> And even if it didn't, our code does absolutely nothing meaningful

> based on its return value, so don't bother calling it, and remove

> another frivolous dependency on ArmPlatformLib.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 7 -------

>  ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S     | 7 -------

>  2 files changed, 14 deletions(-)

> 

> diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S

> index cc8b47e69026..7a9c0c3787cc 100644

> --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S

> +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S

> @@ -128,13 +128,6 @@ _GetStackBase:

>    MOV32 (x3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize))

>    bl    ASM_PFX(ArmPlatformStackSet)

>  

> -  // Is it the Primary Core ?

> -  mov   x0, x10

> -  bl    ASM_PFX(ArmPlatformIsPrimaryCore)

> -  cmp   x0, #1

> -  bne   _PrepareArguments

> -

> -_PrepareArguments:

>    mov   x0, x20

>    mov   x1, x21

>    mov   x2, x22

> diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S

> index 59028d0a553e..eebf660acdb2 100644

> --- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S

> +++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S

> @@ -136,13 +136,6 @@ _GetStackBase:

>    MOV32 (r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize))

>    bl    ASM_PFX(ArmPlatformStackSet)

>  

> -  // Is it the Primary Core ?

> -  mov   r0, r10

> -  bl    ASM_PFX(ArmPlatformIsPrimaryCore)

> -  cmp   r0, #1

> -  bne   _PrepareArguments

> -

> -_PrepareArguments:

>    mov   r0, r10

>    mov   r1, r11

>    mov   r2, r9

> 


I'll assume ArmPlatformIsPrimaryCore has no side effects. Beyond that,
even I can see that

  conditional-jump LABEL
LABEL: ...

is a no-op :)

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
index cc8b47e69026..7a9c0c3787cc 100644
--- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
+++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S
@@ -128,13 +128,6 @@  _GetStackBase:
   MOV32 (x3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize))
   bl    ASM_PFX(ArmPlatformStackSet)
 
-  // Is it the Primary Core ?
-  mov   x0, x10
-  bl    ASM_PFX(ArmPlatformIsPrimaryCore)
-  cmp   x0, #1
-  bne   _PrepareArguments
-
-_PrepareArguments:
   mov   x0, x20
   mov   x1, x21
   mov   x2, x22
diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
index 59028d0a553e..eebf660acdb2 100644
--- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
+++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
@@ -136,13 +136,6 @@  _GetStackBase:
   MOV32 (r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize))
   bl    ASM_PFX(ArmPlatformStackSet)
 
-  // Is it the Primary Core ?
-  mov   r0, r10
-  bl    ASM_PFX(ArmPlatformIsPrimaryCore)
-  cmp   r0, #1
-  bne   _PrepareArguments
-
-_PrepareArguments:
   mov   r0, r10
   mov   r1, r11
   mov   r2, r9