All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/21] Drivers for gunyah hypervisor
@ 2022-10-26 18:58 ` Elliot Berman
  0 siblings, 0 replies; 135+ messages in thread
From: Elliot Berman @ 2022-10-26 18:58 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Elliot Berman, Murali Nalajala, Trilok Soni, Srivatsa Vaddagiri,
	Carl van Schaik, Prakruthi Deepak Heragu, Andy Gross,
	Dmitry Baryshkov, Jassi Brar, linux-arm-kernel, Mark Rutland,
	Lorenzo Pieralisi, Sudeep Holla, Marc Zyngier, Rob Herring,
	Krzysztof Kozlowski, Jonathan Corbet, Will Deacon,
	Catalin Marinas, Arnd Bergmann, Greg Kroah-Hartman,
	Srinivas Kandagatla, Amol Maheshwari, Kalle Valo, devicetree,
	linux-doc, linux-arm-msm, linux-kernel

Gunyah is a Type-1 hypervisor independent of any
high-level OS kernel, and runs in a higher CPU privilege level. It does
not depend on any lower-privileged OS kernel/code for its core
functionality. This increases its security and can support a much smaller
trusted computing base than a Type-2 hypervisor.

Gunyah is an open source hypervisor. The source repo is available at
https://github.com/quic/gunyah-hypervisor.

The diagram below shows the architecture.

::

         VM A                    VM B
     +-----+ +-----+  | +-----+ +-----+ +-----+
     |     | |     |  | |     | |     | |     |
 EL0 | APP | | APP |  | | APP | | APP | | APP |
     |     | |     |  | |     | |     | |     |
     +-----+ +-----+  | +-----+ +-----+ +-----+
 ---------------------|-------------------------
     +--------------+ | +----------------------+
     |              | | |                      |
 EL1 | Linux Kernel | | |Linux kernel/Other OS |   ...
     |              | | |                      |
     +--------------+ | +----------------------+
 --------hvc/smc------|------hvc/smc------------
     +----------------------------------------+
     |                                        |
 EL2 |            Gunyah Hypervisor           |
     |                                        |
     +----------------------------------------+

Gunyah provides these following features.

- Threads and Scheduling: The scheduler schedules virtual CPUs (VCPUs) on
physical CPUs and enables time-sharing of the CPUs.
- Memory Management: Gunyah tracks memory ownership and use of all memory
under its control. Memory partitioning between VMs is a fundamental
security feature.
- Interrupt Virtualization: All interrupts are handled in the hypervisor
and routed to the assigned VM.
- Inter-VM Communication: There are several different mechanisms provided
for communicating between VMs.
- Device Virtualization: Para-virtualization of devices is supported using
inter-VM communication. Low level system features and devices such as
interrupt controllers are supported with emulation where required.

This series adds the basic framework for detecting that Linux is running
under Gunyah as a virtual machine, communication with the Gunyah Resource
Manager, and a basic virtual machine manager capable of launching virtual
machines. In a future series, I'll add more functionality to the VM Manager,
but functionality is kept limited here to reduce the number of patches to
review.

Changes in v6:
 - *Replace gunyah-console with gunyah VM Manager*
 - Move include/asm-generic/gunyah.h into include/linux/gunyah.h
 - s/gunyah_msgq/gh_msgq/
 - Minor tweaks and documentation tidying based on comments from Jiri, Greg, Arnd, Dmitry, and Bagas.

Changes in v5: https://lore.kernel.org/all/20221011000840.289033-1-quic_eberman@quicinc.com/
 - Dropped sysfs nodes
 - Switch from aux bus to Gunyah RM bus for the subdevices
 - Cleaning up RM console

Changes in v4: https://lore.kernel.org/all/20220928195633.2348848-1-quic_eberman@quicinc.com/
 - Tidied up documentation throughout based on questions/feedback received
 - Switched message queue implementation to use mailboxes
 - Renamed "gunyah_device" as "gunyah_resource"

Changes in v3: https://lore.kernel.org/all/20220811214107.1074343-1-quic_eberman@quicinc.com/
 - /Maintained/Supported/ in MAINTAINERS
 - Tidied up documentation throughout based on questions/feedback received
 - Moved hypercalls into arch/arm64/gunyah/; following hyper-v's implementation
 - Drop opaque typedefs
 - Move sysfs nodes under /sys/hypervisor/gunyah/
 - Moved Gunyah console driver to drivers/tty/
 - Reworked gunyah_device design to drop the Gunyah bus.

Changes in v2: https://lore.kernel.org/all/20220801211240.597859-1-quic_eberman@quicinc.com/
 - DT bindings clean up
 - Switch hypercalls to follow SMCCC 

v1: https://lore.kernel.org/all/20220223233729.1571114-1-quic_eberman@quicinc.com/

Elliot Berman (21):
  docs: gunyah: Introduce Gunyah Hypervisor
  dt-bindings: Add binding for gunyah hypervisor
  gunyah: Common types and error codes for Gunyah hypercalls
  arm64: smccc: Include alternative-macros.h
  virt: gunyah: Add hypercalls to identify Gunyah
  virt: gunyah: Identify hypervisor version
  mailbox: Allow direct registration to a channel
  virt: gunyah: msgq: Add hypercalls to send and receive messages
  mailbox: Add Gunyah message queue mailbox
  gunyah: rsc_mgr: Add resource manager RPC core
  gunyah: rsc_mgr: Add subdevices bus
  gunyah: rsc_mgr: Add VM lifecycle RPC
  gunyah: vm_mgr: Introduce basic VM Manager
  gunyah: rsc_mgr: Add RPC for sharing memory
  gunyah: vm_mgr: Add/remove user memory regions
  gunyah: vm_mgr: Add ioctls to support basic non-proxy VM boot
  samples: Add sample userspace Gunyah VM Manager
  gunyah: rsc_mgr: Add platform ops on mem_lend/mem_reclaim
  firmware: qcom_scm: Use fixed width src vm bitmap
  firmware: qcom_scm: Register Gunyah platform ops
  docs: gunyah: Document Gunyah VM Manager

 .../bindings/firmware/gunyah-hypervisor.yaml  |  86 +++
 .../userspace-api/ioctl/ioctl-number.rst      |   1 +
 Documentation/virt/gunyah/index.rst           | 115 +++
 Documentation/virt/gunyah/message-queue.rst   |  63 ++
 Documentation/virt/gunyah/vm-manager.rst      |  94 +++
 Documentation/virt/index.rst                  |   1 +
 MAINTAINERS                                   |  13 +
 arch/arm64/Kbuild                             |   1 +
 arch/arm64/gunyah/Makefile                    |   1 +
 arch/arm64/gunyah/gunyah_hypercall.c          | 102 +++
 arch/arm64/include/uapi/asm/gunyah.h          |  17 +
 drivers/firmware/qcom_scm.c                   | 126 +++-
 drivers/mailbox/Kconfig                       |  10 +
 drivers/mailbox/Makefile                      |   2 +
 drivers/mailbox/gunyah-msgq.c                 | 225 ++++++
 drivers/mailbox/mailbox.c                     |  96 ++-
 drivers/misc/fastrpc.c                        |   6 +-
 drivers/net/wireless/ath/ath10k/qmi.c         |   4 +-
 drivers/remoteproc/qcom_q6v5_mss.c            |   8 +-
 drivers/soc/qcom/rmtfs_mem.c                  |   2 +-
 drivers/virt/Kconfig                          |   1 +
 drivers/virt/Makefile                         |   1 +
 drivers/virt/gunyah/Kconfig                   |  35 +
 drivers/virt/gunyah/Makefile                  |   7 +
 drivers/virt/gunyah/gunyah.c                  |  46 ++
 drivers/virt/gunyah/rsc_mgr.c                 | 690 ++++++++++++++++++
 drivers/virt/gunyah/rsc_mgr.h                 | 146 ++++
 drivers/virt/gunyah/rsc_mgr_bus.c             |  83 +++
 drivers/virt/gunyah/rsc_mgr_rpc.c             | 475 ++++++++++++
 drivers/virt/gunyah/vm_mgr.c                  | 288 ++++++++
 drivers/virt/gunyah/vm_mgr.h                  |  52 ++
 drivers/virt/gunyah/vm_mgr_mm.c               | 245 +++++++
 include/linux/arm-smccc.h                     |   1 +
 include/linux/gunyah.h                        | 167 +++++
 include/linux/gunyah_rsc_mgr.h                | 161 ++++
 include/linux/mailbox_client.h                |   1 +
 include/linux/mod_devicetable.h               |   8 +
 include/linux/qcom_scm.h                      |   2 +-
 include/uapi/linux/gunyah.h                   |  53 ++
 samples/Kconfig                               |  10 +
 samples/Makefile                              |   1 +
 samples/gunyah/.gitignore                     |   2 +
 samples/gunyah/Makefile                       |   6 +
 samples/gunyah/gunyah_vmm.c                   | 270 +++++++
 samples/gunyah/sample_vm.dts                  |  69 ++
 scripts/mod/devicetable-offsets.c             |   3 +
 scripts/mod/file2alias.c                      |  10 +
 47 files changed, 3763 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml
 create mode 100644 Documentation/virt/gunyah/index.rst
 create mode 100644 Documentation/virt/gunyah/message-queue.rst
 create mode 100644 Documentation/virt/gunyah/vm-manager.rst
 create mode 100644 arch/arm64/gunyah/Makefile
 create mode 100644 arch/arm64/gunyah/gunyah_hypercall.c
 create mode 100644 arch/arm64/include/uapi/asm/gunyah.h
 create mode 100644 drivers/mailbox/gunyah-msgq.c
 create mode 100644 drivers/virt/gunyah/Kconfig
 create mode 100644 drivers/virt/gunyah/Makefile
 create mode 100644 drivers/virt/gunyah/gunyah.c
 create mode 100644 drivers/virt/gunyah/rsc_mgr.c
 create mode 100644 drivers/virt/gunyah/rsc_mgr.h
 create mode 100644 drivers/virt/gunyah/rsc_mgr_bus.c
 create mode 100644 drivers/virt/gunyah/rsc_mgr_rpc.c
 create mode 100644 drivers/virt/gunyah/vm_mgr.c
 create mode 100644 drivers/virt/gunyah/vm_mgr.h
 create mode 100644 drivers/virt/gunyah/vm_mgr_mm.c
 create mode 100644 include/linux/gunyah.h
 create mode 100644 include/linux/gunyah_rsc_mgr.h
 create mode 100644 include/uapi/linux/gunyah.h
 create mode 100644 samples/gunyah/.gitignore
 create mode 100644 samples/gunyah/Makefile
 create mode 100644 samples/gunyah/gunyah_vmm.c
 create mode 100644 samples/gunyah/sample_vm.dts


base-commit: 247f34f7b80357943234f93f247a1ae6b6c3a740
-- 
2.25.1


^ permalink raw reply	[flat|nested] 135+ messages in thread

end of thread, other threads:[~2022-11-11 17:10 UTC | newest]

Thread overview: 135+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 18:58 [PATCH v6 00/21] Drivers for gunyah hypervisor Elliot Berman
2022-10-26 18:58 ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 01/21] docs: gunyah: Introduce Gunyah Hypervisor Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-11-02 12:35   ` Bagas Sanjaya
2022-11-02 12:35     ` Bagas Sanjaya
2022-10-26 18:58 ` [PATCH v6 02/21] dt-bindings: Add binding for gunyah hypervisor Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-27 19:57   ` Krzysztof Kozlowski
2022-10-27 19:57     ` Krzysztof Kozlowski
2022-10-28  2:33   ` Jassi Brar
2022-10-28  2:33     ` Jassi Brar
2022-11-01  3:19     ` Elliot Berman
2022-11-01  3:19       ` Elliot Berman
2022-11-01 16:23       ` Jassi Brar
2022-11-01 16:23         ` Jassi Brar
2022-11-01 20:35         ` Elliot Berman
2022-11-01 20:35           ` Elliot Berman
2022-11-01 21:58           ` Jassi Brar
2022-11-01 21:58             ` Jassi Brar
2022-11-02  0:12             ` Elliot Berman
2022-11-02  0:12               ` Elliot Berman
2022-11-02  2:01               ` Jassi Brar
2022-11-02  2:01                 ` Jassi Brar
2022-11-02 18:05                 ` Elliot Berman
2022-11-02 18:05                   ` Elliot Berman
2022-11-02 18:24                   ` Jassi Brar
2022-11-02 18:24                     ` Jassi Brar
2022-11-02 23:23                     ` Elliot Berman
2022-11-02 23:23                       ` Elliot Berman
2022-11-03  3:21                       ` Jassi Brar
2022-11-03  3:21                         ` Jassi Brar
2022-11-03 19:45                         ` Elliot Berman
2022-11-03 19:45                           ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 03/21] gunyah: Common types and error codes for Gunyah hypercalls Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 19:47   ` Dmitry Baryshkov
2022-10-26 19:47     ` Dmitry Baryshkov
2022-10-26 18:58 ` [PATCH v6 04/21] arm64: smccc: Include alternative-macros.h Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 19:46   ` Dmitry Baryshkov
2022-10-26 19:46     ` Dmitry Baryshkov
2022-10-26 20:23     ` Elliot Berman
2022-10-26 20:23       ` Elliot Berman
2022-10-26 20:39       ` Dmitry Baryshkov
2022-10-26 20:39         ` Dmitry Baryshkov
2022-10-26 18:58 ` [PATCH v6 05/21] virt: gunyah: Add hypercalls to identify Gunyah Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 06/21] virt: gunyah: Identify hypervisor version Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 07/21] mailbox: Allow direct registration to a channel Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 08/21] virt: gunyah: msgq: Add hypercalls to send and receive messages Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 09/21] mailbox: Add Gunyah message queue mailbox Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-27 13:55   ` Pavan Kondeti
2022-10-27 13:55     ` Pavan Kondeti
2022-11-01 17:44     ` Elliot Berman
2022-11-01 17:44       ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 10/21] gunyah: rsc_mgr: Add resource manager RPC core Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-11-01 18:02   ` Greg Kroah-Hartman
2022-11-01 18:02     ` Greg Kroah-Hartman
2022-11-02  0:12     ` Elliot Berman
2022-11-02  0:12       ` Elliot Berman
2022-11-02  2:53       ` Greg Kroah-Hartman
2022-11-02  2:53         ` Greg Kroah-Hartman
2022-11-02 18:04         ` Elliot Berman
2022-11-02 18:04           ` Elliot Berman
2022-11-03  0:22           ` Greg Kroah-Hartman
2022-11-03  0:22             ` Greg Kroah-Hartman
2022-11-03 22:07             ` Elliot Berman
2022-11-03 22:07               ` Elliot Berman
2022-11-03 22:09             ` Elliot Berman
2022-11-03 22:09               ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 11/21] gunyah: rsc_mgr: Add subdevices bus Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 12/21] gunyah: rsc_mgr: Add VM lifecycle RPC Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 13/21] gunyah: vm_mgr: Introduce basic VM Manager Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-11-02  5:14   ` Greg Kroah-Hartman
2022-11-02  5:14     ` Greg Kroah-Hartman
2022-11-02 18:45     ` Elliot Berman
2022-11-02 18:45       ` Elliot Berman
2022-11-03  0:24       ` Greg Kroah-Hartman
2022-11-03  0:24         ` Greg Kroah-Hartman
2022-11-04  0:11         ` Elliot Berman
2022-11-04  0:11           ` Elliot Berman
2022-11-04  8:10           ` Arnd Bergmann
2022-11-04  8:10             ` Arnd Bergmann
2022-11-04 22:38             ` Elliot Berman
2022-11-04 22:38               ` Elliot Berman
2022-11-05  4:19               ` Trilok Soni
2022-11-05  4:19                 ` Trilok Soni
2022-11-11  0:03                 ` Elliot Berman
2022-11-11  0:03                   ` Elliot Berman
2022-11-11  6:24                   ` Greg Kroah-Hartman
2022-11-11  6:24                     ` Greg Kroah-Hartman
2022-11-11 17:08                     ` Elliot Berman
2022-11-11 17:08                       ` Elliot Berman
2022-11-02  7:31   ` Arnd Bergmann
2022-11-02  7:31     ` Arnd Bergmann
2022-11-02 18:44     ` Elliot Berman
2022-11-02 18:44       ` Elliot Berman
2022-11-03  0:20       ` Greg Kroah-Hartman
2022-11-03  0:20         ` Greg Kroah-Hartman
2022-11-03 22:33         ` Elliot Berman
2022-11-03 22:33           ` Elliot Berman
2022-11-03  9:39       ` Arnd Bergmann
2022-11-03  9:39         ` Arnd Bergmann
2022-11-03 22:10         ` Elliot Berman
2022-11-03 22:10           ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 14/21] gunyah: rsc_mgr: Add RPC for sharing memory Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 15/21] gunyah: vm_mgr: Add/remove user memory regions Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 16/21] gunyah: vm_mgr: Add ioctls to support basic non-proxy VM boot Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 17/21] samples: Add sample userspace Gunyah VM Manager Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 18/21] gunyah: rsc_mgr: Add platform ops on mem_lend/mem_reclaim Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 19/21] firmware: qcom_scm: Use fixed width src vm bitmap Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 18:58 ` [PATCH v6 20/21] firmware: qcom_scm: Register Gunyah platform ops Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-10-26 21:32   ` kernel test robot
2022-10-26 18:58 ` [PATCH v6 21/21] docs: gunyah: Document Gunyah VM Manager Elliot Berman
2022-10-26 18:58   ` Elliot Berman
2022-11-02 13:05   ` Bagas Sanjaya
2022-11-02 13:05     ` Bagas Sanjaya
2022-11-02 18:04     ` Elliot Berman
2022-11-02 18:04       ` Elliot Berman

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.