From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1BdJ-0000H9-J8 for qemu-devel@nongnu.org; Tue, 14 Aug 2012 03:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1BdI-0003h0-FG for qemu-devel@nongnu.org; Tue, 14 Aug 2012 03:33:45 -0400 Received: from mout.web.de ([212.227.17.12]:59191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1BdI-0003gw-4t for qemu-devel@nongnu.org; Tue, 14 Aug 2012 03:33:44 -0400 Message-ID: <5029FF4B.8040001@web.de> Date: Tue, 14 Aug 2012 09:33:31 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1344272705-17825-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1344272705-17825-1-git-send-email-peter.maydell@linaro.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigCF6C8AD702D69E35913E89F0" Subject: Re: [Qemu-devel] [PATCH] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Avi Kivity , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, patches@linaro.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCF6C8AD702D69E35913E89F0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2012-08-06 19:05, Peter Maydell wrote: > Move the init of the irqchip_inject_ioctl field of KVMState out of > kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() > can be used even when no irqchip is created (for architectures > that support async interrupt notification even without an in > kernel irqchip). >=20 > Signed-off-by: Peter Maydell > --- > We can't just set irqchip_inject_ioctl in target-*/kvm.c because > the KVMState struct layout is private to kvm-all.c. Moving the > default initialisation of this field seemed the simplest approach. > It's safe because the use in kvm_set_irq() is guarded by a check of > kvm_async_interrupts_enabled(). >=20 > The other approach would be to have a helper function for setting > the field, but that seems overkill when KVM_IRQ_LINE is the standard > default value. (KVM_IRQ_LINE_STATUS seems to be undocumented, > incidentally. I am going to assume it's another x86ism until somebody > does document it :-)) >=20 > kvm-all.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/kvm-all.c b/kvm-all.c > index 6def6c9..9a1f001 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -1200,7 +1200,6 @@ static int kvm_irqchip_create(KVMState *s) > return ret; > } > =20 > - s->irqchip_inject_ioctl =3D KVM_IRQ_LINE; > if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) { > s->irqchip_inject_ioctl =3D KVM_IRQ_LINE_STATUS; > } Either you move both or none. KVM_IRQ_LINE is old-style, deprecated, KVM_IRQ_LINE_STATUS (i.e injection with feedback to allow lost-tick compensation) is the current standard that other archs should pick up. Jan --------------enigCF6C8AD702D69E35913E89F0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAp/0sACgkQitSsb3rl5xS0LQCguNCPcOTH6vex7jIM3jN0tKz6 2FYAoIK+rre6jRvE0HaehhehVpLGnqcT =VMSX -----END PGP SIGNATURE----- --------------enigCF6C8AD702D69E35913E89F0--