From patchwork Thu Dec 2 13:46:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1562725 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=aiy+83jW; 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 4J4cgl3crlz9sRN for ; Fri, 3 Dec 2021 00:46:43 +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 1msmPz-0006B5-7E; Thu, 02 Dec 2021 13:46:35 +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 1msmPw-00069H-Ig for kernel-team@lists.ubuntu.com; Thu, 02 Dec 2021 13:46:32 +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 613083F1AE for ; Thu, 2 Dec 2021 13:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638452792; bh=dAs19Oppp63KDaeR9B1NiePkxjx5xPvH2cf7paOklQY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=aiy+83jW9nWTZccToP6SbBuc2lbuQiflJOfGt2zi51GfedXLZ6m5TqzSquyK8GVzd HLue1oOAKcjva9LJ/BI/jN1vfBYYev/OztxsgzDNuzJtDgmbFrWiqJL5J0dNTB725E jaH9fqNxvNniXxx7wxmImQAlMpNRifBd4nFnrr9wnHNGrD5q+y4AqRKkjQn5VBUdPL Dbug+F4ncF2X/PzJXe7FZOovuJgv1VcZwgQBVKXaSmBvoPbIbZ0MoGIY7LPiqm5C7P oSGP6sonPpZ8zYtKZ4C2zIuNE4sAArxPJUVXba4qcH/cRJSqVCgA1JqBk52rwwE7L9 3x+nAGGm4SeHg== Received: by mail-pj1-f72.google.com with SMTP id x3-20020a17090a1f8300b001a285b9f2cbso10626660pja.6 for ; Thu, 02 Dec 2021 05:46:32 -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=dAs19Oppp63KDaeR9B1NiePkxjx5xPvH2cf7paOklQY=; b=LHGqUJ6V5iXNcm08/1PducaJ2glgqP8rycI9rNTIKJTXUCoZ+szY5qz5rmjyXJplJW DXtdDeZ2Ys/WzbJLJd2owcnPTDN7J645YHwJCPJgOaAsx3IKLKM7AOu/87Vw25E65TyK Ui3vpEWI6kb5F1y8kAOG5a/itwD7vABldjTjkccK+qdTJAMN7vIopaK9zf8wgkfff6gn DTB1CDVkyDJabOnygnHva5K2gHvD8z3CVBT5+lzbbTj3WCLfiXYuOfNRU4Is5PU+Zchi rD8HlggKVgWD8zwwhAvs9fm6lNUiQ2NvPdq/eoWFAk0vklx+ORbEiEPCWqmW53oRF1uj sxZA== X-Gm-Message-State: AOAM5337dB8hrpd/7uZxqetH8bCqb757E01CuF3AI5/2MS2HNxOQ2jC/ wRF0V7WLMEQefEFccz+/BnhyEVxd6E/Yizh7SRqSCAJQ/5jEzl9gMrBEfDkgMj85s7QZVYriuM8 IHp0FE3dYuePnU4G0lNxbBRlfRUmB9BdVdTXQfdkdeA== X-Received: by 2002:a17:90b:3e8c:: with SMTP id rj12mr6110877pjb.152.1638452790801; Thu, 02 Dec 2021 05:46:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcisjmJvDs5cA8dp996EVe9/mOtw3wPdLQqAZOAtk6+I2OI9r4hV9e0xB/CObYm5IX8WQPFQ== X-Received: by 2002:a17:90b:3e8c:: with SMTP id rj12mr6110849pjb.152.1638452790580; Thu, 02 Dec 2021 05:46:30 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id a11sm3517258pfh.108.2021.12.02.05.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 05:46:29 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/9] nitro_enclaves: Set Bus Master for the NE PCI device Date: Thu, 2 Dec 2021 06:46:15 -0700 Message-Id: <20211202134622.14875-3-tim.gardner@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211202134622.14875-1-tim.gardner@canonical.com> References: <20211202134622.14875-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 b9c1de41e300..143207e9b969 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);