Re: [PATCH v9 2/2] arm64: boot: Support Flat Image Tree

2023-12-28 Thread Simon Glass
Hi Masahiro, On Thu, Dec 14, 2023 at 7:34 AM Masahiro Yamada wrote: > > On Thu, Dec 14, 2023 at 3:12 PM Masahiro Yamada wrote: > > > > On Thu, Dec 14, 2023 at 1:03 PM Chen-Yu Tsai wrote: > > > > > > On Sun, Dec 10, 2023 at 1:31 AM Geert Uytterhoeven > > > wrote: > > > > > > > > Hi Laurent, >

[PATCH v8 14/20] virt: geniezone: Add demand paging support

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" This page fault handler helps GenieZone hypervisor to do demand paging. On a lower level translation fault, GenieZone hypervisor will first check the fault GPA (guest physical address or IPA in ARM) is valid e.g. within the registered memory region, then it will setup the v

[PATCH v8 11/20] virt: geniezone: Add ioeventfd support

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" Ioeventfd leverages eventfd to provide asynchronous notification mechanism for VMM. VMM can register a mmio address and bind with an eventfd. Once a mmio trap occurs on this registered region, its corresponding eventfd will be notified. Signed-off-by: Yingshiuan Pan Signe

[PATCH v8 07/20] virt: geniezone: Optimize performance of protected VM memory

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" The memory protection mechanism performs better with batch operations on memory pages. To leverage this, we pre-allocate memory for VMs that are set to protected mode. As a result, the memory protection mechanism can proactively protect the pre-allocated memory in advance t

[PATCH v8 20/20] virt: geniezone: Enable PTP for synchronizing time between host and guest VMs

2023-12-28 Thread Yi-De Wu
From: "Kevenny Hsieh" Enabled Precision Time Protocol (PTP) for improved host-guest VM time synchronization, optimizing operations needing precise clock sync in virtual environment. Signed-off-by: Kevenny Hsieh Signed-off-by: Liju Chen Signed-off-by: Yi-De Wu --- arch/arm64/geniezone/Makefil

[PATCH v8 18/20] virt: geniezone: Provide individual VM memory statistics within debugfs

2023-12-28 Thread Yi-De Wu
From: "Jerry Wang" Created a dedicated per-VM debugfs folder under gzvm, providing user-level programs with easy access to per-VM memory statistics for debugging and profiling purposes. This enables users to effectively analyze and optimize the memory usage of individual virtual machines. Two ty

[PATCH v8 10/20] virt: geniezone: Add irqfd support

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" irqfd enables other threads than vcpu threads to inject virtual interrupt through irqfd asynchronously rather through ioctl interface. This interface is necessary for VMM which creates separated thread for IO handling or uses vhost devices. Reported-by: kernel test robot

[PATCH v8 00/20] GenieZone hypervisor drivers

2023-12-28 Thread Yi-De Wu
This series is based on linux-next, tag: next-20231222. GenieZone hypervisor(gzvm) is a type-1 hypervisor that supports various virtual machine types and provides security features such as TEE-like scenarios and secure boot. It can create guest VMs for security use cases and has virtualization cap

[PATCH v8 08/20] virt: geniezone: Add vcpu support

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" VMM use this interface to create vcpu instance which is a fd, and this fd will be for any vcpu operations, such as setting vcpu registers and accepts the most important ioctl GZVM_VCPU_RUN which requests GenieZone hypervisor to do context switch to execute VM's vcpu context

[PATCH v8 04/20] virt: geniezone: Add vm support

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" The VM component is responsible for setting up the capability and memory management for the protected VMs. The capability is mainly about the lifecycle control and boot context initialization. Signed-off-by: Yingshiuan Pan Signed-off-by: Jerry Wang Signed-off-by: Liju Ch

[PATCH v8 13/20] virt: geniezone: Add dtb config support

2023-12-28 Thread Yi-De Wu
From: "Jerry Wang" Hypervisor might need to know the accurate address and size of dtb passed from userspace. And then hypervisor would parse the dtb and get vm information. Signed-off-by: Jerry Wang Signed-off-by: Liju-clr Chen Signed-off-by: Yi-De Wu --- arch/arm64/geniezone/gzvm_arch_commo

[PATCH v8 05/20] virt: geniezone: Add set_user_memory_region for vm

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" Direct use of physical memory from VMs is forbidden and designed to be dictated to the privilege models managed by GenieZone hypervisor for security reason. With the help of gzvm-ko, the hypervisor would be able to manipulate memory as objects. And the memory management is

[PATCH v8 06/20] virt: geniezone: Add vm capability check

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" Inquire the `capability support` on GenieZone hypervisor. Example: `GZVM_CAP_PROTECTED_VM` or `GZVM_CAP_VM_GPA_SIZE`. Signed-off-by: Yingshiuan Pan Signed-off-by: Jerry Wang Signed-off-by: kevenny hsieh Signed-off-by: Liju Chen Signed-off-by: Yi-De Wu --- arch/arm64/

[PATCH v8 15/20] virt: geniezone: Add block-based demand paging support

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" To balance memory usage and performance, GenieZone supports larger granularity demand paging, called block-based demand paging. Gzvm driver uses enable_cap to query the hypervisor if it supports block-based demand paging and the given granularity or not. Meanwhile, the gzvm

[PATCH v8 03/20] virt: geniezone: Add GenieZone hypervisor driver

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" GenieZone hypervisor(gzvm) is a type-1 hypervisor that supports various virtual machine types and provides security features such as TEE-like scenarios and secure boot. It can create guest VMs for security use cases and has virtualization capabilities for both platform and

[PATCH v8 09/20] virt: geniezone: Add irqchip support for virtual interrupt injection

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" Enable GenieZone to handle virtual interrupt injection request. Signed-off-by: Yingshiuan Pan Signed-off-by: kevenny hsieh Signed-off-by: Liju Chen Signed-off-by: Yi-De Wu --- arch/arm64/geniezone/Makefile | 2 +- arch/arm64/geniezone/gzvm_arch_common.h |

[PATCH v8 19/20] virt: geniezone: Add tracing support for hyp call and vcpu exit_reason

2023-12-28 Thread Yi-De Wu
Add tracepoints for hypervisor calls and VCPU exit reasons in GenieZone driver. It aids performance debugging by providing more information about hypervisor operations and VCPU behavior. Command Usage: echo geniezone:* >> /sys/kernel/tracing/set_event echo 1 > /sys/kernel/tracing/tracing_on echo 0

[PATCH v8 16/20] virt: geniezone: Add memory pin/unpin support

2023-12-28 Thread Yi-De Wu
From: "Jerry Wang" Protected VM's memory cannot be swapped out because the memory pages are protected from host access. Once host accesses to those protected pages, the hardware exception is triggered and may crash the host. So, we have to make those protected pages be ineligible for swapping or

[PATCH v8 01/20] docs: geniezone: Introduce GenieZone hypervisor

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" GenieZone is MediaTek proprietary hypervisor solution, and it is running in EL2 stand alone as a type-I hypervisor. It is a pure EL2 implementation which implies it does not rely any specific host VM, and this behavior improves GenieZone's security as it limits its interfac

[PATCH v8 17/20] virt: geniezone: Add memory relinquish support

2023-12-28 Thread Yi-De Wu
From: "Jerry Wang" Unpin the pages when VM relinquish the pages or is destroyed. Signed-off-by: Jerry Wang Signed-off-by: Yingshiuan Pan Signed-off-by: Liju-Clr Chen Signed-off-by: Yi-De Wu --- drivers/virt/geniezone/gzvm_exception.c | 23 +++ drivers/virt/geniezone/gzvm_mmu.c

[PATCH v8 12/20] virt: geniezone: Add memory region support

2023-12-28 Thread Yi-De Wu
From: "Jerry Wang" Hypervisor might need to know the precise purpose of each memory region, so that it can provide specific memory protection. We add a new uapi to pass address and size of a memory region and its purpose. Signed-off-by: Jerry Wang Signed-off-by: Liju-clr Chen Signed-off-by: Yi

[PATCH v8 02/20] dt-bindings: hypervisor: Add MediaTek GenieZone hypervisor

2023-12-28 Thread Yi-De Wu
From: "Yingshiuan Pan" Add documentation for GenieZone(gzvm) node. This node informs gzvm driver to start probing if geniezone hypervisor is available and able to do virtual machine operations. [Reason to use dt solution] - The GenieZone hypervisor serves as a vendor model for facilitating platf