File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,13 @@ void setup_panic(void);
28
28
#define ARCH_PANIC_TIMEOUT 180
29
29
30
30
#ifdef CONFIG_PPC_PSERIES
31
+ extern bool pseries_reloc_on_exception (void );
31
32
extern bool pseries_enable_reloc_on_exc (void );
32
33
extern void pseries_disable_reloc_on_exc (void );
33
34
extern void pseries_big_endian_exceptions (void );
34
35
void __init pseries_little_endian_exceptions (void );
35
36
#else
37
+ static inline bool pseries_reloc_on_exception (void ) { return false; }
36
38
static inline bool pseries_enable_reloc_on_exc (void ) { return false; }
37
39
static inline void pseries_disable_reloc_on_exc (void ) {}
38
40
static inline void pseries_big_endian_exceptions (void ) {}
Original file line number Diff line number Diff line change @@ -705,6 +705,23 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
705
705
r = 1 ;
706
706
break ;
707
707
#endif
708
+ case KVM_CAP_PPC_AIL_MODE_3 :
709
+ r = 0 ;
710
+ /*
711
+ * KVM PR, POWER7, and some POWER9s don't support AIL=3 mode.
712
+ * The POWER9s can support it if the guest runs in hash mode,
713
+ * but QEMU doesn't necessarily query the capability in time.
714
+ */
715
+ if (hv_enabled ) {
716
+ if (kvmhv_on_pseries ()) {
717
+ if (pseries_reloc_on_exception ())
718
+ r = 1 ;
719
+ } else if (cpu_has_feature (CPU_FTR_ARCH_207S ) &&
720
+ !cpu_has_feature (CPU_FTR_P9_RADIX_PREFETCH_BUG )) {
721
+ r = 1 ;
722
+ }
723
+ }
724
+ break ;
708
725
default :
709
726
r = 0 ;
710
727
break ;
Original file line number Diff line number Diff line change @@ -353,6 +353,14 @@ static void pseries_lpar_idle(void)
353
353
pseries_idle_epilog ();
354
354
}
355
355
356
+ static bool pseries_reloc_on_exception_enabled ;
357
+
358
+ bool pseries_reloc_on_exception (void )
359
+ {
360
+ return pseries_reloc_on_exception_enabled ;
361
+ }
362
+ EXPORT_SYMBOL_GPL (pseries_reloc_on_exception );
363
+
356
364
/*
357
365
* Enable relocation on during exceptions. This has partition wide scope and
358
366
* may take a while to complete, if it takes longer than one second we will
@@ -377,6 +385,7 @@ bool pseries_enable_reloc_on_exc(void)
377
385
" on exceptions: %ld\n" , rc );
378
386
return false;
379
387
}
388
+ pseries_reloc_on_exception_enabled = true;
380
389
return true;
381
390
}
382
391
@@ -404,7 +413,9 @@ void pseries_disable_reloc_on_exc(void)
404
413
break ;
405
414
mdelay (get_longbusy_msecs (rc ));
406
415
}
407
- if (rc != H_SUCCESS )
416
+ if (rc == H_SUCCESS )
417
+ pseries_reloc_on_exception_enabled = false;
418
+ else
408
419
pr_warn ("Warning: Failed to disable relocation on exceptions: %ld\n" ,
409
420
rc );
410
421
}
You can’t perform that action at this time.
0 commit comments