Skip to content

Commit 0339eb9

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull more kvm updates from Paolo Bonzini: "s390: - nested virtualization fixes x86: - split svm.c - miscellaneous fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: VMX: fix crash cleanup when KVM wasn't used KVM: X86: Filter out the broadcast dest for IPI fastpath KVM: s390: vsie: Fix possible race when shadowing region 3 tables KVM: s390: vsie: Fix delivery of addressing exceptions KVM: s390: vsie: Fix region 1 ASCE sanity shadow address checks KVM: nVMX: don't clear mtf_pending when nested events are blocked KVM: VMX: Remove unnecessary exception trampoline in vmx_vmenter KVM: SVM: Split svm_vcpu_run inline assembly to separate file KVM: SVM: Move SEV code to separate file KVM: SVM: Move AVIC code to separate file KVM: SVM: Move Nested SVM Implementation to nested.c kVM SVM: Move SVM related files to own sub-directory
2 parents 9bb7152 + dbef280 commit 0339eb9

File tree

16 files changed

+5219
-4989
lines changed

16 files changed

+5219
-4989
lines changed

arch/s390/kvm/vsie.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,7 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
12021202
scb_s->iprcc = PGM_ADDRESSING;
12031203
scb_s->pgmilc = 4;
12041204
scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, 4);
1205+
rc = 1;
12051206
}
12061207
return rc;
12071208
}

arch/s390/mm/gmap.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,14 +787,18 @@ static void gmap_call_notifier(struct gmap *gmap, unsigned long start,
787787
static inline unsigned long *gmap_table_walk(struct gmap *gmap,
788788
unsigned long gaddr, int level)
789789
{
790+
const int asce_type = gmap->asce & _ASCE_TYPE_MASK;
790791
unsigned long *table;
791792

792793
if ((gmap->asce & _ASCE_TYPE_MASK) + 4 < (level * 4))
793794
return NULL;
794795
if (gmap_is_shadow(gmap) && gmap->removed)
795796
return NULL;
796-
if (gaddr & (-1UL << (31 + ((gmap->asce & _ASCE_TYPE_MASK) >> 2)*11)))
797+
798+
if (asce_type != _ASCE_TYPE_REGION1 &&
799+
gaddr & (-1UL << (31 + (asce_type >> 2) * 11)))
797800
return NULL;
801+
798802
table = gmap->table;
799803
switch (gmap->asce & _ASCE_TYPE_MASK) {
800804
case _ASCE_TYPE_REGION1:
@@ -1840,6 +1844,7 @@ int gmap_shadow_r3t(struct gmap *sg, unsigned long saddr, unsigned long r3t,
18401844
goto out_free;
18411845
} else if (*table & _REGION_ENTRY_ORIGIN) {
18421846
rc = -EAGAIN; /* Race with shadow */
1847+
goto out_free;
18431848
}
18441849
crst_table_init(s_r3t, _REGION3_ENTRY_EMPTY);
18451850
/* mark as invalid as long as the parent table is not protected */

arch/x86/kvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ kvm-y += x86.o emulate.o i8259.o irq.o lapic.o \
1414
hyperv.o debugfs.o mmu/mmu.o mmu/page_track.o
1515

1616
kvm-intel-y += vmx/vmx.o vmx/vmenter.o vmx/pmu_intel.o vmx/vmcs12.o vmx/evmcs.o vmx/nested.o
17-
kvm-amd-y += svm.o pmu_amd.o
17+
kvm-amd-y += svm/svm.o svm/vmenter.o svm/pmu.o svm/nested.o svm/avic.o svm/sev.o
1818

1919
obj-$(CONFIG_KVM) += kvm.o
2020
obj-$(CONFIG_KVM_INTEL) += kvm-intel.o

arch/x86/kvm/lapic.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@
5959
#define MAX_APIC_VECTOR 256
6060
#define APIC_VECTORS_PER_REG 32
6161

62-
#define APIC_BROADCAST 0xFF
63-
#define X2APIC_BROADCAST 0xFFFFFFFFul
64-
6562
static bool lapic_timer_advance_dynamic __read_mostly;
6663
#define LAPIC_TIMER_ADVANCE_ADJUST_MIN 100 /* clock cycles */
6764
#define LAPIC_TIMER_ADVANCE_ADJUST_MAX 10000 /* clock cycles */

arch/x86/kvm/lapic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#define APIC_BUS_CYCLE_NS 1
1818
#define APIC_BUS_FREQUENCY (1000000000ULL / APIC_BUS_CYCLE_NS)
1919

20+
#define APIC_BROADCAST 0xFF
21+
#define X2APIC_BROADCAST 0xFFFFFFFFul
22+
2023
enum lapic_mode {
2124
LAPIC_MODE_DISABLED = 0,
2225
LAPIC_MODE_INVALID = X2APIC_ENABLE,

0 commit comments

Comments
 (0)