From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muli Ben-Yehuda Subject: Re: [PATCH 5/7] KVM/userspace: Device Assignment: Support for assigning PCI devices to guests Date: Tue, 23 Sep 2008 21:32:07 +0300 Message-ID: <20080923183207.GA6922@il.ibm.com> References: <1222181695-23418-1-git-send-email-amit.shah@redhat.com> <1222181695-23418-2-git-send-email-amit.shah@redhat.com> <1222181695-23418-3-git-send-email-amit.shah@redhat.com> <1222181695-23418-4-git-send-email-amit.shah@redhat.com> <1222181695-23418-5-git-send-email-amit.shah@redhat.com> <1222181695-23418-6-git-send-email-amit.shah@redhat.com> <48D919A8.8040409@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Amit Shah , avi@redhat.com, kvm@vger.kernel.org, Ben-Ami Yassour1 , weidong.han@intel.com, allen.m.kay@intel.com To: Anthony Liguori Return-path: Received: from mtagate1.de.ibm.com ([195.212.17.161]:57313 "EHLO mtagate1.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752286AbYIWTKK (ORCPT ); Tue, 23 Sep 2008 15:10:10 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id m8NJA5pv031540 for ; Tue, 23 Sep 2008 19:10:05 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m8NJA4v53109044 for ; Tue, 23 Sep 2008 21:10:04 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m8NJA1Vt021881 for ; Tue, 23 Sep 2008 21:10:01 +0200 Content-Disposition: inline In-Reply-To: <48D919A8.8040409@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Sep 23, 2008 at 11:30:32AM -0500, Anthony Liguori wrote: > >> + + (addr - r_access->e_physbase); >> + >> + if (r_access->debug & DEVICE_ASSIGNMENT_DEBUG_PIO) { >> + fprintf(stderr, "%s: r_pio=%08x e_physbase=%08x" >> + " r_virtbase=%08lx value=%08x\n", >> + __func__, r_pio, (int)r_access->e_physbase, >> + (unsigned long)r_access->r_virtbase, value); >> + } >> + iopl(3); >> + outb(value, r_pio); >> > > The formatting is wrong for this entire file. Also, you shouldn't > have device specific debug. Should probably error check iopl(3). > It's not necessary to call it every time you do an outb, just once > when initialized. We tried that at first, but ran into cases where even after iopl() ran, pio's from qemu still failed. Does qemu do anything to drop iopl() privileges? In any case calling iopl() unconditionally on every pio fixed it, but is obviously not the right long-term solution. Cheers, Muli -- The First Workshop on I/O Virtualization (WIOV '08) Dec 2008, San Diego, CA, http://www.usenix.org/wiov08/ xxx SYSTOR 2009---The Israeli Experimental Systems Conference http://www.haifa.il.ibm.com/conferences/systor2009/