Skip to content

Commit 079c4ba

Browse files
jbeulichjgross1
authored andcommitted
xen/x86: hook up xen_banner() also for PVH
This was effectively lost while dropping PVHv1 code. Move the function and arrange for it to be called the same way as done in PV mode. Clearly this then needs re-introducing the XENFEAT_mmu_pt_update_preserve_ad check that was recently removed, as that's a PV-only feature. Since the string pointed at by pv_info.name describes the mode, drop "paravirtualized" from the log message while moving the code. Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent 4d1ab43 commit 079c4ba

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

arch/x86/xen/enlighten.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,20 @@ int xen_vcpu_setup(int cpu)
261261
return ((per_cpu(xen_vcpu, cpu) == NULL) ? -ENODEV : 0);
262262
}
263263

264+
void __init xen_banner(void)
265+
{
266+
unsigned version = HYPERVISOR_xen_version(XENVER_version, NULL);
267+
struct xen_extraversion extra;
268+
269+
HYPERVISOR_xen_version(XENVER_extraversion, &extra);
270+
271+
pr_info("Booting kernel on %s\n", pv_info.name);
272+
pr_info("Xen version: %u.%u%s%s\n",
273+
version >> 16, version & 0xffff, extra.extraversion,
274+
xen_feature(XENFEAT_mmu_pt_update_preserve_ad)
275+
? " (preserve-AD)" : "");
276+
}
277+
264278
/* Check if running on Xen version (major, minor) or later */
265279
bool xen_running_on_version_or_later(unsigned int major, unsigned int minor)
266280
{

arch/x86/xen/enlighten_pv.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,6 @@ struct tls_descs {
108108
*/
109109
static DEFINE_PER_CPU(struct tls_descs, shadow_tls_desc);
110110

111-
static void __init xen_banner(void)
112-
{
113-
unsigned version = HYPERVISOR_xen_version(XENVER_version, NULL);
114-
struct xen_extraversion extra;
115-
HYPERVISOR_xen_version(XENVER_extraversion, &extra);
116-
117-
pr_info("Booting paravirtualized kernel on %s\n", pv_info.name);
118-
pr_info("Xen version: %d.%d%s (preserve-AD)\n",
119-
version >> 16, version & 0xffff, extra.extraversion);
120-
}
121-
122111
static void __init xen_pv_init_platform(void)
123112
{
124113
populate_extra_pte(fix_to_virt(FIX_PARAVIRT_BOOTMAP));

arch/x86/xen/enlighten_pvh.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void __init xen_pvh_init(struct boot_params *boot_params)
3838

3939
if (xen_initial_domain())
4040
x86_init.oem.arch_setup = xen_add_preferred_consoles;
41+
x86_init.oem.banner = xen_banner;
4142

4243
xen_efi_init(boot_params);
4344
}

arch/x86/xen/xen-ops.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void __init xen_remap_memory(void);
5151
phys_addr_t __init xen_find_free_area(phys_addr_t size);
5252
char * __init xen_memory_setup(void);
5353
void __init xen_arch_setup(void);
54+
void xen_banner(void);
5455
void xen_enable_sysenter(void);
5556
void xen_enable_syscall(void);
5657
void xen_vcpu_restore(void);

0 commit comments

Comments
 (0)