From patchwork Thu Dec 2 13:12:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562692 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=Mz4a7hmd; 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 4J4bxD4gffz9sRN for ; Fri, 3 Dec 2021 00:13:20 +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 1mslti-0005nz-QA; Thu, 02 Dec 2021 13:13:14 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1msltb-0005lJ-3e for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:07 +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-1.canonical.com (Postfix) with ESMTPS id D22313F1AE for ; Thu, 2 Dec 2021 13:13:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450786; bh=dOBGRCeGmAaetUxjMF1lttDowsMWNwv0nYAffwXTHU0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Mz4a7hmdA+HC4TrifCpYH+B1hOPU3djav7fQd2oMu+7YzgEW36IYv0wqLhPNIvuQL kmCHnWG1hzwPZpvFh5NB1kLe58Daxm4+yMarHO3AAhqSDPdciTV/AUAU20zRM/4t6v /Fwb2lT38ZPDlwTygGge7CXaUgtavhtrem1hCQBeMFb0J7iOpLLP3ZV9VW9/C2iScu nVM8siAc5li8B47Lxr6WbX1mvVXVX1txvyzRvoqGZ3Z8scsKPDcYfTU53ZrYomnhPK BWvKCqL8N1jza6Y9YR9dEUFJCWGVOuuCAE0UJju6cl9MIrqUbGR4I+FA1lIztYjVFI GaljuOatuqqLQ== Received: by mail-pg1-f199.google.com with SMTP id r15-20020a63ec4f000000b002e582189837so14111767pgj.20 for ; Thu, 02 Dec 2021 05:13:06 -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=dOBGRCeGmAaetUxjMF1lttDowsMWNwv0nYAffwXTHU0=; b=eGVo64d+CHuGCPP4WhMVcsYUldzjR8aF0WHee87/s7YnoVhjaN6n7xkz5kQWwDVUj6 xrrqRx4DusUPZhgjV4L+m2bLC+DUVw6Z9exSZTQJ4Wnw11P/1RXX7aWEutglxjS0c0IU 78ez3Zb4H9rwuypL9nWgr1JGpB6TP0nlmG+cctBQkNrv6VHa/VBqbWoC8FAp57sKD6oJ O4uU68RVzE65Wv1diWhjSe0QEFuNwmX7WysUMwB40zhbmUhbZ8CWM49+dmuIPT0cefpx jov14IZnN1K7RXr1Jfm7iv3UjkUyh7SIPyXSisFPv4CTf/2ezGwXehkNbNpMmz8KUdkv C6Lg== X-Gm-Message-State: AOAM533Vq9TJt2qM1d3pckXowMiI610sbuESTyu6edxoMl1urfmCRagQ OznZ8ag9vA5b/z+O+trKO9aB34Ivh295P3LRc6ChE2i7j5gcJa5yfpo3vmNCskSXKwz+nxegrl8 d84Itxil90RiUjmOqblXAYSGXNLEzEOHP+8ksTr4ujA== X-Received: by 2002:a17:902:8f94:b0:143:8e81:3ec1 with SMTP id z20-20020a1709028f9400b001438e813ec1mr14946084plo.52.1638450785173; Thu, 02 Dec 2021 05:13:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfDH0+BwCbnwnk31lTIyrJSZDZpi6jULQbn4mtoAY57F1IANGZQ9kXw5kF8fRWyPMaRBPWbQ== X-Received: by 2002:a17:902:8f94:b0:143:8e81:3ec1 with SMTP id z20-20020a1709028f9400b001438e813ec1mr14946050plo.52.1638450784888; Thu, 02 Dec 2021 05:13:04 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:04 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 01/10] nitro_enclaves: Fixup type and simplify logic of the poll mask setup Date: Thu, 2 Dec 2021 06:12:49 -0700 Message-Id: <20211202131258.9393-2-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Update the assigned value of the poll result to be EPOLLHUP instead of POLLHUP to match the __poll_t type. While at it, simplify the logic of setting the mask result of the poll function. Reported-by: kernel test robot Reviewed-by: Alexander Graf Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20201102173622.32169-1-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d9109fe0f30a1fba66b8623837fc3d3c1a031090) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index f06622b48d695..f1964ea4b8269 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -1505,10 +1505,8 @@ static __poll_t ne_enclave_poll(struct file *file, poll_table *wait) poll_wait(file, &ne_enclave->eventq, wait); - if (!ne_enclave->has_event) - return mask; - - mask = POLLHUP; + if (ne_enclave->has_event) + mask |= EPOLLHUP; return mask; } From patchwork Thu Dec 2 13:12:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562694 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=jivN+UsQ; 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 4J4bxJ2flWz9s1l for ; Fri, 3 Dec 2021 00:13:24 +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 1msltm-0005rZ-9C; Thu, 02 Dec 2021 13:13:18 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1msltc-0005mA-KX for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:08 +0000 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (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-1.canonical.com (Postfix) with ESMTPS id 6ADDB3F1AE for ; Thu, 2 Dec 2021 13:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450788; bh=o03a8DOweWyudGi/l/dsacS3c+TwjLiCEctSN8BMpcM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jivN+UsQBEExacb9z9Emn36wzPIGvuJJDuDV/GjRHgSGEm4lH/h270TNupj1Palsj oWUeouR4+JR/lUYjQz3GFWNkQgW8dCbZfBoOTH9hTCFOjCtUgRNUs8WTp7VlT37U8d 8bd20uTuzr1+2pEZCg18Qdy+y2xzEYxUiO0YmQqk0A4s66CIUrFYo0kvC0SimL0lnZ AGWXa7IaaQnbSNuL3OYFtuvWLm5cfzJbzCK+I4o2FqlYQDFbrbwTmZ+FzGXvlkzAeI 9VT7779tGkzKhs62noOiC83z26t+O4vKDpEnjnxU9WzM/IaSGwRXh942L+LIe7PdyL Pvze/QYARlQzg== Received: by mail-pj1-f72.google.com with SMTP id b11-20020a17090acc0b00b001a9179dc89fso1947761pju.6 for ; Thu, 02 Dec 2021 05:13:08 -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=o03a8DOweWyudGi/l/dsacS3c+TwjLiCEctSN8BMpcM=; b=yzD8T/hP89CuXYxKkADGbpr1A4sVTcMAJygjDLUAtf15gMbuouKZrE0u1sZAkDEauW chuWiNzrHlzZ0ouWAHGCVYBjgahI4IMQeqgKSBGvOm3euX7gS9LOphPK3XYVoU0ksL2C ZzibNJ9er4Y5F1R3T0tLxZ2fWpEu7X2XtxqF8lBJx1ZVwlMoYHeuyfqUHPqpE4wobito XMlKU3sD1OggZm0zr66J9OtgkSo8XW2bv6jCMUwbg9DMYZySRy8A3fGS58tHhW9RB7em pu72yC6o47oCi9x/r4Yo5uqHa4shhw4UNnk8bvj/9A+cWP8jrbWAYxHzZNGFMwMfuVod n/Yw== X-Gm-Message-State: AOAM532bTuIBUACgr93kIPh2wf0dUSLJYToOhdvzqLUor+WBMJzQTEYV kW2TX0frNHONkbUgYDZddTyCe3S8iQMvnAiB+wdMk+orJ3vw2HddlYeF0LS67hQh6MZGEzh4LUy TllUMe/LjL6NO9v2RmJF+Ce+DjB21ENNXacdRs0qX2Q== X-Received: by 2002:a17:902:ce8f:b0:141:f85a:e0de with SMTP id f15-20020a170902ce8f00b00141f85ae0demr15080597plg.69.1638450786353; Thu, 02 Dec 2021 05:13:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3LQ0uNuXA8cplBWKavhkTD2GUb0/r4OJ5HGfpRjc4pE/ZUaV4/UQ1u/f8DBgLCKb1h5BI3Q== X-Received: by 2002:a17:902:ce8f:b0:141:f85a:e0de with SMTP id f15-20020a170902ce8f00b00141f85ae0demr15080567plg.69.1638450786071; Thu, 02 Dec 2021 05:13:06 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:05 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 02/10] nitro_enclaves: Fix stale file descriptors on failed usercopy Date: Thu, 2 Dec 2021 06:12:50 -0700 Message-Id: <20211202131258.9393-3-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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: Mathias Krause BugLink: https://bugs.launchpad.net/bugs/1951873 A failing usercopy of the slot uid will lead to a stale entry in the file descriptor table as put_unused_fd() won't release it. This enables userland to refer to a dangling 'file' object through that still valid file descriptor, leading to all kinds of use-after-free exploitation scenarios. Exchanging put_unused_fd() for close_fd(), ksys_close() or alike won't solve the underlying issue, as the file descriptor might have been replaced in the meantime, e.g. via userland calling close() on it (leading to a NULL pointer dereference in the error handling code as 'fget(enclave_fd)' will return a NULL pointer) or by dup2()'ing a completely different file object to that very file descriptor, leading to the same situation: a dangling file descriptor pointing to a freed object -- just in this case to a file object of user's choosing. Generally speaking, after the call to fd_install() the file descriptor is live and userland is free to do whatever with it. We cannot rely on it to still refer to our enclave object afterwards. In fact, by abusing userfaultfd() userland can hit the condition without any racing and abuse the error handling in the nitro code as it pleases. To fix the above issues, defer the call to fd_install() until all possible errors are handled. In this case it's just the usercopy, so do it directly in ne_create_vm_ioctl() itself. Signed-off-by: Mathias Krause Signed-off-by: Andra Paraschiv Cc: stable Link: https://lore.kernel.org/r/20210429165941.27020-2-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit f1ce3986baa62cffc3c5be156994de87524bab99) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 43 +++++++++-------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index f1964ea4b8269..e21e1e86ad15f 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -1524,7 +1524,8 @@ static const struct file_operations ne_enclave_fops = { * enclave file descriptor to be further used for enclave * resources handling e.g. memory regions and CPUs. * @ne_pci_dev : Private data associated with the PCI device. - * @slot_uid: Generated unique slot id associated with an enclave. + * @slot_uid: User pointer to store the generated unique slot id + * associated with an enclave to. * * Context: Process context. This function is called with the ne_pci_dev enclave * mutex held. @@ -1532,7 +1533,7 @@ static const struct file_operations ne_enclave_fops = { * * Enclave fd on success. * * Negative return value on failure. */ -static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 *slot_uid) +static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 __user *slot_uid) { struct ne_pci_dev_cmd_reply cmd_reply = {}; int enclave_fd = -1; @@ -1634,7 +1635,18 @@ static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 *slot_uid) list_add(&ne_enclave->enclave_list_entry, &ne_pci_dev->enclaves_list); - *slot_uid = ne_enclave->slot_uid; + if (copy_to_user(slot_uid, &ne_enclave->slot_uid, sizeof(ne_enclave->slot_uid))) { + /* + * As we're holding the only reference to 'enclave_file', fput() + * will call ne_enclave_release() which will do a proper cleanup + * of all so far allocated resources, leaving only the unused fd + * for us to free. + */ + fput(enclave_file); + put_unused_fd(enclave_fd); + + return -EFAULT; + } fd_install(enclave_fd, enclave_file); @@ -1671,34 +1683,13 @@ static long ne_ioctl(struct file *file, unsigned int cmd, unsigned long arg) switch (cmd) { case NE_CREATE_VM: { int enclave_fd = -1; - struct file *enclave_file = NULL; struct ne_pci_dev *ne_pci_dev = ne_devs.ne_pci_dev; - int rc = -EINVAL; - u64 slot_uid = 0; + u64 __user *slot_uid = (void __user *)arg; mutex_lock(&ne_pci_dev->enclaves_list_mutex); - - enclave_fd = ne_create_vm_ioctl(ne_pci_dev, &slot_uid); - if (enclave_fd < 0) { - rc = enclave_fd; - - mutex_unlock(&ne_pci_dev->enclaves_list_mutex); - - return rc; - } - + enclave_fd = ne_create_vm_ioctl(ne_pci_dev, slot_uid); mutex_unlock(&ne_pci_dev->enclaves_list_mutex); - if (copy_to_user((void __user *)arg, &slot_uid, sizeof(slot_uid))) { - enclave_file = fget(enclave_fd); - /* Decrement file refs to have release() called. */ - fput(enclave_file); - fput(enclave_file); - put_unused_fd(enclave_fd); - - return -EFAULT; - } - return enclave_fd; } From patchwork Thu Dec 2 13:12:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562693 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=tiMxMIA1; 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 4J4bxF35Qnz9sRR for ; Fri, 3 Dec 2021 00:13:21 +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 1msltj-0005om-W2; Thu, 02 Dec 2021 13:13:15 +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 1msltd-0005mX-AL for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:09 +0000 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (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 D91293F1EE for ; Thu, 2 Dec 2021 13:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450788; bh=kpwLcEDJM/x8BjWWEIYwbw1E6V8bQptXmaQ5RE1ambY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=tiMxMIA1MsmSc7ElSiuSwBKfjDfqn6a/JMZrv1u5FL1WZSysIf4HMKl5oUNOgzvlx HVLrxf2tiYhHBBUT69+1ih/4MoBNVZLSowDmozsmNV/sMWNjEc9YPsbRlDC6cIJC+H OaKYgGJnfs4kwY5QAfFoQAPPS7KZBaJn36IR/2Vcyf93krBDlAcK0kwxb+P6lf/J4o 7+GWjtiYtDOlIZa7TZ4Tn264zY6LOimuMqbnWG/ipDUFA3KoUP4mYqplawU/ayrei5 fWomfh+9X5DcukCgrxIxdojtSDvS6JU/j6SiOZpzibb4KBIH16RychLr2h5WJHTkvr dUYdyEAhGGl9w== Received: by mail-pf1-f200.google.com with SMTP id y68-20020a626447000000b004a2b2d0c39eso17376943pfb.14 for ; Thu, 02 Dec 2021 05:13:08 -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=kpwLcEDJM/x8BjWWEIYwbw1E6V8bQptXmaQ5RE1ambY=; b=RmslJV77oqeP5S6WEDpxOlDks/RX6X7Jek+6pkcUgUZeCZVTDdz2F1Yb7K7pKXbgPd 1SuAt88A13UVEa7okkrXCTySKAl/Qj1kw9HqM+nqABIqF4kuhTFJXFaLu0anVN2fqg3R vpoA4XeeJFJz0WjiM8wAZ7NGaHQaAcV/LxYy+zvG688CA+h0vqkMywtze877u/NYz1sx qCmpB8EzqOwLSnFqQMJy1DAqNWfuhhWc4XaW926Lvm4mukyetL/QJ3S6/jLTzhbk8J0V buCaZ47r0VhnMKxfS3FjKN86TPdaQGAM23kkS3Rd8K1SrWva6fTmKaMCzVwBcF42fiNi wLjQ== X-Gm-Message-State: AOAM531b7iiCe+fwFUaV01y4fNLKRt8IAHNTLr/9m3LcidWHx4ESS8g2 TKuYu9/z8B1fHYSsEEHzP6iiT2qTgYEDrsao08yfKc5uo+uu+B2ogxLCSV/Ic6tJ+QfCemfea20 24qJ7d3hfNNy0Bv2Amkw11GiwWOj8oPbHtUiDQI/Afg== X-Received: by 2002:a17:903:31d1:b0:141:f14b:6ebd with SMTP id v17-20020a17090331d100b00141f14b6ebdmr15079201ple.75.1638450787140; Thu, 02 Dec 2021 05:13:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXCnExRHvnrKhcp4eoChKmepvPh23kx8YocaXsutw5/3o0pyFgU6xc3dDWxZzAd+BBUz47mg== X-Received: by 2002:a17:903:31d1:b0:141:f14b:6ebd with SMTP id v17-20020a17090331d100b00141f14b6ebdmr15079179ple.75.1638450786944; Thu, 02 Dec 2021 05:13:06 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:06 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 03/10] nitro_enclaves: Set Bus Master for the NE PCI device Date: Thu, 2 Dec 2021 06:12:51 -0700 Message-Id: <20211202131258.9393-4-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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: "Longpeng(Mike)" BugLink: https://bugs.launchpad.net/bugs/1951873 Enable Bus Master for the NE PCI device, according to the PCI spec for submitting memory or I/O requests: Master Enable – Controls the ability of a PCI Express Endpoint to issue Memory and I/O Read/Write Requests, and the ability of a Root or Switch Port to forward Memory and I/O Read/Write Requests in the Upstream direction Cc: Andra Paraschiv Cc: Alexandru Vasile Cc: Alexandru Ciobotaru Reviewed-by: Andra Paraschiv Signed-off-by: Longpeng(Mike) Link: https://lore.kernel.org/r/20210621004046.1419-1-longpeng2@huawei.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d874742f6a734c73c22235f9d56b8f10bcf17c5f) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c index b9c1de41e300c..143207e9b9698 100644 --- a/drivers/virt/nitro_enclaves/ne_pci_dev.c +++ b/drivers/virt/nitro_enclaves/ne_pci_dev.c @@ -480,6 +480,8 @@ static int ne_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto free_ne_pci_dev; } + pci_set_master(pdev); + rc = pci_request_regions_exclusive(pdev, "nitro_enclaves"); if (rc < 0) { dev_err(&pdev->dev, "Error in pci request regions [rc=%d]\n", rc); From patchwork Thu Dec 2 13:12:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562695 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=G539EDoz; 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 4J4bxM2xYRz9s1l for ; Fri, 3 Dec 2021 00:13:27 +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 1msltp-0005vM-Kq; Thu, 02 Dec 2021 13:13:21 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mslte-0005mm-FQ for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:10 +0000 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (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-1.canonical.com (Postfix) with ESMTPS id 499273F1AE for ; Thu, 2 Dec 2021 13:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450790; bh=sspXN20e5gI2MDW7JNFqLQh9k7An9iuBC5uB+6L5HJs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G539EDozexooFhtP1adwzBkp9v4RRO7SJPRPCV1PIKdKFNfj/Af73NsSi1+0pjEcO /hxHaxHsL2KxtW7jX9cVozDaD6RC0ZQsaegk79f4RgVBqnJc1VTSwhEbaQtOp30ULK fJg2gwm7modEIBf4OdnnmlJEB/VP7Ha5a4udVJTRGJcqzrogwNCq/Q4mmVgA6iwqL4 lHRKOkoPW9AxMQGf4zeKrDZlXMvwwViNbPMlt+9egMJ4fr3TNJweHojNVFO+1utLCS 4y6yJVmTGnhAYnoqkJOqQ2eD6tR/yexXUtn8MsjBjcBwdvwagkPkL2Wpiv+yKCyvDC xzkQiR88wyqpQ== Received: by mail-pl1-f198.google.com with SMTP id e10-20020a17090301ca00b00141fbe2569dso11642858plh.14 for ; Thu, 02 Dec 2021 05:13:10 -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=sspXN20e5gI2MDW7JNFqLQh9k7An9iuBC5uB+6L5HJs=; b=mJ+4gIj9hm0iqWCOI5n2e4TABBdh7Q9SU88G+oss/ugu5nMYtLLd05z5NdcmpF6sKs 4APzjCN7d8bGRqqjy068KBboyQMSTCgegXm1MSTxc3PTz9jtocb3Zv/zzeaATQaz3HO4 G9NASFI3LrGFMc8xEP/7CLEYM6iy+WXfJdAtaK/h68km1jQuoDoGfpZB7qOfB+dn2LCV pGNLjZztqwusZwjfFTHCf7T1/VmU3iO4U2XPR22EUS6NSbsHMDFEd03jtNtgoJIksKJv M0EOkG+GCoKpWuxT2yFVILv99ob5g0StwhAjLCaJFiksmpp+a9xt8soIhb1PZjmgb+7K F+CQ== X-Gm-Message-State: AOAM533Qqwhp4WkwSLKQryG2tdLIqD0TVMDPltJLGcSg/WRU52v10oVw HJ/rwpclcV8fkFlcp6xJ4uqOMI18EPdreSCaZsom35jezrRtEnS/oeRkuHiXa41N4hWo0KNmk6V EnZZJ5pb7PRSatQljGdbk6R+AgQCdKBI/QBTQQQSrXg== X-Received: by 2002:a17:903:124e:b0:143:a388:a5de with SMTP id u14-20020a170903124e00b00143a388a5demr15259013plh.73.1638450788761; Thu, 02 Dec 2021 05:13:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqTzk+0y/uiB+G2nXKiT/FervjFrfGb3NlOkqyUdwXUi98SgZ641iAN21o+8H2nVWayXqoAA== X-Received: by 2002:a17:903:124e:b0:143:a388:a5de with SMTP id u14-20020a170903124e00b00143a388a5demr15258953plh.73.1638450788080; Thu, 02 Dec 2021 05:13:08 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:07 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 04/10] nitro_enclaves: Enable Arm64 support Date: Thu, 2 Dec 2021 06:12:52 -0700 Message-Id: <20211202131258.9393-5-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Update the kernel config to enable the Nitro Enclaves kernel driver for Arm64 support. Reviewed-by: George-Aurelian Popescu Acked-by: Stefano Garzarella Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-2-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit f7e55f05301e71af557c45224817438670225aa7) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/Kconfig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/virt/nitro_enclaves/Kconfig b/drivers/virt/nitro_enclaves/Kconfig index 8c9387a232df8..f53740b941c0f 100644 --- a/drivers/virt/nitro_enclaves/Kconfig +++ b/drivers/virt/nitro_enclaves/Kconfig @@ -1,17 +1,13 @@ # SPDX-License-Identifier: GPL-2.0 # -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # Amazon Nitro Enclaves (NE) support. # Nitro is a hypervisor that has been developed by Amazon. -# TODO: Add dependency for ARM64 once NE is supported on Arm platforms. For now, -# the NE kernel driver can be built for aarch64 arch. -# depends on (ARM64 || X86) && HOTPLUG_CPU && PCI && SMP - config NITRO_ENCLAVES tristate "Nitro Enclaves Support" - depends on X86 && HOTPLUG_CPU && PCI && SMP + depends on (ARM64 || X86) && HOTPLUG_CPU && PCI && SMP help This driver consists of support for enclave lifetime management for Nitro Enclaves (NE). From patchwork Thu Dec 2 13:12:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562697 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=v354DOVB; 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 4J4bxT5kVYz9s1l for ; Fri, 3 Dec 2021 00:13:33 +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 1msltv-00064N-EM; Thu, 02 Dec 2021 13:13:27 +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 1msltf-0005n8-Tz for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:11 +0000 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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 A69C93F1EE for ; Thu, 2 Dec 2021 13:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450791; bh=/4RjIXuRf1kOE1+iO8Lmd/WZ5ZG+62b1X3OFe+AyOlo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=v354DOVBaTqohmKiAcRH401Q97l491E0W5wy6O2/S7fppu09ZPql0VhRMtdmaWtdV nXBr9JcYgZUaFstImIPVuF5qGfJ6TEExEu8+3XdDl+QcbwdK57ItKrj/i6RJioCghE WTlraNLe9qeI6WoN8XYEKYlRRitdIVfeMdENAXnQg5OT+vtbyluuR0gC6w7LVgd/dv x8N7r9Fhlz/mZU5x37PCzgvmAguSFX/k5driA3ErrZzDhpWkgukg5XtV4XObUcuVMm ym7SnGpmhMDaBVg7WMvaD70nQ4BaxT3546hn9FVUp+wdrPAFwoUSUwGj92i6VbBtAV 16R6eWVmIJwDg== Received: by mail-pj1-f70.google.com with SMTP id b8-20020a17090a10c800b001a61dff6c9dso10588811pje.5 for ; Thu, 02 Dec 2021 05:13:11 -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=/4RjIXuRf1kOE1+iO8Lmd/WZ5ZG+62b1X3OFe+AyOlo=; b=59Imw4tM+RkQfW2dITYVyQBSP3yUKbg2gRfVXN84e4LeSjGApApGWSJsJ05q2OAwP2 +H9PfYs055QOeELEGiIWnNWwLCMr14K0Ec3Cy86lSSdNIilb4GyJsyWY47+a64am0d/K 377/w6ZgARjHLBz+8pY/UBgF63rLakcL6Ap6IEZe6b0mk/H7RepGEAuPlepgIYoZMtp6 rxSw/YEoqg88XtJRbKx1J6f6xTCElTKSfZJoPzq5kSsfhEWw2N3HzZXCfuPUEPqmh2BM Qx4UghUBdfC5G/q5N5e7VRpIDHusFDzdaYPfOrZyJRs2FmOAcJubW4fJmGoDaKd03v6F 3g+Q== X-Gm-Message-State: AOAM531koxWte/op1egu4wxXOybw1R96vq6SkBsnBqCjnQu5EM70LzpP zeGbjC6K/v7w5UqrJ7usCniJpGSoGefFSbRCu7Er6Juesg+42Vm4gcBCNfSKP180sQmbUVOEx6f OVS7+oFBYVxrASRDAmMVCgjh30cDymvEwHdfkBPqosg== X-Received: by 2002:a17:902:ba84:b0:142:5514:8dd7 with SMTP id k4-20020a170902ba8400b0014255148dd7mr15287927pls.87.1638450789931; Thu, 02 Dec 2021 05:13:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBBvWNw4/EF8jLOAaTSaNk6xKah8EosAUE+tlMRWjhqQk16dzzvYB7BmpQ1qsyhj7YVhM0ZQ== X-Received: by 2002:a17:902:ba84:b0:142:5514:8dd7 with SMTP id k4-20020a170902ba8400b0014255148dd7mr15287898pls.87.1638450789603; Thu, 02 Dec 2021 05:13:09 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:08 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 05/10] nitro_enclaves: Update documentation for Arm64 support Date: Thu, 2 Dec 2021 06:12:53 -0700 Message-Id: <20211202131258.9393-6-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 39b0c8fe2654a..74c2f5919c886 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 From patchwork Thu Dec 2 13:12:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562698 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=aRrEAaWZ; 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 4J4bxT6SVlz9sRN for ; Fri, 3 Dec 2021 00:13:33 +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 1msltv-000676-Nw; Thu, 02 Dec 2021 13:13:27 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1msltg-0005nX-UU for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:12 +0000 Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (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-1.canonical.com (Postfix) with ESMTPS id AC59B3F1AE for ; Thu, 2 Dec 2021 13:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450792; bh=p49hHxsVwQ5jVIF3lw/Zy1mM2wH7prieIuAPdrlyl2g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aRrEAaWZx85JPhjQPmCpeDmE8WcJe21NICwx1OwMTByKg5JDtXNjYd99Cxg+WftOD IVRBmeTORXFVb1f8V4wbm1rTIN0ZmORVH589250Lq9Tice086k/uyM6kf1MqDI3h72 wjsv7PTOTFOjMJ776WwgQX2XyrJ4T6D/9gHSSWKU9fYmWy4mTAz2cMizg0+fELFy/A 9vZ6VwKsvzMa4UhnTP8SouGZEiMejQPMA4Mej52rHeLVbkp6cODMzJsUS5ejHtLZEk upnCoHn0UY5Yt1qEUnIsTSl0wTxERlS6hiS5URsBb4Pwp5uYTQcvTFH3X50DFfcgni tn1xUENk3fsqA== Received: by mail-pg1-f198.google.com with SMTP id n22-20020a6563d6000000b0029261ffde9bso14095016pgv.22 for ; Thu, 02 Dec 2021 05:13:12 -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=p49hHxsVwQ5jVIF3lw/Zy1mM2wH7prieIuAPdrlyl2g=; b=K78zYIr4b0yG+CBNbwi42769Y/0sfF6sL3mTufVXaO6TiSYSwimIi8d0b+YHXzf57+ V9VMVgKwYbmVT+fYE+SVoHPFkuaUNcjLT78upOpQWfLRGTsM7hgHqowSfOtyT4/Rbn3c jcc7JRtAkvffbOs+Z1D3vFr8oZoPMOMr7FHkXeKZDZ4fHMXy6A81Z/ZdoF5zOWKwU2lf fHxcj7c4C8xN9/BgMozm95vFWgYOO5YRrwC5ge+re8Rq7XJXjk9d+aU/ZI+5oN4Aj3g/ 3wwGvqM6VhsUTkO5qUVk6cyEaEgKlILPyJbKa0xH8duDSLDCqMqaTaXSCITYi97Hn31e ZOxg== X-Gm-Message-State: AOAM532Y8lxIkdTFyWJ0wa92UsJXqlSTPjDOpntddF24xpbnG6yfS8uZ +xjlLPWJvDmIFsBLf9tptDiCYiK1Uz65fOVEvfRPTEMMMGnNAORK4/JN0aSxpFtnwrACRIsTNND H/IwPaUxbLopenydDtl4Av2jLJY8YzDw7Re3agRU+ug== X-Received: by 2002:a17:90a:5d8b:: with SMTP id t11mr5847553pji.8.1638450790752; Thu, 02 Dec 2021 05:13:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDV7lcActikx6XmzPSf5LNbbnXuM7bPfheHDotXNRHHIVkvV2vMu6veh5C4DEabpaimILEnw== X-Received: by 2002:a17:90a:5d8b:: with SMTP id t11mr5847521pji.8.1638450790450; Thu, 02 Dec 2021 05:13:10 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:10 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 06/10] nitro_enclaves: Add fix for the kernel-doc report Date: Thu, 2 Dec 2021 06:12:54 -0700 Message-Id: <20211202131258.9393-7-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Fix the reported issue from the kernel-doc script, to have a comment per identifier. Reviewed-by: George-Aurelian Popescu Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-4-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit e16a30a419c89d71e68f4da348b48918944fd49c) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/ne_pci_dev.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.h b/drivers/virt/nitro_enclaves/ne_pci_dev.h index 8bfbc66078185..6e9f28971a4e0 100644 --- a/drivers/virt/nitro_enclaves/ne_pci_dev.h +++ b/drivers/virt/nitro_enclaves/ne_pci_dev.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ #ifndef _NE_PCI_DEV_H_ @@ -84,9 +84,13 @@ */ /** - * NE_SEND_DATA_SIZE / NE_RECV_DATA_SIZE - 240 bytes for send / recv buffer. + * NE_SEND_DATA_SIZE - Size of the send buffer, in bytes. */ #define NE_SEND_DATA_SIZE (240) + +/** + * NE_RECV_DATA_SIZE - Size of the receive buffer, in bytes. + */ #define NE_RECV_DATA_SIZE (240) /** From patchwork Thu Dec 2 13:12:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562699 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=v65AxNRS; 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 4J4bxb57N5z9s1l for ; Fri, 3 Dec 2021 00:13:39 +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 1msltz-0006Dq-A8; Thu, 02 Dec 2021 13:13:31 +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 1mslth-0005ni-KC for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:13 +0000 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (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 582783F1EE for ; Thu, 2 Dec 2021 13:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450793; bh=sbZly5T29pd8/kdSUqi0yhQVesupvHS6S2Q+GCOSZws=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=v65AxNRSeBd1PB/hpkyCBLEXL7w3t3Wfl3CHfui2/D6Zr3r/W65G/82BGmJRPu/CB 83Lgxm18NfM4QfSmgueot+9htkqyP/1a3e5mFuPNhJUesNSbclulU4kkmw24NrpZTH o7/f3R/WfB+nBELaugg4SDWqW4MootCSHu9XC86aYpQWzZvJEACFCJvDH9gNPaqlYZ o7vAQVh6BYxizDe1K1hdDSqORn3T38sizORbpJWa33BCoxNInvuuH+Hc2vR6tpTV9H fIvYI4TPQnnVNUjhlJ58mO2KlV+6xV0tLAjjaC7L75L0WulPBZ4s7wJ7i4XCV7ubna 6kPPKwG1woHMg== Received: by mail-pf1-f200.google.com with SMTP id 184-20020a6217c1000000b0049f9aad0040so17361539pfx.21 for ; Thu, 02 Dec 2021 05:13:13 -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=sbZly5T29pd8/kdSUqi0yhQVesupvHS6S2Q+GCOSZws=; b=eGIO9ShMROs//CJqZkXDGpkvHfuFeHxdjWDoSR6O9P1J8iE0rljPD66VmUiw3219bg LRrAsaw+YSUdaXw197dZiGk+NE5tKyW954qOxCGl2OKouXNkeeMnLYxbZX1cIDHVCZ4p jVDBkl3PVFy1c1WlR5Q2LfV3kWzhCpscodJLJOTyD/68i20qQC3/YFHXnXjIxjFHoKAV hgWBS0fjnGvSNBq6bVMwNhaZWwN345J28WD1WjqbACu/AvQEXHq/lwEG1mJvAZT0kBjd xeR209Hf8Q5ze+5BULvw47a6fjqDd+v5BnyPmj8fuOxyDhdNuVcS0Hw7cmzzxmiB/ZPq qCaA== X-Gm-Message-State: AOAM532mlwJdZnv/Ka9LXAdGcnDdp9z127A2h4ykt6rnflGSDPYgP9BL snTxcQWQ2XFm1HJQ3V9LPsx4Fnh66unPmI6grX6w1Yv0ftV0iyDqf3OS+eE7VRauK6ZnK5NrvUE StB5ZrBnqqaCq2Rp7fSx+zeU6QrXoAZfXFsrrjP2TVw== X-Received: by 2002:a17:90a:e54c:: with SMTP id ei12mr5971454pjb.81.1638450791757; Thu, 02 Dec 2021 05:13:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPnEDtWv4Mk5iFLA+Fx3Mn+Mj26ufYzzQSey6loiIFaJfQWHJXWJSO2+3bven08hXimTDHlQ== X-Received: by 2002:a17:90a:e54c:: with SMTP id ei12mr5971428pjb.81.1638450791479; Thu, 02 Dec 2021 05:13:11 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:10 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 07/10] nitro_enclaves: Update copyright statement to include 2021 Date: Thu, 2 Dec 2021 06:12:55 -0700 Message-Id: <20211202131258.9393-8-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Update the copyright statement to include 2021, as a change has been made over this year. Check commit d874742f6a73 ("nitro_enclaves: Set Bus Master for the NE PCI device") for the codebase update from this file (ne_pci_dev.c). Reviewed-by: George-Aurelian Popescu Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-5-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit e3cba4d2454c2e4034147ca53b75c6592ded7c5a) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c index 143207e9b9698..40b49ec8e30b1 100644 --- a/drivers/virt/nitro_enclaves/ne_pci_dev.c +++ b/drivers/virt/nitro_enclaves/ne_pci_dev.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ /** From patchwork Thu Dec 2 13:12:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562696 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=G4vuxnQw; 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 4J4bxR0ghlz9s1l for ; Fri, 3 Dec 2021 00:13:31 +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 1msltr-0005yh-Rv; Thu, 02 Dec 2021 13:13:23 +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 1msltj-0005o9-1n for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:15 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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 C358E3F1EE for ; Thu, 2 Dec 2021 13:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450794; bh=QrUqFk5XjRKpnKvla3t8noH8JriBQ+9zF/jpq2P2NbE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G4vuxnQwtRbAuwWyqnGUbRe1yicKMqEeXM6i6txNK2ZyP4GUrUwtEvPoJqhQnO7kZ DAGFjJ6kWrBDohAfYNd8njQD20yb0dhodZwt0H4fW4CNmCJThSLq7M9r1RfVvy3yuZ 0MuteX6C+OorHC4NrdTHz0pVdFOUE3o1WOjKCjWVXqy7lt9wRlshImphAA3WObAz1q ha07dMoJQS3I1f/0fqUqSEdI7NcDTSsfWOfl8U91xVIzSS4Nmax6no2nodjq2O9C8e y0ju4QXELUGRaqkPmSe16D7rrhcVabAaJOq5kTpHfxUOw14e30OxNlwHGpUUT4EIuV ymmCJYVN2s4AQ== Received: by mail-pj1-f71.google.com with SMTP id x1-20020a17090a294100b001a6e7ba6b4eso3183352pjf.9 for ; Thu, 02 Dec 2021 05:13:14 -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=QrUqFk5XjRKpnKvla3t8noH8JriBQ+9zF/jpq2P2NbE=; b=7s+s5AMa/aIk8FavP1AJe55ImF+HWEXSTSS+IUEQ96IW/Z9P27TqFsBFHFULpaLNEj PiM2gIxYt3ehV8ZAFTKdaD6ETyNvEIGkewNnw2ZlRsr2mD00QR9ntu84iXW2xx953gud +xsUrpB3X6xHFuSAmHEBmIA+9lWrXVtiNxxk7n5/ijBXcixeOeQRRqQYrQipOamjXX7S NHAcbiWj8OGCPVhKYaLKfcroXHLw45flTzkjYCasxE0K+AuP1VTZQkB455+eMQRz8JPE 75Jt+5isQAn3wUMW0RsowcqLr7EXTEYNBOb5kqvUnJcFyToL+gw3AQQMptHAsGOWApEZ N21Q== X-Gm-Message-State: AOAM531cGvxCUsb3Q4Uu/tz5Rig3Bfjoxa1+1f8OrxuQdd+XiNpeBEg2 Tc7ZCE01DVCmldDXUfFuF78nYjV6uJ6DF28cWboeiOOOD7/l6hSJDgCyjNPEZRmg/iqyVDAEC+9 E7f4dErb7iz8qvSwvy3jY7nWDoSU72UOFQl2CSBOA+w== X-Received: by 2002:a63:111d:: with SMTP id g29mr9297791pgl.49.1638450793041; Thu, 02 Dec 2021 05:13:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJx70IFyuIjpQcDa9YDXpVLqs6h+rpt3EhNUM3CavV7BY1++rbgKL5HbrbhHCslaMYH0HAqVqw== X-Received: by 2002:a63:111d:: with SMTP id g29mr9297778pgl.49.1638450792732; Thu, 02 Dec 2021 05:13:12 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:12 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 08/10] nitro_enclaves: Add fixes for checkpatch match open parenthesis reports Date: Thu, 2 Dec 2021 06:12:56 -0700 Message-Id: <20211202131258.9393-9-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Update the codebase formatting to fix the reports from the checkpatch script, to match the open parenthesis. Reviewed-by: George-Aurelian Popescu Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-6-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 02bba596de19c0b951b2843ebcd7a9da6e0938d4) Signed-off-by: Tim Gardner --- drivers/virt/nitro_enclaves/ne_misc_dev.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/virt/nitro_enclaves/ne_misc_dev.c b/drivers/virt/nitro_enclaves/ne_misc_dev.c index e21e1e86ad15f..8939612ee0e08 100644 --- a/drivers/virt/nitro_enclaves/ne_misc_dev.c +++ b/drivers/virt/nitro_enclaves/ne_misc_dev.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ /** @@ -284,8 +284,8 @@ static int ne_setup_cpu_pool(const char *ne_cpu_list) ne_cpu_pool.nr_parent_vm_cores = nr_cpu_ids / ne_cpu_pool.nr_threads_per_core; ne_cpu_pool.avail_threads_per_core = kcalloc(ne_cpu_pool.nr_parent_vm_cores, - sizeof(*ne_cpu_pool.avail_threads_per_core), - GFP_KERNEL); + sizeof(*ne_cpu_pool.avail_threads_per_core), + GFP_KERNEL); if (!ne_cpu_pool.avail_threads_per_core) { rc = -ENOMEM; @@ -735,7 +735,7 @@ static int ne_add_vcpu_ioctl(struct ne_enclave *ne_enclave, u32 vcpu_id) * * Negative return value on failure. */ static int ne_sanity_check_user_mem_region(struct ne_enclave *ne_enclave, - struct ne_user_memory_region mem_region) + struct ne_user_memory_region mem_region) { struct ne_mem_region *ne_mem_region = NULL; @@ -771,7 +771,7 @@ static int ne_sanity_check_user_mem_region(struct ne_enclave *ne_enclave, u64 userspace_addr = ne_mem_region->userspace_addr; if ((userspace_addr <= mem_region.userspace_addr && - mem_region.userspace_addr < (userspace_addr + memory_size)) || + mem_region.userspace_addr < (userspace_addr + memory_size)) || (mem_region.userspace_addr <= userspace_addr && (mem_region.userspace_addr + mem_region.memory_size) > userspace_addr)) { dev_err_ratelimited(ne_misc_dev.this_device, @@ -836,7 +836,7 @@ static int ne_sanity_check_user_mem_region_page(struct ne_enclave *ne_enclave, * * Negative return value on failure. */ static int ne_set_user_memory_region_ioctl(struct ne_enclave *ne_enclave, - struct ne_user_memory_region mem_region) + struct ne_user_memory_region mem_region) { long gup_rc = 0; unsigned long i = 0; @@ -1014,7 +1014,7 @@ static int ne_set_user_memory_region_ioctl(struct ne_enclave *ne_enclave, * * Negative return value on failure. */ static int ne_start_enclave_ioctl(struct ne_enclave *ne_enclave, - struct ne_enclave_start_info *enclave_start_info) + struct ne_enclave_start_info *enclave_start_info) { struct ne_pci_dev_cmd_reply cmd_reply = {}; unsigned int cpu = 0; @@ -1574,7 +1574,8 @@ static int ne_create_vm_ioctl(struct ne_pci_dev *ne_pci_dev, u64 __user *slot_ui mutex_unlock(&ne_cpu_pool.mutex); ne_enclave->threads_per_core = kcalloc(ne_enclave->nr_parent_vm_cores, - sizeof(*ne_enclave->threads_per_core), GFP_KERNEL); + sizeof(*ne_enclave->threads_per_core), + GFP_KERNEL); if (!ne_enclave->threads_per_core) { rc = -ENOMEM; From patchwork Thu Dec 2 13:12:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562700 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=mKDy8nw/; 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 4J4bxd5VcZz9s1l for ; Fri, 3 Dec 2021 00:13:41 +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 1mslu0-0006Gi-TC; Thu, 02 Dec 2021 13:13:32 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1msltk-0005op-AU for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:16 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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-1.canonical.com (Postfix) with ESMTPS id CA6F23F1BA for ; Thu, 2 Dec 2021 13:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450795; bh=CyEXTkFa81xgMPH23q/uu7J9fxz9JKC20ZXFSd8mN3E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mKDy8nw/bQDMBtTht476B8TE5WaRtuXHnxgObdwJgwQLWJ0G1s2SvJAq/txAjmrm2 G0KRsCoEsSZO++jigr79WTp8aepv20MLUqbKxQ21Nqmr9y+mGw8z5JEKHzf48TcVeg PsRiw2zK2WjuWnPVE/G2kYfna00p0TTodSzUXzrDaRqOndbvVj5dxHul/NRtOKVsLe f8iCP6FaLwnvsKdzKmPxUxia8mi0iEPyqJycOTEZnpn7LZRLCZGIlZb1WG+TqwnVlm Lcza1l0wFuUZ3oEsv82fP6arjjlYIgOpNlRDLmyoxR7FexRfcaNf4v1FQLLjHfKfne ezrvNzOYbOg/g== Received: by mail-pj1-f71.google.com with SMTP id x3-20020a17090a1f8300b001a285b9f2cbso10580015pja.6 for ; Thu, 02 Dec 2021 05:13:15 -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=CyEXTkFa81xgMPH23q/uu7J9fxz9JKC20ZXFSd8mN3E=; b=AmD5JKgGRkSWbcVFoKBREjt4E/B0kQX4s9a8ezQuItZczi3nGDK9wzDWlzwSBoy0qd VWW+GlKCeyYYGEon/1Yt11Z1SYwU0xsysC1LgxO4JHPoobfW08vXBjosrDprZHDm6PWS IX1QTn6B4NdlmsaNaRgtqEFUhk5Edv63ewMOI8T1Sh/ccxt4tbTSFOvunfxsHjuEMU8A isvRmW+waRFEB3y/zzvU8ja8e2C97uPNILa3dfcZ/QHAUltO4aW0f2IlLgzIo1SiYNgj LO1W8QbqJ39+oJ5C7ghAmKvKdXAQLfztfjXujWxTjkFw8ancB0hsbe1svSOGY24FiePK 2pFQ== X-Gm-Message-State: AOAM530fR4+DSUx/PC5t0ALMOEYO9IOeyr70wAmUtcuUeOdhaov4hK9M S2wALJw2JG0O8IYqmhgrx6mupp6op9WDELlqw2JGbyNTAY2L2gmXnPT40zR9kFhMFJj+LG23fKN l02RnEyynZW0THfrFA1IJghENf3DIbiUBDFkFGbtuMw== X-Received: by 2002:a17:902:e890:b0:142:f3:7bf7 with SMTP id w16-20020a170902e89000b0014200f37bf7mr14982778plg.87.1638450793840; Thu, 02 Dec 2021 05:13:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiWVnKJpTY0umzAPanpvAift4G/S/RwH84BJrb5UsCFUsO/Nz+2I2a982LZJD2i1boPVdFmg== X-Received: by 2002:a17:902:e890:b0:142:f3:7bf7 with SMTP id w16-20020a170902e89000b0014200f37bf7mr14982755plg.87.1638450793540; Thu, 02 Dec 2021 05:13:13 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:13 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 09/10] nitro_enclaves: Add fixes for checkpatch spell check reports Date: Thu, 2 Dec 2021 06:12:57 -0700 Message-Id: <20211202131258.9393-10-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Fix the typos in the words spelling as per the checkpatch script reports. Reviewed-by: George-Aurelian Popescu Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-7-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 059ebe4fe332c5d1c25124166527cdf9fe43a3ce) Signed-off-by: Tim Gardner --- include/uapi/linux/nitro_enclaves.h | 10 +++++----- samples/nitro_enclaves/ne_ioctl_sample.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/nitro_enclaves.h b/include/uapi/linux/nitro_enclaves.h index b945073fe544d..e808f5ba124d4 100644 --- a/include/uapi/linux/nitro_enclaves.h +++ b/include/uapi/linux/nitro_enclaves.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ #ifndef _UAPI_LINUX_NITRO_ENCLAVES_H_ @@ -60,7 +60,7 @@ * * Context: Process context. * Return: - * * 0 - Logic succesfully completed. + * * 0 - Logic successfully completed. * * -1 - There was a failure in the ioctl logic. * On failure, errno is set to: * * EFAULT - copy_from_user() / copy_to_user() failure. @@ -95,7 +95,7 @@ * * Context: Process context. * Return: - * * 0 - Logic succesfully completed. + * * 0 - Logic successfully completed. * * -1 - There was a failure in the ioctl logic. * On failure, errno is set to: * * EFAULT - copy_from_user() / copy_to_user() failure. @@ -118,7 +118,7 @@ * * Context: Process context. * Return: - * * 0 - Logic succesfully completed. + * * 0 - Logic successfully completed. * * -1 - There was a failure in the ioctl logic. * On failure, errno is set to: * * EFAULT - copy_from_user() failure. @@ -161,7 +161,7 @@ * * Context: Process context. * Return: - * * 0 - Logic succesfully completed. + * * 0 - Logic successfully completed. * * -1 - There was a failure in the ioctl logic. * On failure, errno is set to: * * EFAULT - copy_from_user() / copy_to_user() failure. diff --git a/samples/nitro_enclaves/ne_ioctl_sample.c b/samples/nitro_enclaves/ne_ioctl_sample.c index 480b763142b34..6a60990b2e202 100644 --- a/samples/nitro_enclaves/ne_ioctl_sample.c +++ b/samples/nitro_enclaves/ne_ioctl_sample.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ /** @@ -638,7 +638,7 @@ static int ne_start_enclave(int enclave_fd, struct ne_enclave_start_info *encla } /** - * ne_start_enclave_check_booted() - Start the enclave and wait for a hearbeat + * ne_start_enclave_check_booted() - Start the enclave and wait for a heartbeat * from it, on a newly created vsock channel, * to check it has booted. * @enclave_fd : The file descriptor associated with the enclave. From patchwork Thu Dec 2 13:12:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562701 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=JvqzMUpc; 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 4J4bxf3Hflz9sRN for ; Fri, 3 Dec 2021 00:13:42 +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 1mslu2-0006J9-8q; Thu, 02 Dec 2021 13:13:34 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1msltl-0005qF-1w for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:13:17 +0000 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (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-1.canonical.com (Postfix) with ESMTPS id C9E943F1AE for ; Thu, 2 Dec 2021 13:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638450796; bh=8LgNoCXK1yeGRhfAXoU5I9oS7OdQHvVZnlDdRU6mICQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JvqzMUpcGYF9pRKxk8VUd8UPg5vS/cp2USJ2t/aNCfiV204tqDG86aDCiU3NuIsCI IyxEP9jFim1OZQida+bp3tiv7GYYb/Mh5hNfV3gs0ubPLvtn9Uu4bW1pvGjq2IDGrG SICbdikXLKd8dz6nhSDlGCJ3s82Va06m6rnYUXnaguNwmunjdRnJGtrZIK0rMJB7wP +AvqTUTpWP10qCPDV90TI8GMdOHN9i6ft1fHjEd5bH9QuNsR0eEBRoVP/a1Y/CZ/JE KEP8AowiUnUksfOYynzD0yB1LdXsg585jAkml2KyYt8HL5Gxlzbu1RDFok1Ir37cWe 5cj0Rnkeqav8w== Received: by mail-pg1-f200.google.com with SMTP id x23-20020a634a17000000b003252e908ce3so10488855pga.1 for ; Thu, 02 Dec 2021 05:13:16 -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=8LgNoCXK1yeGRhfAXoU5I9oS7OdQHvVZnlDdRU6mICQ=; b=kX5atecJktUo8wWLIcttYHBnn08a0rw27m4gFw+4v2/sUJROs2nQmhb1uB82WtbIMD YxA/LydZmwnl5MAaV98B9V27fkzItZOyE9K1t2tsKH60Qiq9kGXPrtzsbSv0Ozyt6jLi MBWKiSsw83+4yWByRp0sPI6uLQ7RL4mR9vujg7BYbgt5eLkndfZeYVuW/p2/nZWJMiVX HHs4gYkat0CSB3DgHYXJjp1gUWr/KqWmyoJ5hxTkiP7MvOkUuEhTELro8VtU4UXJoNA2 dlISKl+WmqQ8PsucrPK0MmwO0c/kLmr10LDvvPLno+si7WdMB31vriVy3KbETSLX7aQb GWGg== X-Gm-Message-State: AOAM533E1PS32HLFqZdJcm30NkGw2zBwFcLlC4Nai+aIOK8hQspneDYw 2na7DVycOfK4kK9947HiQdCSzbJvZwURn+mGJXG2oldzQ13U9wXeD5kNoAe9AEEE4DZ4CAkLC7e 80AdGrbEfCEb8VetN8BHGiFcNvZ04ACJlqRpDDL/Gew== X-Received: by 2002:a05:6a00:1c56:b0:4a4:f8cb:2604 with SMTP id s22-20020a056a001c5600b004a4f8cb2604mr12677458pfw.34.1638450795231; Thu, 02 Dec 2021 05:13:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJytoIIA3hJ/McepNhUe4Qd2499Tc5h3ll7csZt86j3ZZWbLS3pBsPuticlqHxtwdC2ctngPhg== X-Received: by 2002:a05:6a00:1c56:b0:4a4:f8cb:2604 with SMTP id s22-20020a056a001c5600b004a4f8cb2604mr12677434pfw.34.1638450795006; Thu, 02 Dec 2021 05:13:15 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id p3sm2666992pjd.45.2021.12.02.05.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:13:14 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 10/10] nitro_enclaves: Add fixes for checkpatch blank line reports Date: Thu, 2 Dec 2021 06:12:58 -0700 Message-Id: <20211202131258.9393-11-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202131258.9393-1-tim.gardner@canonical.com> References: <20211202131258.9393-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 Remove blank lines that are not necessary, fixing the checkpatch script reports. While at it, add a blank line after the switch default block, similar to the other parts of the codebase. Reviewed-by: George-Aurelian Popescu Signed-off-by: Andra Paraschiv Link: https://lore.kernel.org/r/20210827154930.40608-8-andraprs@amazon.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit da1c396a81b87541cf7a7c2c6e128b722461a1c8) Signed-off-by: Tim Gardner --- samples/nitro_enclaves/ne_ioctl_sample.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samples/nitro_enclaves/ne_ioctl_sample.c b/samples/nitro_enclaves/ne_ioctl_sample.c index 6a60990b2e202..765b131c73190 100644 --- a/samples/nitro_enclaves/ne_ioctl_sample.c +++ b/samples/nitro_enclaves/ne_ioctl_sample.c @@ -185,7 +185,6 @@ static int ne_create_vm(int ne_dev_fd, unsigned long *slot_uid, int *enclave_fd) return 0; } - /** * ne_poll_enclave_fd() - Thread function for polling the enclave fd. * @data: Argument provided for the polling function. @@ -560,8 +559,8 @@ static int ne_add_vcpu(int enclave_fd, unsigned int *vcpu_id) default: printf("Error in add vcpu [%m]\n"); - } + return rc; }