From: benami@il.ibm.com Subject: [PATCH] KVM: PCIPT: temporary fix for pio (userspace part) Date: Tue, 17 Jun 2008 22:25:14 +0300 Message-ID: <1213730714-10959-2-git-send-email-benami@il.ibm.com> References: <1213729526-10410-5-git-send-email-benami@il.ibm.com> <1213730714-10959-1-git-send-email-benami@il.ibm.com> Cc: weidong.han@intel.com, muli@il.ibm.com, raharper@us.ibm.com, kvm@vger.kernel.org, Ben-Ami Yassour To: amit.shah@qumranet.com Return-path: Received: from mtagate1.uk.ibm.com ([195.212.29.134]:2577 "EHLO mtagate1.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759076AbYFQTZY (ORCPT ); Tue, 17 Jun 2008 15:25:24 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate1.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m5HJPMwa059440 for ; Tue, 17 Jun 2008 19:25:22 GMT Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5HJPMoJ2502902 for ; Tue, 17 Jun 2008 20:25:22 +0100 Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5HJPGoW009434 for ; Tue, 17 Jun 2008 20:25:17 +0100 In-Reply-To: <1213730714-10959-1-git-send-email-benami@il.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Ben-Ami Yassour PIO for passthrough does not work properly since the permissions are not set, it is not enough to call iopl at init time. This temporary patch calls iopl for every pio request. A better solution would be have a per thread iopl. An alternative approach would be to use sysfs for pio. In the mean time, if you want to use the vtd branch, then you probably need this patch. Signed-off-by: Ben-Ami Yassour --- qemu/hw/pci-passthrough.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/hw/pci-passthrough.c b/qemu/hw/pci-passthrough.c index 2d916a2..b091a85 100644 --- a/qemu/hw/pci-passthrough.c +++ b/qemu/hw/pci-passthrough.c @@ -117,6 +117,7 @@ static void pt_ioport_write##suffix(void *opaque, uint32_t addr, uint32_t value) r_pio, (int)r_access->e_physbase, \ (unsigned long)r_access->r_virtbase, value); \ } \ + iopl(3); \ out##suffix(value, r_pio); \ } -- 1.5.5.1