x86/PVH/libxl: Check whether Linux guest can handle RSDP at 4G boundary
PATCH v2 1/1 x86/PVH/libxl: Check whether Linux guest can handle RSDP at 4G boundary
Commit 4a5733771e6f ("libxl: put RSDP for PVH guest near 4GB") breaks pre-4.17 Linux guests since they do not use start_info's rsdp_paddr pointer and instread scan BIOS memory for RSDP signature.
Introduce XENFEAT_rsdp_unrestricted feature flag that indicates whether the guest can handle RSDP at locations pointed to by rsdp_paddr.
Since only Linux PVH guests suffer from this problem (BSD has always relied on rsdp_paddr) we check this flag just for those guests. If the flag is not set we place RSDP in BIOS, as before.
---
v2:
* Renamed flag to XENFEAT_linux_rsdp_unrestricted
* Clarified comment in features.h
I did not include tags because of the changes but just in case --- here they are:
tools/libxl/libxl_x86_acpi.c | 14 ++++++++++++-- xen/include/public/features.h | 9 +++++++++ 2 files changed, 21 insertions(+), 2 deletions(-)
tools/libxl/libxl_x86_acpi.c +12 -2
@@ -218,8 +218,18 @@ int libxl__dom_load_acpi(libxl__gc *gc, dom->acpi_modules[0 ].data = (void *)config.rsdp; dom->acpi_modules[0 ].length =64 ; - dom->acpi_modules[0 ].guest_addr_out =ACPI_INFO_PHYSICAL_ADDRESS + - (1 + acpi_pages_num) * libxl_ctxt.page_size; +/* +* Some Linux versions cannot properly process hvm_start_info.rsdp_paddr +* and so we need to put RSDP in location that can be discovered by ACPI's +* standard search method, in R-O BIOS memory (we chose last 64 bytes) +*/ +if (strcmp (dom->parms.guest_os,"linux" ) || +elf_xen_feature_get (XENFEAT_linux_rsdp_unrestricted, + dom->parms.f_supported)) + dom->acpi_modules[0 ].guest_addr_out =ACPI_INFO_PHYSICAL_ADDRESS + + (1 + acpi_pages_num) * libxl_ctxt.page_size; +else + dom->acpi_modules[0 ].guest_addr_out =0x100000 -64 ; dom->acpi_modules[1 ].data = (void *)config.infop; dom->acpi_modules[1 ].length =4096 ;
xen/include/public/features.h +9 -0
@@ -105,6 +105,15 @@/* arm: Hypervisor supports ARM SMC calling convention. */ #define XENFEAT_ARM_SMCCC_supported 14 +/* +* x86/PVH: If set, ACPI RSDP can be placed at any address. Otherwise RSDP +* must be located in lower 1MB, as required by ACPI Specification for IA-PC +* systems. +* This feature flag is only consulted if XEN_ELFNOTE_GUEST_OS contains +* the "linux" string. +*/ +#define XENFEAT_linux_rsdp_unrestricted 15 +#define XENFEAT_NR_SUBMAPS 1#endif /* __XEN_PUBLIC_FEATURES_H__ */
Signature · 7 lines
2.14.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Boris Ostrovsky
Commit
4a5733771e6f("libxl: put RSDP for PVH guest near 4GB") breaks pre-4.17 Linux guests since they do not use start_info'srsdp_paddrpointer and instread scan BIOS memory for RSDP signature.
Quoted 8 lines
Introduce
XENFEAT_rsdp_unrestrictedfeature flag that indicates whether the guest can handle RSDP at locations pointed to byrsdp_paddr.Since only Linux PVH guests suffer from this problem (BSD has always relied on
rsdp_paddr) we check this flag just for those guests. If the flag is not set we place RSDP in BIOS, as before.Signed-off-by Boris Ostrovsky <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 17 lines · Boris Ostrovsky
Commit
4a5733771e6f("libxl: put RSDP for PVH guest near 4GB") breaks pre-4.17 Linux guests since they do not use start_info'srsdp_paddrpointer and instread scan BIOS memory for RSDP signature.Introduce
XENFEAT_rsdp_unrestrictedfeature flag that indicates whether the guest can handle RSDP at locations pointed to byrsdp_paddr.Since only Linux PVH guests suffer from this problem (BSD has always relied on
rsdp_paddr) we check this flag just for those guests. If the flag is not set we place RSDP in BIOS, as before.Signed-off-by Boris Ostrovsky <[email protected]>---
v2:
* Renamed flag toXENFEAT_linux_rsdp_unrestricted
* Clarified comment infeatures.h
Quoted 4 lines
I did not include tags because of the changes but just in case --- here they are:
Acked-by George Dunlap <[email protected]>
So again:
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Boris Ostrovsky
Commit
4a5733771e6f("libxl: put RSDP for PVH guest near 4GB") breaks pre-4.17 Linux guests since they do not use start_info'srsdp_paddrpointer and instread scan BIOS memory for RSDP signature.Introduce
XENFEAT_rsdp_unrestrictedfeature flag that indicates whether
I realise the name here is not updated. That can be done upon committing.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 8 lines · Wei Liu
Quoted 5 lines · Boris Ostrovsky
Commit
4a5733771e6f("libxl: put RSDP for PVH guest near 4GB") breaks pre-4.17 Linux guests since they do not use start_info'srsdp_paddrpointer and instread scan BIOS memory for RSDP signature.Introduce
XENFEAT_rsdp_unrestrictedfeature flag that indicates whetherI realise the name here is not updated. That can be done upon committing.
Please!
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Boris Ostrovsky
Commit
4a5733771e6f("libxl: put RSDP for PVH guest near 4GB") breaks pre-4.17 Linux guests since they do not use start_info'srsdp_paddrpointer and instread scan BIOS memory for RSDP signature.
Quoted 8 lines
Introduce
XENFEAT_rsdp_unrestrictedfeature flag that indicates whether the guest can handle RSDP at locations pointed to byrsdp_paddr.Since only Linux PVH guests suffer from this problem (BSD has always relied on
rsdp_paddr) we check this flag just for those guests. If the flag is not set we place RSDP in BIOS, as before.Signed-off-by Boris Ostrovsky <[email protected]>
LGTM:
Thanks!
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel