From patchwork Thu Dec 2 13:17:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Nys42uUx; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J4c215bJ3z9s1l for ; Fri, 3 Dec 2021 00:17:29 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mslxg-0008As-2h; Thu, 02 Dec 2021 13:17:20 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mslxd-000892-PT for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:17:17 +0000 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 4E1643F1F2 for ; Thu, 2 Dec 2021 13:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638451037; bh=5TG5mAHFUkZm+5l/uVLtvJGZbjuCZEh99Q7y9+CRV1w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Nys42uUxHF/Ss2sh+ECjtcnkJWomJOTxgjsZm3XiTj7D1NBicWZxdxW5mMGryJOYc noiM/YrmxmHK6xXQOuLRWn6bDl2W9sZ4vHATFqPAHulRdH7yZYcCs6FgOYd72go7eh EK/pAm6PUHmAaEJEB1S72s42yE5zLBH2Q+3ulNgi+PYQs8OPPID2HvzQczxSDSsEmg JUTrToZZhFfUM3cyHRVOEuC385v7+WniDjYt4iFBoBKRFQYAGhTdn2HopcUIebOCeD r4DypQc6GxiFolY1eMXxNUxsCQZ/FzJnUpZ740phZ8a6itURUXqVfvR52a6juPqWt7 pGVIS4aarEVNg== Received: by mail-pg1-f199.google.com with SMTP id 141-20020a630793000000b003214e421b2cso14108253pgh.5 for ; Thu, 02 Dec 2021 05:17:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5TG5mAHFUkZm+5l/uVLtvJGZbjuCZEh99Q7y9+CRV1w=; b=y1zEIf9VO7LkffLraxJW+SLIb59vb+gOtYFqPfSOr3D81dSJYm1MYTZdMJoOS5JD6e UpqrPr2cc3+SNQsxrtXYm221YCF545Lm3tkUnjqtAzDI/GpJFdPP3aO+9S3yowRf5QKN LyTg3NHRrOKuEBF1/yyc9LyeTsfloltuiPBTQGHld/mo1qZx7EnOzr0ZXtYyDZ+KxEk3 QSeTSza0VzrJqYMZipeD+LUYPsVEIg0EsqH5vdGw7n5M3xnpt7CBCO1YK3f6SqtdnPaI 4OWZjssmE9tblDLs8NR7Y0OiHQzKjgKWaL/TYIxJHkQR5sbPM0CXvizzUk1UK0vHp/me sIYw== X-Gm-Message-State: AOAM533U42o+aLZcjeIIK4gHqrP6ZBZxFfUVPLNanm5VjdqfOsqxUjYZ CmwHA1Iv/g1VlBtJqDchWvfQxvNg5fd4oeEFXikCI+dEgNKJ9ne5jEp0D67StY1wIbCQcOCQgIq yvaIp4pFdP7o+9mfN2u+ZT/+PCqMkUZna9HrIdq4hMA== X-Received: by 2002:a05:6a00:1312:b0:4a4:e341:213a with SMTP id j18-20020a056a00131200b004a4e341213amr12423447pfu.57.1638451035447; Thu, 02 Dec 2021 05:17:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJpRdrgS3jyVP4yw5LrOvXISHYetK1ve32jJnLxPZGFvFxsSk9M6iLd5cVhlvkRU8evXDi8Q== X-Received: by 2002:a05:6a00:1312:b0:4a4:e341:213a with SMTP id j18-20020a056a00131200b004a4e341213amr12423421pfu.57.1638451035161; Thu, 02 Dec 2021 05:17:15 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id mi18sm2820019pjb.13.2021.12.02.05.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:17:14 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/8] nitro_enclaves: Update documentation for Arm64 support Date: Thu, 2 Dec 2021 06:17:00 -0700 Message-Id: <20211202131705.9536-4-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131705.9536-1-tim.gardner@canonical.com> References: <20211202131705.9536-1-tim.gardner@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Andra Paraschiv BugLink: https://bugs.launchpad.net/bugs/1951873 Add references for hugepages and booting steps for Arm64. Include info about the current supported architectures for the NE kernel driver. Reviewed-by: George-Aurelian Popescu Acked-by: Stefano Garzarella Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-3-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit cfa3c18cd528f48fd1b4b584f330df8f00b8a97f) Signed-off-by: Tim Gardner --- Documentation/virt/ne_overview.rst | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/virt/ne_overview.rst b/Documentation/virt/ne_overview.rst index 39b0c8fe2654..74c2f5919c88 100644 --- a/Documentation/virt/ne_overview.rst +++ b/Documentation/virt/ne_overview.rst @@ -14,12 +14,15 @@ instances [1]. For example, an application that processes sensitive data and runs in a VM, can be separated from other applications running in the same VM. This application then runs in a separate VM than the primary VM, namely an enclave. +It runs alongside the VM that spawned it. This setup matches low latency +applications needs. -An enclave runs alongside the VM that spawned it. This setup matches low latency -applications needs. The resources that are allocated for the enclave, such as -memory and CPUs, are carved out of the primary VM. Each enclave is mapped to a -process running in the primary VM, that communicates with the NE driver via an -ioctl interface. +The current supported architectures for the NE kernel driver, available in the +upstream Linux kernel, are x86 and ARM64. + +The resources that are allocated for the enclave, such as memory and CPUs, are +carved out of the primary VM. Each enclave is mapped to a process running in the +primary VM, that communicates with the NE kernel driver via an ioctl interface. In this sense, there are two components: @@ -43,8 +46,8 @@ for the enclave VM. An enclave does not have persistent storage attached. The memory regions carved out of the primary VM and given to an enclave need to be aligned 2 MiB / 1 GiB physically contiguous memory regions (or multiple of this size e.g. 8 MiB). The memory can be allocated e.g. by using hugetlbfs from -user space [2][3]. The memory size for an enclave needs to be at least 64 MiB. -The enclave memory and CPUs need to be from the same NUMA node. +user space [2][3][7]. The memory size for an enclave needs to be at least +64 MiB. The enclave memory and CPUs need to be from the same NUMA node. An enclave runs on dedicated cores. CPU 0 and its CPU siblings need to remain available for the primary VM. A CPU pool has to be set for NE purposes by an @@ -61,7 +64,7 @@ device is placed in memory below the typical 4 GiB. The application that runs in the enclave needs to be packaged in an enclave image together with the OS ( e.g. kernel, ramdisk, init ) that will run in the enclave VM. The enclave VM has its own kernel and follows the standard Linux -boot protocol [6]. +boot protocol [6][8]. The kernel bzImage, the kernel command line, the ramdisk(s) are part of the Enclave Image Format (EIF); plus an EIF header including metadata such as magic @@ -93,3 +96,5 @@ enclave process can exit. [4] https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html [5] https://man7.org/linux/man-pages/man7/vsock.7.html [6] https://www.kernel.org/doc/html/latest/x86/boot.html +[7] https://www.kernel.org/doc/html/latest/arm64/hugetlbpage.html +[8] https://www.kernel.org/doc/html/latest/arm64/booting.html