From: "Jan Beulich" Subject: [PATCH] evtchn: eliminate 64k ports limitation Date: Wed, 02 Apr 2014 09:03:20 +0100 Message-ID: <533BE06802000078000048B7@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part9CAEF958.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVG8p-0005HI-8U for xen-devel@lists.xenproject.org; Wed, 02 Apr 2014 08:03:23 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser , David Vrabel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part9CAEF958.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The introduction of FIFO event channels claimed to support over 100k ports, but failed to widen a number of 16-bit variables/operations. Signed-off-by: Jan Beulich --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -275,12 +275,12 @@ static long evtchn_bind_interdomain(evtc goto out; =20 lchn->u.interdomain.remote_dom =3D rd; - lchn->u.interdomain.remote_port =3D (u16)rport; + lchn->u.interdomain.remote_port =3D rport; lchn->state =3D ECS_INTERDOMAIN; evtchn_port_init(ld, lchn); =20 rchn->u.interdomain.remote_dom =3D ld; - rchn->u.interdomain.remote_port =3D (u16)lport; + rchn->u.interdomain.remote_port =3D lport; rchn->state =3D ECS_INTERDOMAIN; =20 /* --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -90,13 +90,13 @@ struct evtchn domid_t remote_domid; } unbound; /* state =3D=3D ECS_UNBOUND */ struct { - u16 remote_port; + evtchn_port_t remote_port; struct domain *remote_dom; } interdomain; /* state =3D=3D ECS_INTERDOMAIN */ struct { - u16 irq; - u16 next_port; - u16 prev_port; + u32 irq; + evtchn_port_t next_port; + evtchn_port_t prev_port; } pirq; /* state =3D=3D ECS_PIRQ */ u16 virq; /* state =3D=3D ECS_VIRQ */ } u; @@ -209,7 +209,7 @@ struct vcpu=20 atomic_t pause_count; =20 /* IRQ-safe virq_lock protects against delivering VIRQ to stale = evtchn. */ - u16 virq_to_evtchn[NR_VIRQS]; + evtchn_port_t virq_to_evtchn[NR_VIRQS]; spinlock_t virq_lock; =20 /* Bitmask of CPUs on which this VCPU may run. */ --=__Part9CAEF958.1__= Content-Type: text/plain; name="evtchn-fix-port-width.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="evtchn-fix-port-width.patch" evtchn: eliminate 64k ports limitation=0A=0AThe introduction of FIFO event = channels claimed to support over 100k=0Aports, but failed to widen a = number of 16-bit variables/operations.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/common/event_channel.c=0A+++ b/xen/commo= n/event_channel.c=0A@@ -275,12 +275,12 @@ static long evtchn_bind_interdoma= in(evtc=0A goto out;=0A =0A lchn->u.interdomain.remote_dom = =3D rd;=0A- lchn->u.interdomain.remote_port =3D (u16)rport;=0A+ = lchn->u.interdomain.remote_port =3D rport;=0A lchn->state = =3D ECS_INTERDOMAIN;=0A evtchn_port_init(ld, lchn);=0A =0A = rchn->u.interdomain.remote_dom =3D ld;=0A- rchn->u.interdomain.remot= e_port =3D (u16)lport;=0A+ rchn->u.interdomain.remote_port =3D = lport;=0A rchn->state =3D ECS_INTERDOMAIN;=0A =0A = /*=0A--- a/xen/include/xen/sched.h=0A+++ b/xen/include/xen/sched.h=0A@@ = -90,13 +90,13 @@ struct evtchn=0A domid_t remote_domid;=0A = } unbound; /* state =3D=3D ECS_UNBOUND */=0A struct {=0A- = u16 remote_port;=0A+ evtchn_port_t = remote_port;=0A struct domain *remote_dom;=0A } = interdomain; /* state =3D=3D ECS_INTERDOMAIN */=0A struct {=0A- = u16 irq;=0A- u16 next_port;=0A- = u16 prev_port;=0A+ u32 irq;=0A+ = evtchn_port_t next_port;=0A+ evtchn_port_t = prev_port;=0A } pirq; /* state =3D=3D ECS_PIRQ */=0A = u16 virq; /* state =3D=3D ECS_VIRQ */=0A } u;=0A@@ -209,7 +209,7 = @@ struct vcpu =0A atomic_t pause_count;=0A =0A /* = IRQ-safe virq_lock protects against delivering VIRQ to stale evtchn. = */=0A- u16 virq_to_evtchn[NR_VIRQS];=0A+ evtchn_port_t = virq_to_evtchn[NR_VIRQS];=0A spinlock_t virq_lock;=0A =0A = /* Bitmask of CPUs on which this VCPU may run. */=0A --=__Part9CAEF958.1__= 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 --=__Part9CAEF958.1__=--