Skip to content

Commit 4a387c9

Browse files
committed
Merge tag 'for-linus-5.17a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: - Two small cleanups - Another fix for addressing the EFI framebuffer above 4GB when running as Xen dom0 - A patch to let Xen guests use reserved bits in MSI- and IO-APIC- registers for extended APIC-IDs the same way KVM guests are doing it already * tag 'for-linus-5.17a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/pci: Make use of the helper macro LIST_HEAD() xen/x2apic: Fix inconsistent indenting xen/x86: detect support for extended destination ID xen/x86: obtain full video frame buffer address for Dom0 also under EFI
2 parents eef8cff + f66edf6 commit 4a387c9

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

arch/x86/include/asm/xen/cpuid.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
/* Memory mapped from other domains has valid IOMMU entries */
101101
#define XEN_HVM_CPUID_IOMMU_MAPPINGS (1u << 2)
102102
#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 */
104+
/*
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.
108+
*/
109+
#define XEN_HVM_CPUID_EXT_DEST_ID (1u << 5)
103110

104111
/*
105112
* Leaf 6 (0x40000x05)

arch/x86/xen/enlighten_hvm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ static int xen_cpu_dead_hvm(unsigned int cpu)
185185

186186
if (xen_have_vector_callback && xen_feature(XENFEAT_hvm_safe_pvclock))
187187
xen_teardown_timer(cpu);
188-
189-
return 0;
188+
return 0;
190189
}
191190

192191
static bool no_vector_callback __initdata;
@@ -248,6 +247,11 @@ static __init bool xen_x2apic_available(void)
248247
return x2apic_supported();
249248
}
250249

250+
static bool __init msi_ext_dest_id(void)
251+
{
252+
return cpuid_eax(xen_cpuid_base() + 4) & XEN_HVM_CPUID_EXT_DEST_ID;
253+
}
254+
251255
static __init void xen_hvm_guest_late_init(void)
252256
{
253257
#ifdef CONFIG_XEN_PVH
@@ -310,6 +314,7 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata = {
310314
.init.x2apic_available = xen_x2apic_available,
311315
.init.init_mem_mapping = xen_hvm_init_mem_mapping,
312316
.init.guest_late_init = xen_hvm_guest_late_init,
317+
.init.msi_ext_dest_id = msi_ext_dest_id,
313318
.runtime.pin_vcpu = xen_pin_vcpu,
314319
.ignore_nopv = true,
315320
};

arch/x86/xen/vga.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size)
5757
screen_info->rsvd_size = info->u.vesa_lfb.rsvd_size;
5858
screen_info->rsvd_pos = info->u.vesa_lfb.rsvd_pos;
5959

60+
if (size >= offsetof(struct dom0_vga_console_info,
61+
u.vesa_lfb.ext_lfb_base)
62+
+ sizeof(info->u.vesa_lfb.ext_lfb_base)
63+
&& info->u.vesa_lfb.ext_lfb_base) {
64+
screen_info->ext_lfb_base = info->u.vesa_lfb.ext_lfb_base;
65+
screen_info->capabilities |= VIDEO_CAPABILITY_64BIT_BASE;
66+
}
67+
6068
if (info->video_type == XEN_VGATYPE_EFI_LFB) {
6169
screen_info->orig_video_isVGA = VIDEO_TYPE_EFI;
6270
break;
@@ -66,14 +74,6 @@ void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size)
6674
u.vesa_lfb.mode_attrs)
6775
+ sizeof(info->u.vesa_lfb.mode_attrs))
6876
screen_info->vesa_attributes = info->u.vesa_lfb.mode_attrs;
69-
70-
if (size >= offsetof(struct dom0_vga_console_info,
71-
u.vesa_lfb.ext_lfb_base)
72-
+ sizeof(info->u.vesa_lfb.ext_lfb_base)
73-
&& info->u.vesa_lfb.ext_lfb_base) {
74-
screen_info->ext_lfb_base = info->u.vesa_lfb.ext_lfb_base;
75-
screen_info->capabilities |= VIDEO_CAPABILITY_64BIT_BASE;
76-
}
7777
break;
7878
}
7979
}

drivers/xen/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ struct xen_device_domain_owner {
264264
};
265265

266266
static DEFINE_SPINLOCK(dev_domain_list_spinlock);
267-
static struct list_head dev_domain_list = LIST_HEAD_INIT(dev_domain_list);
267+
static LIST_HEAD(dev_domain_list);
268268

269269
static struct xen_device_domain_owner *find_device(struct pci_dev *dev)
270270
{

0 commit comments

Comments
 (0)