KVM: Add some helper functions for Posted-Interrupts
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu <feng.wu@intel.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> [Make the new functions inline. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6ef1522f7e
commit
ebbfc76536
@ -443,6 +443,8 @@ struct nested_vmx {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define POSTED_INTR_ON 0
|
#define POSTED_INTR_ON 0
|
||||||
|
#define POSTED_INTR_SN 1
|
||||||
|
|
||||||
/* Posted-Interrupt Descriptor */
|
/* Posted-Interrupt Descriptor */
|
||||||
struct pi_desc {
|
struct pi_desc {
|
||||||
u32 pir[8]; /* Posted interrupt requested */
|
u32 pir[8]; /* Posted interrupt requested */
|
||||||
@ -483,6 +485,30 @@ static int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
|
|||||||
return test_and_set_bit(vector, (unsigned long *)pi_desc->pir);
|
return test_and_set_bit(vector, (unsigned long *)pi_desc->pir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void pi_clear_sn(struct pi_desc *pi_desc)
|
||||||
|
{
|
||||||
|
return clear_bit(POSTED_INTR_SN,
|
||||||
|
(unsigned long *)&pi_desc->control);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void pi_set_sn(struct pi_desc *pi_desc)
|
||||||
|
{
|
||||||
|
return set_bit(POSTED_INTR_SN,
|
||||||
|
(unsigned long *)&pi_desc->control);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int pi_test_on(struct pi_desc *pi_desc)
|
||||||
|
{
|
||||||
|
return test_bit(POSTED_INTR_ON,
|
||||||
|
(unsigned long *)&pi_desc->control);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int pi_test_sn(struct pi_desc *pi_desc)
|
||||||
|
{
|
||||||
|
return test_bit(POSTED_INTR_SN,
|
||||||
|
(unsigned long *)&pi_desc->control);
|
||||||
|
}
|
||||||
|
|
||||||
struct vcpu_vmx {
|
struct vcpu_vmx {
|
||||||
struct kvm_vcpu vcpu;
|
struct kvm_vcpu vcpu;
|
||||||
unsigned long host_rsp;
|
unsigned long host_rsp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user