From: "Jan Beulich" Subject: [PATCH 2/3] x86/HVM: drop pointless parameters from vIOAPIC internal routines Date: Thu, 08 Jan 2015 15:51:23 +0000 Message-ID: <54AEB58B0200007800052BF5@mail.emea.novell.com> References: <54AEB49C0200007800052BDE@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part5E6BA96B.0__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Y9FMr-0002Ne-EE for xen-devel@lists.xenproject.org; Thu, 08 Jan 2015 15:51:25 +0000 In-Reply-To: <54AEB49C0200007800052BDE@mail.emea.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: xen-devel Cc: Keir Fraser 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. --=__Part5E6BA96B.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Also simplify a few other operations (without funtional change). Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -46,11 +46,9 @@ =20 static void vioapic_deliver(struct hvm_hw_vioapic *vioapic, int irq); =20 -static unsigned long vioapic_read_indirect(struct hvm_hw_vioapic = *vioapic, - unsigned long addr, - unsigned long length) +static uint32_t vioapic_read_indirect(const struct hvm_hw_vioapic = *vioapic) { - unsigned long result =3D 0; + uint32_t result =3D 0; =20 switch ( vioapic->ioregsel ) { @@ -77,9 +75,8 @@ static unsigned long vioapic_read_indire } =20 redir_content =3D vioapic->redirtbl[redir_index].bits; - result =3D (vioapic->ioregsel & 0x1)? - (redir_content >> 32) & 0xffffffff : - redir_content & 0xffffffff; + result =3D (vioapic->ioregsel & 1) ? (redir_content >> 32) + : redir_content; break; } } @@ -91,21 +88,19 @@ static int vioapic_read( struct vcpu *v, unsigned long addr, unsigned long length, unsigned long *pval) { - struct hvm_hw_vioapic *vioapic =3D domain_vioapic(v->domain); + const struct hvm_hw_vioapic *vioapic =3D domain_vioapic(v->domain); uint32_t result; =20 HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "addr %lx", addr); =20 - addr &=3D 0xff; - - switch ( addr ) + switch ( addr & 0xff ) { case VIOAPIC_REG_SELECT: result =3D vioapic->ioregsel; break; =20 case VIOAPIC_REG_WINDOW: - result =3D vioapic_read_indirect(vioapic, addr, length); + result =3D vioapic_read_indirect(vioapic); break; =20 default: @@ -169,7 +164,7 @@ static void vioapic_write_redirent( } =20 static void vioapic_write_indirect( - struct hvm_hw_vioapic *vioapic, unsigned long length, unsigned long = val) + struct hvm_hw_vioapic *vioapic, uint32_t val) { switch ( vioapic->ioregsel ) { @@ -188,8 +183,8 @@ static void vioapic_write_indirect( { uint32_t redir_index =3D (vioapic->ioregsel - 0x10) >> 1; =20 - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "change redir index %x val %lx", - redir_index, val); + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "rte[%02x].%s =3D %08x", + redir_index, vioapic->ioregsel & 1 ? "hi" : "lo", = val); =20 if ( redir_index >=3D VIOAPIC_NUM_PINS ) { @@ -211,16 +206,14 @@ static int vioapic_write( { struct hvm_hw_vioapic *vioapic =3D domain_vioapic(v->domain); =20 - addr &=3D 0xff; - - switch ( addr ) + switch ( addr & 0xff ) { case VIOAPIC_REG_SELECT: vioapic->ioregsel =3D val; break; =20 case VIOAPIC_REG_WINDOW: - vioapic_write_indirect(vioapic, length, val); + vioapic_write_indirect(vioapic, val); break; =20 #if VIOAPIC_VERSION_ID >=3D 0x20 --=__Part5E6BA96B.0__= Content-Type: text/plain; name="x86-vIOAPIC-drop-params.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-vIOAPIC-drop-params.patch" x86/HVM: drop pointless parameters from vIOAPIC internal routines=0A=0AAlso= simplify a few other operations (without funtional change).=0A=0ASigned-of= f-by: Jan Beulich =0A=0A--- a/xen/arch/x86/hvm/vioapic.c= =0A+++ b/xen/arch/x86/hvm/vioapic.c=0A@@ -46,11 +46,9 @@=0A =0A static = void vioapic_deliver(struct hvm_hw_vioapic *vioapic, int irq);=0A = =0A-static unsigned long vioapic_read_indirect(struct hvm_hw_vioapic = *vioapic,=0A- unsigned long = addr,=0A- unsigned long = length)=0A+static uint32_t vioapic_read_indirect(const struct hvm_hw_vioapi= c *vioapic)=0A {=0A- unsigned long result =3D 0;=0A+ uint32_t result = =3D 0;=0A =0A switch ( vioapic->ioregsel )=0A {=0A@@ -77,9 +75,8 = @@ static unsigned long vioapic_read_indire=0A }=0A =0A = redir_content =3D vioapic->redirtbl[redir_index].bits;=0A- result = =3D (vioapic->ioregsel & 0x1)?=0A- (redir_content >> 32) & = 0xffffffff :=0A- redir_content & 0xffffffff;=0A+ result = =3D (vioapic->ioregsel & 1) ? (redir_content >> 32)=0A+ = : redir_content;=0A break;=0A }=0A = }=0A@@ -91,21 +88,19 @@ static int vioapic_read(=0A struct vcpu *v, = unsigned long addr,=0A unsigned long length, unsigned long *pval)=0A = {=0A- struct hvm_hw_vioapic *vioapic =3D domain_vioapic(v->domain);=0A+ = const struct hvm_hw_vioapic *vioapic =3D domain_vioapic(v->domain);=0A = uint32_t result;=0A =0A HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "addr %lx", = addr);=0A =0A- addr &=3D 0xff;=0A-=0A- switch ( addr )=0A+ switch = ( addr & 0xff )=0A {=0A case VIOAPIC_REG_SELECT:=0A result = =3D vioapic->ioregsel;=0A break;=0A =0A case VIOAPIC_REG_WINDOW= :=0A- result =3D vioapic_read_indirect(vioapic, addr, length);=0A+ = result =3D vioapic_read_indirect(vioapic);=0A break;=0A =0A = default:=0A@@ -169,7 +164,7 @@ static void vioapic_write_redirent(=0A = }=0A =0A static void vioapic_write_indirect(=0A- struct hvm_hw_vioapic = *vioapic, unsigned long length, unsigned long val)=0A+ struct hvm_hw_vio= apic *vioapic, uint32_t val)=0A {=0A switch ( vioapic->ioregsel )=0A = {=0A@@ -188,8 +183,8 @@ static void vioapic_write_indirect(=0A {=0A = uint32_t redir_index =3D (vioapic->ioregsel - 0x10) >> 1;=0A =0A- = HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "change redir index %x val %lx",=0A- = redir_index, val);=0A+ HVM_DBG_LOG(DBG_LEVEL_IOAPIC,= "rte[%02x].%s =3D %08x",=0A+ redir_index, vioapic->iore= gsel & 1 ? "hi" : "lo", val);=0A =0A if ( redir_index >=3D = VIOAPIC_NUM_PINS )=0A {=0A@@ -211,16 +206,14 @@ static int = vioapic_write(=0A {=0A struct hvm_hw_vioapic *vioapic =3D domain_vioapi= c(v->domain);=0A =0A- addr &=3D 0xff;=0A-=0A- switch ( addr )=0A+ = switch ( addr & 0xff )=0A {=0A case VIOAPIC_REG_SELECT:=0A = vioapic->ioregsel =3D val;=0A break;=0A =0A case VIOAPIC_REG_WI= NDOW:=0A- vioapic_write_indirect(vioapic, length, val);=0A+ = vioapic_write_indirect(vioapic, val);=0A break;=0A =0A #if = VIOAPIC_VERSION_ID >=3D 0x20=0A --=__Part5E6BA96B.0__= 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 --=__Part5E6BA96B.0__=--