All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Baptiste Reynal <b.reynal@virtualopensystems.com>,
	Alex Williamson <alex.williamson@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Alexander Graf <agraf@suse.de>,
	Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	kvm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	qemu-devel@nongnu.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC 0/6] R-Car Gen3 GPIO Pass-Through Prototype (Linux)
Date: Fri,  9 Feb 2018 16:16:47 +0100	[thread overview]
Message-ID: <1518189413-2761-1-git-send-email-geert+renesas@glider.be> (raw)

	Hi all,

This RFC patch series is the Linux side of a GPIO Pass-Through prototype
for Renesas R-Car platforms using vfio-platform.  Together with its
counterpart for QEMU, it provides direct access from a QEMU+KVM guest to
a GPIO controller in an R-Car Gen3 SoC.  This allows the guest to
control the LEDs on a Renesas Salvator-X(S) board.

This patch series is not meant to be upstreamed as-is.  Indeed, for
various reasons (e.g. security, as the different GPIOs on the same GPIO
controller may control different parts of the system) access to GPIOs is
better not implemented using Device Pass-Through, but by
paravirtualization.  Yet, this is still a simple and valuable
proof-of-concept, which can serve as a basis for the future development
of Pass-Through support for more complex platform devices on R-Car Gen3
SoCs.

This patch series consists of two parts:

  1. Patches 1-4 are Linux host patches.

     They provide workarounds for missing virtualization platform
     support (vfio reset, IOMMU group, clock domain), and a defconfig
     update for testing.

     These allow a GPIO controller to be unbound from its host driver,
     and rebound to vfio-platform, for pass-through to a guest:

	echo e6055400.gpio > /sys/bus/platform/drivers/gpio_rcar/unbind
	echo vfio-platform > \
		/sys/bus/platform/devices/e6055400.gpio/driver_override
	echo e6055400.gpio > /sys/bus/platform/drivers/vfio-platform/bind

  2. Patches 5-6 are Linux guest patches.

     They provide workarounds for missing pass-through support (clock,
     interrupt), and a guest defconfig for testing.

     These allow the gpio-rcar driver to bind to a pass-through GPIO
     device, and thus control the LEDs from the guest.

Several questions and TODOs are appended to the individual patches.

Please see https://elinux.org/R-Car/Virtualization/VFIO for full usage
instructions of this prototype.

Thanks for your comments!

Geert Uytterhoeven (6):
  vfio: platform: Allow runtime override of reset_required
  vfio: Ignore real IOMMUs if CONFIG_VFIO_NOIOMMU=y
  clk: renesas: r8a7795: Mark the GPIO6 clock critical
  arm64: renesas_defconfig: Enable VFIO_PLATFORM and VFIO_NOIOMMU
  gpio: rcar: Add virtualization workarounds
  arm64: Add virt_defconfig

 arch/arm64/configs/renesas_defconfig   |   2 +
 arch/arm64/configs/virt_defconfig      | 722 +++++++++++++++++++++++++++++++++
 drivers/clk/renesas/r8a7795-cpg-mssr.c |   1 +
 drivers/gpio/Kconfig                   |   2 +-
 drivers/gpio/gpio-rcar.c               |  28 +-
 drivers/vfio/platform/vfio_platform.c  |   2 +-
 drivers/vfio/vfio.c                    |   6 +-
 7 files changed, 744 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm64/configs/virt_defconfig

-- 
2.7.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Baptiste Reynal <b.reynal@virtualopensystems.com>,
	Alex Williamson <alex.williamson@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Alexander Graf <agraf@suse.de>,
	Magnus Damm <magnus.damm@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	kvm@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	qemu-devel@nongnu.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [Qemu-devel] [PATCH/RFC 0/6] R-Car Gen3 GPIO Pass-Through Prototype (Linux)
Date: Fri,  9 Feb 2018 16:16:47 +0100	[thread overview]
Message-ID: <1518189413-2761-1-git-send-email-geert+renesas@glider.be> (raw)

	Hi all,

This RFC patch series is the Linux side of a GPIO Pass-Through prototype
for Renesas R-Car platforms using vfio-platform.  Together with its
counterpart for QEMU, it provides direct access from a QEMU+KVM guest to
a GPIO controller in an R-Car Gen3 SoC.  This allows the guest to
control the LEDs on a Renesas Salvator-X(S) board.

This patch series is not meant to be upstreamed as-is.  Indeed, for
various reasons (e.g. security, as the different GPIOs on the same GPIO
controller may control different parts of the system) access to GPIOs is
better not implemented using Device Pass-Through, but by
paravirtualization.  Yet, this is still a simple and valuable
proof-of-concept, which can serve as a basis for the future development
of Pass-Through support for more complex platform devices on R-Car Gen3
SoCs.

This patch series consists of two parts:

  1. Patches 1-4 are Linux host patches.

     They provide workarounds for missing virtualization platform
     support (vfio reset, IOMMU group, clock domain), and a defconfig
     update for testing.

     These allow a GPIO controller to be unbound from its host driver,
     and rebound to vfio-platform, for pass-through to a guest:

	echo e6055400.gpio > /sys/bus/platform/drivers/gpio_rcar/unbind
	echo vfio-platform > \
		/sys/bus/platform/devices/e6055400.gpio/driver_override
	echo e6055400.gpio > /sys/bus/platform/drivers/vfio-platform/bind

  2. Patches 5-6 are Linux guest patches.

     They provide workarounds for missing pass-through support (clock,
     interrupt), and a guest defconfig for testing.

     These allow the gpio-rcar driver to bind to a pass-through GPIO
     device, and thus control the LEDs from the guest.

Several questions and TODOs are appended to the individual patches.

Please see https://elinux.org/R-Car/Virtualization/VFIO for full usage
instructions of this prototype.

Thanks for your comments!

Geert Uytterhoeven (6):
  vfio: platform: Allow runtime override of reset_required
  vfio: Ignore real IOMMUs if CONFIG_VFIO_NOIOMMU=y
  clk: renesas: r8a7795: Mark the GPIO6 clock critical
  arm64: renesas_defconfig: Enable VFIO_PLATFORM and VFIO_NOIOMMU
  gpio: rcar: Add virtualization workarounds
  arm64: Add virt_defconfig

 arch/arm64/configs/renesas_defconfig   |   2 +
 arch/arm64/configs/virt_defconfig      | 722 +++++++++++++++++++++++++++++++++
 drivers/clk/renesas/r8a7795-cpg-mssr.c |   1 +
 drivers/gpio/Kconfig                   |   2 +-
 drivers/gpio/gpio-rcar.c               |  28 +-
 drivers/vfio/platform/vfio_platform.c  |   2 +-
 drivers/vfio/vfio.c                    |   6 +-
 7 files changed, 744 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm64/configs/virt_defconfig

-- 
2.7.4

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

             reply	other threads:[~2018-02-09 15:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 15:16 Geert Uytterhoeven [this message]
2018-02-09 15:16 ` [Qemu-devel] [PATCH/RFC 0/6] R-Car Gen3 GPIO Pass-Through Prototype (Linux) Geert Uytterhoeven
2018-02-09 15:16 ` [PATCH/RFC 1/6] vfio: platform: Allow runtime override of reset_required Geert Uytterhoeven
2018-02-09 15:16   ` [Qemu-devel] " Geert Uytterhoeven
2018-02-09 15:16 ` [PATCH/RFC 2/6] vfio: Ignore real IOMMUs if CONFIG_VFIO_NOIOMMU=y Geert Uytterhoeven
2018-02-09 15:16   ` [Qemu-devel] " Geert Uytterhoeven
2018-02-09 15:16 ` [PATCH/RFC 3/6] clk: renesas: r8a7795: Mark the GPIO6 clock critical Geert Uytterhoeven
2018-02-09 15:16   ` [Qemu-devel] " Geert Uytterhoeven
2018-02-09 15:16 ` [PATCH/RFC 4/6] arm64: renesas_defconfig: Enable VFIO_PLATFORM and VFIO_NOIOMMU Geert Uytterhoeven
2018-02-09 15:16   ` [Qemu-devel] " Geert Uytterhoeven
2018-02-09 15:16 ` [PATCH/RFC 5/6] gpio: rcar: Add virtualization workarounds Geert Uytterhoeven
2018-02-09 15:16   ` [Qemu-devel] " Geert Uytterhoeven
2018-02-09 15:16 ` [PATCH/RFC 6/6] arm64: Add virt_defconfig Geert Uytterhoeven
2018-02-09 15:16   ` [Qemu-devel] " Geert Uytterhoeven

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=1518189413-2761-1-git-send-email-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=arnd@arndb.de \
    --cc=b.reynal@virtualopensystems.com \
    --cc=kvm@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.