|
10 | 10 |
|
11 | 11 | void kvm_spurious_fault(void); |
12 | 12 |
|
13 | | -static __always_inline void kvm_guest_enter_irqoff(void) |
14 | | -{ |
15 | | - /* |
16 | | - * VMENTER enables interrupts (host state), but the kernel state is |
17 | | - * interrupts disabled when this is invoked. Also tell RCU about |
18 | | - * it. This is the same logic as for exit_to_user_mode(). |
19 | | - * |
20 | | - * This ensures that e.g. latency analysis on the host observes |
21 | | - * guest mode as interrupt enabled. |
22 | | - * |
23 | | - * guest_enter_irqoff() informs context tracking about the |
24 | | - * transition to guest mode and if enabled adjusts RCU state |
25 | | - * accordingly. |
26 | | - */ |
27 | | - instrumentation_begin(); |
28 | | - trace_hardirqs_on_prepare(); |
29 | | - lockdep_hardirqs_on_prepare(CALLER_ADDR0); |
30 | | - instrumentation_end(); |
31 | | - |
32 | | - guest_enter_irqoff(); |
33 | | - lockdep_hardirqs_on(CALLER_ADDR0); |
34 | | -} |
35 | | - |
36 | | -static __always_inline void kvm_guest_exit_irqoff(void) |
37 | | -{ |
38 | | - /* |
39 | | - * VMEXIT disables interrupts (host state), but tracing and lockdep |
40 | | - * have them in state 'on' as recorded before entering guest mode. |
41 | | - * Same as enter_from_user_mode(). |
42 | | - * |
43 | | - * context_tracking_guest_exit() restores host context and reinstates |
44 | | - * RCU if enabled and required. |
45 | | - * |
46 | | - * This needs to be done immediately after VM-Exit, before any code |
47 | | - * that might contain tracepoints or call out to the greater world, |
48 | | - * e.g. before x86_spec_ctrl_restore_host(). |
49 | | - */ |
50 | | - lockdep_hardirqs_off(CALLER_ADDR0); |
51 | | - context_tracking_guest_exit(); |
52 | | - |
53 | | - instrumentation_begin(); |
54 | | - trace_hardirqs_off_finish(); |
55 | | - instrumentation_end(); |
56 | | -} |
57 | | - |
58 | 13 | #define KVM_NESTED_VMENTER_CONSISTENCY_CHECK(consistency_check) \ |
59 | 14 | ({ \ |
60 | 15 | bool failed = (consistency_check); \ |
|
0 commit comments