From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH] KVM: nSVM: Fix IOIO bitmap evaluation Date: Tue, 1 Jul 2014 17:23:49 +0200 Message-ID: <20140701152349.GJ26537@8bytes.org> References: <53B125B9.6050306@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Bonzini , kvm , Valentine Sinitsyn To: Jan Kiszka Return-path: Received: from 8bytes.org ([85.214.48.195]:36776 "EHLO mail.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752920AbaGAPXx (ORCPT ); Tue, 1 Jul 2014 11:23:53 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.8bytes.org (Postfix) with SMTP id EE97112B320 for ; Tue, 1 Jul 2014 17:23:49 +0200 (CEST) Content-Disposition: inline In-Reply-To: <53B125B9.6050306@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jun 30, 2014 at 10:54:17AM +0200, Jan Kiszka wrote: > From: Jan Kiszka > > First, kvm_read_guest returns 0 on success. And then we need to take the > access size into account when testing the bitmap: intercept if any of > bits corresponding to the access is set. > > Signed-off-by: Jan Kiszka Reviewed-by: Joerg Roedel Acked-by: Joerg Roedel I have the slight hope that this fixes the issues with L2 Linux guests on L1 Windows hypervisors. Have to check that at some point :) > - if (kvm_read_guest(svm->vcpu.kvm, gpa, &val, 1)) > - val &= (1 << bit); > + if (kvm_read_guest(svm->vcpu.kvm, gpa, &val, iopm_len)) > + return NESTED_EXIT_DONE; Not related to that fix, but as a further improvement we should probably do a #vmexit(invalid-vmcb) or something if we can't read the iopm. Joerg