Skip to contentSkip to conversation

Fix vlapic.h type

PATCH In review Wei Huang 5 participants 9 messages Jul 7, 2009 – Jul 8, 2009

lore
Share & tools
lore

Wei Huang

author
#0 lore raw

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
diff -r d768628c28a4 xen/arch/x86/hvm/vlapic.c
@@ -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
diff -r d768628c28a4 xen/include/asm-x86/hvm/vlapic.h
@@ -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

#1 lore raw

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_domain inside vlapic.h. I also found an related error in vlapic.c file, which is fixed by this patch too.

------------------------------------------------------------------------

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
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.

#3 lore raw
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_vcpu based 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

#4 lore raw
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_vcpu based 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.]
#5 lore raw
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.

#6 lore raw

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.

#8 lore raw
In reply to Neil Turton
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

#7 lore raw
In reply to Patrick Colp
Quoted 2 lines · Patrick Colp

Right, sorry. My bad. However, calling it vpic is still a bad idea :) _vlapic or _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.