linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Rui Wang <ruiv.wang@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>,
	chaohong.guo@intel.com, Chen Gong <gong.chen@linux.intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rui Wang <rui.y.wang@intel.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [RFC 0/3] IO Hook: Method for emulating h/w events
Date: Fri, 26 Jul 2013 13:38:53 -0600	[thread overview]
Message-ID: <CAErSpo653opkF_ROupSOYoP21LGwm023430Pyj_thbFeDXRq9w@mail.gmail.com> (raw)
In-Reply-To: <1374821475-3196-1-git-send-email-rui.y.wang@intel.com>

[+cc linux-acpi]

On Fri, Jul 26, 2013 at 12:51 AM, Rui Wang <ruiv.wang@gmail.com> wrote:
> Hi Bjorn,
>
> This was originally the method I used to test hotplug on Intel SDV machines
> which are not capable of doing hotplug. I would like to present it here in
> case it interests the community, then it can be made available to a wider
> range of developers who are working on hotplug.
>
> I used it to generate desired ACPI events, PCI interrupts, and more. So
> things like CPU hotplug, IOH hotplug, memory hotplug, PCI native hotplug,
> PCI AER injection can be emulated and tested easily.
>
> The best thing is that, it doesn't require any modification to those drivers
> involved. It works with whatever hardware events that the user can imagine.
> Further development in user-space using scripts may help simplify the usage
> model and add more software-defined logic on hardware.
>
> Because it modifies the heart of all h/w access functions, I used Jump Label
> to reduce the performance penalty to effectively zero.

This is a cool idea.

I don't know if you want to merge this upstream, or if it's just a "I
found this useful; here it is in case it's useful to you" sort of
thing.  So the comments below are only relevant if you want to try to
merge it upstream.

I wouldn't really want all the gunk in drivers/pci/access.c.  Most of
it isn't related to PCI, and some of it is even x86-specific.  It'd be
nicer if you could factor it out so just the generic PCI-related
things go in drivers/pci.

It appears to be implemented only for x86.  The MMIO & I/O port parts
are x86-specific, but the PCI config stuff should work on any arch.

I don't know whether it's worth supporting as a module.  It seems like
a development aid where building in statically would probably be fine.
 If it didn't have to work as a module, you wouldn't have to export
any symbols.

> I tested the performance by repeatedly running lspci, which calls into the
> pci access functions. There's no added overhead observed.
>
> Regards,
> Rui Wang
> Intel Open Source Technology Center
>
> Rui Wang (3):
>   IO Hook: core functions and Register Override
>   IO Hook: kernel interface to manage the hook
>   IO Hook: sysfs interface to emulate h/w events
>
>  Documentation/PCI/iohook.txt      |  290 +++++++++++++++++
>  arch/x86/Kconfig                  |    7 +
>  arch/x86/boot/compressed/Makefile |    1 +
>  arch/x86/include/asm/io.h         |   58 ++++-
>  arch/x86/vdso/Makefile            |    2 +
>  drivers/misc/Kconfig              |    1 +
>  drivers/misc/Makefile             |    1 +
>  drivers/misc/iohook/Kconfig       |    5 +
>  drivers/misc/iohook/Makefile      |    1 +
>  drivers/misc/iohook/iohook.c      |  503 +++++++++++++++++++++++++++++
>  drivers/pci/access.c              |  630 +++++++++++++++++++++++++++++++++++++
>  include/linux/reg_ovrd.h          |   55 ++++
>  12 files changed, 1552 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/PCI/iohook.txt
>  create mode 100644 drivers/misc/iohook/Kconfig
>  create mode 100644 drivers/misc/iohook/Makefile
>  create mode 100644 drivers/misc/iohook/iohook.c
>  create mode 100644 include/linux/reg_ovrd.h
>
> --
> 1.7.5.4
>

  parent reply	other threads:[~2013-07-26 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26  6:51 [RFC 0/3] IO Hook: Method for emulating h/w events Rui Wang
2013-07-26  6:51 ` [RFC 1/3] IO Hook: core functions and Register Override Rui Wang
2013-07-26  6:51 ` [RFC 2/3] IO Hook: kernel interface to manage the hook Rui Wang
2013-07-26  6:51 ` [RFC 3/3] IO Hook: sysfs interface to emulate h/w events Rui Wang
2013-07-26 19:38 ` Bjorn Helgaas [this message]
2013-07-27 16:54   ` [RFC 0/3] IO Hook: Method for emulating " rui wang

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=CAErSpo653opkF_ROupSOYoP21LGwm023430Pyj_thbFeDXRq9w@mail.gmail.com \
    --to=bhelgaas@google.com \
    --cc=chaohong.guo@intel.com \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rui.y.wang@intel.com \
    --cc=ruiv.wang@gmail.com \
    --cc=tony.luck@intel.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;
as well as URLs for NNTP newsgroup(s).