Skip to content

Commit b63c2eb

Browse files
committed
Merge remote-tracking branch 'origin/master' into drm-intel-fixes
Direct backmerge to get commit 88b67ed ("dax: Fix compilation for CONFIG_DAX && !CONFIG_FS_DAX") to fix CI build issues. Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2 parents ba4f184 + 9847774 commit b63c2eb

7 files changed

Lines changed: 46 additions & 35 deletions

File tree

Documentation/virt/kvm/api.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6173,3 +6173,23 @@ specific interfaces must be consistent, i.e. if one says the feature
61736173
is supported, than the other should as well and vice versa. For arm64
61746174
see Documentation/virt/kvm/devices/vcpu.rst "KVM_ARM_VCPU_PVTIME_CTRL".
61756175
For x86 see Documentation/virt/kvm/msr.rst "MSR_KVM_STEAL_TIME".
6176+
6177+
8.25 KVM_CAP_S390_DIAG318
6178+
-------------------------
6179+
6180+
:Architectures: s390
6181+
6182+
This capability enables a guest to set information about its control program
6183+
(i.e. guest kernel type and version). The information is helpful during
6184+
system/firmware service events, providing additional data about the guest
6185+
environments running on the machine.
6186+
6187+
The information is associated with the DIAGNOSE 0x318 instruction, which sets
6188+
an 8-byte value consisting of a one-byte Control Program Name Code (CPNC) and
6189+
a 7-byte Control Program Version Code (CPVC). The CPNC determines what
6190+
environment the control program is running in (e.g. Linux, z/VM...), and the
6191+
CPVC is used for information specific to OS (e.g. Linux version, Linux
6192+
distribution...)
6193+
6194+
If this capability is available, then the CPNC and CPVC can be synchronized
6195+
between KVM and userspace via the sync regs mechanism (KVM_SYNC_DIAG318).

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,15 @@ static __always_inline int kvm_vcpu_dabt_get_rd(const struct kvm_vcpu *vcpu)
298298
return (kvm_vcpu_get_esr(vcpu) & ESR_ELx_SRT_MASK) >> ESR_ELx_SRT_SHIFT;
299299
}
300300

301-
static __always_inline bool kvm_vcpu_dabt_iss1tw(const struct kvm_vcpu *vcpu)
301+
static __always_inline bool kvm_vcpu_abt_iss1tw(const struct kvm_vcpu *vcpu)
302302
{
303303
return !!(kvm_vcpu_get_esr(vcpu) & ESR_ELx_S1PTW);
304304
}
305305

306+
/* Always check for S1PTW *before* using this. */
306307
static __always_inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
307308
{
308-
return !!(kvm_vcpu_get_esr(vcpu) & ESR_ELx_WNR) ||
309-
kvm_vcpu_dabt_iss1tw(vcpu); /* AF/DBM update */
309+
return kvm_vcpu_get_esr(vcpu) & ESR_ELx_WNR;
310310
}
311311

312312
static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)
@@ -335,6 +335,11 @@ static inline bool kvm_vcpu_trap_is_iabt(const struct kvm_vcpu *vcpu)
335335
return kvm_vcpu_trap_get_class(vcpu) == ESR_ELx_EC_IABT_LOW;
336336
}
337337

338+
static inline bool kvm_vcpu_trap_is_exec_fault(const struct kvm_vcpu *vcpu)
339+
{
340+
return kvm_vcpu_trap_is_iabt(vcpu) && !kvm_vcpu_abt_iss1tw(vcpu);
341+
}
342+
338343
static __always_inline u8 kvm_vcpu_trap_get_fault(const struct kvm_vcpu *vcpu)
339344
{
340345
return kvm_vcpu_get_esr(vcpu) & ESR_ELx_FSC;
@@ -372,6 +377,9 @@ static __always_inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu)
372377

373378
static inline bool kvm_is_write_fault(struct kvm_vcpu *vcpu)
374379
{
380+
if (kvm_vcpu_abt_iss1tw(vcpu))
381+
return true;
382+
375383
if (kvm_vcpu_trap_is_iabt(vcpu))
376384
return false;
377385

arch/arm64/kvm/hyp/include/hyp/switch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)
449449
kvm_vcpu_trap_get_fault_type(vcpu) == FSC_FAULT &&
450450
kvm_vcpu_dabt_isvalid(vcpu) &&
451451
!kvm_vcpu_abt_issea(vcpu) &&
452-
!kvm_vcpu_dabt_iss1tw(vcpu);
452+
!kvm_vcpu_abt_iss1tw(vcpu);
453453

454454
if (valid) {
455455
int ret = __vgic_v2_perform_cpuif_access(vcpu);

arch/arm64/kvm/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
18491849
struct kvm_s2_mmu *mmu = vcpu->arch.hw_mmu;
18501850

18511851
write_fault = kvm_is_write_fault(vcpu);
1852-
exec_fault = kvm_vcpu_trap_is_iabt(vcpu);
1852+
exec_fault = kvm_vcpu_trap_is_exec_fault(vcpu);
18531853
VM_BUG_ON(write_fault && exec_fault);
18541854

18551855
if (fault_status == FSC_PERM && !write_fault && !exec_fault) {
@@ -2131,7 +2131,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
21312131
goto out;
21322132
}
21332133

2134-
if (kvm_vcpu_dabt_iss1tw(vcpu)) {
2134+
if (kvm_vcpu_abt_iss1tw(vcpu)) {
21352135
kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu));
21362136
ret = 1;
21372137
goto out_unlock;

arch/x86/kernel/kvm.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ static void __init kvm_guest_init(void)
652652
}
653653

654654
if (pv_tlb_flush_supported()) {
655+
pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
655656
pv_ops.mmu.tlb_remove_table = tlb_remove_table;
656657
pr_info("KVM setup pv remote TLB flush\n");
657658
}
@@ -764,14 +765,6 @@ static __init int activate_jump_labels(void)
764765
}
765766
arch_initcall(activate_jump_labels);
766767

767-
static void kvm_free_pv_cpu_mask(void)
768-
{
769-
unsigned int cpu;
770-
771-
for_each_possible_cpu(cpu)
772-
free_cpumask_var(per_cpu(__pv_cpu_mask, cpu));
773-
}
774-
775768
static __init int kvm_alloc_cpumask(void)
776769
{
777770
int cpu;
@@ -790,20 +783,11 @@ static __init int kvm_alloc_cpumask(void)
790783

791784
if (alloc)
792785
for_each_possible_cpu(cpu) {
793-
if (!zalloc_cpumask_var_node(
794-
per_cpu_ptr(&__pv_cpu_mask, cpu),
795-
GFP_KERNEL, cpu_to_node(cpu))) {
796-
goto zalloc_cpumask_fail;
797-
}
786+
zalloc_cpumask_var_node(per_cpu_ptr(&__pv_cpu_mask, cpu),
787+
GFP_KERNEL, cpu_to_node(cpu));
798788
}
799789

800-
apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself;
801-
pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
802790
return 0;
803-
804-
zalloc_cpumask_fail:
805-
kvm_free_pv_cpu_mask();
806-
return -ENOMEM;
807791
}
808792
arch_initcall(kvm_alloc_cpumask);
809793

include/linux/dax.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ static inline void set_dax_synchronous(struct dax_device *dax_dev)
5858
{
5959
__set_dax_synchronous(dax_dev);
6060
}
61+
bool dax_supported(struct dax_device *dax_dev, struct block_device *bdev,
62+
int blocksize, sector_t start, sector_t len);
6163
/*
6264
* Check if given mapping is supported by the file / underlying device.
6365
*/
@@ -104,6 +106,12 @@ static inline bool dax_synchronous(struct dax_device *dax_dev)
104106
static inline void set_dax_synchronous(struct dax_device *dax_dev)
105107
{
106108
}
109+
static inline bool dax_supported(struct dax_device *dax_dev,
110+
struct block_device *bdev, int blocksize, sector_t start,
111+
sector_t len)
112+
{
113+
return false;
114+
}
107115
static inline bool daxdev_mapping_supported(struct vm_area_struct *vma,
108116
struct dax_device *dax_dev)
109117
{
@@ -130,8 +138,6 @@ static inline bool generic_fsdax_supported(struct dax_device *dax_dev,
130138
return __generic_fsdax_supported(dax_dev, bdev, blocksize, start,
131139
sectors);
132140
}
133-
bool dax_supported(struct dax_device *dax_dev, struct block_device *bdev,
134-
int blocksize, sector_t start, sector_t len);
135141

136142
static inline void fs_put_dax(struct dax_device *dax_dev)
137143
{
@@ -159,13 +165,6 @@ static inline bool generic_fsdax_supported(struct dax_device *dax_dev,
159165
return false;
160166
}
161167

162-
static inline bool dax_supported(struct dax_device *dax_dev,
163-
struct block_device *bdev, int blocksize, sector_t start,
164-
sector_t len)
165-
{
166-
return false;
167-
}
168-
169168
static inline void fs_put_dax(struct dax_device *dax_dev)
170169
{
171170
}

kernel/rcu/tasks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ void exit_tasks_rcu_finish(void) __releases(&tasks_rcu_exit_srcu)
590590
}
591591

592592
#else /* #ifdef CONFIG_TASKS_RCU */
593-
static void show_rcu_tasks_classic_gp_kthread(void) { }
593+
static inline void show_rcu_tasks_classic_gp_kthread(void) { }
594594
void exit_tasks_rcu_start(void) { }
595595
void exit_tasks_rcu_finish(void) { exit_tasks_rcu_finish_trace(current); }
596596
#endif /* #else #ifdef CONFIG_TASKS_RCU */

0 commit comments

Comments
 (0)