From patchwork Fri Oct 30 17:33:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1391185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com 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 ozlabs.org (Postfix) with ESMTPS id 4CN8Yp6dl7z9sTR; Sat, 31 Oct 2020 04:34:06 +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 1kYYHn-0005DF-S5; Fri, 30 Oct 2020 17:33:59 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kYYHm-0005CR-Dt for kernel-team@lists.ubuntu.com; Fri, 30 Oct 2020 17:33:58 +0000 Received: from mail-wr1-f72.google.com ([209.85.221.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kYYHm-0002p0-6z for kernel-team@lists.ubuntu.com; Fri, 30 Oct 2020 17:33:58 +0000 Received: by mail-wr1-f72.google.com with SMTP id f11so2900610wro.15 for ; Fri, 30 Oct 2020 10:33:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cZIugUAWn8YxvZHDUtLGWO7YBXmuhpH+Za4FD61MHXg=; b=XzhbXTyssdxH2t4bIdVDHpaxdD/D7F4PpjdhPIVqYCGpYgwbUg8XC/NC5rhjXbpn5N PDg4qiJFIJoaUtmagaAMSAVFmjUI8bFeZEcrp9YkjR/vsIES1JXj9maXWAfyBKzeh4p7 NMMMevWBa68byMEUJXUyPDoyJHmzVGY+8P1EKpWzbJ1RXZgmZAbDPFaA7XLTXsnYYnjr 3joCmQpPhYKBmVYdTckm2JpyyPCA+lxrE7fmaeLzr9m1PXIJXWzI5lGTldpBqgHGmuN0 MBM8TKrOM4FzgaoE2ES+AHL5Oc3jCCH+aVMcd9RBzbLAJupjg9L5eFxC0RsVlBsVcpnZ VwhQ== X-Gm-Message-State: AOAM531LQU3IX6ECEPQQeUcTF5+skbgF1GNp7voMyR3H0ygVDwfyj+Fy dnZSsJnqXaFUnxjtMOxFGJ6DZZVeCI9RYr03BwRFmIjIjhJWu9LbRZlPlIYqLizNrWwSJkt2/wJ k3NaAwFJKEFsZ9T8/Z914NYVYYpsBiiDilQcXQ2A8aA== X-Received: by 2002:a5d:498a:: with SMTP id r10mr4624986wrq.106.1604079237568; Fri, 30 Oct 2020 10:33:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOzjBQVA7GfzSuG5cZwWPTgTpvg4j3GkxJmZAvda5+T/eeVfsmS0gHfdT0AA+AL9OMQ3DEIA== X-Received: by 2002:a5d:498a:: with SMTP id r10mr4624958wrq.106.1604079237259; Fri, 30 Oct 2020 10:33:57 -0700 (PDT) Received: from xps-13-7390.homenet.telecomitalia.it (host-79-33-123-6.retail.telecomitalia.it. [79.33.123.6]) by smtp.gmail.com with ESMTPSA id y206sm5594911wmd.34.2020.10.30.10.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 10:33:56 -0700 (PDT) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [PATCH][SRU][B/aws] UBUNTU: SAUCE: [aws] iommu: set the default iommu-dma mode as non-strict Date: Fri, 30 Oct 2020 18:33:39 +0100 Message-Id: <20201030173340.123560-2-andrea.righi@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201030173340.123560-1-andrea.righi@canonical.com> References: <20201030173340.123560-1-andrea.righi@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" BugLink: https://bugs.launchpad.net/bugs/1902281 Relax the synchronous IOMMU TLB invalidation constraint by default to get a significant performance improvement on some AWS arm64 instance types. This is a performance vs security tradeoff and it is not suitable for the generic kernel. In the particular AWS environment it is reasonable to relax the constraint without realisticly introducing security flaws. Signed-off-by: Andrea Righi --- Documentation/admin-guide/kernel-parameters.txt | 4 ++-- drivers/iommu/iommu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index de792d94d195c..0d8cdf0b9013c 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1704,13 +1704,13 @@ iommu.strict= [ARM64] Configure TLB invalidation behaviour Format: { "0" | "1" } - 0 - Lazy mode. + 0 - Lazy mode (default). Request that DMA unmap operations use deferred invalidation of hardware TLBs, for increased throughput at the cost of reduced device isolation. Will fall back to strict mode if not supported by the relevant IOMMU driver. - 1 - Strict mode (default). + 1 - Strict mode. DMA unmap operations invalidate IOMMU hardware TLBs synchronously. diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 35b588479bc81..f8fef61d2a3f5 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -37,7 +37,7 @@ static struct kset *iommu_group_kset; static DEFINE_IDA(iommu_group_ida); static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA; -static bool iommu_dma_strict __read_mostly = true; +static bool iommu_dma_strict __read_mostly; struct iommu_callback_data { const struct iommu_ops *ops;