Fix vlapic.h type
PATCH 1/1 Fix vlapic.h type
The following patch fixes a typo in vlapic_domain inside vlapic.h. I also found an related error in vlapic.c file, which is fixed by this patch too.
xen/arch/x86/hvm/vlapic.c +1 -1
@@ -460,7 +460,7 @@ int vlapic_ipi(if ( delivery_mode ==APIC_DM_LOWEST ) { - target =apic_lowest_prio (vlapic_domain (v), lpr_map); + target =apic_lowest_prio (vlapic_domain (vlapic), lpr_map);if ( target !=NULL ) rc =vlapic_accept_irq (vlapic_vcpu (target), delivery_mode, vector, level, trig_mode);
xen/include/asm-x86/hvm/vlapic.h +1 -1
@@ -31,7 +31,7 @@#define vcpu_vlapic (vcpu) (&(vcpu)->arch.hvm_vcpu.vlapic)#define vlapic_vcpu (vpic) (container_of((vpic), struct vcpu, \ arch.hvm_vcpu.vlapic)) -#define vlapic_domain (vpic) (vlapic_vcpu(vlapic)->domain) +#define vlapic_domain (vlapic) (vlapic_vcpu(vlapic)->domain)#define VLAPIC_ID (vlapic) \ (GET_xAPIC_ID(vlapic_get_reg((vlapic), APIC_ID)))
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Good catch. This line:
#define vlapic_vcpu(vpic) (container_of((vpic), struct vcpu, \
arch.hvm_vcpu.vlapic))
should probably also be changed to this:
#define vlapic_vcpu(vlapic) (container_of((vlapic), struct vcpu, \
arch.hvm_vcpu.vlapic))
Patrick
Quoted 12 lines · Wei Huang
The following patch fixes a typo in
vlapic_domaininsidevlapic.h. I also found an related error invlapic.cfile, which is fixed by this patch too.Signed-off-by Wei Huang <[email protected]>------------------------------------------------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 9 lines · Patrick Colp
Good catch. This line:
#define vlapic_vcpu(vpic) (container_of((vpic), struct vcpu, \ arch.hvm_vcpu.vlapic))should probably also be changed to this:
#define vlapic_vcpu(vlapic) (container_of((vlapic), struct vcpu, \ arch.hvm_vcpu.vlapic))
I'm not sure. Do you intend to change the member name after hvm_vcpu based on the macro parameter?
Cheers, Neil.
Quoted 6 lines · Neil Turton
Quoted 5 lines · Patrick Colp
Good catch. This line:
#define vlapic_vcpu(vpic) (container_of((vpic), struct vcpu, \ arch.hvm_vcpu.vlapic))
Quoted 7 lines
Quoted 4 lines
should probably also be changed to this:
#define vlapic_vcpu(vlapic) (container_of((vlapic), struct vcpu, \ arch.hvm_vcpu.vlapic))I'm not sure. Do you intend to change the member name after
hvm_vcpubased on the macro parameter?
No. Why would I do that?
The issue here is that the macro parameter is referring to a vlapic and not a vpic (which is something different). So for the sake of clarity, it should be changed to vlapic instead of vpic.
Patrick
Quoted 12 lines · Patrick Colp
Quoted 11 lines · Neil Turton
Quoted 9 lines · Patrick Colp
Good catch. This line:
#define vlapic_vcpu(vpic) (container_of((vpic), struct vcpu, \ arch.hvm_vcpu.vlapic))should probably also be changed to this:
#define vlapic_vcpu(vlapic) (container_of((vlapic), struct vcpu, \ arch.hvm_vcpu.vlapic))
Quoted 8 lines
Quoted 2 lines
I'm not sure. Do you intend to change the member name after
hvm_vcpubased on the macro parameter?No. Why would I do that?
The issue here is that the macro parameter is referring to a vlapic and not a vpic (which is something different). So for the sake of clarity, it should be changed to vlapic instead of vpic.
but vlapic_vcpu(oops) would expand to
(container_of((oops), struct vcpu, arch.hvm_vcpu.oops)
^^^^
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]
Quoted 3 lines · Tim Deegan
but
vlapic_vcpu(oops)would expand to
(container_of((oops), struct vcpu, arch.hvm_vcpu.oops)^^^^
Thanks, Tim. That's what I was trying to say.
Cheers, Neil.
Right, sorry. My bad. However, calling it vpic is still a bad idea :) _vlapic or _v or even v would be a better choice.
Patrick
Quoted 8 lines · Neil Turton
Quoted 3 lines · Tim Deegan
but
vlapic_vcpu(oops)would expand to
(container_of((oops), struct vcpu, arch.hvm_vcpu.oops)^^^^Thanks, Tim. That's what I was trying to say.
Cheers, Neil.
Quoted 2 lines · Patrick Colp
Right, sorry. My bad. However, calling it vpic is still a bad idea :)
_vlapicor _v or even v would be a better choice.
Yes, any of those would work (or x as Keir said). I wasn't objecting to it being changed. Just the clash of names.
Cheers, Neil.
Quoted 6 lines · Neil Turton
Quoted 3 lines · Tim Deegan
but
vlapic_vcpu(oops)would expand to
(container_of((oops), struct vcpu, arch.hvm_vcpu.oops)^^^^Thanks, Tim. That's what I was trying to say.
I'm going to go through and change all the parameters for these macros to 'x'. You can't go wrong with 'x'.
-- Keir