提交 b7cb2231 编写于 作者: P Paolo Bonzini

KVM: x86: tweak types of fields in kvm_lapic_irq

Change to u16 if they only contain data in the low 16 bits.

Change the level field to bool, since we assign 1 sometimes, but
just mask icr_low with APIC_INT_ASSERT in apic_send_ipi.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 d28bc9dd
...@@ -689,10 +689,10 @@ struct msr_data { ...@@ -689,10 +689,10 @@ struct msr_data {
struct kvm_lapic_irq { struct kvm_lapic_irq {
u32 vector; u32 vector;
u32 delivery_mode; u16 delivery_mode;
u32 dest_mode; u16 dest_mode;
u32 level; bool level;
u32 trig_mode; u16 trig_mode;
u32 shorthand; u32 shorthand;
u32 dest_id; u32 dest_id;
}; };
......
...@@ -914,7 +914,7 @@ static void apic_send_ipi(struct kvm_lapic *apic) ...@@ -914,7 +914,7 @@ static void apic_send_ipi(struct kvm_lapic *apic)
irq.vector = icr_low & APIC_VECTOR_MASK; irq.vector = icr_low & APIC_VECTOR_MASK;
irq.delivery_mode = icr_low & APIC_MODE_MASK; irq.delivery_mode = icr_low & APIC_MODE_MASK;
irq.dest_mode = icr_low & APIC_DEST_MASK; irq.dest_mode = icr_low & APIC_DEST_MASK;
irq.level = icr_low & APIC_INT_ASSERT; irq.level = (icr_low & APIC_INT_ASSERT) != 0;
irq.trig_mode = icr_low & APIC_INT_LEVELTRIG; irq.trig_mode = icr_low & APIC_INT_LEVELTRIG;
irq.shorthand = icr_low & APIC_SHORT_MASK; irq.shorthand = icr_low & APIC_SHORT_MASK;
if (apic_x2apic_mode(apic)) if (apic_x2apic_mode(apic))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册