File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,9 @@ struct pi_desc {
15
15
};
16
16
union {
17
17
struct {
18
- /* bit 256 - Outstanding Notification */
19
- u16 on : 1 ,
20
- /* bit 257 - Suppress Notification */
21
- sn : 1 ,
22
- /* bit 271:258 - Reserved */
23
- rsvd_1 : 14 ;
24
- /* bit 279:272 - Notification Vector */
18
+ u16 notifications ; /* Suppress and outstanding bits */
25
19
u8 nv ;
26
- /* bit 287:280 - Reserved */
27
20
u8 rsvd_2 ;
28
- /* bit 319:288 - Notification Destination */
29
21
u32 ndst ;
30
22
};
31
23
u64 control ;
@@ -88,4 +80,15 @@ static inline bool pi_test_sn(struct pi_desc *pi_desc)
88
80
return test_bit (POSTED_INTR_SN , (unsigned long * )& pi_desc -> control );
89
81
}
90
82
83
+ /* Non-atomic helpers */
84
+ static inline void __pi_set_sn (struct pi_desc * pi_desc )
85
+ {
86
+ pi_desc -> notifications |= BIT (POSTED_INTR_SN );
87
+ }
88
+
89
+ static inline void __pi_clear_sn (struct pi_desc * pi_desc )
90
+ {
91
+ pi_desc -> notifications &= ~BIT (POSTED_INTR_SN );
92
+ }
93
+
91
94
#endif /* _X86_POSTED_INTR_H */
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu)
107
107
* handle task migration (@cpu != vcpu->cpu).
108
108
*/
109
109
new .ndst = dest ;
110
- new . sn = 0 ;
110
+ __pi_clear_sn ( & new ) ;
111
111
112
112
/*
113
113
* Restore the notification vector; in the blocking case, the
@@ -157,7 +157,7 @@ static void pi_enable_wakeup_handler(struct kvm_vcpu *vcpu)
157
157
& per_cpu (wakeup_vcpus_on_cpu , vcpu -> cpu ));
158
158
raw_spin_unlock (& per_cpu (wakeup_vcpus_on_cpu_lock , vcpu -> cpu ));
159
159
160
- WARN (pi_desc -> sn , "PI descriptor SN field set before blocking" );
160
+ WARN (pi_test_sn ( pi_desc ) , "PI descriptor SN field set before blocking" );
161
161
162
162
old .control = READ_ONCE (pi_desc -> control );
163
163
do {
Original file line number Diff line number Diff line change @@ -4845,7 +4845,7 @@ static void __vmx_vcpu_reset(struct kvm_vcpu *vcpu)
4845
4845
* or POSTED_INTR_WAKEUP_VECTOR.
4846
4846
*/
4847
4847
vmx -> pi_desc .nv = POSTED_INTR_VECTOR ;
4848
- vmx -> pi_desc . sn = 1 ;
4848
+ __pi_set_sn ( & vmx -> pi_desc ) ;
4849
4849
}
4850
4850
4851
4851
static void vmx_vcpu_reset (struct kvm_vcpu * vcpu , bool init_event )
You can’t perform that action at this time.
0 commit comments