From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF0FC433F5 for ; Fri, 31 Dec 2021 16:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbhLaQ4v (ORCPT ); Fri, 31 Dec 2021 11:56:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbhLaQ4u (ORCPT ); Fri, 31 Dec 2021 11:56:50 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CC49C061574 for ; Fri, 31 Dec 2021 08:56:50 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id f18-20020a17090aa79200b001ad9cb23022so26057240pjq.4 for ; Fri, 31 Dec 2021 08:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Fhqsai9/5uTpmhu9BCUGRv/iOpwY1XebeAJzkMmetAg=; b=DTTANcgQxP/+d+SIfU7vQgtLwKl7eY50ftYhrvl9vSh6Hu0HYf2iigJ3RKtoyq23sj gRii9H+9YyK62wyllPKWLhPo3BegEtpX6Yg3ZHXeUdvoOw0sH/I84xuypATf+fMk8LBH O4lBZrdOFmhBJQPp2875HXZ0ZVQblWDDurWrkXhIP5fG+QM8vpMSh7BpJwiVB1IQDsJg 4m3w6u6gZPWBzgqiTJNinwfqTuL1w2cnMa/rTYP2hWmAH6sPVcVqosaxqYQSH5GxqZet xeSf1JN5N2AE76YbEuqRaWdJ/ngfTjedQ98lpvwYnHxRUFlTeLb3fXRkGObrPqaiDrK6 4bHQ== 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:mime-version :content-transfer-encoding; bh=Fhqsai9/5uTpmhu9BCUGRv/iOpwY1XebeAJzkMmetAg=; b=UQVD3cLfE4sqRLJbe3oj6XiCauX6w9qmzF3aqCIbIA8uauZGsc3m5SXk4XKEWgjU9t Mhw/BLnI4u0fbzaaLudrM9xisjE2F4BeyIQ9FZgKdyGWOPCJ0tbAKKz+rrHfbsp/55c7 BsBUwytZPbXvUaX1McyO9KO+KwDgAbf04NFs+pWTFIrBG4wtg8+07EyiRp8ype6Qltjm m1hxZThYLL5Japf4ZdoiWy6mFG+3tHeyuBMOSHjBKEFmsPjYlnpYc2OLfAhK2lFK54Wc Iy6oKGhlS60flU9JmMdIc+BYwwrSZZVujF5XjZvoeGVr5ozHkJqlqw1mU7qqMQMAM9GD o0cw== X-Gm-Message-State: AOAM532Q4Ej9OwMQyP6vIQe7L7PivZGoHp0gIXeB2KFJrY/6hTAUJ5LA XW2BfS1GS+b/Yr0fUMUsqX/lDIxY+CL5mjvC X-Google-Smtp-Source: ABdhPJxbh1vyPADNysAidGV2ytIAgoJ8tmJoKQuoiBd2eBUqHzHGm5J35dSdoI4BZhj0Nw+Z6BHyhQ== X-Received: by 2002:a17:902:8d8c:b0:149:4497:faab with SMTP id v12-20020a1709028d8c00b001494497faabmr36204345plo.161.1640969809949; Fri, 31 Dec 2021 08:56:49 -0800 (PST) Received: from ubuntu-Virtual-Machine.corp.microsoft.com ([2001:4898:80e8:b:18dd:5111:d391:607b]) by smtp.gmail.com with ESMTPSA id mh3sm35188026pjb.26.2021.12.31.08.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 08:56:49 -0800 (PST) From: Tianyu Lan To: hch@infradead.org, m.szyprowski@samsung.com, robin.murphy@arm.com, michael.h.kelley@microsoft.com, kys@microsoft.com Cc: Tianyu Lan , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, vkuznets@redhat.com, brijesh.singh@amd.com, konrad.wilk@oracle.com, hch@lst.de, wei.liu@kernel.org, parri.andrea@gmail.com, thomas.lendacky@amd.com, kernel test robot Subject: [PATCH] Swiotlb: Add CONFIG_HAS_IOMEM check around memremap() in the swiotlb_mem_remap() Date: Fri, 31 Dec 2021 11:56:40 -0500 Message-Id: <20211231165640.1245751-1-ltykernel@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tianyu Lan HAS_IOMEM option may not be selected on some platforms(e.g, s390) and this will cause compile error due to miss memremap() implementation. Fix it via adding HAS_IOMEM check around memremap() in the swiotlb.c. Reported-by: kernel test robot Signed-off-by: Tianyu Lan --- kernel/dma/swiotlb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index b36c1cdd0c4f..3de651ba38cc 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -167,6 +167,7 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) { void *vaddr = NULL; +#ifdef CONFIG_HAS_IOMEM if (swiotlb_unencrypted_base) { phys_addr_t paddr = mem->start + swiotlb_unencrypted_base; @@ -175,6 +176,7 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) pr_err("Failed to map the unencrypted memory %pa size %lx.\n", &paddr, bytes); } +#endif return vaddr; } -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7FB7EC433EF for ; Fri, 31 Dec 2021 16:56:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 077D640126; Fri, 31 Dec 2021 16:56:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iylm1SGnOlNh; Fri, 31 Dec 2021 16:56:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 8ADD140120; Fri, 31 Dec 2021 16:56:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 61BDCC002F; Fri, 31 Dec 2021 16:56:52 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 337ADC0012 for ; Fri, 31 Dec 2021 16:56:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2011060ACD for ; Fri, 31 Dec 2021 16:56:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ngmgvnF-0mJf for ; Fri, 31 Dec 2021 16:56:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by smtp3.osuosl.org (Postfix) with ESMTPS id 93079605E8 for ; Fri, 31 Dec 2021 16:56:50 +0000 (UTC) Received: by mail-pl1-x62f.google.com with SMTP id l16so8415844plg.10 for ; Fri, 31 Dec 2021 08:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Fhqsai9/5uTpmhu9BCUGRv/iOpwY1XebeAJzkMmetAg=; b=DTTANcgQxP/+d+SIfU7vQgtLwKl7eY50ftYhrvl9vSh6Hu0HYf2iigJ3RKtoyq23sj gRii9H+9YyK62wyllPKWLhPo3BegEtpX6Yg3ZHXeUdvoOw0sH/I84xuypATf+fMk8LBH O4lBZrdOFmhBJQPp2875HXZ0ZVQblWDDurWrkXhIP5fG+QM8vpMSh7BpJwiVB1IQDsJg 4m3w6u6gZPWBzgqiTJNinwfqTuL1w2cnMa/rTYP2hWmAH6sPVcVqosaxqYQSH5GxqZet xeSf1JN5N2AE76YbEuqRaWdJ/ngfTjedQ98lpvwYnHxRUFlTeLb3fXRkGObrPqaiDrK6 4bHQ== 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:mime-version :content-transfer-encoding; bh=Fhqsai9/5uTpmhu9BCUGRv/iOpwY1XebeAJzkMmetAg=; b=B92GNe4G1ktki89vY8t3G1BWedKM9U8Uw7QYEdj9UvXgvX98TW2hV4ngLvYJnT88lD K7wJXosEfVo5V9+kl/yjrpIgtkaqx6bq2gJaQMY/SD4Vu2K5uzvmBG31x4EfsVnljVa4 S31cOhfEy9YjrYLKC7Op5w0HsLAUF313r+Jmd67JubRJ13jYF//3y0LYOerRa+0Gqsrn aT7MZfdnV9xRBzxzSqmOqzboMX2WvvEVxuZqmSezp7Deb1f0Nwz/lXf2hwdWy22phDdr atISbNPxZfHU+cu7ohg+zfTI4V5ItfavBiiPlqz1GA/0HHwiSpddmNAv169yl00akIDU 8yrg== X-Gm-Message-State: AOAM531mXSJEw2d0JFv0/O4cTLdaChmfOfEjlF5KCNcB601LPj8PMUhy 5qZr3lbkYKC6yqwX1og6cyU= X-Google-Smtp-Source: ABdhPJxbh1vyPADNysAidGV2ytIAgoJ8tmJoKQuoiBd2eBUqHzHGm5J35dSdoI4BZhj0Nw+Z6BHyhQ== X-Received: by 2002:a17:902:8d8c:b0:149:4497:faab with SMTP id v12-20020a1709028d8c00b001494497faabmr36204345plo.161.1640969809949; Fri, 31 Dec 2021 08:56:49 -0800 (PST) Received: from ubuntu-Virtual-Machine.corp.microsoft.com ([2001:4898:80e8:b:18dd:5111:d391:607b]) by smtp.gmail.com with ESMTPSA id mh3sm35188026pjb.26.2021.12.31.08.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 08:56:49 -0800 (PST) From: Tianyu Lan To: hch@infradead.org, m.szyprowski@samsung.com, robin.murphy@arm.com, michael.h.kelley@microsoft.com, kys@microsoft.com Subject: [PATCH] Swiotlb: Add CONFIG_HAS_IOMEM check around memremap() in the swiotlb_mem_remap() Date: Fri, 31 Dec 2021 11:56:40 -0500 Message-Id: <20211231165640.1245751-1-ltykernel@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: parri.andrea@gmail.com, thomas.lendacky@amd.com, wei.liu@kernel.org, Tianyu Lan , kernel test robot , konrad.wilk@oracle.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, brijesh.singh@amd.com, vkuznets@redhat.com, hch@lst.de X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" From: Tianyu Lan HAS_IOMEM option may not be selected on some platforms(e.g, s390) and this will cause compile error due to miss memremap() implementation. Fix it via adding HAS_IOMEM check around memremap() in the swiotlb.c. Reported-by: kernel test robot Signed-off-by: Tianyu Lan --- kernel/dma/swiotlb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index b36c1cdd0c4f..3de651ba38cc 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -167,6 +167,7 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) { void *vaddr = NULL; +#ifdef CONFIG_HAS_IOMEM if (swiotlb_unencrypted_base) { phys_addr_t paddr = mem->start + swiotlb_unencrypted_base; @@ -175,6 +176,7 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) pr_err("Failed to map the unencrypted memory %pa size %lx.\n", &paddr, bytes); } +#endif return vaddr; } -- 2.25.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu