All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]Fix vlapic.h type
@ 2009-07-07 21:20 Wei Huang
  2009-07-08  7:32 ` Patrick Colp
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Huang @ 2009-07-07 21:20 UTC (permalink / raw)
  To: 'xen-devel@lists.xensource.com'

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

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.

Signed-off-by: Wei Huang <wei.huang2@amd.com>



[-- Attachment #2: vlapic_typo_patch.txt --]
[-- Type: text/plain, Size: 1172 bytes --]

diff -r d768628c28a4 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c	Mon Jul 06 11:58:02 2009 +0100
+++ b/xen/arch/x86/hvm/vlapic.c	Tue Jul 07 16:16:18 2009 -0500
@@ -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);
diff -r d768628c28a4 xen/include/asm-x86/hvm/vlapic.h
--- a/xen/include/asm-x86/hvm/vlapic.h	Mon Jul 06 11:58:02 2009 +0100
+++ b/xen/include/asm-x86/hvm/vlapic.h	Tue Jul 07 16:16:18 2009 -0500
@@ -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)))

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-07 21:20 [PATCH]Fix vlapic.h type Wei Huang
@ 2009-07-08  7:32 ` Patrick Colp
  2009-07-08  9:15   ` Neil Turton
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick Colp @ 2009-07-08  7:32 UTC (permalink / raw)
  To: Wei Huang; +Cc: 'xen-devel@lists.xensource.com'

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


Wei Huang wrote:
> 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.
> 
> Signed-off-by: Wei Huang <wei.huang2@amd.com>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  7:32 ` Patrick Colp
@ 2009-07-08  9:15   ` Neil Turton
  2009-07-08  9:31     ` Patrick Colp
  0 siblings, 1 reply; 9+ messages in thread
From: Neil Turton @ 2009-07-08  9:15 UTC (permalink / raw)
  To: Patrick Colp; +Cc: Wei Huang, 'xen-devel@lists.xensource.com'

Patrick Colp wrote:
> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  9:15   ` Neil Turton
@ 2009-07-08  9:31     ` Patrick Colp
  2009-07-08  9:33       ` Tim Deegan
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick Colp @ 2009-07-08  9:31 UTC (permalink / raw)
  To: Neil Turton; +Cc: Wei Huang, 'xen-devel@lists.xensource.com'

Neil Turton wrote:
> Patrick Colp wrote:
>> 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?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  9:31     ` Patrick Colp
@ 2009-07-08  9:33       ` Tim Deegan
  2009-07-08  9:35         ` Neil Turton
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Deegan @ 2009-07-08  9:33 UTC (permalink / raw)
  To: Patrick Colp
  Cc: Wei Huang, Neil Turton, 'xen-devel@lists.xensource.com'

At 10:31 +0100 on 08 Jul (1247049063), Patrick Colp wrote:
> Neil Turton wrote:
> > Patrick Colp wrote:
> >> 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?
> 
> 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.

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  9:33       ` Tim Deegan
@ 2009-07-08  9:35         ` Neil Turton
  2009-07-08  9:38           ` Patrick Colp
  2009-07-08  9:42           ` Keir Fraser
  0 siblings, 2 replies; 9+ messages in thread
From: Neil Turton @ 2009-07-08  9:35 UTC (permalink / raw)
  To: Tim Deegan
  Cc: 'xen-devel@lists.xensource.com', Wei Huang, Patrick Colp

Tim Deegan wrote:
> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  9:35         ` Neil Turton
@ 2009-07-08  9:38           ` Patrick Colp
  2009-07-08  9:58             ` Neil Turton
  2009-07-08  9:42           ` Keir Fraser
  1 sibling, 1 reply; 9+ messages in thread
From: Patrick Colp @ 2009-07-08  9:38 UTC (permalink / raw)
  To: Neil Turton
  Cc: Tim Deegan, Wei Huang, 'xen-devel@lists.xensource.com'

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


Neil Turton wrote:
> Tim Deegan wrote:
>> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  9:35         ` Neil Turton
  2009-07-08  9:38           ` Patrick Colp
@ 2009-07-08  9:42           ` Keir Fraser
  1 sibling, 0 replies; 9+ messages in thread
From: Keir Fraser @ 2009-07-08  9:42 UTC (permalink / raw)
  To: Neil Turton, Tim Deegan
  Cc: 'xen-devel@lists.xensource.com', Patrick Colp (Intern),
	Wei Huang

On 08/07/2009 10:35, "Neil Turton" <nturton@solarflare.com> wrote:

> Tim Deegan wrote:
>> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH]Fix vlapic.h type
  2009-07-08  9:38           ` Patrick Colp
@ 2009-07-08  9:58             ` Neil Turton
  0 siblings, 0 replies; 9+ messages in thread
From: Neil Turton @ 2009-07-08  9:58 UTC (permalink / raw)
  To: Patrick Colp
  Cc: Tim Deegan, Wei Huang, 'xen-devel@lists.xensource.com'

Patrick Colp wrote:
> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-08  9:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07 21:20 [PATCH]Fix vlapic.h type Wei Huang
2009-07-08  7:32 ` Patrick Colp
2009-07-08  9:15   ` Neil Turton
2009-07-08  9:31     ` Patrick Colp
2009-07-08  9:33       ` Tim Deegan
2009-07-08  9:35         ` Neil Turton
2009-07-08  9:38           ` Patrick Colp
2009-07-08  9:58             ` Neil Turton
2009-07-08  9:42           ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.