From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86: drop MAX_VECTOR definition Date: Tue, 2 Jul 2013 10:26:50 +0100 Message-ID: <51D29CDA.3080609@citrix.com> References: <51D2984002000078000E21A9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4695529933643020850==" Return-path: In-Reply-To: <51D2984002000078000E21A9@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org --===============4695529933643020850== Content-Type: multipart/alternative; boundary="------------090905030609030704090608" --------------090905030609030704090608 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 02/07/13 08:07, Jan Beulich wrote: > .. in favor of NR_VECTORS, as being redundant and as the latter is > correct in terms of its naming, while the former is off by one. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > > --- a/xen/arch/x86/hvm/vlapic.c > +++ b/xen/arch/x86/hvm/vlapic.c > @@ -90,10 +90,10 @@ static const unsigned int vlapic_lvt_mas > ((vlapic_get_reg(vlapic, APIC_LVTT) & APIC_TIMER_MODE_MASK) \ > == APIC_TIMER_MODE_TSC_DEADLINE) > > -static int vlapic_find_highest_vector(void *bitmap) > +static int vlapic_find_highest_vector(const void *bitmap) > { > - uint32_t *word = bitmap; > - int word_offset = MAX_VECTOR / 32; > + const uint32_t *word = bitmap; > + unsigned int word_offset = NR_VECTORS / 32; > > /* Work backwards through the bitmap (first 32-bit word in every four). */ > while ( (word_offset != 0) && (word[(--word_offset)*4] == 0) ) > --- a/xen/include/asm-x86/hvm/vlapic.h > +++ b/xen/include/asm-x86/hvm/vlapic.h > @@ -26,8 +26,6 @@ > #include > #include > > -#define MAX_VECTOR 256 > - > #define vcpu_vlapic(x) (&(x)->arch.hvm_vcpu.vlapic) > #define vlapic_vcpu(x) (container_of((x), struct vcpu, arch.hvm_vcpu.vlapic)) > #define vlapic_domain(x) (vlapic_vcpu(x)->domain) > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------090905030609030704090608 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 02/07/13 08:07, Jan Beulich wrote:
.. in favor of NR_VECTORS, as being redundant and as the latter is
correct in terms of its naming, while the former is off by one.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -90,10 +90,10 @@ static const unsigned int vlapic_lvt_mas
     ((vlapic_get_reg(vlapic, APIC_LVTT) & APIC_TIMER_MODE_MASK) \
      == APIC_TIMER_MODE_TSC_DEADLINE)
 
-static int vlapic_find_highest_vector(void *bitmap)
+static int vlapic_find_highest_vector(const void *bitmap)
 {
-    uint32_t *word = bitmap;
-    int word_offset = MAX_VECTOR / 32;
+    const uint32_t *word = bitmap;
+    unsigned int word_offset = NR_VECTORS / 32;
 
     /* Work backwards through the bitmap (first 32-bit word in every four). */
     while ( (word_offset != 0) && (word[(--word_offset)*4] == 0) )
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -26,8 +26,6 @@
 #include <public/hvm/ioreq.h>
 #include <asm/hvm/vpt.h>
 
-#define MAX_VECTOR      256
-
 #define vcpu_vlapic(x)   (&(x)->arch.hvm_vcpu.vlapic)
 #define vlapic_vcpu(x)   (container_of((x), struct vcpu, arch.hvm_vcpu.vlapic))
 #define vlapic_domain(x) (vlapic_vcpu(x)->domain)





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

--------------090905030609030704090608-- --===============4695529933643020850== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============4695529933643020850==--