Skip to content

Commit a964807

Browse files
committed
Merge tag 'for-linus-4.12b-rc0b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: "Xen fixes and featrues for 4.12. The main changes are: - enable building the kernel with Xen support but without enabling paravirtualized mode (Vitaly Kuznetsov) - add a new 9pfs xen frontend driver (Stefano Stabellini) - simplify Xen's cpuid handling by making use of cpu capabilities (Juergen Gross) - add/modify some headers for new Xen paravirtualized devices (Oleksandr Andrushchenko) - EFI reset_system support under Xen (Julien Grall) - and the usual cleanups and corrections" * tag 'for-linus-4.12b-rc0b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (57 commits) xen: Move xen_have_vector_callback definition to enlighten.c xen: Implement EFI reset_system callback arm/xen: Consolidate calls to shutdown hypercall in a single helper xen: Export xen_reboot xen/x86: Call xen_smp_intr_init_pv() on BSP xen: Revert commits da72ff5 and 72a9b18 xen/pvh: Do not fill kernel's e820 map in init_pvh_bootparams() xen/scsifront: use offset_in_page() macro xen/arm,arm64: rename __generic_dma_ops to xen_get_dma_ops xen/arm,arm64: fix xen_dma_ops after 815dd18 "Consolidate get_dma_ops..." xen/9pfs: select CONFIG_XEN_XENBUS_FRONTEND x86/cpu: remove hypervisor specific set_cpu_features vmware: set cpu capabilities during platform initialization x86/xen: use capabilities instead of fake cpuid values for xsave x86/xen: use capabilities instead of fake cpuid values for x2apic x86/xen: use capabilities instead of fake cpuid values for mwait x86/xen: use capabilities instead of fake cpuid values for acpi x86/xen: use capabilities instead of fake cpuid values for acc x86/xen: use capabilities instead of fake cpuid values for mtrr x86/xen: use capabilities instead of fake cpuid values for aperf ...
2 parents a1be8ed + 3dbd820 commit a964807

53 files changed

Lines changed: 8490 additions & 5381 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/include/asm/device.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ struct dev_archdata {
1515
#endif
1616
#ifdef CONFIG_ARM_DMA_USE_IOMMU
1717
struct dma_iommu_mapping *mapping;
18+
#endif
19+
#ifdef CONFIG_XEN
20+
const struct dma_map_ops *dev_dma_ops;
1821
#endif
1922
bool dma_coherent;
2023
};

‎arch/arm/include/asm/dma-mapping.h‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,9 @@
1616
extern const struct dma_map_ops arm_dma_ops;
1717
extern const struct dma_map_ops arm_coherent_dma_ops;
1818

19-
static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)
20-
{
21-
if (dev && dev->dma_ops)
22-
return dev->dma_ops;
23-
return &arm_dma_ops;
24-
}
25-
2619
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
2720
{
28-
if (xen_initial_domain())
29-
return xen_dma_ops;
30-
else
31-
return __generic_dma_ops(NULL);
21+
return &arm_dma_ops;
3222
}
3323

3424
#define HAVE_ARCH_DMA_SUPPORTED 1

‎arch/arm/mm/dma-mapping.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,6 +2414,13 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
24142414
dma_ops = arm_get_dma_map_ops(coherent);
24152415

24162416
set_dma_ops(dev, dma_ops);
2417+
2418+
#ifdef CONFIG_XEN
2419+
if (xen_initial_domain()) {
2420+
dev->archdata.dev_dma_ops = dev->dma_ops;
2421+
dev->dma_ops = xen_dma_ops;
2422+
}
2423+
#endif
24172424
}
24182425

24192426
void arch_teardown_dma_ops(struct device *dev)

‎arch/arm/xen/efi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ void __init xen_efi_runtime_setup(void)
3535
efi.update_capsule = xen_efi_update_capsule;
3636
efi.query_capsule_caps = xen_efi_query_capsule_caps;
3737
efi.get_next_high_mono_count = xen_efi_get_next_high_mono_count;
38-
efi.reset_system = NULL; /* Functionality provided by Xen. */
38+
efi.reset_system = xen_efi_reset_system;
3939
}
4040
EXPORT_SYMBOL_GPL(xen_efi_runtime_setup);

‎arch/arm/xen/enlighten.c‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,24 @@ static int xen_dying_cpu(unsigned int cpu)
191191
return 0;
192192
}
193193

194-
static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
194+
void xen_reboot(int reason)
195195
{
196-
struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
196+
struct sched_shutdown r = { .reason = reason };
197197
int rc;
198+
198199
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
199200
BUG_ON(rc);
200201
}
201202

203+
static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
204+
{
205+
xen_reboot(SHUTDOWN_reboot);
206+
}
207+
208+
202209
static void xen_power_off(void)
203210
{
204-
struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
205-
int rc;
206-
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
207-
BUG_ON(rc);
211+
xen_reboot(SHUTDOWN_poweroff);
208212
}
209213

210214
static irqreturn_t xen_arm_callback(int irq, void *arg)

‎arch/arm64/include/asm/device.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
struct dev_archdata {
2020
#ifdef CONFIG_IOMMU_API
2121
void *iommu; /* private IOMMU data */
22+
#endif
23+
#ifdef CONFIG_XEN
24+
const struct dma_map_ops *dev_dma_ops;
2225
#endif
2326
bool dma_coherent;
2427
};

‎arch/arm64/include/asm/dma-mapping.h‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,15 @@
2727
#define DMA_ERROR_CODE (~(dma_addr_t)0)
2828
extern const struct dma_map_ops dummy_dma_ops;
2929

30-
static inline const struct dma_map_ops *__generic_dma_ops(struct device *dev)
30+
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
3131
{
32-
if (dev && dev->dma_ops)
33-
return dev->dma_ops;
34-
3532
/*
3633
* We expect no ISA devices, and all other DMA masters are expected to
3734
* have someone call arch_setup_dma_ops at device creation time.
3835
*/
3936
return &dummy_dma_ops;
4037
}
4138

42-
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
43-
{
44-
if (xen_initial_domain())
45-
return xen_dma_ops;
46-
else
47-
return __generic_dma_ops(NULL);
48-
}
49-
5039
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
5140
const struct iommu_ops *iommu, bool coherent);
5241
#define arch_setup_dma_ops arch_setup_dma_ops

‎arch/arm64/mm/dma-mapping.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,4 +977,11 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
977977

978978
dev->archdata.dma_coherent = coherent;
979979
__iommu_setup_dma_ops(dev, dma_base, size, iommu);
980+
981+
#ifdef CONFIG_XEN
982+
if (xen_initial_domain()) {
983+
dev->archdata.dev_dma_ops = dev->dma_ops;
984+
dev->dma_ops = xen_dma_ops;
985+
}
986+
#endif
980987
}

‎arch/x86/include/asm/hypervisor.h‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ struct hypervisor_x86 {
3535
/* Detection routine */
3636
uint32_t (*detect)(void);
3737

38-
/* Adjust CPU feature bits (run once per CPU) */
39-
void (*set_cpu_features)(struct cpuinfo_x86 *);
40-
4138
/* Platform setup (run once per boot) */
4239
void (*init_platform)(void);
4340

@@ -53,15 +50,14 @@ extern const struct hypervisor_x86 *x86_hyper;
5350
/* Recognized hypervisors */
5451
extern const struct hypervisor_x86 x86_hyper_vmware;
5552
extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
56-
extern const struct hypervisor_x86 x86_hyper_xen;
53+
extern const struct hypervisor_x86 x86_hyper_xen_pv;
54+
extern const struct hypervisor_x86 x86_hyper_xen_hvm;
5755
extern const struct hypervisor_x86 x86_hyper_kvm;
5856

59-
extern void init_hypervisor(struct cpuinfo_x86 *c);
6057
extern void init_hypervisor_platform(void);
6158
extern bool hypervisor_x2apic_available(void);
6259
extern void hypervisor_pin_vcpu(int cpu);
6360
#else
64-
static inline void init_hypervisor(struct cpuinfo_x86 *c) { }
6561
static inline void init_hypervisor_platform(void) { }
6662
static inline bool hypervisor_x2apic_available(void) { return false; }
6763
#endif /* CONFIG_HYPERVISOR_GUEST */

‎arch/x86/include/asm/xen/events.h‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@ static inline int xen_irqs_disabled(struct pt_regs *regs)
2020
/* No need for a barrier -- XCHG is a barrier on x86. */
2121
#define xchg_xen_ulong(ptr, val) xchg((ptr), (val))
2222

23+
extern int xen_have_vector_callback;
24+
25+
/*
26+
* Events delivered via platform PCI interrupts are always
27+
* routed to vcpu 0 and hence cannot be rebound.
28+
*/
29+
static inline bool xen_support_evtchn_rebind(void)
30+
{
31+
return (!xen_hvm_domain() || xen_have_vector_callback);
32+
}
33+
2334
#endif /* _ASM_X86_XEN_EVENTS_H */

0 commit comments

Comments
 (0)