diff mbox

[XEN] xen: event channel arrays are xen_ulong_t and not unsigned long

Message ID 1361285363-27133-1-git-send-email-ian.campbell@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Campbell Feb. 19, 2013, 2:49 p.m. UTC
On ARM we want these to be the same size on 32- and 64-bit.

This is an ABI change on ARM. X86 does not change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: xen-devel@lists.xen.org
---
 tools/include/xen-foreign/mkheader.py |    6 ++++++
 xen/include/public/xen.h              |    8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

Comments

Stefano Stabellini Feb. 19, 2013, 4:42 p.m. UTC | #1
On Tue, 19 Feb 2013, Ian Campbell wrote:
> On ARM we want these to be the same size on 32- and 64-bit.
> 
> This is an ABI change on ARM. X86 does not change.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Keir (Xen.org) <keir@xen.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: xen-devel@lists.xen.org

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  tools/include/xen-foreign/mkheader.py |    6 ++++++
>  xen/include/public/xen.h              |    8 ++++----
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
> index d189b07..57681fa 100644
> --- a/tools/include/xen-foreign/mkheader.py
> +++ b/tools/include/xen-foreign/mkheader.py
> @@ -21,13 +21,18 @@ inttypes["arm"] = {
>      "unsigned long" : "uint32_t",
>      "long"          : "uint32_t",
>      "xen_pfn_t"     : "uint64_t",
> +    "xen_ulong_t"   : "uint64_t",
>  };
> +header["arm"] = """
> +#define __arm___ARM32 1
> +""";
>  
>  # x86_32
>  inttypes["x86_32"] = {
>      "unsigned long" : "uint32_t",
>      "long"          : "uint32_t",
>      "xen_pfn_t"     : "uint32_t",
> +    "xen_ulong_t"   : "uint32_t",
>  };
>  header["x86_32"] = """
>  #define __i386___X86_32 1
> @@ -42,6 +47,7 @@ inttypes["x86_64"] = {
>      "unsigned long" : "__align8__ uint64_t",
>      "long"          : "__align8__ uint64_t",
>      "xen_pfn_t"     : "__align8__ uint64_t",
> +    "xen_ulong_t"   : "__align8__ uint64_t",
>  };
>  header["x86_64"] = """
>  #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
> index 5593066..99c8212 100644
> --- a/xen/include/public/xen.h
> +++ b/xen/include/public/xen.h
> @@ -556,7 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
>   * Event channel endpoints per domain:
>   *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
>   */
> -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
> +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
>  
>  struct vcpu_time_info {
>      /*
> @@ -613,7 +613,7 @@ struct vcpu_info {
>       */
>      uint8_t evtchn_upcall_pending;
>      uint8_t evtchn_upcall_mask;
> -    unsigned long evtchn_pending_sel;
> +    xen_ulong_t evtchn_pending_sel;
>      struct arch_vcpu_info arch;
>      struct vcpu_time_info time;
>  }; /* 64 bytes (x86) */
> @@ -663,8 +663,8 @@ struct shared_info {
>       * per-vcpu selector word to be set. Each bit in the selector covers a
>       * 'C long' in the PENDING bitfield array.
>       */
> -    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
> -    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
> +    xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
> +    xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
>  
>      /*
>       * Wallclock time: updated only by control software. Guests should base
> -- 
> 1.7.9.1
>
Ian Campbell Feb. 21, 2013, 5:16 p.m. UTC | #2
On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
> On ARM we want these to be the same size on 32- and 64-bit.
> 
> This is an ABI change on ARM. X86 does not change.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Keir (Xen.org) <keir@xen.org>

Are you guys (un)happy with this change from the Xen & x86 side?

> Cc: Tim Deegan <tim@xen.org>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: xen-devel@lists.xen.org
> ---
>  tools/include/xen-foreign/mkheader.py |    6 ++++++
>  xen/include/public/xen.h              |    8 ++++----
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
> index d189b07..57681fa 100644
> --- a/tools/include/xen-foreign/mkheader.py
> +++ b/tools/include/xen-foreign/mkheader.py
> @@ -21,13 +21,18 @@ inttypes["arm"] = {
>      "unsigned long" : "uint32_t",
>      "long"          : "uint32_t",
>      "xen_pfn_t"     : "uint64_t",
> +    "xen_ulong_t"   : "uint64_t",
>  };
> +header["arm"] = """
> +#define __arm___ARM32 1
> +""";
>  
>  # x86_32
>  inttypes["x86_32"] = {
>      "unsigned long" : "uint32_t",
>      "long"          : "uint32_t",
>      "xen_pfn_t"     : "uint32_t",
> +    "xen_ulong_t"   : "uint32_t",
>  };
>  header["x86_32"] = """
>  #define __i386___X86_32 1
> @@ -42,6 +47,7 @@ inttypes["x86_64"] = {
>      "unsigned long" : "__align8__ uint64_t",
>      "long"          : "__align8__ uint64_t",
>      "xen_pfn_t"     : "__align8__ uint64_t",
> +    "xen_ulong_t"   : "__align8__ uint64_t",
>  };
>  header["x86_64"] = """
>  #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
> index 5593066..99c8212 100644
> --- a/xen/include/public/xen.h
> +++ b/xen/include/public/xen.h
> @@ -556,7 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
>   * Event channel endpoints per domain:
>   *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
>   */
> -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
> +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
>  
>  struct vcpu_time_info {
>      /*
> @@ -613,7 +613,7 @@ struct vcpu_info {
>       */
>      uint8_t evtchn_upcall_pending;
>      uint8_t evtchn_upcall_mask;
> -    unsigned long evtchn_pending_sel;
> +    xen_ulong_t evtchn_pending_sel;
>      struct arch_vcpu_info arch;
>      struct vcpu_time_info time;
>  }; /* 64 bytes (x86) */
> @@ -663,8 +663,8 @@ struct shared_info {
>       * per-vcpu selector word to be set. Each bit in the selector covers a
>       * 'C long' in the PENDING bitfield array.
>       */
> -    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
> -    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
> +    xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
> +    xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
>  
>      /*
>       * Wallclock time: updated only by control software. Guests should base
Keir Fraser Feb. 21, 2013, 6:43 p.m. UTC | #3
On 21/02/2013 17:16, "Ian Campbell" <Ian.Campbell@citrix.com> wrote:

> On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
>> On ARM we want these to be the same size on 32- and 64-bit.
>> 
>> This is an ABI change on ARM. X86 does not change.
>> 
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: Jan Beulich <JBeulich@suse.com>
>> Cc: Keir (Xen.org) <keir@xen.org>
> 
> Are you guys (un)happy with this change from the Xen & x86 side?

Fine by me.

 -- Keir

>> Cc: Tim Deegan <tim@xen.org>
>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: xen-devel@lists.xen.org
>> ---
>>  tools/include/xen-foreign/mkheader.py |    6 ++++++
>>  xen/include/public/xen.h              |    8 ++++----
>>  2 files changed, 10 insertions(+), 4 deletions(-)
>> 
>> diff --git a/tools/include/xen-foreign/mkheader.py
>> b/tools/include/xen-foreign/mkheader.py
>> index d189b07..57681fa 100644
>> --- a/tools/include/xen-foreign/mkheader.py
>> +++ b/tools/include/xen-foreign/mkheader.py
>> @@ -21,13 +21,18 @@ inttypes["arm"] = {
>>      "unsigned long" : "uint32_t",
>>      "long"          : "uint32_t",
>>      "xen_pfn_t"     : "uint64_t",
>> +    "xen_ulong_t"   : "uint64_t",
>>  };
>> +header["arm"] = """
>> +#define __arm___ARM32 1
>> +""";
>>  
>>  # x86_32
>>  inttypes["x86_32"] = {
>>      "unsigned long" : "uint32_t",
>>      "long"          : "uint32_t",
>>      "xen_pfn_t"     : "uint32_t",
>> +    "xen_ulong_t"   : "uint32_t",
>>  };
>>  header["x86_32"] = """
>>  #define __i386___X86_32 1
>> @@ -42,6 +47,7 @@ inttypes["x86_64"] = {
>>      "unsigned long" : "__align8__ uint64_t",
>>      "long"          : "__align8__ uint64_t",
>>      "xen_pfn_t"     : "__align8__ uint64_t",
>> +    "xen_ulong_t"   : "__align8__ uint64_t",
>>  };
>>  header["x86_64"] = """
>>  #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
>> diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
>> index 5593066..99c8212 100644
>> --- a/xen/include/public/xen.h
>> +++ b/xen/include/public/xen.h
>> @@ -556,7 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
>>   * Event channel endpoints per domain:
>>   *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
>>   */
>> -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) *
>> 64)
>> +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
>>  
>>  struct vcpu_time_info {
>>      /*
>> @@ -613,7 +613,7 @@ struct vcpu_info {
>>       */
>>      uint8_t evtchn_upcall_pending;
>>      uint8_t evtchn_upcall_mask;
>> -    unsigned long evtchn_pending_sel;
>> +    xen_ulong_t evtchn_pending_sel;
>>      struct arch_vcpu_info arch;
>>      struct vcpu_time_info time;
>>  }; /* 64 bytes (x86) */
>> @@ -663,8 +663,8 @@ struct shared_info {
>>       * per-vcpu selector word to be set. Each bit in the selector covers a
>>       * 'C long' in the PENDING bitfield array.
>>       */
>> -    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
>> -    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
>> +    xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
>> +    xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
>>  
>>      /*
>>       * Wallclock time: updated only by control software. Guests should base
> 
>
Jan Beulich Feb. 22, 2013, 8:12 a.m. UTC | #4
>>> On 21.02.13 at 18:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
>> On ARM we want these to be the same size on 32- and 64-bit.
>> 
>> This is an ABI change on ARM. X86 does not change.
>> 
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: Jan Beulich <JBeulich@suse.com>
>> Cc: Keir (Xen.org) <keir@xen.org>
> 
> Are you guys (un)happy with this change from the Xen & x86 side?

I don't see any problem with it.

Jan

>> Cc: Tim Deegan <tim@xen.org>
>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Cc: linux-arm-kernel@lists.infradead.org 
>> Cc: xen-devel@lists.xen.org 
>> ---
>>  tools/include/xen-foreign/mkheader.py |    6 ++++++
>>  xen/include/public/xen.h              |    8 ++++----
>>  2 files changed, 10 insertions(+), 4 deletions(-)
>> 
>> diff --git a/tools/include/xen-foreign/mkheader.py 
> b/tools/include/xen-foreign/mkheader.py
>> index d189b07..57681fa 100644
>> --- a/tools/include/xen-foreign/mkheader.py
>> +++ b/tools/include/xen-foreign/mkheader.py
>> @@ -21,13 +21,18 @@ inttypes["arm"] = {
>>      "unsigned long" : "uint32_t",
>>      "long"          : "uint32_t",
>>      "xen_pfn_t"     : "uint64_t",
>> +    "xen_ulong_t"   : "uint64_t",
>>  };
>> +header["arm"] = """
>> +#define __arm___ARM32 1
>> +""";
>>  
>>  # x86_32
>>  inttypes["x86_32"] = {
>>      "unsigned long" : "uint32_t",
>>      "long"          : "uint32_t",
>>      "xen_pfn_t"     : "uint32_t",
>> +    "xen_ulong_t"   : "uint32_t",
>>  };
>>  header["x86_32"] = """
>>  #define __i386___X86_32 1
>> @@ -42,6 +47,7 @@ inttypes["x86_64"] = {
>>      "unsigned long" : "__align8__ uint64_t",
>>      "long"          : "__align8__ uint64_t",
>>      "xen_pfn_t"     : "__align8__ uint64_t",
>> +    "xen_ulong_t"   : "__align8__ uint64_t",
>>  };
>>  header["x86_64"] = """
>>  #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
>> diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
>> index 5593066..99c8212 100644
>> --- a/xen/include/public/xen.h
>> +++ b/xen/include/public/xen.h
>> @@ -556,7 +556,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
>>   * Event channel endpoints per domain:
>>   *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
>>   */
>> -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 
> 64)
>> +#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
>>  
>>  struct vcpu_time_info {
>>      /*
>> @@ -613,7 +613,7 @@ struct vcpu_info {
>>       */
>>      uint8_t evtchn_upcall_pending;
>>      uint8_t evtchn_upcall_mask;
>> -    unsigned long evtchn_pending_sel;
>> +    xen_ulong_t evtchn_pending_sel;
>>      struct arch_vcpu_info arch;
>>      struct vcpu_time_info time;
>>  }; /* 64 bytes (x86) */
>> @@ -663,8 +663,8 @@ struct shared_info {
>>       * per-vcpu selector word to be set. Each bit in the selector covers a
>>       * 'C long' in the PENDING bitfield array.
>>       */
>> -    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
>> -    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
>> +    xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
>> +    xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
>>  
>>      /*
>>       * Wallclock time: updated only by control software. Guests should base
Ian Campbell Feb. 22, 2013, 8:28 a.m. UTC | #5
On Thu, 2013-02-21 at 18:43 +0000, Keir Fraser wrote:
> On 21/02/2013 17:16, "Ian Campbell" <Ian.Campbell@citrix.com> wrote:
> 
> > On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
> >> On ARM we want these to be the same size on 32- and 64-bit.
> >> 
> >> This is an ABI change on ARM. X86 does not change.
> >> 
> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >> Cc: Jan Beulich <JBeulich@suse.com>
> >> Cc: Keir (Xen.org) <keir@xen.org>
> > 
> > Are you guys (un)happy with this change from the Xen & x86 side?
> 
> Fine by me.

I'm going to take that as an Acked-by then, assuming that's ok with you.
I suppose Fine-by: Keir would do too ;-)

Ian.
Ian Campbell Feb. 22, 2013, 8:28 a.m. UTC | #6
On Fri, 2013-02-22 at 08:12 +0000, Jan Beulich wrote:
> >>> On 21.02.13 at 18:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
> >> On ARM we want these to be the same size on 32- and 64-bit.
> >> 
> >> This is an ABI change on ARM. X86 does not change.
> >> 
> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >> Cc: Jan Beulich <JBeulich@suse.com>
> >> Cc: Keir (Xen.org) <keir@xen.org>
> > 
> > Are you guys (un)happy with this change from the Xen & x86 side?
> 
> I don't see any problem with it.

I'll take this as an Acked-by if that's ok with you.

Ian.
Jan Beulich Feb. 22, 2013, 8:48 a.m. UTC | #7
>>> On 22.02.13 at 09:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2013-02-22 at 08:12 +0000, Jan Beulich wrote:
>> >>> On 21.02.13 at 18:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
>> >> On ARM we want these to be the same size on 32- and 64-bit.
>> >> 
>> >> This is an ABI change on ARM. X86 does not change.
>> >> 
>> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> >> Cc: Jan Beulich <JBeulich@suse.com>
>> >> Cc: Keir (Xen.org) <keir@xen.org>
>> > 
>> > Are you guys (un)happy with this change from the Xen & x86 side?
>> 
>> I don't see any problem with it.
> 
> I'll take this as an Acked-by if that's ok with you.

Well, I specifically didn't say "ack": I don't really mind the change,
but I'm also not eager see it go in. Not seeing a problem with it
doesn't really mean there's none lurking - type changes in public
interfaces are always an at least slightly risky business.

Jan
Ian Campbell Feb. 22, 2013, 8:55 a.m. UTC | #8
On Fri, 2013-02-22 at 08:48 +0000, Jan Beulich wrote:
> >>> On 22.02.13 at 09:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Fri, 2013-02-22 at 08:12 +0000, Jan Beulich wrote:
> >> >>> On 21.02.13 at 18:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >> > On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
> >> >> On ARM we want these to be the same size on 32- and 64-bit.
> >> >> 
> >> >> This is an ABI change on ARM. X86 does not change.
> >> >> 
> >> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >> >> Cc: Jan Beulich <JBeulich@suse.com>
> >> >> Cc: Keir (Xen.org) <keir@xen.org>
> >> > 
> >> > Are you guys (un)happy with this change from the Xen & x86 side?
> >> 
> >> I don't see any problem with it.
> > 
> > I'll take this as an Acked-by if that's ok with you.
> 
> Well, I specifically didn't say "ack": I don't really mind the change,
> but I'm also not eager see it go in. Not seeing a problem with it
> doesn't really mean there's none lurking - type changes in public
> interfaces are always an at least slightly risky business.

For x86 there is no change here since:
xen/include/public/arch-x86/xen.h:typedef unsigned long xen_ulong_t;

Also the tools/include/xen-foreign checks show no change in the size of
things on x86.

On ARM the change is deliberate, if there is any fallout we can fix it.

Ian.
Jan Beulich Feb. 22, 2013, 9:05 a.m. UTC | #9
>>> On 22.02.13 at 09:55, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2013-02-22 at 08:48 +0000, Jan Beulich wrote:
>> >>> On 22.02.13 at 09:28, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Fri, 2013-02-22 at 08:12 +0000, Jan Beulich wrote:
>> >> >>> On 21.02.13 at 18:16, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> >> > On Tue, 2013-02-19 at 14:49 +0000, Ian Campbell wrote:
>> >> >> On ARM we want these to be the same size on 32- and 64-bit.
>> >> >> 
>> >> >> This is an ABI change on ARM. X86 does not change.
>> >> >> 
>> >> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> >> >> Cc: Jan Beulich <JBeulich@suse.com>
>> >> >> Cc: Keir (Xen.org) <keir@xen.org>
>> >> > 
>> >> > Are you guys (un)happy with this change from the Xen & x86 side?
>> >> 
>> >> I don't see any problem with it.
>> > 
>> > I'll take this as an Acked-by if that's ok with you.
>> 
>> Well, I specifically didn't say "ack": I don't really mind the change,
>> but I'm also not eager see it go in. Not seeing a problem with it
>> doesn't really mean there's none lurking - type changes in public
>> interfaces are always an at least slightly risky business.
> 
> For x86 there is no change here since:
> xen/include/public/arch-x86/xen.h:typedef unsigned long xen_ulong_t;
> 
> Also the tools/include/xen-foreign checks show no change in the size of
> things on x86.

Which is why I said I see no problem with it.

> On ARM the change is deliberate, if there is any fallout we can fix it.

I understand that.

Jan
diff mbox

Patch

diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
index d189b07..57681fa 100644
--- a/tools/include/xen-foreign/mkheader.py
+++ b/tools/include/xen-foreign/mkheader.py
@@ -21,13 +21,18 @@  inttypes["arm"] = {
     "unsigned long" : "uint32_t",
     "long"          : "uint32_t",
     "xen_pfn_t"     : "uint64_t",
+    "xen_ulong_t"   : "uint64_t",
 };
+header["arm"] = """
+#define __arm___ARM32 1
+""";
 
 # x86_32
 inttypes["x86_32"] = {
     "unsigned long" : "uint32_t",
     "long"          : "uint32_t",
     "xen_pfn_t"     : "uint32_t",
+    "xen_ulong_t"   : "uint32_t",
 };
 header["x86_32"] = """
 #define __i386___X86_32 1
@@ -42,6 +47,7 @@  inttypes["x86_64"] = {
     "unsigned long" : "__align8__ uint64_t",
     "long"          : "__align8__ uint64_t",
     "xen_pfn_t"     : "__align8__ uint64_t",
+    "xen_ulong_t"   : "__align8__ uint64_t",
 };
 header["x86_64"] = """
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 5593066..99c8212 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -556,7 +556,7 @@  DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
  * Event channel endpoints per domain:
  *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
  */
-#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
+#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
 
 struct vcpu_time_info {
     /*
@@ -613,7 +613,7 @@  struct vcpu_info {
      */
     uint8_t evtchn_upcall_pending;
     uint8_t evtchn_upcall_mask;
-    unsigned long evtchn_pending_sel;
+    xen_ulong_t evtchn_pending_sel;
     struct arch_vcpu_info arch;
     struct vcpu_time_info time;
 }; /* 64 bytes (x86) */
@@ -663,8 +663,8 @@  struct shared_info {
      * per-vcpu selector word to be set. Each bit in the selector covers a
      * 'C long' in the PENDING bitfield array.
      */
-    unsigned long evtchn_pending[sizeof(unsigned long) * 8];
-    unsigned long evtchn_mask[sizeof(unsigned long) * 8];
+    xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8];
+    xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8];
 
     /*
      * Wallclock time: updated only by control software. Guests should base