Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com, mst@redhat.com,
	agordeev@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 05/10] x86: move x86/pci to the common lib
Date: Mon, 18 Jan 2016 14:59:02 +0100	[thread overview]
Message-ID: <20160118135902.GE4075@hawk.localdomain> (raw)
In-Reply-To: <20160115215708.GB11566@potion.brq.redhat.com>

On Fri, Jan 15, 2016 at 10:57:09PM +0100, Radim Krčmář wrote:
> 2016-01-15 17:51+0100, Andrew Jones:
> > Also move pci_config_read into asm/pci.h
> > 
> > Signed-off-by: Andrew Jones <drjones@redhat.com>
> > ---
> > +++ b/lib/asm-generic/pci.h
> > @@ -0,0 +1,4 @@
> > +#ifndef _ASM_GENERIC_PCI_H_
> > +#define _ASM_GENERIC_PCI_H_
> > +#error need architecture specific asm/pci.h
> > +#endif
> > +++ b/lib/x86/asm/pci.h
> > @@ -0,0 +1,19 @@
> > +#ifndef ASM_PCI_H
> > +#define ASM_PCI_H
> > +/*
> > + * Copyright (C) 2013, Red Hat Inc, Michael S. Tsirkin <mst@redhat.com>
> > + *
> > + * This work is licensed under the terms of the GNU LGPL, version 2.
> > + */
> > +#include "libcflat.h"
> > +#include "pci.h"
> > +#include "asm/io.h"
> > +
> > +static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t reg)
> > +{
> > +    uint32_t index = reg | (dev << 8) | (0x1 << 31);
> > +    outl(index, 0xCF8);
> > +    return inl(0xCFC);
> 
> Hm, why can't this be generalized with [1/10]?

0xcf8 and 0xcfc are special x86 ports. Other architectures need to do
other things.

> 
> Thanks.
> 
> > +}
> > +
> > +#endif
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-01-18 13:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 16:51 [kvm-unit-tests PATCH v2 00/10] share pci-testdev with the framework Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 01/10] asm-generic: add portio accessors to io.h Andrew Jones
2016-01-15 21:34   ` Radim Krčmář
2016-01-18 13:52     ` Andrew Jones
2016-01-18 16:40       ` Radim Krčmář
2016-01-18 17:02         ` Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 02/10] x86: move io.h to asm Andrew Jones
2016-01-15 21:39   ` Radim Krčmář
2016-01-18 13:55     ` Andrew Jones
2016-01-18 16:43       ` Radim Krčmář
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 03/10] x86: use common portio accessors from io.h Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 04/10] x86: pci.h: remove useless include Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 05/10] x86: move x86/pci to the common lib Andrew Jones
2016-01-15 21:57   ` Radim Krčmář
2016-01-18 13:59     ` Andrew Jones [this message]
2016-01-18 16:46       ` Radim Krčmář
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 06/10] x86: share pci-testdev hdr in " Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 07/10] lib/pci: make PCIDEVADDR_INVALID truly invalid Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 08/10] lib: add linux dir for kernel uapi headers Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 09/10] Revert "arm/arm64: import include/uapi/linux/psci.h" Andrew Jones
2016-01-15 16:51 ` [kvm-unit-tests PATCH v2 10/10] lib/linux: import pci_regs.h Andrew Jones
2016-01-15 21:57 ` [kvm-unit-tests PATCH v2 00/10] share pci-testdev with the framework Radim Krčmář
2016-01-18 14:01   ` Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160118135902.GE4075@hawk.localdomain \
    --to=drjones@redhat.com \
    --cc=agordeev@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox