Pull xen fixes from Juergen Gross: - cleanup for xen time handling - enable the VGA console in a Xen PVH dom0 - cleanup in the xenfs driver * tag 'for-linus-6.3-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: remove unnecessary (void*) conversions x86/PVH: obtain VGA console info in Dom0 x86/xen/time: cleanup xen_tsc_safe_clocksource xen: update arch/x86/include/asm/xen/cpuid.h
Unified · Split
| @@ -89,11 +89,21 @@ · 88 unmodified lines | ||
| 89 | 89 | * Sub-leaf 2: EAX: host tsc frequency in kHz |
| 90 | 90 | */ |
| 91 | 91 | |
| 92 | +#define XEN_CPUID_TSC_EMULATED (1u << 0) | |
| 93 | +#define XEN_CPUID_HOST_TSC_RELIABLE (1u << 1) | |
| 94 | +#define XEN_CPUID_RDTSCP_INSTR_AVAIL (1u << 2) | |
| 95 | + | |
| 96 | +#define XEN_CPUID_TSC_MODE_DEFAULT (0) | |
| 97 | +#define XEN_CPUID_TSC_MODE_ALWAYS_EMULATE (1u) | |
| 98 | +#define XEN_CPUID_TSC_MODE_NEVER_EMULATE (2u) | |
| 99 | +#define XEN_CPUID_TSC_MODE_PVRDTSCP (3u) | |
| 100 | + | |
| 92 | 101 | /* |
| 93 | 102 | * Leaf 5 (0x40000x04) |
| 94 | 103 | * HVM-specific features |
| 95 | 104 | * Sub-leaf 0: EAX: Features |
| 96 | 105 | * Sub-leaf 0: EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag) |
| 106 | + * Sub-leaf 0: ECX: domain id (iff EAX has XEN_HVM_CPUID_DOMID_PRESENT flag) | |
| 97 | 107 | */ |
| 98 | 108 | #define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */ |
| 99 | 109 | #define XEN_HVM_CPUID_X2APIC_VIRT (1u << 1) /* Virtualized x2APIC accesses */ |
| @@ -102,12 +112,16 @@ · 2 unmodified lines | ||
| 102 | 112 | #define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */ |
| 103 | 113 | #define XEN_HVM_CPUID_DOMID_PRESENT (1u << 4) /* domid is present in ECX */ |
| 104 | 114 | /* |
| 105 | − * Bits 55:49 from the IO-APIC RTE and bits 11:5 from the MSI address can be | |
| 106 | − * used to store high bits for the Destination ID. This expands the Destination | |
| 107 | − * ID field from 8 to 15 bits, allowing to target APIC IDs up 32768. | |
| 115 | + * With interrupt format set to 0 (non-remappable) bits 55:49 from the | |
| 116 | + * IO-APIC RTE and bits 11:5 from the MSI address can be used to store | |
| 117 | + * high bits for the Destination ID. This expands the Destination ID | |
| 118 | + * field from 8 to 15 bits, allowing to target APIC IDs up 32768. | |
| 108 | 119 | */ |
| 109 | 120 | #define XEN_HVM_CPUID_EXT_DEST_ID (1u << 5) |
| 110 | −/* Per-vCPU event channel upcalls */ | |
| 121 | +/* | |
| 122 | + * Per-vCPU event channel upcalls work correctly with physical IRQs | |
| 123 | + * bound to event channels. | |
| 124 | + */ | |
| 111 | 125 | #define XEN_HVM_CPUID_UPCALL_VECTOR (1u << 6) |
| 112 | 126 | |
| 113 | 127 | /* |
| @@ -45,6 +45,6 @@ obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o · 44 unmodified lines | ||
| 45 | 45 | |
| 46 | 46 | obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o |
| 47 | 47 | |
| 48 | −obj-$(CONFIG_XEN_PV_DOM0) += vga.o | |
| 48 | +obj-$(CONFIG_XEN_DOM0) += vga.o | |
| 49 | 49 | |
| 50 | 50 | obj-$(CONFIG_XEN_EFI) += efi.o |
| @@ -1390,7 +1390,8 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si) · 1389 unmodified lines | ||
| 1390 | 1390 | |
| 1391 | 1391 | x86_platform.set_legacy_features = |
| 1392 | 1392 | xen_dom0_set_legacy_features; |
| 1393 | − xen_init_vga(info, xen_start_info->console.dom0.info_size); | |
| 1393 | + xen_init_vga(info, xen_start_info->console.dom0.info_size, | |
| 1394 | + &boot_params.screen_info); | |
| 1394 | 1395 | xen_start_info->console.domU.mfn = 0; |
| 1395 | 1396 | xen_start_info->console.domU.evtchn = 0; |
| 1396 | 1397 | |
| @@ -43,6 +43,19 @@ void __init xen_pvh_init(struct boot_params *boot_params) · 42 unmodified lines | ||
| 43 | 43 | x86_init.oem.banner = xen_banner; |
| 44 | 44 | |
| 45 | 45 | xen_efi_init(boot_params); |
| 46 | + | |
| 47 | + if (xen_initial_domain()) { | |
| 48 | + struct xen_platform_op op = { | |
| 49 | + .cmd = XENPF_get_dom0_console, | |
| 50 | + }; | |
| 51 | + long ret = HYPERVISOR_platform_op(&op); | |
| 52 | + | |
| 53 | + if (ret > 0) | |
| 54 | + xen_init_vga(&op.u.dom0_console, | |
| 55 | + min(ret * sizeof(char), | |
| 56 | + sizeof(op.u.dom0_console)), | |
| 57 | + &boot_params->screen_info); | |
| 58 | + } | |
| 46 | 59 | } |
| 47 | 60 | |
| 48 | 61 | void __init mem_map_via_hcall(struct boot_params *boot_params_p) |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <asm/pvclock.h> |
| 21 | 21 | #include <asm/xen/hypervisor.h> |
| 22 | 22 | #include <asm/xen/hypercall.h> |
| 23 | +#include <asm/xen/cpuid.h> | |
| 23 | 24 | |
| 24 | 25 | #include <xen/events.h> |
| 25 | 26 | #include <xen/features.h> |
| @@ -503,11 +504,7 @@ static int __init xen_tsc_safe_clocksource(void) · 477 unmodified lines | ||
| 503 | 504 | /* Leaf 4, sub-leaf 0 (0x40000x03) */ |
| 504 | 505 | cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx); |
| 505 | 506 | |
| 506 | − /* tsc_mode = no_emulate (2) */ | |
| 507 | − if (ebx != 2) | |
| 508 | − return 0; | |
| 509 | − | |
| 510 | − return 1; | |
| 507 | + return ebx == XEN_CPUID_TSC_MODE_NEVER_EMULATE; | |
| 511 | 508 | } |
| 512 | 509 | |
| 513 | 510 | static void __init xen_time_init(void) |
| @@ -9,10 +9,9 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #include "xen-ops.h" |
| 11 | 11 | |
| 12 | −void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size) | |
| 12 | +void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size, | |
| 13 | + struct screen_info *screen_info) | |
| 13 | 14 | { |
| 14 | − struct screen_info *screen_info = &boot_params.screen_info; | |
| 15 | − | |
| 16 | 15 | /* This is drawn from a dump from vgacon:startup in |
| 17 | 16 | * standard Linux. */ |
| 18 | 17 | screen_info->orig_video_mode = 3; |
| @@ -108,11 +108,12 @@ static inline void xen_uninit_lock_cpu(int cpu) · 107 unmodified lines | ||
| 108 | 108 | |
| 109 | 109 | struct dom0_vga_console_info; |
| 110 | 110 | |
| 111 | −#ifdef CONFIG_XEN_PV_DOM0 | |
| 112 | −void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size); | |
| 111 | +#ifdef CONFIG_XEN_DOM0 | |
| 112 | +void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size, | |
| 113 | + struct screen_info *); | |
| 113 | 114 | #else |
| 114 | 115 | static inline void __init xen_init_vga(const struct dom0_vga_console_info *info, |
| 115 | − size_t size) | |
| 116 | + size_t size, struct screen_info *si) | |
| 116 | 117 | { |
| 117 | 118 | } |
| 118 | 119 | #endif |
| @@ -64,7 +64,7 @@ static int xensyms_next_sym(struct xensyms *xs) · 63 unmodified lines | ||
| 64 | 64 | |
| 65 | 65 | static void *xensyms_start(struct seq_file *m, loff_t *pos) |
| 66 | 66 | { |
| 67 | − struct xensyms *xs = (struct xensyms *)m->private; | |
| 67 | + struct xensyms *xs = m->private; | |
| 68 | 68 | |
| 69 | 69 | xs->op.u.symdata.symnum = *pos; |
| 70 | 70 | |
| @@ -76,7 +76,7 @@ static void *xensyms_start(struct seq_file *m, loff_t *pos) · 5 unmodified lines | ||
| 76 | 76 | |
| 77 | 77 | static void *xensyms_next(struct seq_file *m, void *p, loff_t *pos) |
| 78 | 78 | { |
| 79 | − struct xensyms *xs = (struct xensyms *)m->private; | |
| 79 | + struct xensyms *xs = m->private; | |
| 80 | 80 | |
| 81 | 81 | xs->op.u.symdata.symnum = ++(*pos); |
| 82 | 82 | |
| @@ -88,7 +88,7 @@ static void *xensyms_next(struct seq_file *m, void *p, loff_t *pos) · 5 unmodified lines | ||
| 88 | 88 | |
| 89 | 89 | static int xensyms_show(struct seq_file *m, void *p) |
| 90 | 90 | { |
| 91 | − struct xensyms *xs = (struct xensyms *)m->private; | |
| 91 | + struct xensyms *xs = m->private; | |
| 92 | 92 | struct xenpf_symdata *symdata = &xs->op.u.symdata; |
| 93 | 93 | |
| 94 | 94 | seq_printf(m, "%016llx %c %s\n", symdata->address, |
| @@ -120,7 +120,7 @@ static int xensyms_open(struct inode *inode, struct file *file) · 25 unmodified lines | ||
| 120 | 120 | return ret; |
| 121 | 121 | |
| 122 | 122 | m = file->private_data; |
| 123 | − xs = (struct xensyms *)m->private; | |
| 123 | + xs = m->private; | |
| 124 | 124 | |
| 125 | 125 | xs->namelen = XEN_KSYM_NAME_LEN + 1; |
| 126 | 126 | xs->name = kzalloc(xs->namelen, GFP_KERNEL); |
| @@ -138,7 +138,7 @@ static int xensyms_open(struct inode *inode, struct file *file) · 11 unmodified lines | ||
| 138 | 138 | static int xensyms_release(struct inode *inode, struct file *file) |
| 139 | 139 | { |
| 140 | 140 | struct seq_file *m = file->private_data; |
| 141 | − struct xensyms *xs = (struct xensyms *)m->private; | |
| 141 | + struct xensyms *xs = m->private; | |
| 142 | 142 | |
| 143 | 143 | kfree(xs->name); |
| 144 | 144 | return seq_release_private(inode, file); |
| @@ -483,6 +483,8 @@ struct xenpf_symdata { · 482 unmodified lines | ||
| 483 | 483 | }; |
| 484 | 484 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_symdata); |
| 485 | 485 | |
| 486 | +#define XENPF_get_dom0_console 64 | |
| 487 | + | |
| 486 | 488 | struct xen_platform_op { |
| 487 | 489 | uint32_t cmd; |
| 488 | 490 | uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ |
| @@ -506,6 +508,7 @@ struct xen_platform_op { · 17 unmodified lines | ||
| 506 | 508 | struct xenpf_mem_hotadd mem_add; |
| 507 | 509 | struct xenpf_core_parking core_parking; |
| 508 | 510 | struct xenpf_symdata symdata; |
| 511 | + struct dom0_vga_console_info dom0_console; | |
| 509 | 512 | uint8_t pad[128]; |
| 510 | 513 | } u; |
| 511 | 514 | }; |