From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH kvm-unit-tests 09/17] pci: add pci_config_write[wb]() Date: Tue, 8 Nov 2016 01:25:20 +0800 Message-ID: <20161107172520.GH3719@pxdev.xzpeter.org> References: <1477468040-21034-1-git-send-email-peterx@redhat.com> <1477468040-21034-10-git-send-email-peterx@redhat.com> <20161105170649.GB10472@agordeev.lab.eng.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, drjones@redhat.com, rkrcmar@redhat.com, jan.kiszka@web.de, pbonzini@redhat.com To: Alexander Gordeev Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43240 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932314AbcKGRZW (ORCPT ); Mon, 7 Nov 2016 12:25:22 -0500 Content-Disposition: inline In-Reply-To: <20161105170649.GB10472@agordeev.lab.eng.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Nov 05, 2016 at 06:06:49PM +0100, Alexander Gordeev wrote: > On Wed, Oct 26, 2016 at 03:47:12PM +0800, Peter Xu wrote: > > We have writel() for 4 bytes but still missing 2/1 bytes accessors. > > > > Signed-off-by: Peter Xu > > --- > > lib/pci-host-generic.c | 12 ++++++++++++ > > lib/x86/asm/pci.h | 14 ++++++++++++++ > > 2 files changed, 26 insertions(+) > > > > diff --git a/lib/pci-host-generic.c b/lib/pci-host-generic.c > > index be3f9e7..c04e4f5 100644 > > --- a/lib/pci-host-generic.c > > +++ b/lib/pci-host-generic.c > > @@ -291,6 +291,18 @@ u32 pci_config_readl(pcidevaddr_t dev, u8 off) > > return readl(conf + off); > > } > > > > +void pci_config_writeb(pcidevaddr_t dev, u8 off, u8 val) > > +{ > > + void __iomem *conf = pci_get_dev_conf(pci_host_bridge, dev); > > + writeb(val, conf + off); > > +} > > + > > +void pci_config_writew(pcidevaddr_t dev, u8 off, u16 val) > > +{ > > + void __iomem *conf = pci_get_dev_conf(pci_host_bridge, dev); > > + writew(val, conf + off); > > +} > > + > > The two above need to be declared in lib/asm-generic/pci-host-bridge.h Will add them. Thanks, -- peterx