Re: [kvm-unit-tests PATCH 1/8] s390x: uv-host: Fix UV init test memory allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Janosch Frank (2023-03-23 11:39:06)
> The init memory has to be above 2G and 1M aligned but we're currently
> aligning on 2G which means the allocations need a lot of unused
> memory.
> 
> Let's fix that.
> 
> Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
> ---
>  s390x/uv-host.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/s390x/uv-host.c b/s390x/uv-host.c
> index 33e6eec6..68de47e7 100644
> --- a/s390x/uv-host.c
> +++ b/s390x/uv-host.c
> @@ -555,7 +555,7 @@ static void test_init(void)
>         rc = uv_call(0, (uint64_t)&uvcb_init);
>         report(rc == 0 && uvcb_init.header.rc == UVC_RC_EXECUTED, "successful");
>  
> -       mem = (uint64_t)memalign(1UL << 31, uvcb_qui.uv_base_stor_len);
> +       mem = (uint64_t)memalign_pages_flags(HPAGE_SIZE, uvcb_qui.uv_base_stor_len, AREA_NORMAL);
>         rc = uv_call(0, (uint64_t)&uvcb_init);
>         report(rc == 1 && uvcb_init.header.rc == 0x101, "double init");
>         free((void *)mem);

Your fix looks reasonable, but I think this is still broken, no?

We allocate a new mem, initalize the ultravisor again and then free the memory. We do absolutely nothing with the allocated memory, do we?

Are we maybe missing a
  uvcb_init.stor_origin = mem;
here?

Also, a comment stating that AREA_NORMAL starts at PFN 524288 (2G) might be nice.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux