[edk2] ArmVirtPkg/RelocatableVirtHelper: use correct FindMemNode argument order

Message ID 1460548190-8942-1-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit 8457f5e40277d682b2de25f7769106a2cf803216
Headers show

Commit Message

Ard Biesheuvel April 13, 2016, 11:49 a.m.
Commit 03b6bed17ea6 ArmVirtPkg/XenRelocatablePlatformLib: rewrite DTB
memory node retrieval in C") introduced a FindMemNode () C function
that takes pointers to system memory base and size as arguments, but the
calling code passes them in the wrong order.

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

---
 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S | 4 ++--
 ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S     | 4 ++--
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S  | 4 ++--
 ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S      | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.5.0

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

Comments

Laszlo Ersek April 13, 2016, 12:14 p.m. | #1
On 04/13/16 13:49, Ard Biesheuvel wrote:
> Commit 03b6bed17ea6 ArmVirtPkg/XenRelocatablePlatformLib: rewrite DTB

> memory node retrieval in C") introduced a FindMemNode () C function

> that takes pointers to system memory base and size as arguments, but the

> calling code passes them in the wrong order.

> 

> Contributed-under: TianoCore Contribution Agreement 1.0

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

> ---

>  ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S | 4 ++--

>  ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S     | 4 ++--

>  ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S  | 4 ++--

>  ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S      | 4 ++--

>  4 files changed, 8 insertions(+), 8 deletions(-)

> 

> diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

> index 0980a387207f..27ad07a1a197 100644

> --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

> +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

> @@ -82,8 +82,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>    // encountered. Since we are calling a C function, use the window at the

>    // beginning of the FD image as a temp stack.

>    //

> -  adr   x1, PcdGet64 (PcdSystemMemorySize)

> -  adr   x2, PcdGet64 (PcdSystemMemoryBase)

> +  adr   x1, PcdGet64 (PcdSystemMemoryBase)

> +  adr   x2, PcdGet64 (PcdSystemMemorySize)

>    mov   sp, x7

>    bl    FindMemnode

>    cbz   x0, .Lout

> diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

> index 3d77ea215709..097038806ecd 100644

> --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

> +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

> @@ -79,8 +79,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>    // encountered. Since we are calling a C function, use the window at the

>    // beginning of the FD image as a temp stack.

>    //

> -  ldr   r1, =PcdGet64 (PcdSystemMemorySize)

> -  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)

> +  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)

> +  ldr   r2, =PcdGet64 (PcdSystemMemorySize)

>    mov   sp, r5

>    bl    FindMemnode

>    teq   r0, #0

> diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

> index ae77492bf363..940bcb2d257a 100644

> --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

> +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

> @@ -81,8 +81,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>    // encountered. Since we are calling a C function, use the window at the

>    // beginning of the FD image as a temp stack.

>    //

> -  adr   x1, PcdGet64 (PcdSystemMemorySize)

> -  adr   x2, PcdGet64 (PcdSystemMemoryBase)

> +  adr   x1, PcdGet64 (PcdSystemMemoryBase)

> +  adr   x2, PcdGet64 (PcdSystemMemorySize)

>    mov   sp, x7

>    bl    FindMemnode

>    cbz   x0, .Lout

> diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

> index b69c6d618a26..539426f36f50 100644

> --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

> +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

> @@ -78,8 +78,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>    // encountered. Since we are calling a C function, use the window at the

>    // beginning of the FD image as a temp stack.

>    //

> -  ldr   r1, =PcdGet64 (PcdSystemMemorySize)

> -  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)

> +  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)

> +  ldr   r2, =PcdGet64 (PcdSystemMemorySize)

>    mov   sp, r5

>    bl    FindMemnode

>    teq   r0, #0

> 


This is all Xen, right?

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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel April 13, 2016, 1:27 p.m. | #2
On 13 April 2016 at 14:14, Laszlo Ersek <lersek@redhat.com> wrote:
> On 04/13/16 13:49, Ard Biesheuvel wrote:

>> Commit 03b6bed17ea6 ArmVirtPkg/XenRelocatablePlatformLib: rewrite DTB

>> memory node retrieval in C") introduced a FindMemNode () C function

>> that takes pointers to system memory base and size as arguments, but the

>> calling code passes them in the wrong order.

>>

>> Contributed-under: TianoCore Contribution Agreement 1.0

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

>> ---

>>  ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S | 4 ++--

>>  ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S     | 4 ++--

>>  ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S  | 4 ++--

>>  ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S      | 4 ++--

>>  4 files changed, 8 insertions(+), 8 deletions(-)

>>

>> diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>> index 0980a387207f..27ad07a1a197 100644

>> --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>> +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>> @@ -82,8 +82,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>    // encountered. Since we are calling a C function, use the window at the

>>    // beginning of the FD image as a temp stack.

>>    //

>> -  adr   x1, PcdGet64 (PcdSystemMemorySize)

>> -  adr   x2, PcdGet64 (PcdSystemMemoryBase)

>> +  adr   x1, PcdGet64 (PcdSystemMemoryBase)

>> +  adr   x2, PcdGet64 (PcdSystemMemorySize)

>>    mov   sp, x7

>>    bl    FindMemnode

>>    cbz   x0, .Lout

>> diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>> index 3d77ea215709..097038806ecd 100644

>> --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>> +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>> @@ -79,8 +79,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>    // encountered. Since we are calling a C function, use the window at the

>>    // beginning of the FD image as a temp stack.

>>    //

>> -  ldr   r1, =PcdGet64 (PcdSystemMemorySize)

>> -  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)

>> +  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)

>> +  ldr   r2, =PcdGet64 (PcdSystemMemorySize)

>>    mov   sp, r5

>>    bl    FindMemnode

>>    teq   r0, #0

>> diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>> index ae77492bf363..940bcb2d257a 100644

>> --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>> +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>> @@ -81,8 +81,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>    // encountered. Since we are calling a C function, use the window at the

>>    // beginning of the FD image as a temp stack.

>>    //

>> -  adr   x1, PcdGet64 (PcdSystemMemorySize)

>> -  adr   x2, PcdGet64 (PcdSystemMemoryBase)

>> +  adr   x1, PcdGet64 (PcdSystemMemoryBase)

>> +  adr   x2, PcdGet64 (PcdSystemMemorySize)

>>    mov   sp, x7

>>    bl    FindMemnode

>>    cbz   x0, .Lout

>> diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>> index b69c6d618a26..539426f36f50 100644

>> --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>> +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>> @@ -78,8 +78,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>    // encountered. Since we are calling a C function, use the window at the

>>    // beginning of the FD image as a temp stack.

>>    //

>> -  ldr   r1, =PcdGet64 (PcdSystemMemorySize)

>> -  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)

>> +  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)

>> +  ldr   r2, =PcdGet64 (PcdSystemMemorySize)

>>    mov   sp, r5

>>    bl    FindMemnode

>>    teq   r0, #0

>>

>

> This is all Xen, right?

>

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


Xen and QemuKernel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Laszlo Ersek April 13, 2016, 1:37 p.m. | #3
On 04/13/16 15:27, Ard Biesheuvel wrote:
> On 13 April 2016 at 14:14, Laszlo Ersek <lersek@redhat.com> wrote:

>> On 04/13/16 13:49, Ard Biesheuvel wrote:

>>> Commit 03b6bed17ea6 ArmVirtPkg/XenRelocatablePlatformLib: rewrite DTB

>>> memory node retrieval in C") introduced a FindMemNode () C function

>>> that takes pointers to system memory base and size as arguments, but the

>>> calling code passes them in the wrong order.

>>>

>>> Contributed-under: TianoCore Contribution Agreement 1.0

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

>>> ---

>>>  ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S | 4 ++--

>>>  ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S     | 4 ++--

>>>  ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S  | 4 ++--

>>>  ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S      | 4 ++--

>>>  4 files changed, 8 insertions(+), 8 deletions(-)

>>>

>>> diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>>> index 0980a387207f..27ad07a1a197 100644

>>> --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>>> +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>>> @@ -82,8 +82,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>>    // encountered. Since we are calling a C function, use the window at the

>>>    // beginning of the FD image as a temp stack.

>>>    //

>>> -  adr   x1, PcdGet64 (PcdSystemMemorySize)

>>> -  adr   x2, PcdGet64 (PcdSystemMemoryBase)

>>> +  adr   x1, PcdGet64 (PcdSystemMemoryBase)

>>> +  adr   x2, PcdGet64 (PcdSystemMemorySize)

>>>    mov   sp, x7

>>>    bl    FindMemnode

>>>    cbz   x0, .Lout

>>> diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>>> index 3d77ea215709..097038806ecd 100644

>>> --- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>>> +++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>>> @@ -79,8 +79,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>>    // encountered. Since we are calling a C function, use the window at the

>>>    // beginning of the FD image as a temp stack.

>>>    //

>>> -  ldr   r1, =PcdGet64 (PcdSystemMemorySize)

>>> -  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)

>>> +  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)

>>> +  ldr   r2, =PcdGet64 (PcdSystemMemorySize)

>>>    mov   sp, r5

>>>    bl    FindMemnode

>>>    teq   r0, #0

>>> diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>>> index ae77492bf363..940bcb2d257a 100644

>>> --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>>> +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S

>>> @@ -81,8 +81,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>>    // encountered. Since we are calling a C function, use the window at the

>>>    // beginning of the FD image as a temp stack.

>>>    //

>>> -  adr   x1, PcdGet64 (PcdSystemMemorySize)

>>> -  adr   x2, PcdGet64 (PcdSystemMemoryBase)

>>> +  adr   x1, PcdGet64 (PcdSystemMemoryBase)

>>> +  adr   x2, PcdGet64 (PcdSystemMemorySize)

>>>    mov   sp, x7

>>>    bl    FindMemnode

>>>    cbz   x0, .Lout

>>> diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>>> index b69c6d618a26..539426f36f50 100644

>>> --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>>> +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S

>>> @@ -78,8 +78,8 @@ ASM_PFX(ArmPlatformPeiBootAction):

>>>    // encountered. Since we are calling a C function, use the window at the

>>>    // beginning of the FD image as a temp stack.

>>>    //

>>> -  ldr   r1, =PcdGet64 (PcdSystemMemorySize)

>>> -  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)

>>> +  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)

>>> +  ldr   r2, =PcdGet64 (PcdSystemMemorySize)

>>>    mov   sp, r5

>>>    bl    FindMemnode

>>>    teq   r0, #0

>>>

>>

>> This is all Xen, right?

>>

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

> 

> Xen and QemuKernel


OK, thanks. The ACK stands.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
index 0980a387207f..27ad07a1a197 100644
--- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
+++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
@@ -82,8 +82,8 @@  ASM_PFX(ArmPlatformPeiBootAction):
   // encountered. Since we are calling a C function, use the window at the
   // beginning of the FD image as a temp stack.
   //
-  adr   x1, PcdGet64 (PcdSystemMemorySize)
-  adr   x2, PcdGet64 (PcdSystemMemoryBase)
+  adr   x1, PcdGet64 (PcdSystemMemoryBase)
+  adr   x2, PcdGet64 (PcdSystemMemorySize)
   mov   sp, x7
   bl    FindMemnode
   cbz   x0, .Lout
diff --git a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
index 3d77ea215709..097038806ecd 100644
--- a/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
+++ b/ArmVirtPkg/Library/ArmQemuRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
@@ -79,8 +79,8 @@  ASM_PFX(ArmPlatformPeiBootAction):
   // encountered. Since we are calling a C function, use the window at the
   // beginning of the FD image as a temp stack.
   //
-  ldr   r1, =PcdGet64 (PcdSystemMemorySize)
-  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)
+  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)
+  ldr   r2, =PcdGet64 (PcdSystemMemorySize)
   mov   sp, r5
   bl    FindMemnode
   teq   r0, #0
diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
index ae77492bf363..940bcb2d257a 100644
--- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
+++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/AARCH64/RelocatableVirtHelper.S
@@ -81,8 +81,8 @@  ASM_PFX(ArmPlatformPeiBootAction):
   // encountered. Since we are calling a C function, use the window at the
   // beginning of the FD image as a temp stack.
   //
-  adr   x1, PcdGet64 (PcdSystemMemorySize)
-  adr   x2, PcdGet64 (PcdSystemMemoryBase)
+  adr   x1, PcdGet64 (PcdSystemMemoryBase)
+  adr   x2, PcdGet64 (PcdSystemMemorySize)
   mov   sp, x7
   bl    FindMemnode
   cbz   x0, .Lout
diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
index b69c6d618a26..539426f36f50 100644
--- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
+++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/ARM/RelocatableVirtHelper.S
@@ -78,8 +78,8 @@  ASM_PFX(ArmPlatformPeiBootAction):
   // encountered. Since we are calling a C function, use the window at the
   // beginning of the FD image as a temp stack.
   //
-  ldr   r1, =PcdGet64 (PcdSystemMemorySize)
-  ldr   r2, =PcdGet64 (PcdSystemMemoryBase)
+  ldr   r1, =PcdGet64 (PcdSystemMemoryBase)
+  ldr   r2, =PcdGet64 (PcdSystemMemorySize)
   mov   sp, r5
   bl    FindMemnode
   teq   r0, #0