Skip to content

Commit 9553404

Browse files
committed
Merge tag 'loongarch-fixes-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch fixes from Huacai Chen: "Fix boot failure on machines with more than 8 nodes, and fix two build errors about KVM" * tag 'loongarch-fixes-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: KVM: Add returns to SIMD stubs LoongArch: KVM: Fix build due to API changes LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init()
2 parents cd2286f + 48ef9e8 commit 9553404

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

arch/loongarch/include/asm/kvm_vcpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int kvm_own_lsx(struct kvm_vcpu *vcpu);
6060
void kvm_save_lsx(struct loongarch_fpu *fpu);
6161
void kvm_restore_lsx(struct loongarch_fpu *fpu);
6262
#else
63-
static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { }
63+
static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { return -EINVAL; }
6464
static inline void kvm_save_lsx(struct loongarch_fpu *fpu) { }
6565
static inline void kvm_restore_lsx(struct loongarch_fpu *fpu) { }
6666
#endif
@@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu);
7070
void kvm_save_lasx(struct loongarch_fpu *fpu);
7171
void kvm_restore_lasx(struct loongarch_fpu *fpu);
7272
#else
73-
static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
73+
static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; }
7474
static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { }
7575
static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
7676
#endif

arch/loongarch/kernel/smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ asmlinkage void start_secondary(void)
509509
sync_counter();
510510
cpu = raw_smp_processor_id();
511511
set_my_cpu_offset(per_cpu_offset(cpu));
512-
rcutree_report_cpu_starting(cpu);
513512

514513
cpu_probe();
515514
constant_clockevent_init();

arch/loongarch/kvm/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot,
675675
*
676676
* There are several ways to safely use this helper:
677677
*
678-
* - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before
678+
* - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before
679679
* consuming it. In this case, mmu_lock doesn't need to be held during the
680680
* lookup, but it does need to be held while checking the MMU notifier.
681681
*
@@ -855,7 +855,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write)
855855

856856
/* Check if an invalidation has taken place since we got pfn */
857857
spin_lock(&kvm->mmu_lock);
858-
if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) {
858+
if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) {
859859
/*
860860
* This can happen when mappings are changed asynchronously, but
861861
* also synchronously if a COW is triggered by

arch/loongarch/mm/tlb.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,16 @@ static void setup_tlb_handler(int cpu)
284284
set_handler(EXCCODE_TLBNR * VECSIZE, handle_tlb_protect, VECSIZE);
285285
set_handler(EXCCODE_TLBNX * VECSIZE, handle_tlb_protect, VECSIZE);
286286
set_handler(EXCCODE_TLBPE * VECSIZE, handle_tlb_protect, VECSIZE);
287-
}
287+
} else {
288+
int vec_sz __maybe_unused;
289+
void *addr __maybe_unused;
290+
struct page *page __maybe_unused;
291+
292+
/* Avoid lockdep warning */
293+
rcutree_report_cpu_starting(cpu);
294+
288295
#ifdef CONFIG_NUMA
289-
else {
290-
void *addr;
291-
struct page *page;
292-
const int vec_sz = sizeof(exception_handlers);
296+
vec_sz = sizeof(exception_handlers);
293297

294298
if (pcpu_handlers[cpu])
295299
return;
@@ -305,8 +309,8 @@ static void setup_tlb_handler(int cpu)
305309
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_EENTRY);
306310
csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_MERRENTRY);
307311
csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
308-
}
309312
#endif
313+
}
310314
}
311315

312316
void tlb_init(int cpu)

0 commit comments

Comments
 (0)