From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CF3F41B347 for ; Tue, 9 Jun 2026 13:44:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781012679; cv=none; b=tfD/hfN5aHKIp7b/MWNRKPX8iByGIxrrNu4RhFl2ojnPefrixXiQcyaKIvsTeb7aORZ2MXetNOwXDgRXLbW+Ata7a/h8XvpqppjUeTmyPRXTrK2zy3LCLiiT+RFpAjX6/cDoxpL39ZW/CQuXfT+acIbtn90nkN9gx1nxTNPPjJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781012679; c=relaxed/simple; bh=De9dpWLqJDkTwPqqIvLBYIkFXDqvYTvryiNP3i+XxAA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KF3flVjWXbW2eCl9Wtztn8GdFdA7DgOGSRTzDnadvAbcjJ6r3IRXd2/yhRj4XBKHpNI49Qmp4wb8w6mH7Wgl1/klLFG7f/5CAIKhQrfdEw+9SXV2yYukGsk9wi+5gxEtB6mYqU00WcRvtJmFMBXxbpLmyBc0HqDWAHZSJiwp+dY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=cRMetSv8; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="cRMetSv8" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-45efb47aa6fso534801f8f.1 for ; Tue, 09 Jun 2026 06:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1781012677; x=1781617477; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=l00W81UYsyqDsSVEFT5iHHagCSaGJS6VwfSu9rBGR+c=; b=cRMetSv8wXNxtuCIHaWBL8a+lkH2aTXZ0aq2oEHHKt5iU2y2XqsoLYltsJwH//1M7G FgFRqTDDH4NrvwkyAyzezpK+n1eFUcvaDepoumVx0/nCjvbdYG8X9cZRWcdMOa1XvVuw s3h5ONlDDMEu2IiCPlmr1c38oFhj20Zzwlgvx88IM4bS4y+axfFulKGElavXj/GOrBwD 6+lee47KbnKFJNg31qFV3tS+tOaQys2akgfu+oTkhota2F6gcNq46GlaJJKIe2mXBJSN XGcTTFX38gCBjpwRqF5zKDiofSjCG8JXvk2NsqCoHraZYJwa/HyNMoJuZFO8uMYRm/cT JZ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781012677; x=1781617477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l00W81UYsyqDsSVEFT5iHHagCSaGJS6VwfSu9rBGR+c=; b=RDoLUZMtKSmjDRKw7c2lMWwtWk8fi96f7yPtYcoQDb0z5gkFp8uU10EPWrWGsja0Xh GGAaiInY9HpP5w0s7WjJnS5Xf/R51YzGocgDWy/DxIv8Jf6wehql1sKsHtU097B/Xfgr QzmMbW5XDg5jecmue5Y7JGvJGJ6ip3+JXi5n2Fkw79NKcL5ybgnqjk8mdV4Plp3R/7wX QZymTteJfGFhuacf9SJn7YB2o9fgxz4JfbynBOzTclQnViJ43DAj36Mqk2UyTimNS70u Nq30bNd9SqylsqsUydPnf2Gto7v5BfJKM6HEgyATiwRpWMiAKKymNMlBWuxNMlmGD/pq ey+g== X-Forwarded-Encrypted: i=1; AFNElJ8DapnFLQSzBT+k/77vAE0KQAEsirS4DyK8s5r9W7ea5+VaeenuOGi6CKDQzFnP0aa6Led5XlWtlywLLCQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yyb69eC9H0xQnEzl1PckMvq/e2v36iWy6jzdtAyFSM5xDGa9w4l QtqHAR0YfA+ZjGkbZgpEHMJwh4t3SAyQ0zlkm7wn0/pYtSYWiNwuhmS2k/U8KI5pzmc= X-Gm-Gg: Acq92OHnInLXzRGW9gw1txwO7K3JjDgWyoM/yCA3gZYUK4RVxs0N84hGcRh5sRPhIia ujpBst+d28tuJtEYtJHV+waAG+mnnc4o6dxj/FrYmLbKOgLLwPoPf60apCngg+oxvyo+DDFY8Pc GY6jsJnW7KVsnHREVrRuvf/uABqFw6ZJvKuz753ZLa5tyeqm0FUtW3YA+aETVGiiMEJXPPjsRU/ EaMYKunrd4x8MAtr1uMMhxaNXhxOnKRivXCMliXFnuYTifCs8iA76BUKInbgEBzlDN9c+TqND5q 8rHY7VZoxcj8Wl0D/lPfExakIUAZjqsU/SoOsfbUURxBJWlxbxkGlijs8eg4iKtPTWHR1H5ya3y q693vfdsVJdq7BC3v+7saXZ+kHthWzMb66jyzWYd56qdYMTelaFCqVhNzQspiGv6PqwaDzYqa3i VkIVh8r1zSgpLkyGzqF46vAbI6FCCq6yShLg== X-Received: by 2002:a05:6000:715:b0:441:1c35:4b79 with SMTP id ffacd0b85a97d-4603076f62bmr12393402f8f.8.1781012676663; Tue, 09 Jun 2026 06:44:36 -0700 (PDT) Received: from mordecai ([62.77.90.70]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f360bd6sm66805957f8f.36.2026.06.09.06.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 06:44:36 -0700 (PDT) Date: Tue, 9 Jun 2026 15:44:34 +0200 From: Petr Tesarik To: "Aneesh Kumar K.V (Arm)" Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, Robin Murphy , Marek Szyprowski , Will Deacon , Marc Zyngier , Steven Price , Suzuki K Poulose , Catalin Marinas , Jiri Pirko , Jason Gunthorpe , Mostafa Saleh , Alexey Kardashevskiy , Dan Williams , Xu Yilun , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , x86@kernel.org Subject: Re: [PATCH v6 20/20] swiotlb: remove unused SWIOTLB_FORCE flag Message-ID: <20260609154434.13dba7b9@mordecai> In-Reply-To: <20260604083959.1265923-21-aneesh.kumar@kernel.org> References: <20260604083959.1265923-1-aneesh.kumar@kernel.org> <20260604083959.1265923-21-aneesh.kumar@kernel.org> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-suse-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 4 Jun 2026 14:09:59 +0530 "Aneesh Kumar K.V (Arm)" wrote: > SWIOTLB_FORCE has no remaining in-tree users. Forced bouncing is now > controlled through the swiotlb=force command line option via > swiotlb_force_bounce. > > Remove the unused flag and simplify the force_bounce initialization. > > Signed-off-by: Aneesh Kumar K.V (Arm) > --- > include/linux/swiotlb.h | 1 - > kernel/dma/swiotlb.c | 3 +-- > 2 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h > index 526f82e9da45..af88ca7182f4 100644 > --- a/include/linux/swiotlb.h > +++ b/include/linux/swiotlb.h > @@ -15,7 +15,6 @@ struct page; > struct scatterlist; > > #define SWIOTLB_VERBOSE (1 << 0) /* verbose initialization */ > -#define SWIOTLB_FORCE (1 << 1) /* force bounce buffering */ > #define SWIOTLB_ANY (1 << 2) /* allow any memory for the buffer */ These constants are kernel-internal, so let's not leave a hole in the bitmask... I mean, what about changing SWIOTLB_ANY to (1 << 1) after you remove SWIOTLB_FORCE? Other than that, LGTM. I consider this whole series a big step towards saner handling of encrypted/decrypted memory for DMA buffers. Thank you for your effort! Petr T > > /* > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c > index e4bd8c9eaeda..81cc4928e949 100644 > --- a/kernel/dma/swiotlb.c > +++ b/kernel/dma/swiotlb.c > @@ -400,8 +400,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags, > if (swiotlb_force_disable) > return; > > - io_tlb_default_mem.force_bounce = > - swiotlb_force_bounce || (flags & SWIOTLB_FORCE); > + io_tlb_default_mem.force_bounce = swiotlb_force_bounce; > > #ifdef CONFIG_SWIOTLB_DYNAMIC > if (!remap)