From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: Corner cases of I/O bitmap Date: Tue, 3 Sep 2013 14:19:12 +0300 Message-ID: <20130903111912.GA22899@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=cp1255 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm , Paolo Bonzini , Jan Kiszka To: Arthur Chunqi Li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35776 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752699Ab3ICLTP convert rfc822-to-8bit (ORCPT ); Tue, 3 Sep 2013 07:19:15 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Aug 12, 2013 at 08:35:57PM +0800, Arthur Chunqi Li wrote: > Hi Gleb and Paolo, > There are some corner cases when testing I/O bitmaps, and I don't kno= w > the exact action of HW. >=20 A little bit late but... > 1. If we set bit of 0x4000 in bitmap and call inl(0x3FFFF) or > inl(0x4000) in guest, what will get of exit information? >=20 Spec says; execution of an I/O instruction causes a VM exit if any bit in the I/O bitmaps corresponding to a port it accesses is 1. Note "any" here. The exit will have address that instruction used, otherwise how can we be able to emulate it properly. > 2. What will we get when calling inl(0xFFFF) in guest with/without > =93unconditional I/O exiting=94 VM-execution control and =93use I/O b= itmaps=94 > VM-execution control? In other words are you asking what happens if you do inl(0xFFFF) on rea= l HW? "The result of an attempt to address beyond the I/O address space limit= of =46FFFH is implementation-specific" >=20 > I test the two cases in nested env. For the first one, I got normal > exit if any of the port accessed is masked in bitmap. For the second, > it will acts the same as other ports. And the SDM says "If an I/O > operation =93wraps around=94 the 16-bit I/O-port space (accesses port= s > FFFFH and 0000H), the I/O instruction causes a VM exit." I cannot fin= d > the exact reaction of this case. What do you mean by "exact reaction"? >=20 > Do you have any ideas about these? >=20 > Arthur >=20 > --=20 > Arthur Chunqi Li > Department of Computer Science > School of EECS > Peking University > Beijing, China -- Gleb.