* [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB
@ 2017-04-04 14:45 Ard Biesheuvel
2017-04-04 14:59 ` Laszlo Ersek
0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2017-04-04 14:45 UTC (permalink / raw)
To: edk2-devel, lersek; +Cc: jens.wiklander, Ard Biesheuvel
The relocatable build of ArmVirtQemuKernel is designed to be executed
from RAM, and contains some scratch memory at the start of the image
to use as a stack very early on, and to preserve the DTB image received
from QEMU while it discovers and initializes memory.
It turns out that 8 KB is a bit on the small side here, especially when
executing with secure world emulation enabled, in which case there are
additional nodes present.
So increase the slack space to 32 KB.
While at it, remove a stale Xen reference that was copy/pasted when this
file was created.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
ArmVirtPkg/ArmVirtQemuKernel.fdf | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKernel.fdf
index 7bc62f6b0b48..55541a1075d8 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.fdf
+++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf
@@ -52,15 +52,15 @@ [FD.QEMU_EFI]
################################################################################
#
-# Implement the Linux kernel header layout so that the Xen loader will identify
+# Implement the Linux kernel header layout so that the loader will identify
# it as something bootable, and execute it with a FDT pointer in x0 or r2.
-# This area will be reused to store a copy of the FDT so round it up to 8 KB.
+# This area will be reused to store a copy of the FDT so round it up to 32 KB.
#
-0x00000000|0x00002000
+0x00000000|0x00008000
DATA = {
!if $(ARCH) == AARCH64
0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
- 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
+ 0xff, 0x1f, 0x00, 0x14, # code1: b 0x8000
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
@@ -79,7 +79,7 @@ [FD.QEMU_EFI]
0x00, 0x00, 0xa0, 0xe1, # nop
0x00, 0x00, 0xa0, 0xe1, # nop
- 0xf6, 0x07, 0x00, 0xea, # b 0x2000
+ 0xf6, 0x1f, 0x00, 0xea, # b 0x8000
0x18, 0x28, 0x6f, 0x01, # magic
0x00, 0x00, 0x00, 0x00, # start
0x00, 0x00, 0x20, 0x00, # image size: 2 MB
@@ -87,7 +87,7 @@ [FD.QEMU_EFI]
!endif
}
-0x00002000|0x001fe000
+0x00008000|0x001f8000
gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
FV = FVMAIN_COMPACT
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB
2017-04-04 14:45 [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB Ard Biesheuvel
@ 2017-04-04 14:59 ` Laszlo Ersek
2017-04-04 15:02 ` Ard Biesheuvel
0 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2017-04-04 14:59 UTC (permalink / raw)
To: Ard Biesheuvel, edk2-devel; +Cc: jens.wiklander
On 04/04/17 16:45, Ard Biesheuvel wrote:
> The relocatable build of ArmVirtQemuKernel is designed to be executed
> from RAM, and contains some scratch memory at the start of the image
> to use as a stack very early on, and to preserve the DTB image received
> from QEMU while it discovers and initializes memory.
>
> It turns out that 8 KB is a bit on the small side here, especially when
> executing with secure world emulation enabled, in which case there are
> additional nodes present.
>
> So increase the slack space to 32 KB.
>
> While at it, remove a stale Xen reference that was copy/pasted when this
> file was created.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> ArmVirtPkg/ArmVirtQemuKernel.fdf | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKernel.fdf
> index 7bc62f6b0b48..55541a1075d8 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.fdf
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf
> @@ -52,15 +52,15 @@ [FD.QEMU_EFI]
> ################################################################################
>
> #
> -# Implement the Linux kernel header layout so that the Xen loader will identify
> +# Implement the Linux kernel header layout so that the loader will identify
> # it as something bootable, and execute it with a FDT pointer in x0 or r2.
> -# This area will be reused to store a copy of the FDT so round it up to 8 KB.
> +# This area will be reused to store a copy of the FDT so round it up to 32 KB.
> #
> -0x00000000|0x00002000
> +0x00000000|0x00008000
> DATA = {
> !if $(ARCH) == AARCH64
> 0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
> - 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
> + 0xff, 0x1f, 0x00, 0x14, # code1: b 0x8000
> 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
> 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
> @@ -79,7 +79,7 @@ [FD.QEMU_EFI]
> 0x00, 0x00, 0xa0, 0xe1, # nop
> 0x00, 0x00, 0xa0, 0xe1, # nop
>
> - 0xf6, 0x07, 0x00, 0xea, # b 0x2000
> + 0xf6, 0x1f, 0x00, 0xea, # b 0x8000
> 0x18, 0x28, 0x6f, 0x01, # magic
> 0x00, 0x00, 0x00, 0x00, # start
> 0x00, 0x00, 0x20, 0x00, # image size: 2 MB
> @@ -87,7 +87,7 @@ [FD.QEMU_EFI]
> !endif
> }
>
> -0x00002000|0x001fe000
> +0x00008000|0x001f8000
> gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
> FV = FVMAIN_COMPACT
>
>
Acked-by: Laszlo Ersek <lersek@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB
2017-04-04 14:59 ` Laszlo Ersek
@ 2017-04-04 15:02 ` Ard Biesheuvel
2017-04-14 6:04 ` Michael Zimmermann
0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2017-04-04 15:02 UTC (permalink / raw)
To: Laszlo Ersek; +Cc: edk2-devel@lists.01.org, Jens Wiklander
On 4 April 2017 at 15:59, Laszlo Ersek <lersek@redhat.com> wrote:
> On 04/04/17 16:45, Ard Biesheuvel wrote:
>> The relocatable build of ArmVirtQemuKernel is designed to be executed
>> from RAM, and contains some scratch memory at the start of the image
>> to use as a stack very early on, and to preserve the DTB image received
>> from QEMU while it discovers and initializes memory.
>>
>> It turns out that 8 KB is a bit on the small side here, especially when
>> executing with secure world emulation enabled, in which case there are
>> additional nodes present.
>>
>> So increase the slack space to 32 KB.
>>
>> While at it, remove a stale Xen reference that was copy/pasted when this
>> file was created.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>> ArmVirtPkg/ArmVirtQemuKernel.fdf | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKernel.fdf
>> index 7bc62f6b0b48..55541a1075d8 100644
>> --- a/ArmVirtPkg/ArmVirtQemuKernel.fdf
>> +++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf
>> @@ -52,15 +52,15 @@ [FD.QEMU_EFI]
>> ################################################################################
>>
>> #
>> -# Implement the Linux kernel header layout so that the Xen loader will identify
>> +# Implement the Linux kernel header layout so that the loader will identify
>> # it as something bootable, and execute it with a FDT pointer in x0 or r2.
>> -# This area will be reused to store a copy of the FDT so round it up to 8 KB.
>> +# This area will be reused to store a copy of the FDT so round it up to 32 KB.
>> #
>> -0x00000000|0x00002000
>> +0x00000000|0x00008000
>> DATA = {
>> !if $(ARCH) == AARCH64
>> 0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
>> - 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
>> + 0xff, 0x1f, 0x00, 0x14, # code1: b 0x8000
>> 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
>> 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
>> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
>> @@ -79,7 +79,7 @@ [FD.QEMU_EFI]
>> 0x00, 0x00, 0xa0, 0xe1, # nop
>> 0x00, 0x00, 0xa0, 0xe1, # nop
>>
>> - 0xf6, 0x07, 0x00, 0xea, # b 0x2000
>> + 0xf6, 0x1f, 0x00, 0xea, # b 0x8000
>> 0x18, 0x28, 0x6f, 0x01, # magic
>> 0x00, 0x00, 0x00, 0x00, # start
>> 0x00, 0x00, 0x20, 0x00, # image size: 2 MB
>> @@ -87,7 +87,7 @@ [FD.QEMU_EFI]
>> !endif
>> }
>>
>> -0x00002000|0x001fe000
>> +0x00008000|0x001f8000
>> gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
>> FV = FVMAIN_COMPACT
>>
>>
>
> Acked-by: Laszlo Ersek <lersek@redhat.com>
Thanks. Pushed as 4d2ea2616e94
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB
2017-04-04 15:02 ` Ard Biesheuvel
@ 2017-04-14 6:04 ` Michael Zimmermann
2017-04-14 6:19 ` Michael Zimmermann
0 siblings, 1 reply; 5+ messages in thread
From: Michael Zimmermann @ 2017-04-14 6:04 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: Laszlo Ersek, edk2-devel@lists.01.org, Jens Wiklander
"contains some scratch memory at the start of the image to use as a
stack very early on"
When does this happen? I didn't see any edk2-code which sets SP to the
slack space.
Thanks
Michael
On Tue, Apr 4, 2017 at 5:02 PM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> On 4 April 2017 at 15:59, Laszlo Ersek <lersek@redhat.com> wrote:
>> On 04/04/17 16:45, Ard Biesheuvel wrote:
>>> The relocatable build of ArmVirtQemuKernel is designed to be executed
>>> from RAM, and contains some scratch memory at the start of the image
>>> to use as a stack very early on, and to preserve the DTB image received
>>> from QEMU while it discovers and initializes memory.
>>>
>>> It turns out that 8 KB is a bit on the small side here, especially when
>>> executing with secure world emulation enabled, in which case there are
>>> additional nodes present.
>>>
>>> So increase the slack space to 32 KB.
>>>
>>> While at it, remove a stale Xen reference that was copy/pasted when this
>>> file was created.
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> ---
>>> ArmVirtPkg/ArmVirtQemuKernel.fdf | 12 ++++++------
>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKernel.fdf
>>> index 7bc62f6b0b48..55541a1075d8 100644
>>> --- a/ArmVirtPkg/ArmVirtQemuKernel.fdf
>>> +++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf
>>> @@ -52,15 +52,15 @@ [FD.QEMU_EFI]
>>> ################################################################################
>>>
>>> #
>>> -# Implement the Linux kernel header layout so that the Xen loader will identify
>>> +# Implement the Linux kernel header layout so that the loader will identify
>>> # it as something bootable, and execute it with a FDT pointer in x0 or r2.
>>> -# This area will be reused to store a copy of the FDT so round it up to 8 KB.
>>> +# This area will be reused to store a copy of the FDT so round it up to 32 KB.
>>> #
>>> -0x00000000|0x00002000
>>> +0x00000000|0x00008000
>>> DATA = {
>>> !if $(ARCH) == AARCH64
>>> 0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
>>> - 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
>>> + 0xff, 0x1f, 0x00, 0x14, # code1: b 0x8000
>>> 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
>>> 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
>>> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
>>> @@ -79,7 +79,7 @@ [FD.QEMU_EFI]
>>> 0x00, 0x00, 0xa0, 0xe1, # nop
>>> 0x00, 0x00, 0xa0, 0xe1, # nop
>>>
>>> - 0xf6, 0x07, 0x00, 0xea, # b 0x2000
>>> + 0xf6, 0x1f, 0x00, 0xea, # b 0x8000
>>> 0x18, 0x28, 0x6f, 0x01, # magic
>>> 0x00, 0x00, 0x00, 0x00, # start
>>> 0x00, 0x00, 0x20, 0x00, # image size: 2 MB
>>> @@ -87,7 +87,7 @@ [FD.QEMU_EFI]
>>> !endif
>>> }
>>>
>>> -0x00002000|0x001fe000
>>> +0x00008000|0x001f8000
>>> gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
>>> FV = FVMAIN_COMPACT
>>>
>>>
>>
>> Acked-by: Laszlo Ersek <lersek@redhat.com>
>
> Thanks. Pushed as 4d2ea2616e94
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB
2017-04-14 6:04 ` Michael Zimmermann
@ 2017-04-14 6:19 ` Michael Zimmermann
0 siblings, 0 replies; 5+ messages in thread
From: Michael Zimmermann @ 2017-04-14 6:19 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: Laszlo Ersek, edk2-devel@lists.01.org, Jens Wiklander
Ok I've found it in "RelocatableVirtHelper.S".
Thanks
Michael
On Fri, Apr 14, 2017 at 8:04 AM, Michael Zimmermann
<sigmaepsilon92@gmail.com> wrote:
> "contains some scratch memory at the start of the image to use as a
> stack very early on"
> When does this happen? I didn't see any edk2-code which sets SP to the
> slack space.
>
> Thanks
> Michael
>
> On Tue, Apr 4, 2017 at 5:02 PM, Ard Biesheuvel
> <ard.biesheuvel@linaro.org> wrote:
>> On 4 April 2017 at 15:59, Laszlo Ersek <lersek@redhat.com> wrote:
>>> On 04/04/17 16:45, Ard Biesheuvel wrote:
>>>> The relocatable build of ArmVirtQemuKernel is designed to be executed
>>>> from RAM, and contains some scratch memory at the start of the image
>>>> to use as a stack very early on, and to preserve the DTB image received
>>>> from QEMU while it discovers and initializes memory.
>>>>
>>>> It turns out that 8 KB is a bit on the small side here, especially when
>>>> executing with secure world emulation enabled, in which case there are
>>>> additional nodes present.
>>>>
>>>> So increase the slack space to 32 KB.
>>>>
>>>> While at it, remove a stale Xen reference that was copy/pasted when this
>>>> file was created.
>>>>
>>>> Contributed-under: TianoCore Contribution Agreement 1.0
>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>> ---
>>>> ArmVirtPkg/ArmVirtQemuKernel.fdf | 12 ++++++------
>>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKernel.fdf
>>>> index 7bc62f6b0b48..55541a1075d8 100644
>>>> --- a/ArmVirtPkg/ArmVirtQemuKernel.fdf
>>>> +++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf
>>>> @@ -52,15 +52,15 @@ [FD.QEMU_EFI]
>>>> ################################################################################
>>>>
>>>> #
>>>> -# Implement the Linux kernel header layout so that the Xen loader will identify
>>>> +# Implement the Linux kernel header layout so that the loader will identify
>>>> # it as something bootable, and execute it with a FDT pointer in x0 or r2.
>>>> -# This area will be reused to store a copy of the FDT so round it up to 8 KB.
>>>> +# This area will be reused to store a copy of the FDT so round it up to 32 KB.
>>>> #
>>>> -0x00000000|0x00002000
>>>> +0x00000000|0x00008000
>>>> DATA = {
>>>> !if $(ARCH) == AARCH64
>>>> 0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
>>>> - 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
>>>> + 0xff, 0x1f, 0x00, 0x14, # code1: b 0x8000
>>>> 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
>>>> 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
>>>> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
>>>> @@ -79,7 +79,7 @@ [FD.QEMU_EFI]
>>>> 0x00, 0x00, 0xa0, 0xe1, # nop
>>>> 0x00, 0x00, 0xa0, 0xe1, # nop
>>>>
>>>> - 0xf6, 0x07, 0x00, 0xea, # b 0x2000
>>>> + 0xf6, 0x1f, 0x00, 0xea, # b 0x8000
>>>> 0x18, 0x28, 0x6f, 0x01, # magic
>>>> 0x00, 0x00, 0x00, 0x00, # start
>>>> 0x00, 0x00, 0x20, 0x00, # image size: 2 MB
>>>> @@ -87,7 +87,7 @@ [FD.QEMU_EFI]
>>>> !endif
>>>> }
>>>>
>>>> -0x00002000|0x001fe000
>>>> +0x00008000|0x001f8000
>>>> gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
>>>> FV = FVMAIN_COMPACT
>>>>
>>>>
>>>
>>> Acked-by: Laszlo Ersek <lersek@redhat.com>
>>
>> Thanks. Pushed as 4d2ea2616e94
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-14 6:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-04 14:45 [PATCH] ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB Ard Biesheuvel
2017-04-04 14:59 ` Laszlo Ersek
2017-04-04 15:02 ` Ard Biesheuvel
2017-04-14 6:04 ` Michael Zimmermann
2017-04-14 6:19 ` Michael Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox