Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1784774rwd; Fri, 9 Jun 2023 02:01:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aeSVGYpaq6UjlcbH4N+cOeaYLQImWO/E0IkhcR8j3u+HG01Rez/F+IujcdQvNNC2yFwWr X-Received: by 2002:a92:c60d:0:b0:335:7a0a:3cc5 with SMTP id p13-20020a92c60d000000b003357a0a3cc5mr1170487ilm.21.1686301278987; Fri, 09 Jun 2023 02:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686301278; cv=none; d=google.com; s=arc-20160816; b=HrHhoOxW0lAjMNCdJnQ+w/iq6OCsI7alTdJCt5suhZktKPR4Bq2gcTechdpf0zu9nX /ojbb2yi5Sy+uokyztboZS7Z4nslnBXH0wFY7sKl0KkFilnI5oaMBHk5TFpKsK16SFag e5IKPEJBPXluzqo6KeAk6cScYrrLA6H5UkXjBWo2i3zqyVo06JxqQ1i5UUVgNAn77YiY rqL772ZiT9L/e/aEQUJOVrl1yzLvkH+iT3RExAB0resKTBP7aJDCBB8ncD3w8tIBmE/6 /1uRLYbVCnonBzjatN4ViI7VR7eDjqbJ4QbQN8223dEecCEptSfEUDATwvs3HXPncMan qxZA== 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=dLIYRoXshZCYjSVWIjyzdBAAVLO0fisUp3j6Z8T0P4A=; b=dUNZsI0sPCvyYgH47NnsMTdse+Y34+2AuUAQPH015GIgJqjPuMprL2o7luagfuiIx1 Wz6UQ0DPBaNMEl9J/YP2BZysvHQJMvjHAmjP2tCSOwLA97LUBv6bSC3XEM5lCEY4suA5 J/u2xbj+wmDMiv2kxQ4vzyd78S/6FdqoqC4Hj7C4m+Uh/TOwO/qAxwTG3/DC6O5HfAjf oDW+68/KcUWeX3HOTvATyNZ64grr70GCAkfUENGL9qZtkyEnjtiU2QDtqbUgOuaH5EYw 6BVPIRmXMF7QAi3cdiXDg8NJb+EHcckfajyjm3jA36P2q49viw1o4LadejaN65xzW9bZ tVBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WJcos5W5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i65-20020a636d44000000b00543a0bddd71si2255747pgc.363.2023.06.09.02.01.04; Fri, 09 Jun 2023 02:01:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WJcos5W5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239432AbjFIIwz (ORCPT + 99 others); Fri, 9 Jun 2023 04:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238928AbjFIIwZ (ORCPT ); Fri, 9 Jun 2023 04:52:25 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B8FB95; Fri, 9 Jun 2023 01:52:21 -0700 (PDT) X-UUID: ef24577406a211ee9cb5633481061a41-20230609 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=dLIYRoXshZCYjSVWIjyzdBAAVLO0fisUp3j6Z8T0P4A=; b=WJcos5W5Et208j+7Ov+VCgujf7AwzkGwRkTxArFJGzYkL8TAaLTC4lMzBwC7fgJes8ALOKUW7INM3bjiqWljN23pNxG7wtFKdtuZDpzS9U4lRTo9P7w0+emRgTROjmpYTABl4Er5ZBZAbYrxhQ+CMbQo2nKlmiB53O5S7C1AiH8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.26,REQID:70af0df7-d156-4991-861e-a728b95b32fb,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:47,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:47 X-CID-INFO: VERSION:1.1.26,REQID:70af0df7-d156-4991-861e-a728b95b32fb,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:47,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:47 X-CID-META: VersionHash:cb9a4e1,CLOUDID:15f8ea3d-de1e-4348-bc35-c96f92f1dcbb,B ulkID:230609165216951NQGEH,BulkQuantity:0,Recheck:0,SF:48|101|38|29|28|100 |17|19|102,TC:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:ni l,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_ULN,TF_CID_SPAM_SNR,TF_CID_SPAM_SDM,TF_CID_SPAM_FAS, TF_CID_SPAM_FSD X-UUID: ef24577406a211ee9cb5633481061a41-20230609 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1656020971; Fri, 09 Jun 2023 16:52:16 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 9 Jun 2023 16:52:15 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 9 Jun 2023 16:52:15 +0800 From: Yi-De Wu To: Yingshiuan Pan , Ze-Yu Wang , Yi-De Wu , Jonathan Corbet , Catalin Marinas , Will Deacon , Arnd Bergmann , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Conor Dooley , Trilok Soni , David Bradil , Jade Shih , Miles Chen , Ivan Tseng , My Chuang , Shawn Hsiao , PeiLun Suei , Liju Chen , Willix Yeh Subject: [PATCH v4 1/9] docs: geniezone: Introduce GenieZone hypervisor Date: Fri, 9 Jun 2023 16:52:06 +0800 Message-ID: <20230609085214.31071-2-yi-de.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230609085214.31071-1-yi-de.wu@mediatek.com> References: <20230609085214.31071-1-yi-de.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham 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 From: "Yi-De Wu" 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 | 79 +++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 85 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..872c66f60e7f --- /dev/null +++ b/Documentation/virt/geniezone/introduction.rst @@ -0,0 +1,79 @@ +.. 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 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/MAINTAINERS b/MAINTAINERS index 3a05599017b4..1b1db2073f8b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8745,6 +8745,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