From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH v2 05/10] x86: move x86/pci to the common lib Date: Mon, 18 Jan 2016 17:46:39 +0100 Message-ID: <20160118164638.GB15204@potion.brq.redhat.com> References: <1452876695-9240-1-git-send-email-drjones@redhat.com> <1452876695-9240-6-git-send-email-drjones@redhat.com> <20160115215708.GB11566@potion.brq.redhat.com> <20160118135902.GE4075@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, pbonzini@redhat.com, mst@redhat.com, agordeev@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40381 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755618AbcARQqm (ORCPT ); Mon, 18 Jan 2016 11:46:42 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E74CC8CF4D for ; Mon, 18 Jan 2016 16:46:42 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20160118135902.GE4075@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: 2016-01-18 14:59+0100, Andrew Jones: > On Fri, Jan 15, 2016 at 10:57:09PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: >> 2016-01-15 17:51+0100, Andrew Jones: >>> +++ b/lib/x86/asm/pci.h >>> +static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t r= eg) >>> +{ >>> + uint32_t index =3D reg | (dev << 8) | (0x1 << 31); >>> + outl(index, 0xCF8); >>> + return inl(0xCFC); >>=20 >> Hm, why can't this be generalized with [1/10]? >=20 > 0xcf8 and 0xcfc are special x86 ports. Other architectures need to do > other things. Ok, thanks. If the port space is not standardized, we have even less reasons to share in*/out*.