x86/HyperV: correct hv_hcall_page for xen.efi build
PATCH 1/1 x86/HyperV: correct hv_hcall_page for xen.efi build
Along the lines of what the not reverted part of 3c4b2eef4941 ("x86:
refine link time stub area related assertion") did, we need to transform the absolute HV_HCALL_PAGE into the image base relative hv_hcall_page (or else there'd be no need for two distinct symbols). Otherwise mkreloc, as used for generating the base relocations of xen.efi, will spit out warnings like "Difference at .text:0009b74f is 0xc0000000 (expected 0x40000000)". As long as the offending relocations are PC relative ones, the generated binary is correct afaict, but if there ever was the absolute address stored, xen.efi would miss a fixup for it.
---
Build tested only (and generated binary inspected) - Wei, please check that this doesn't break things.
xen/arch/x86/xen.lds.S +1 -1
@@ -327,7 +327,7 @@ SECTIONS #endif #ifdef CONFIG_HYPERV_GUEST - hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE); + hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE - XEN_VIRT_START + __XEN_VIRT_START); #endif /* Sections to be discarded */
Quoted 10 lines · Jan Beulich
Along the lines of what the not reverted part of
3c4b2eef4941("x86:
refine link time stub area related assertion") did, we need to transform the absoluteHV_HCALL_PAGEinto the image base relativehv_hcall_page(or else there'd be no need for two distinct symbols). Otherwise mkreloc, as used for generating the base relocations of xen.efi, will spit out warnings like "Difference at .text:0009b74f is0xc0000000(expected0x40000000)". As long as the offending relocations are PC relative ones, the generated binary is correct afaict, but if there ever was the absolute address stored, xen.efi would miss a fixup for it.
Quoted 2 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Quoted 4 lines
---
Build tested only (and generated binary inspected) - Wei, please check that this doesn't break things.
I don't have time to verify this in next couple of weeks, but I will surely notice if there is a breakage.
Quoted 11 lines
xen/arch/x86/xen.lds.S +1
-1@@ -327,7 +327,7 @@ SECTIONS #endif #ifdef CONFIG_HYPERV_GUEST - hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE); + hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE - XEN_VIRT_START + __XEN_VIRT_START); #endif /* Sections to be discarded */
Quoted 13 lines · Wei Liu
Quoted 10 lines · Jan Beulich
Along the lines of what the not reverted part of
3c4b2eef4941("x86:
refine link time stub area related assertion") did, we need to transform the absoluteHV_HCALL_PAGEinto the image base relativehv_hcall_page(or else there'd be no need for two distinct symbols). Otherwise mkreloc, as used for generating the base relocations of xen.efi, will spit out warnings like "Difference at .text:0009b74f is0xc0000000(expected0x40000000)". As long as the offending relocations are PC relative ones, the generated binary is correct afaict, but if there ever was the absolute address stored, xen.efi would miss a fixup for it.Quoted 2 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Quoted 8 lines
Acked-by Wei Liu <[email protected]>Quoted 4 lines
---
Build tested only (and generated binary inspected) - Wei, please check that this doesn't break things.I don't have time to verify this in next couple of weeks, but I will surely notice if there is a breakage.
FWIW, the resulting assembly is identical, so it surely will be as fine as it was previously.
~Andrew
Quoted 20 lines · Andrew Cooper
Quoted 19 lines · Wei Liu
Quoted 10 lines · Jan Beulich
Along the lines of what the not reverted part of
3c4b2eef4941("x86:
refine link time stub area related assertion") did, we need to transform the absoluteHV_HCALL_PAGEinto the image base relativehv_hcall_page(or else there'd be no need for two distinct symbols). Otherwise mkreloc, as used for generating the base relocations of xen.efi, will spit out warnings like "Difference at .text:0009b74f is0xc0000000(expected0x40000000)". As long as the offending relocations are PC relative ones, the generated binary is correct afaict, but if there ever was the absolute address stored, xen.efi would miss a fixup for it.Quoted 2 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>Acked-by Wei Liu <[email protected]>Quoted 4 lines
---
Build tested only (and generated binary inspected) - Wei, please check that this doesn't break things.
Quoted 5 lines
Quoted 2 lines
I don't have time to verify this in next couple of weeks, but I will surely notice if there is a breakage.
FWIW, the resulting assembly is identical, so it surely will be as fine as it was previously.
Thanks. That should be okay.
Wei.
Quoted 2 lines
~Andrew