From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v4] device-assignment: Use PCI I/O port sysfs resource file when available Date: Tue, 27 Jul 2010 17:37:44 -0300 Message-ID: <20100727203744.GA31991@amt.cnet> References: <20100721142128.3466.1430.stgit@localhost6.localdomain6> <20100723214454.21633.93017.stgit@localhost6.localdomain6> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, ddutile@redhat.com, chrisw@redhat.com To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34255 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655Ab0G0VWq (ORCPT ); Tue, 27 Jul 2010 17:22:46 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6RLMkxC019352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 27 Jul 2010 17:22:46 -0400 Content-Disposition: inline In-Reply-To: <20100723214454.21633.93017.stgit@localhost6.localdomain6> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jul 23, 2010 at 03:47:18PM -0600, Alex Williamson wrote: > When supported by the host kernel, we can use read/write on the > PCI sysfs resource file for I/O port regions. This allows us to > avoid raw in/out commands and works with deprivileged guests via > libvirt. > > Signed-off-by: Alex Williamson > --- > > Required kernel patch pending here: > http://www.spinics.net/lists/linux-pci/msg09389.html > > v4: Remove commit sentence about uid since we removed the code > in v2. Identical patch to v3. Also note preliminary > agreement to include kerenl patch: > http://www.spinics.net/lists/linux-pci/msg09412.html > > v3: Fixup sysfs errno checking, anything except EINVAL should fall > back to in/out. This covers things like EPERM on the resource > file too. > > v2: Drop getuid() since it doesn't guarantee permissions > Don't use in/out as a fallback since we don't have permissions > Consolidate ioport read/write functions > > hw/device-assignment.c | 201 +++++++++++++++++++++++++++--------------------- > hw/device-assignment.h | 1 > 2 files changed, 116 insertions(+), 86 deletions(-) Applied, thanks.