Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3356090rdb; Thu, 16 Nov 2023 07:29:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IH09LS1DdBzkaqHKhwtpnO8slD8XRwVuCchasOir/EMwYD8VDL+upUt+5GPjxMGwCSfdLyE X-Received: by 2002:a17:90a:34b:b0:27d:880d:8645 with SMTP id 11-20020a17090a034b00b0027d880d8645mr13102077pjf.49.1700148568967; Thu, 16 Nov 2023 07:29:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700148568; cv=none; d=google.com; s=arc-20160816; b=rUHJdudxtuapuRzadz/48ggiVN34qDLDTEGAak6HlkgTazIlo/rYbBEHGnlLW6JIlR dJ9JdWXBOSC7gtj9q4V+OLXSA7o/Durr52A+h6cvAdabZP/yKdn7nFD80aNsRFtzyInY VjFaCES9opBhgnNykFkxbSuZ9orFznL2TFukzFJ+/PqNr07qTuh/rortgcCjTGMWfzgJ QSye1tSUjwuA42jwHcwuJrvE+WcM6D+vNvpyKqxvqMfse5nhujRBcUldhI4JIKy5cJ1g zLjvQAvNUgMUICoaaxoDfWktqdPzBuhl/tUaXmF8jMMD42CPOXKZZhSkNRERHI5KMWDo x+gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TAULPHkOdLk0sIcSE32SUJPJrWyPc3mcQD4zckgNoOE=; fh=v/wTNYTiH+jql/ZrmuhPg6uKzUZg3GlpVXvzAQL+X04=; b=PCuXHiWrij6SSIuXzVaTeYL/VRYf1JvUj1yCJv9oet7qo5WZhHR9X+OQsBt3kfZExT 8JxXY6zQdavPkfiX20880cW8acCqGhLxRWYbEw5v7/eLC/IlG0mOyV0Ps9qGobnc6TzO om1mhdWVdNo6OfKGFByEpuxhNsrOYDcxMppEsLiNaf9D66fspb3bJh2DIuADmzJ1zqLD Zo+JOZGKFZ9sVibTpS1O/4ZY+Wz7onc/GJ5gdI2UwyJVvMrhhsNvTl3J5FU75y03CC5r B3mJJoAjvj7RWJp7NNtVxq+kX/jMvHCVFyh6Dx0gn8NBtFXqN9B6LAF+9Q42BCiT/qFc DPcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rrkIkr3k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a1-20020a17090a8c0100b0027d61342674si2182815pjo.70.2023.11.16.07.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:29:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rrkIkr3k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C1FA4801E879; Thu, 16 Nov 2023 07:29:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbjKPP30 (ORCPT + 99 others); Thu, 16 Nov 2023 10:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbjKPP3X (ORCPT ); Thu, 16 Nov 2023 10:29:23 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F6B618B; Thu, 16 Nov 2023 07:29:16 -0800 (PST) X-UUID: e3852b08849411ee8051498923ad61e6-20231116 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=TAULPHkOdLk0sIcSE32SUJPJrWyPc3mcQD4zckgNoOE=; b=rrkIkr3kGIpvXtIRREAoylEpyUG9iP32Yqp5o0zEHQhT0Rc3ALFQ/MQ7G96v6npdtNBM0URbuYxwwdTuGr0Sg5flZFVcjXAJzf4yBDtW+WJe8+HEO+dyPhljeTPB6PXl58mpv/wRKyFt38CsKngx9ZSJR3jOyaeW10zIfltbDA8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:c3c04f5c-cd2a-4364-a8f3-ab31c2e32c66,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:364b77b,CLOUDID:f0b79cfc-4a48-46e2-b946-12f04f20af8c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: e3852b08849411ee8051498923ad61e6-20231116 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1725635505; Thu, 16 Nov 2023 23:29:10 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 16 Nov 2023 23:29:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 16 Nov 2023 23:29:08 +0800 From: Yi-De Wu To: Yingshiuan Pan , Ze-Yu Wang , Yi-De Wu , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Catalin Marinas , Will Deacon , Matthias Brugger , AngeloGioacchino Del Regno CC: Arnd Bergmann , , , , , , David Bradil , Trilok Soni , Jade Shih , Ivan Tseng , My Chuang , Shawn Hsiao , PeiLun Suei , Liju Chen , Willix Yeh , Kevenny Hsieh Subject: [PATCH v7 01/16] docs: geniezone: Introduce GenieZone hypervisor Date: Thu, 16 Nov 2023 23:27:41 +0800 Message-ID: <20231116152756.4250-2-yi-de.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231116152756.4250-1-yi-de.wu@mediatek.com> References: <20231116152756.4250-1-yi-de.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 07:29:27 -0800 (PST) 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 interface. Signed-off-by: Yingshiuan Pan Signed-off-by: Liju Chen Signed-off-by: Yi-De Wu --- Documentation/virt/geniezone/introduction.rst | 86 +++++++++++++++++++ Documentation/virt/index.rst | 1 + MAINTAINERS | 6 ++ 3 files changed, 93 insertions(+) create mode 100644 Documentation/virt/geniezone/introduction.rst diff --git a/Documentation/virt/geniezone/introduction.rst b/Documentation/virt/geniezone/introduction.rst new file mode 100644 index 000000000000..fb9fa41bcfb8 --- /dev/null +++ b/Documentation/virt/geniezone/introduction.rst @@ -0,0 +1,86 @@ +.. SPDX-License-Identifier: GPL-2.0 + +====================== +GenieZone Introduction +====================== + +Overview +======== +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 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. + +Supported Architecture +====================== +GenieZone now only supports MediaTek ARM64 SoC. + +Features +======== + +- vCPU Management + +VM manager aims to provide vCPUs on the basis of time sharing on physical CPUs. +It requires Linux kernel in host VM for vCPU scheduling and VM power management. + +- Memory Management + +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. + +- Virtual Platform + +We manage to emulate a virtual mobile platform for guest OS running on guest +VM. The platform supports various architecture-defined devices, such as +virtual arch timer, GIC, MMIO, PSCI, and exception watching...etc. + +- Inter-VM Communication + +Communication among guest VMs was provided mainly on RPC. More communication +mechanisms were to be provided in the future based on VirtIO-vsock. + +- Device Virtualization + +The solution is provided using the well-known VirtIO. The gzvm-ko would +redirect MMIO traps back to VMM where the virtual devices are mostly emulated. +Ioeventfd is implemented using eventfd for signaling host VM that some IO +events in guest VMs need to be processed. + +- Interrupt virtualization + +All Interrupts during some guest VMs running would be handled by GenieZone +hypervisor with the help of gzvm-ko, both virtual and physical ones. In case +there's no guest VM running out there, physical interrupts would be handled by +host VM directly for performance reason. Irqfd is also implemented using +eventfd for accepting vIRQ requests in gzvm-ko. + +Platform architecture component +=============================== + +- vm + +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. And the memory management is highly +integrated with ARM 2-stage translation tables to convert VA to IPA to PA under +proper security measures required by protected VMs. + +- vcpu + +The vcpu component is the core of virtualizing aarch64 physical CPU runnable, +and it controls the vCPU lifecycle including creating, running and destroying. +With self-defined exit handler, the vm component would be able to act +accordingly before terminated. + +- vgic + +The vgic component exposes control interfaces to Linux kernel via irqchip, and +we intend to support all SPI, PPI, and SGI. When it comes to virtual +interrupts, the GenieZone hypervisor would write to list registers and trigger +vIRQ injection in guest VMs via GIC. diff --git a/Documentation/virt/index.rst b/Documentation/virt/index.rst index 7fb55ae08598..cf12444db336 100644 --- a/Documentation/virt/index.rst +++ b/Documentation/virt/index.rst @@ -16,6 +16,7 @@ Virtualization Support coco/sev-guest coco/tdx-guest hyperv/index + geniezone/introduction .. only:: html and subproject diff --git a/MAINTAINERS b/MAINTAINERS index b294edaf5698..b4f7ff186619 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8942,6 +8942,12 @@ F: include/vdso/ F: kernel/time/vsyscall.c F: lib/vdso/ +GENIEZONE HYPERVISOR DRIVER +M: Yingshiuan Pan +M: Ze-Yu Wang +M: Yi-De Wu +F: Documentation/virt/geniezone/ + GENWQE (IBM Generic Workqueue Card) M: Frank Haverkamp S: Supported -- 2.18.0