* [PATCH] x86: drop MAX_VECTOR definition
@ 2013-07-02 7:07 Jan Beulich
2013-07-02 7:54 ` Keir Fraser
2013-07-02 9:26 ` Andrew Cooper
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2013-07-02 7:07 UTC (permalink / raw)
To: xen-devel; +Cc: Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]
.. 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>
--- 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)
[-- Attachment #2: x86-drop-MAX_VECTOR.patch --]
[-- Type: text/plain, Size: 1273 bytes --]
x86: drop MAX_VECTOR definition
.. 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>
--- 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)
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] x86: drop MAX_VECTOR definition
2013-07-02 7:07 [PATCH] x86: drop MAX_VECTOR definition Jan Beulich
@ 2013-07-02 7:54 ` Keir Fraser
2013-07-02 9:26 ` Andrew Cooper
1 sibling, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2013-07-02 7:54 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 02/07/2013 08:07, "Jan Beulich" <JBeulich@suse.com> 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>
Acked-by: Keir Fraser <keir@xen.org>
> --- 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)
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] x86: drop MAX_VECTOR definition
2013-07-02 7:07 [PATCH] x86: drop MAX_VECTOR definition Jan Beulich
2013-07-02 7:54 ` Keir Fraser
@ 2013-07-02 9:26 ` Andrew Cooper
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2013-07-02 9:26 UTC (permalink / raw)
To: Jan Beulich; +Cc: Keir Fraser, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1508 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 2402 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-02 9:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-02 7:07 [PATCH] x86: drop MAX_VECTOR definition Jan Beulich
2013-07-02 7:54 ` Keir Fraser
2013-07-02 9:26 ` Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).