From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: KVM: x86: use proper port value when checking io instruction permission (v2) Date: Thu, 26 May 2011 09:49:21 +0200 Message-ID: <4DDE0601.8060008@redhat.com> References: <20110524171120.GA19906@amt.cnet> <20110524172706.GC22042@redhat.com> <20110525181820.GA14921@amt.cnet> <4DDDF3D6.3000505@redhat.com> <20110526065511.GA29458@redhat.com> <4DDDFB07.2050909@redhat.com> <4DDDFB78.9070307@redhat.com> <20110526070737.GB29458@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , kvm , Joerg Roedel To: Gleb Natapov Return-path: Received: from mail-pw0-f46.google.com ([209.85.160.46]:38595 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755761Ab1EZHt2 (ORCPT ); Thu, 26 May 2011 03:49:28 -0400 Received: by pwi15 with SMTP id 15so223706pwi.19 for ; Thu, 26 May 2011 00:49:27 -0700 (PDT) In-Reply-To: <20110526070737.GB29458@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/26/2011 09:07 AM, Gleb Natapov wrote: > > Still, op_bytes is irrelevant for > > SrcDX, the 16-bit version is always used. > > If SrcDX/DstDX will be used only for decoding in/out instruction > then yes. Otherwise it is nice to have more general decoder. Not counting instructions that read/write many registers (rdmsr/wrmsr, mul/imul/div/idiv, rdtsc, etc.), I think the only other instruction with an implicit DstDX is cwd/cdq/cqo. Since cwd/cdq/cqo needs c->dst.bytes = c->src.bytes (not op_bytes) I think DstDX is not really reusable beyond port instructions. Paolo