On 04/09/2024 3:56 pm, Frediano Ziglio wrote:
> All code and dat from this file will go into a text section
> which we want to not be writeable.

Getting data out of the instruction cache is a good thing, but
writeability isn't relevant here.  This logic only executes in 32bit
unpaged mode.

>
> Signed-off-by: Frediano Ziglio <frediano.zig...@cloud.com>
> ---
>  xen/arch/x86/boot/reloc.c | 62 ++++++++++++++++++++-------------------
>  1 file changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
> index 201e38d544..de8487483a 100644
> --- a/xen/arch/x86/boot/reloc.c
> +++ b/xen/arch/x86/boot/reloc.c
> @@ -72,11 +72,13 @@ struct vesa_mode_info {
>  #define get_mb2_data(tag, type, member)   (((const multiboot2_tag_##type##_t 
> *)(tag))->member)
>  #define get_mb2_string(tag, type, member) ((uint32_t)get_mb2_data(tag, type, 
> member))
>  
> -static uint32_t alloc;
> +typedef struct memctx {
> +    uint32_t alloc;
> +} memctx;

Can we take the opportunity to rename alloc to ptr, and have a comment
explaining how this works

/* Simple bump allocator.  It starts from the base of the trampoline and
allocates downwards. */

Happy to fix up on commit.

~Andrew

Reply via email to