From: Don Zickus dzickus@redhat.com
Upstream status: RHEL only
The variable x86_hyper_type is hidden behind a macro and not available when guest mode is not config'd enabled.
Update to use hypervisor_is_type() macro, available since
commit 79cc74155218316b9a5d28577c7077b2adba8e58 Author: Thomas Gleixner tglx@linutronix.de Date: Mon Dec 4 15:07:31 2017 +0100
x86/paravirt: Provide a way to check for hypervisors
Test compiled with HYPERVISOR_GUEST enabled/disabled.
Signed-off-by: Don Zickus dzickus@redhat.com --- arch/x86/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 505ed44d4e31..00fa8139b069 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -822,7 +822,7 @@ static void rh_check_supported(void) { bool guest;
- guest = (x86_hyper_type != X86_HYPER_NATIVE || boot_cpu_has(X86_FEATURE_HYPERVISOR)); + guest = (!hypervisor_is_type(X86_HYPER_NATIVE) || boot_cpu_has(X86_FEATURE_HYPERVISOR));
/* RHEL supports single cpu on guests only */ if (((boot_cpu_data.x86_max_cores * smp_num_siblings) == 1) &&
On Thu, 14 May 2020 20:20:52 -0000 GitLab Bridge on behalf of dzickusrh jcline@redhat.com wrote:
From: Don Zickus dzickus@redhat.com
Upstream status: RHEL only
The variable x86_hyper_type is hidden behind a macro and not available when guest mode is not config'd enabled.
Update to use hypervisor_is_type() macro, available since
Thanks for fixing this.
From: Don Zickus dzickus@redhat.com
Upstream status: RHEL only
The function rh_check_supported is a RHEL function to limit the platforms RHEL does not want to support.
To avoid imposing this requirement on Fedora, the function was wrapped with CONFIG_RHEL_DIFFERENCES so Fedora can disable this.
However, this has a few compile warnings that need to be cleaned up when disabled.
Move CONFIG_RHEL_DIFFERENCES to include the functions themselves instead of the call. As the unused functions created warnings.
Signed-off-by: Don Zickus dzickus@redhat.com --- arch/x86/kernel/setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0fd824c4162d..505ed44d4e31 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -750,6 +750,7 @@ static void __init trim_low_memory_range(void) memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE)); }
+#ifdef CONFIG_RHEL_DIFFERENCES static bool valid_amd_processor(__u8 family, const char *model_id) { bool valid; @@ -874,6 +875,9 @@ static void rh_check_supported(void) if (acpi_disabled && !guest) pr_crit("ACPI has been disabled or is not available on this hardware. This may result in a single cpu boot, incorrect PCI IRQ routing, or boot failure.\n"); } +#else +static void rh_check_supported(void) { return; } +#endif
/* * Dump out kernel offset information on panic. @@ -1366,9 +1370,7 @@ void __init setup_arch(char **cmdline_p) efi_apply_memmap_quirks(); #endif
-#ifdef CONFIG_RHEL_DIFFERENCES rh_check_supported(); -#endif
unwind_init(); }
On Thu, 14 May 2020 20:20:52 -0000, GitLab Bridge on behalf of dzickusrh wrote:
+static void rh_check_supported(void) { return; }
It would be better to use:
#define rh_check_supported()
for the resulting code to be really the same as before. It does make a difference when compiled without -O. I know we compile the kernel with -O2 but since it's easy to support all cases by using #define, we should do it.
Politely requesting v2, Nacked-by: Jiri Benc jbenc@redhat.com
Thanks,
Jiri
From: Don Zickus dzickus@redhat.com
Upstream status: RHEL only
The function rh_check_supported is a RHEL function to limit the platforms RHEL does not want to support.
To avoid imposing this requirement on Fedora, the function was wrapped with CONFIG_RHEL_DIFFERENCES so Fedora can disable this.
However, this has a few compile warnings that need to be cleaned up when disabled.
Move CONFIG_RHEL_DIFFERENCES to include the functions themselves instead of the call. As the unused functions created warnings.
V2: modified stub definition
Signed-off-by: Don Zickus dzickus@redhat.com --- arch/x86/kernel/setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0fd824c4162d..a7bf9730a2ca 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -750,6 +750,7 @@ static void __init trim_low_memory_range(void) memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE)); }
+#ifdef CONFIG_RHEL_DIFFERENCES static bool valid_amd_processor(__u8 family, const char *model_id) { bool valid; @@ -874,6 +875,9 @@ static void rh_check_supported(void) if (acpi_disabled && !guest) pr_crit("ACPI has been disabled or is not available on this hardware. This may result in a single cpu boot, incorrect PCI IRQ routing, or boot failure.\n"); } +#else +#define rh_check_supported() +#endif
/* * Dump out kernel offset information on panic. @@ -1366,9 +1370,7 @@ void __init setup_arch(char **cmdline_p) efi_apply_memmap_quirks(); #endif
-#ifdef CONFIG_RHEL_DIFFERENCES rh_check_supported(); -#endif
unwind_init(); }
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/362#note_34475526...
Dropped patch1 because internally Red Hat may drop the whole patch anyway. Let's just fix the Fedora compile problem for now.
On Mon, 18 May 2020 21:07:47 -0000, GitLab Bridge on behalf of dzickusrh wrote:
From: Don Zickus dzickus@redhat.com
Upstream status: RHEL only
The function rh_check_supported is a RHEL function to limit the platforms RHEL does not want to support.
To avoid imposing this requirement on Fedora, the function was wrapped with CONFIG_RHEL_DIFFERENCES so Fedora can disable this.
However, this has a few compile warnings that need to be cleaned up when disabled.
Move CONFIG_RHEL_DIFFERENCES to include the functions themselves instead of the call. As the unused functions created warnings.
V2: modified stub definition
Acked-by: Jiri Benc jbenc@redhat.com
On 5/18/20 5:07 PM, GitLab Bridge on behalf of dzickusrh wrote:
From: Don Zickus dzickus@redhat.com
Upstream status: RHEL only
The function rh_check_supported is a RHEL function to limit the platforms RHEL does not want to support.
To avoid imposing this requirement on Fedora, the function was wrapped with CONFIG_RHEL_DIFFERENCES so Fedora can disable this.
However, this has a few compile warnings that need to be cleaned up when disabled.
Move CONFIG_RHEL_DIFFERENCES to include the functions themselves instead of the call. As the unused functions created warnings.
V2: modified stub definition
Signed-off-by: Don Zickus dzickus@redhat.com
Acked-by: Prarit Bhargava prarit@redhat.com
P.
From: Justin Forbes on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/362#note_34544472...
Acked-by: Justin Forbes jforbes@fedoraproject.org
kernel@lists.fedoraproject.org