From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: nSVM: Fix IOIO bitmap evaluation Date: Mon, 30 Jun 2014 17:08:13 +0200 Message-ID: <53B17D5D.8030206@redhat.com> References: <53B125B9.6050306@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Joerg Roedel , Valentine Sinitsyn To: Jan Kiszka , kvm Return-path: Received: from mail-we0-f171.google.com ([74.125.82.171]:44544 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753919AbaF3PIS (ORCPT ); Mon, 30 Jun 2014 11:08:18 -0400 Received: by mail-we0-f171.google.com with SMTP id q58so8408159wes.30 for ; Mon, 30 Jun 2014 08:08:17 -0700 (PDT) In-Reply-To: <53B125B9.6050306@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Il 30/06/2014 10:54, Jan Kiszka ha scritto: > + SVM_IOIO_SIZE_SHIFT; > gpa = svm->nested.vmcb_iopm + (port / 8); > - bit = port % 8; > - val = 0; > + start_bit = port % 8; > + iopm_len = (start_bit + size > 8) ? 2 : 1; > + mask = (0xf >> (4 - size)) << start_bit; These two lines are tricky. :) The patch looks good, I'll write a test case if you don't beat me to it. Paolo > + val = 0; >