History

Merge tag 'for-linus-6.3-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

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

Linus Torvalds committed 3 years ago

Commit 0eb392e2 parents cb80b96 7ad2c399 files · +50 −22Browse files

Unified · Split

9 files
  1. arch/x86/include/asm/xen/cpuid.h +18 −4
  2. arch/x86/xen/Makefile +1 −1
  3. arch/x86/xen/enlighten_pv.c +2 −1
  4. arch/x86/xen/enlighten_pvh.c +13 −0
  5. arch/x86/xen/time.c +2 −5
  6. arch/x86/xen/vga.c +2 −3
  7. arch/x86/xen/xen-ops.h +4 −3
  8. drivers/xen/xenfs/xensyms.c +5 −5
  9. include/xen/interface/platform.h +3 −0
arch/x86/include/asm/xen/cpuid.h+18−4
@@ -89,11 +89,21 @@ · 88 unmodified lines
89 * Sub-leaf 2: EAX: host tsc frequency in kHz89 * 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 * Leaf 5 (0x40000x04)102 * Leaf 5 (0x40000x04)
94 * HVM-specific features103 * HVM-specific features
95 * Sub-leaf 0: EAX: Features104 * Sub-leaf 0: EAX: Features
96 * Sub-leaf 0: EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag)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#define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */108#define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */
99#define XEN_HVM_CPUID_X2APIC_VIRT (1u << 1) /* Virtualized x2APIC accesses */109#define XEN_HVM_CPUID_X2APIC_VIRT (1u << 1) /* Virtualized x2APIC accesses */
@@ -102,12 +112,16 @@ · 2 unmodified lines
102#define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */112#define XEN_HVM_CPUID_VCPU_ID_PRESENT (1u << 3) /* vcpu id is present in EBX */
103#define XEN_HVM_CPUID_DOMID_PRESENT (1u << 4) /* domid is present in ECX */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 be115 * With interrupt format set to 0 (non-remappable) bits 55:49 from the
106 * used to store high bits for the Destination ID. This expands the Destination116 * IO-APIC RTE and bits 11:5 from the MSI address can be used to store
107 * ID field from 8 to 15 bits, allowing to target APIC IDs up 32768.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#define XEN_HVM_CPUID_EXT_DEST_ID (1u << 5)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#define XEN_HVM_CPUID_UPCALL_VECTOR (1u << 6)125#define XEN_HVM_CPUID_UPCALL_VECTOR (1u << 6)
112 126
113/*127/*
arch/x86/xen/Makefile+1−1
@@ -45,6 +45,6 @@ obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o · 44 unmodified lines
45 45
46obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o46obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
47 47
48obj-$(CONFIG_XEN_PV_DOM0) += vga.o48obj-$(CONFIG_XEN_DOM0) += vga.o
49 49
50obj-$(CONFIG_XEN_EFI) += efi.o50obj-$(CONFIG_XEN_EFI) += efi.o
arch/x86/xen/enlighten_pv.c+2−1
@@ -1390,7 +1390,8 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si) · 1389 unmodified lines
1390 1390
1391 x86_platform.set_legacy_features =1391 x86_platform.set_legacy_features =
1392 xen_dom0_set_legacy_features;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 xen_start_info->console.domU.mfn = 0;1395 xen_start_info->console.domU.mfn = 0;
1395 xen_start_info->console.domU.evtchn = 0;1396 xen_start_info->console.domU.evtchn = 0;
1396 1397
arch/x86/xen/enlighten_pvh.c+13−0
@@ -43,6 +43,19 @@ void __init xen_pvh_init(struct boot_params *boot_params) · 42 unmodified lines
43 x86_init.oem.banner = xen_banner;43 x86_init.oem.banner = xen_banner;
44 44
45 xen_efi_init(boot_params);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
48void __init mem_map_via_hcall(struct boot_params *boot_params_p)61void __init mem_map_via_hcall(struct boot_params *boot_params_p)
arch/x86/xen/time.c+2−5
@@ -20,6 +20,7 @@ · 19 unmodified lines
20#include <asm/pvclock.h>20#include <asm/pvclock.h>
21#include <asm/xen/hypervisor.h>21#include <asm/xen/hypervisor.h>
22#include <asm/xen/hypercall.h>22#include <asm/xen/hypercall.h>
23#include <asm/xen/cpuid.h>
23 24
24#include <xen/events.h>25#include <xen/events.h>
25#include <xen/features.h>26#include <xen/features.h>
@@ -503,11 +504,7 @@ static int __init xen_tsc_safe_clocksource(void) · 477 unmodified lines
503 /* Leaf 4, sub-leaf 0 (0x40000x03) */504 /* Leaf 4, sub-leaf 0 (0x40000x03) */
504 cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx);505 cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx);
505 506
506 /* tsc_mode = no_emulate (2) */507 return ebx == XEN_CPUID_TSC_MODE_NEVER_EMULATE;
507 if (ebx != 2)
508 return 0;
509
510 return 1;
511}508}
512 509
513static void __init xen_time_init(void)510static void __init xen_time_init(void)
arch/x86/xen/vga.c+2−3
@@ -9,10 +9,9 @@ · 8 unmodified lines
9 9
10#include "xen-ops.h"10#include "xen-ops.h"
11 11
12void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size)12void __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 /* This is drawn from a dump from vgacon:startup in15 /* This is drawn from a dump from vgacon:startup in
17 * standard Linux. */16 * standard Linux. */
18 screen_info->orig_video_mode = 3;17 screen_info->orig_video_mode = 3;
arch/x86/xen/xen-ops.h+4−3
@@ -108,11 +108,12 @@ static inline void xen_uninit_lock_cpu(int cpu) · 107 unmodified lines
108 108
109struct dom0_vga_console_info;109struct dom0_vga_console_info;
110 110
111#ifdef CONFIG_XEN_PV_DOM0111#ifdef CONFIG_XEN_DOM0
112void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size);112void __init xen_init_vga(const struct dom0_vga_console_info *, size_t size,
113 struct screen_info *);
113#else114#else
114static inline void __init xen_init_vga(const struct dom0_vga_console_info *info,115static 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#endif119#endif
drivers/xen/xenfs/xensyms.c+5−5
@@ -64,7 +64,7 @@ static int xensyms_next_sym(struct xensyms *xs) · 63 unmodified lines
64 64
65static void *xensyms_start(struct seq_file *m, loff_t *pos)65static 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 xs->op.u.symdata.symnum = *pos;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
77static void *xensyms_next(struct seq_file *m, void *p, loff_t *pos)77static 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 xs->op.u.symdata.symnum = ++(*pos);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
89static int xensyms_show(struct seq_file *m, void *p)89static 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 struct xenpf_symdata *symdata = &xs->op.u.symdata;92 struct xenpf_symdata *symdata = &xs->op.u.symdata;
93 93
94 seq_printf(m, "%016llx %c %s\n", symdata->address,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 return ret;120 return ret;
121 121
122 m = file->private_data;122 m = file->private_data;
123 xs = (struct xensyms *)m->private;123 xs = m->private;
124 124
125 xs->namelen = XEN_KSYM_NAME_LEN + 1;125 xs->namelen = XEN_KSYM_NAME_LEN + 1;
126 xs->name = kzalloc(xs->namelen, GFP_KERNEL);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
138static int xensyms_release(struct inode *inode, struct file *file)138static int xensyms_release(struct inode *inode, struct file *file)
139{139{
140 struct seq_file *m = file->private_data;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 kfree(xs->name);143 kfree(xs->name);
144 return seq_release_private(inode, file);144 return seq_release_private(inode, file);
include/xen/interface/platform.h+3−0
@@ -483,6 +483,8 @@ struct xenpf_symdata { · 482 unmodified lines
483};483};
484DEFINE_GUEST_HANDLE_STRUCT(xenpf_symdata);484DEFINE_GUEST_HANDLE_STRUCT(xenpf_symdata);
485 485
486#define XENPF_get_dom0_console 64
487
486struct xen_platform_op {488struct xen_platform_op {
487 uint32_t cmd;489 uint32_t cmd;
488 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */490 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -506,6 +508,7 @@ struct xen_platform_op { · 17 unmodified lines
506 struct xenpf_mem_hotadd mem_add;508 struct xenpf_mem_hotadd mem_add;
507 struct xenpf_core_parking core_parking;509 struct xenpf_core_parking core_parking;
508 struct xenpf_symdata symdata;510 struct xenpf_symdata symdata;
511 struct dom0_vga_console_info dom0_console;
509 uint8_t pad[128];512 uint8_t pad[128];
510 } u;513 } u;
511};514};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t