From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: kvm_external interrupt Date: Thu, 21 Feb 2013 09:58:04 +0100 Message-ID: <5125E19C.5030803@web.de> References: ,<5125CF3C.80207@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2QXWTPFSXSWSKXHRQOFIU" Cc: kvm@vger.kernel.org To: =?GB2312?B?1cXWxw==?= Return-path: Received: from mout.web.de ([212.227.15.3]:53945 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263Ab3BUI6L (ORCPT ); Thu, 21 Feb 2013 03:58:11 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2QXWTPFSXSWSKXHRQOFIU Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable On 2013-02-21 09:43, =D5=C5=D6=C7 wrote: >=20 > =20 >=20 >> Date: Thu, 21 Feb 2013 08:39:40 +0100 >> From: jan.kiszka@web.de >> To: zhangzhi2022@hotmail.com >> Subject: Re: kvm_external interrupt >> >> On 2013-02-21 06:49, zhang zhi wrote: >>> Hi Dear Jan, >>> >>> I have one question to ask : when I'm using the guest os to do some k= eyboard >>> input, I feel no time delay as if guest os were on the bare-metal mac= hine. >> >> Your "measurement" can't reveal the existing delay. It's in the order = of >> milliseconds, at most. >> > So regardless of ELI and posted interrupts, when user is using keyboard= input to interact with guest os, the keyboard event is still intercepted= by vmm, which handles the interrupt according to interrupt descriptor ta= ble of vmm. After that, vmm finally delivers the corresponding interrupt = to guest os using inter-processor interrupt.=20 > Is that so? In general (independent of KVM), if the hypervisor has to share a device between different guests or between itself (in case of KVM, the Linux host is the hypervisor) and a guest, it has to intercept access to and events from that device. The PC keyboard is usually shared (and you can't allow a guest direct access to it as that I/O port can reset the host). So its interrupt is in first handled by the host and then potentially forwarded to a guest. That may happen via posted interrupts in the future or via event injection into the VCPU. If the physical interrupt triggered on a different CPU than the target VCPU is running on (and you don't have posted interrupts), you also need a host-side IPI to kick the VCPU out of guest mode, enabling the injection of the virtual interrupt on re-entr= y. HTH, Jan ------enig2QXWTPFSXSWSKXHRQOFIU 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 Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlEl4Z8ACgkQitSsb3rl5xQAYACdHIKLAFrC4dtMqgjLggmKA+w5 LI4AnAxuRlEeZbX/Ao1C0Yt+cEyJm38m =rLpp -----END PGP SIGNATURE----- ------enig2QXWTPFSXSWSKXHRQOFIU--