[PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver

Liju-clr Chen posted 25 patches 1 year, 2 months ago
[PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Liju-clr Chen 1 year, 2 months ago
From: Yingshiuan Pan <yingshiuan.pan@mediatek.com>

GenieZone hypervisor(gzvm) is a type-I 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
interrupt. Although the hypervisor can be booted independently, it
requires the assistance of GenieZone hypervisor kernel driver(gzvm-ko)
to leverage the ability of Linux kernel for vCPU scheduling, memory
management, inter-VM communication and virtio backend support.

Add the basic hypervisor driver. Subsequent patches will add more
supported features to this driver.

Signed-off-by: Yingshiuan Pan <yingshiuan.pan@mediatek.com>
Co-developed-by: Jerry Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Jerry Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Yi-De Wu <yi-de.wu@mediatek.com>
Signed-off-by: Liju Chen <liju-clr.chen@mediatek.com>
---
 MAINTAINERS                             |   3 +
 arch/arm64/Kbuild                       |   1 +
 arch/arm64/geniezone/Makefile           |   9 ++
 arch/arm64/geniezone/gzvm_arch_common.h |  44 +++++++++
 arch/arm64/geniezone/vm.c               |  72 +++++++++++++++
 drivers/virt/Kconfig                    |   2 +
 drivers/virt/geniezone/Kconfig          |  16 ++++
 drivers/virt/geniezone/Makefile         |   9 ++
 drivers/virt/geniezone/gzvm_main.c      | 117 ++++++++++++++++++++++++
 include/linux/soc/mediatek/gzvm_drv.h   |  41 +++++++++
 10 files changed, 314 insertions(+)
 create mode 100644 arch/arm64/geniezone/Makefile
 create mode 100644 arch/arm64/geniezone/gzvm_arch_common.h
 create mode 100644 arch/arm64/geniezone/vm.c
 create mode 100644 drivers/virt/geniezone/Kconfig
 create mode 100644 drivers/virt/geniezone/Makefile
 create mode 100644 drivers/virt/geniezone/gzvm_main.c
 create mode 100644 include/linux/soc/mediatek/gzvm_drv.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 291f46017f3f..708c13103ec5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9677,6 +9677,9 @@ M:	Ze-Yu Wang <ze-yu.wang@mediatek.com>
 M:	Liju Chen <liju-clr.chen@mediatek.com>
 F:	Documentation/devicetree/bindings/firmware/mediatek,geniezone.yaml
 F:	Documentation/virt/geniezone/
+F:	arch/arm64/geniezone/
+F:	drivers/virt/geniezone/
+F:	include/linux/soc/mediatek/gzvm_drv.h
 
 GENWQE (IBM Generic Workqueue Card)
 M:	Frank Haverkamp <haver@linux.ibm.com>
diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild
index 5bfbf7d79c99..0c3cca572919 100644
--- a/arch/arm64/Kbuild
+++ b/arch/arm64/Kbuild
@@ -4,6 +4,7 @@ obj-$(CONFIG_KVM)	+= kvm/
 obj-$(CONFIG_XEN)	+= xen/
 obj-$(subst m,y,$(CONFIG_HYPERV))	+= hyperv/
 obj-$(CONFIG_CRYPTO)	+= crypto/
+obj-$(CONFIG_MTK_GZVM)	+= geniezone/
 
 # for cleaning
 subdir- += boot
diff --git a/arch/arm64/geniezone/Makefile b/arch/arm64/geniezone/Makefile
new file mode 100644
index 000000000000..2957898cdd05
--- /dev/null
+++ b/arch/arm64/geniezone/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Main Makefile for gzvm, this one includes drivers/virt/geniezone/Makefile
+#
+include $(srctree)/drivers/virt/geniezone/Makefile
+
+gzvm-y += vm.o
+
+obj-$(CONFIG_MTK_GZVM) += gzvm.o
diff --git a/arch/arm64/geniezone/gzvm_arch_common.h b/arch/arm64/geniezone/gzvm_arch_common.h
new file mode 100644
index 000000000000..660c7cf3fc18
--- /dev/null
+++ b/arch/arm64/geniezone/gzvm_arch_common.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2023 MediaTek Inc.
+ */
+
+#ifndef __GZVM_ARCH_COMMON_H__
+#define __GZVM_ARCH_COMMON_H__
+
+#include <linux/arm-smccc.h>
+
+enum {
+	GZVM_FUNC_PROBE = 12,
+	NR_GZVM_FUNC,
+};
+
+#define SMC_ENTITY_MTK			59
+#define GZVM_FUNCID_START		(0x1000)
+#define GZVM_HCALL_ID(func)						\
+	ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64,	\
+			   SMC_ENTITY_MTK, (GZVM_FUNCID_START + (func)))
+
+#define MT_HVC_GZVM_PROBE		GZVM_HCALL_ID(GZVM_FUNC_PROBE)
+
+/**
+ * gzvm_hypcall_wrapper() - the wrapper for hvc calls
+ * @a0: argument passed in registers 0
+ * @a1: argument passed in registers 1
+ * @a2: argument passed in registers 2
+ * @a3: argument passed in registers 3
+ * @a4: argument passed in registers 4
+ * @a5: argument passed in registers 5
+ * @a6: argument passed in registers 6
+ * @a7: argument passed in registers 7
+ * @res: result values from registers 0 to 3
+ *
+ * Return: The wrapper helps caller to convert geniezone errno to Linux errno.
+ */
+int gzvm_hypcall_wrapper(unsigned long a0, unsigned long a1,
+			 unsigned long a2, unsigned long a3,
+			 unsigned long a4, unsigned long a5,
+			 unsigned long a6, unsigned long a7,
+			 struct arm_smccc_res *res);
+
+#endif /* __GZVM_ARCH_COMMON_H__ */
diff --git a/arch/arm64/geniezone/vm.c b/arch/arm64/geniezone/vm.c
new file mode 100644
index 000000000000..daad21b28f6f
--- /dev/null
+++ b/arch/arm64/geniezone/vm.c
@@ -0,0 +1,72 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 MediaTek Inc.
+ */
+
+#include <linux/arm-smccc.h>
+#include <linux/err.h>
+#include <linux/uaccess.h>
+
+#include <linux/soc/mediatek/gzvm_drv.h>
+#include "gzvm_arch_common.h"
+
+/**
+ * gzvm_hypcall_wrapper() - the wrapper for hvc calls
+ * @a0: arguments passed in registers 0
+ * @a1: arguments passed in registers 1
+ * @a2: arguments passed in registers 2
+ * @a3: arguments passed in registers 3
+ * @a4: arguments passed in registers 4
+ * @a5: arguments passed in registers 5
+ * @a6: arguments passed in registers 6
+ * @a7: arguments passed in registers 7
+ * @res: result values from registers 0 to 3
+ *
+ * Return: The wrapper helps caller to convert geniezone errno to Linux errno.
+ */
+int gzvm_hypcall_wrapper(unsigned long a0, unsigned long a1,
+			 unsigned long a2, unsigned long a3,
+			 unsigned long a4, unsigned long a5,
+			 unsigned long a6, unsigned long a7,
+			 struct arm_smccc_res *res)
+{
+	struct arm_smccc_1_2_regs res_1_2;
+	struct arm_smccc_1_2_regs args = {
+		.a0 = a0,
+		.a1 = a1,
+		.a2 = a2,
+		.a3 = a3,
+		.a4 = a4,
+		.a5 = a5,
+		.a6 = a6,
+		.a7 = a7,
+	};
+	arm_smccc_1_2_hvc(&args, &res_1_2);
+	res->a0 = res_1_2.a0;
+	res->a1 = res_1_2.a1;
+	res->a2 = res_1_2.a2;
+	res->a3 = res_1_2.a3;
+
+	return gzvm_err_to_errno(res->a0);
+}
+
+int gzvm_arch_probe(struct gzvm_version drv_version,
+		    struct gzvm_version *hyp_version)
+{
+	struct arm_smccc_res res;
+	int ret;
+
+	ret = gzvm_hypcall_wrapper(MT_HVC_GZVM_PROBE,
+				   drv_version.major,
+				   drv_version.minor,
+				   drv_version.sub,
+				   0, 0, 0, 0, &res);
+	if (ret)
+		return -ENXIO;
+
+	hyp_version->major = (u32)res.a1;
+	hyp_version->minor = (u32)res.a2;
+	hyp_version->sub = res.a3;
+
+	return 0;
+}
diff --git a/drivers/virt/Kconfig b/drivers/virt/Kconfig
index d8c848cf09a6..848eb97202d1 100644
--- a/drivers/virt/Kconfig
+++ b/drivers/virt/Kconfig
@@ -49,4 +49,6 @@ source "drivers/virt/acrn/Kconfig"
 
 source "drivers/virt/coco/Kconfig"
 
+source "drivers/virt/geniezone/Kconfig"
+
 endif
diff --git a/drivers/virt/geniezone/Kconfig b/drivers/virt/geniezone/Kconfig
new file mode 100644
index 000000000000..b17c06c91074
--- /dev/null
+++ b/drivers/virt/geniezone/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config MTK_GZVM
+	tristate "GenieZone Hypervisor driver for guest VM operation"
+	depends on ARM64 && EVENTFD
+	help
+	  This driver, gzvm, enables to run guest VMs on MTK GenieZone
+	  hypervisor. It exports kvm-like interfaces for VMM (e.g., crosvm) in
+	  order to operate guest VMs on GenieZone hypervisor.
+
+	  GenieZone hypervisor now only supports MediaTek SoC and arm64
+	  architecture.
+
+	  Select M if you want it be built as a module (gzvm.ko).
+
+	  If unsure, say N.
diff --git a/drivers/virt/geniezone/Makefile b/drivers/virt/geniezone/Makefile
new file mode 100644
index 000000000000..3a82e5fddf90
--- /dev/null
+++ b/drivers/virt/geniezone/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Makefile for GenieZone driver, this file should be include in arch's
+# to avoid two ko being generated.
+#
+
+GZVM_DIR ?= ../../../drivers/virt/geniezone
+
+gzvm-y := $(GZVM_DIR)/gzvm_main.o
diff --git a/drivers/virt/geniezone/gzvm_main.c b/drivers/virt/geniezone/gzvm_main.c
new file mode 100644
index 000000000000..dc91fd61ba75
--- /dev/null
+++ b/drivers/virt/geniezone/gzvm_main.c
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2023 MediaTek Inc.
+ */
+
+#include <linux/device.h>
+#include <linux/kdev_t.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/soc/mediatek/gzvm_drv.h>
+
+static struct gzvm_driver gzvm_drv = {
+	.drv_version = {
+		.major = GZVM_DRV_MAJOR_VERSION,
+		.minor = GZVM_DRV_MINOR_VERSION,
+		.sub = 0,
+	},
+};
+
+/**
+ * gzvm_err_to_errno() - Convert geniezone return value to standard errno
+ *
+ * @err: Return value from geniezone function return
+ *
+ * Return: Standard errno
+ */
+int gzvm_err_to_errno(unsigned long err)
+{
+	int gz_err = (int)err;
+
+	switch (gz_err) {
+	case 0:
+		return 0;
+	case ERR_NO_MEMORY:
+		return -ENOMEM;
+	case ERR_NOT_SUPPORTED:
+		fallthrough;
+	case ERR_NOT_IMPLEMENTED:
+		return -EOPNOTSUPP;
+	case ERR_FAULT:
+		return -EFAULT;
+	default:
+		break;
+	}
+
+	return -EINVAL;
+}
+
+static int gzvm_dev_open(struct inode *inode, struct file *file)
+{
+	/*
+	 * Reference count to prevent this module is unload without destroying
+	 * VM
+	 */
+	try_module_get(THIS_MODULE);
+	return 0;
+}
+
+static int gzvm_dev_release(struct inode *inode, struct file *file)
+{
+	module_put(THIS_MODULE);
+	return 0;
+}
+
+static const struct file_operations gzvm_chardev_ops = {
+	.llseek		= noop_llseek,
+	.open		= gzvm_dev_open,
+	.release	= gzvm_dev_release,
+};
+
+static struct miscdevice gzvm_dev = {
+	.minor = MISC_DYNAMIC_MINOR,
+	.name = KBUILD_MODNAME,
+	.fops = &gzvm_chardev_ops,
+};
+
+static int gzvm_drv_probe(struct platform_device *pdev)
+{
+	if (gzvm_arch_probe(gzvm_drv.drv_version, &gzvm_drv.hyp_version) != 0) {
+		dev_err(&pdev->dev, "Not found available conduit\n");
+		return -ENODEV;
+	}
+
+	pr_debug("Found GenieZone hypervisor version %u.%u.%llu\n",
+		 gzvm_drv.hyp_version.major, gzvm_drv.hyp_version.minor,
+		 gzvm_drv.hyp_version.sub);
+
+	return misc_register(&gzvm_dev);
+}
+
+static void gzvm_drv_remove(struct platform_device *pdev)
+{
+	misc_deregister(&gzvm_dev);
+}
+
+static const struct of_device_id gzvm_of_match[] = {
+	{ .compatible = "mediatek,geniezone" },
+	{/* sentinel */},
+};
+
+static struct platform_driver gzvm_driver = {
+	.probe = gzvm_drv_probe,
+	.remove = gzvm_drv_remove,
+	.driver = {
+		.name = KBUILD_MODNAME,
+		.of_match_table = gzvm_of_match,
+	},
+};
+
+module_platform_driver(gzvm_driver);
+
+MODULE_DEVICE_TABLE(of, gzvm_of_match);
+MODULE_AUTHOR("MediaTek");
+MODULE_DESCRIPTION("GenieZone interface for VMM");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/soc/mediatek/gzvm_drv.h b/include/linux/soc/mediatek/gzvm_drv.h
new file mode 100644
index 000000000000..495bf5b8b8e0
--- /dev/null
+++ b/include/linux/soc/mediatek/gzvm_drv.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2023 MediaTek Inc.
+ */
+
+#ifndef __GZVM_DRV_H__
+#define __GZVM_DRV_H__
+
+/* GZVM version encode */
+#define GZVM_DRV_MAJOR_VERSION		16
+#define GZVM_DRV_MINOR_VERSION		0
+
+struct gzvm_version {
+	u32 major;
+	u32 minor;
+	u64 sub;	/* currently, used by hypervisor */
+};
+
+struct gzvm_driver {
+	struct gzvm_version hyp_version;
+	struct gzvm_version drv_version;
+};
+
+/*
+ * These are the definitions of APIs between GenieZone hypervisor and driver,
+ * there's no need to be visible to uapi. Furthermore, we need GenieZone
+ * specific error code in order to map to Linux errno
+ */
+#define NO_ERROR                (0)
+#define ERR_NO_MEMORY           (-5)
+#define ERR_NOT_SUPPORTED       (-24)
+#define ERR_NOT_IMPLEMENTED     (-27)
+#define ERR_FAULT               (-40)
+
+int gzvm_err_to_errno(unsigned long err);
+
+/* arch-dependant functions */
+int gzvm_arch_probe(struct gzvm_version drv_version,
+		    struct gzvm_version *hyp_version);
+
+#endif /* __GZVM_DRV_H__ */
-- 
2.18.0
Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Krzysztof Kozlowski 1 year, 1 month ago
On 14/11/2024 11:07, Liju-clr Chen wrote:
> +
> +static int gzvm_dev_open(struct inode *inode, struct file *file)
> +{
> +	/*
> +	 * Reference count to prevent this module is unload without destroying
> +	 * VM

So you re-implemented suppress-bind attrs... no, drop.

> +	 */
> +	try_module_get(THIS_MODULE);
> +	return 0;
> +}
> +
> +static int gzvm_dev_release(struct inode *inode, struct file *file)
> +{
> +	module_put(THIS_MODULE);
> +	return 0;
> +}
> +
> +static const struct file_operations gzvm_chardev_ops = {
> +	.llseek		= noop_llseek,
> +	.open		= gzvm_dev_open,
> +	.release	= gzvm_dev_release,
> +};
> +
> +static struct miscdevice gzvm_dev = {
> +	.minor = MISC_DYNAMIC_MINOR,
> +	.name = KBUILD_MODNAME,
> +	.fops = &gzvm_chardev_ops,
> +};
> +
> +static int gzvm_drv_probe(struct platform_device *pdev)
> +{
> +	if (gzvm_arch_probe(gzvm_drv.drv_version, &gzvm_drv.hyp_version) != 0) {
> +		dev_err(&pdev->dev, "Not found available conduit\n");

So you can autodetect your hypervisor? Why your soc info drivers cannot
instantiate this device thus removing any need for fake DT node (fake
because no resources and used only to satisfy Linux driver instantiation)?


> +		return -ENODEV;
> +	}
> +
> +	pr_debug("Found GenieZone hypervisor version %u.%u.%llu\n",
> +		 gzvm_drv.hyp_version.major, gzvm_drv.hyp_version.minor,
> +		 gzvm_drv.hyp_version.sub);
> +
> +	return misc_register(&gzvm_dev);
> +}
> +
> +static void gzvm_drv_remove(struct platform_device *pdev)
> +{
> +	misc_deregister(&gzvm_dev);
> +}
> +
> +static const struct of_device_id gzvm_of_match[] = {
> +	{ .compatible = "mediatek,geniezone" },
> +	{/* sentinel */},
> +};
> +
> +static struct platform_driver gzvm_driver = {
> +	.probe = gzvm_drv_probe,
> +	.remove = gzvm_drv_remove,
> +	.driver = {
> +		.name = KBUILD_MODNAME,
> +		.of_match_table = gzvm_of_match,
> +	},
> +};
> +
> +module_platform_driver(gzvm_driver);
> +
> +MODULE_DEVICE_TABLE(of, gzvm_of_match);

This is immediately after next to ID table. Never in different place, so
I wonder from which obscure code did you copy it and what other issues
like that we can find...

> +MODULE_AUTHOR("MediaTek");
> +MODULE_DESCRIPTION("GenieZone interface for VMM");
> +MODULE_LICENSE("GPL");
Best regards,
Krzysztof
Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Liju-clr Chen (陳麗如) 6 months ago
On Wed, 2024-12-11 at 09:44 +0100, Krzysztof Kozlowski wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 14/11/2024 11:07, Liju-clr Chen wrote:
> > +
> > +static int gzvm_dev_open(struct inode *inode, struct file *file)
> > +{
> > +     /*
> > +      * Reference count to prevent this module is unload without
> > destroying
> > +      * VM
> 
> So you re-implemented suppress-bind attrs... no, drop.
> 

Thanks, will fix in next version.

> > +      */
> > +     try_module_get(THIS_MODULE);
> > +     return 0;
> > +}
> > +
> > +static int gzvm_dev_release(struct inode *inode, struct file
> > *file)
> > +{
> > +     module_put(THIS_MODULE);
> > +     return 0;
> > +}
> > +
> > +static const struct file_operations gzvm_chardev_ops = {
> > +     .llseek         = noop_llseek,
> > +     .open           = gzvm_dev_open,
> > +     .release        = gzvm_dev_release,
> > +};
> > +
> > +static struct miscdevice gzvm_dev = {
> > +     .minor = MISC_DYNAMIC_MINOR,
> > +     .name = KBUILD_MODNAME,
> > +     .fops = &gzvm_chardev_ops,
> > +};
> > +
> > +static int gzvm_drv_probe(struct platform_device *pdev)
> > +{
> > +     if (gzvm_arch_probe(gzvm_drv.drv_version,
> > &gzvm_drv.hyp_version) != 0) {
> > +             dev_err(&pdev->dev, "Not found available conduit\n");
> 
> So you can autodetect your hypervisor? Why your soc info drivers
> cannot
> instantiate this device thus removing any need for fake DT node (fake
> because no resources and used only to satisfy Linux driver
> instantiation)?
> 
> 
Hi Krzysztof,

I'm following up regarding your recent feedback on the MTK SoC driver
instantiation, as well as your earlier concerns about probing for the
hypervisor on all systems.

To recap your previous comment [1]:

> So for every system and architecture you want to: probe, run some SMC
> and then print error that it is not othe system you wanted.
>
> I don't think this is what we want. You basically pollute all of
other
> users just to have your hypervisor guest additions...

We understand the concern about unnecessary probing and potential
impact on platforms that do not support the GenieZone hypervisor.
However, using a generic SoC info driver is not practical in our case,
as not all products based on the same SoC support the hypervisor or
require the gzvm driver.

Previously, we attempted a device tree solution, but as Rob and Conor
pointed out, introducing a DT node without hardware resources is not
acceptable for upstreaming.

Given these constraints, we are considering reverting to the original
approach, where the driver probes for the hypervisor's presence
directly via HVC. To address your concern about system-wide pollution,
we have guarded the gzvm driver with the CONFIG_MTK_GZVM Kconfig
option. This ensures the code is only compiled and active on selected
platforms, and will not affect other users or systems.

If you have any further suggestions or see a better
solution for this scenario, we would appreciate your advice.

Thanks for your time and feedback.

[1]
https://lore.kernel.org/all/2fe0c7f9-55fc-ae63-3631-8526a0212ccd@linaro.org/

> > +             return -ENODEV;
> > +     }
> > +
> > +     pr_debug("Found GenieZone hypervisor version %u.%u.%llu\n",
> > +              gzvm_drv.hyp_version.major,
> > gzvm_drv.hyp_version.minor,
> > +              gzvm_drv.hyp_version.sub);
> > +
> > +     return misc_register(&gzvm_dev);
> > +}
> > +
> > +static void gzvm_drv_remove(struct platform_device *pdev)
> > +{
> > +     misc_deregister(&gzvm_dev);
> > +}
> > +
> > +static const struct of_device_id gzvm_of_match[] = {
> > +     { .compatible = "mediatek,geniezone" },
> > +     {/* sentinel */},
> > +};
> > +
> > +static struct platform_driver gzvm_driver = {
> > +     .probe = gzvm_drv_probe,
> > +     .remove = gzvm_drv_remove,
> > +     .driver = {
> > +             .name = KBUILD_MODNAME,
> > +             .of_match_table = gzvm_of_match,
> > +     },
> > +};
> > +
> > +module_platform_driver(gzvm_driver);
> > +
> > +MODULE_DEVICE_TABLE(of, gzvm_of_match);
> 
> This is immediately after next to ID table. Never in different place,
> so
> I wonder from which obscure code did you copy it and what other
> issues
> like that we can find...
> 

Thanks, will fix in next version.

> > +MODULE_AUTHOR("MediaTek");
> > +MODULE_DESCRIPTION("GenieZone interface for VMM");
> > +MODULE_LICENSE("GPL");
> Best regards,
> Krzysztof

Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Krzysztof Kozlowski 6 months ago
On 12/08/2025 09:04, Liju-clr Chen (陳麗如) wrote:
> we have guarded the gzvm driver with the CONFIG_MTK_GZVM Kconfig
> option. This ensures the code is only compiled and active on selected
> platforms, and will not affect other users or systems.

That is simply not true, since it will be enabled in defconfig in EVERY
platform. Look up approach of single kernel and single image.

Best regards,
Krzysztof
Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Liju-clr Chen (陳麗如) 5 months, 4 weeks ago
On Tue, 2025-08-12 at 09:32 +0200, Krzysztof Kozlowski wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 12/08/2025 09:04, Liju-clr Chen (陳麗如) wrote:
> > we have guarded the gzvm driver with the CONFIG_MTK_GZVM Kconfig
> > option. This ensures the code is only compiled and active on
> > selected
> > platforms, and will not affect other users or systems.
> 
> That is simply not true, since it will be enabled in defconfig in
> EVERY
> platform. Look up approach of single kernel and single image.
> 
> Best regards,
> Krzysztof

Hi Krzysztof,

Thank you for explaining why the Kconfig option cannot prevent
polluting all systems due to the single kernel approach.

As you mentioned, using Kconfig cannot solve the issue of polluting all
systems, so probing directly is not recommended.

The other method I know is to use a DT node, but the community does not
accept DT nodes without real hardware resources.

Currently, these are the only two methods I am aware of. I will
continue to look for other possible solutions, and any suggestions
would be appreciated.

Thank you again for your feedback.

Best Regards,
Liju-clr Chen
Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Krzysztof Kozlowski 6 months ago
On 12/08/2025 09:04, Liju-clr Chen (陳麗如) wrote:
> On Wed, 2024-12-11 at 09:44 +0100, Krzysztof Kozlowski wrote:
>>
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>
>>
>> On 14/11/2024 11:07, Liju-clr Chen wrote:
>>> +
>>> +static int gzvm_dev_open(struct inode *inode, struct file *file)
>>> +{
>>> +     /*
>>> +      * Reference count to prevent this module is unload without
>>> destroying
>>> +      * VM
>>
>> So you re-implemented suppress-bind attrs... no, drop.
>>
> 
> Thanks, will fix in next version.

I gave you comments within hours. You responded 8 months after. That is
not making the process easy.

I expect all comments applied in such case and I will not be reading
further. You got comments, implement them fully. I think you reject
them, but rejection after 8 months, means all context is gone.

NAK

Best regards,
Krzysztof
Re: [PATCH v13 04/25] virt: geniezone: Add GenieZone hypervisor driver
Posted by Liju-clr Chen (陳麗如) 6 months ago
On Tue, 2025-08-12 at 09:23 +0200, Krzysztof Kozlowski wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 12/08/2025 09:04, Liju-clr Chen (陳麗如) wrote:
> > On Wed, 2024-12-11 at 09:44 +0100, Krzysztof Kozlowski wrote:
> > > 
> > > External email : Please do not click links or open attachments
> > > until
> > > you have verified the sender or the content.
> > > 
> > > 
> > > On 14/11/2024 11:07, Liju-clr Chen wrote:
> > > > +
> > > > +static int gzvm_dev_open(struct inode *inode, struct file
> > > > *file)
> > > > +{
> > > > +     /*
> > > > +      * Reference count to prevent this module is unload
> > > > without
> > > > destroying
> > > > +      * VM
> > > 
> > > So you re-implemented suppress-bind attrs... no, drop.
> > > 
> > 
> > Thanks, will fix in next version.
> 
> I gave you comments within hours. You responded 8 months after. That
> is
> not making the process easy.
> 
> I expect all comments applied in such case and I will not be reading
> further. You got comments, implement them fully. I think you reject
> them, but rejection after 8 months, means all context is gone.
> 
> NAK
> 
> Best regards,
> Krzysztof

Hi Krzysztof,

Thanks for your feedback and for pointing out these issues.
I'm really sorry for the late reply and understand this may
have delayed the review process. I'll make sure to respond
more promptly next time.

Thank you for your time and understanding.

Best Regards,
Liju-clr Chen