From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 87D9138911F for ; Mon, 6 Jul 2026 19:52:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783367532; cv=none; b=Pl/cYIVfXBLlcOi+5nXwVZSH/VKahZOpvtlQrLBnSQzdHVByZhcWFr/X2Q6QgNmd/KZjSPRGFrudv0qVSnWDP3pC/yH++nn08+gOMeKOAukK32eohv/IhU6LecZmo9Pc3O3woZmd6iVpfCGQK9XDGvNgOCoxRedQaBGRS6hT4QQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783367532; c=relaxed/simple; bh=hKPpU41kPhzJrO0I4v1JFTcP1rq+uvMCyjdGLEJkQ9c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e569PPRgR1nmP25RNI7poddrFSGuXN+9zvNOxo7QrpWHi2F9DhVFNrvcazhJiD1LXTmK6MRatns9zWFPRDKAXZBO+E+2pBcjaRuK3FuLsaOZ6M0ZH3vPgS9udIpcQH4Lq+uX4TvevZrxwrZqmgxDMjTEcNncBB8udPArbORMeUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=bMjGwiW8; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="bMjGwiW8" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-92e7632b193so216623985a.2 for ; Mon, 06 Jul 2026 12:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1783367529; x=1783972329; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=hKPpU41kPhzJrO0I4v1JFTcP1rq+uvMCyjdGLEJkQ9c=; b=bMjGwiW89yNmKf1kdANLQsrDg9bXYFcWb3LFwediYSx9BPsxJ25iVJG7amJt6E+CCS CM1+KwqM16rt3s9+oVtKVi/dBGkjtQGZV3B6+FFewF7ffsLDRH5WaAXE25IYZMuEcW61 WFYEaEzSbRsjHppR8KNGN2UUxth6+C0zAhi7+fEU/nitCt4wpalWlefln6uqazdcjJQg YxymOYgeydrgkTdbVkPYZw6VjcAz6bsQ+oht6o4yz7wLf2FJrfkVlHN8wZGrUrcd60o+ x9lQXq/L/ZkUcuvNgymDIPtIj04I2pO7tt8sjVFAQYXqRCpIo5kn9IO2MuIEOu3xFeWy qqAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783367529; x=1783972329; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hKPpU41kPhzJrO0I4v1JFTcP1rq+uvMCyjdGLEJkQ9c=; b=NAlEKviM7nzG5hqMgBaSv8wTZZExZV+lbjTAM2L60qMnMi/jNiRqU5QhuDYLjTdBrL Y3Gzvhp3XajXSkgPFoUKG4mwRg0DxTdM8yTJ2Dy7TIVJrRJbntAC5IW8JJhgc11yBA8S 3onkm/XWEDY0BvGaGA0tvg1JrB9GufVsLm9f8mxF5C4npqgfoR98aaRnxRcBcGCX19/q E71cknBAwN1WVetY4ixZERJT9kYmEiOUcPFFVZxpbRkz3z35iGewfNDXF36glU9P8yNI N8ZGovxOXpNixqsl3FNY4263qhtYNhspkF6rBOa5U1GFdZw/7jFAI/IJGW0iPlKmxDd9 hZAA== X-Forwarded-Encrypted: i=1; AHgh+Rr/GArO6nIBMm1HMJWdcCswMWs9BsItSYIl8V37MJ/0iCR1PfLo7Ba7qhktWkqAGqaIkmFzofWdpsAzgXo=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0c5W6bKKRIfROjrr/3ktkonAJGzQmEVmPpMhEQjkCGU2bZl1G ppExYJ1eEeDag9GhfIivnkuezyDFyNUv+CvLbc/QGAkQ88hDFZyG8P3mcqVQk/rOPPM= X-Gm-Gg: AfdE7clkKSahMxYCsINr9FCS+XBtHRtpuWpuQ2oKKxJ9bRyKl72QiMIUYQl+Q91H2Oj QfZuC/2LM2wgPZDVn1k78namvUXdMGqYz1UyXRE0Cg4yxKoR97jCJFZa1wFMbBqWSiZWcMBCugc 6Lv7NWRl3F6UUH8tUPU6q3p3MvQhogG1Ff+PAxzxFL48e2/fFEdjz/XsH2Hp7/hbanVsoIhEej9 0UpaEf+Z8h3sr4142TK21iFWXKC+GRfr0Hsr7djzyJvraDWbaJspELyODpV9eaj61u7+5ruv2xg QBvj4D0u9YoC+bfFUEgqiaa+UBjfxCbYFuaGFrX/wrCHuCD/ArpWBOMX27iWPsjRfpEXitTCQzO DyaiWBsYMuthNNNogNAfmf0a4K2Jafglb7n7kPD0W7MR6YeCPZszsdf4C+pt7 X-Received: by 2002:a05:620a:2911:b0:92e:70e9:6865 with SMTP id af79cd13be357-92ebb585521mr281465085a.59.1783367529434; Mon, 06 Jul 2026 12:52:09 -0700 (PDT) Received: from ziepe.ca ([159.2.72.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92e90b800efsm972606685a.4.2026.07.06.12.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 12:52:08 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wgpMO-00000000etJ-0DJM; Mon, 06 Jul 2026 16:52:08 -0300 Date: Mon, 6 Jul 2026 16:52:08 -0300 From: Jason Gunthorpe To: Tom Lendacky Cc: Alexey Kardashevskiy , "Aneesh Kumar K.V" , Catalin Marinas , 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 , Jiri Pirko , Mostafa Saleh , Petr Tesarik , 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 00/20] dma-mapping: Use DMA_ATTR_CC_SHARED through direct, pool and swiotlb paths Message-ID: <20260706195208.GD118978@ziepe.ca> References: <20260618153705.GH231643@ziepe.ca> <20260619122148.GL231643@ziepe.ca> <20260619140616.GB1068655@ziepe.ca> <20260630174216.GK7525@ziepe.ca> 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-Disposition: inline In-Reply-To: On Mon, Jul 06, 2026 at 01:45:33PM -0500, Tom Lendacky wrote: > In that situation, with SME enabled on the host, the SWIOTLB must be > mapped by the kernel without the encryption bit set and DMA addresses > must be provided to devices without the encryption bit set. This is > because if SWIOTLB is mapped encrypted, requiring the encryption bit be > part of the DMA address, any device that cannot perform DMA at the > address width where the encryption bit exists will fail to DMA properly. Ideally there would be two SWIOTLBs and "decrypted" aka low address, one is only used if the device requires it. Alternatively we don't support this questionable security choice and using swiotlb with an incapable device just fails. Use the iommu, or don't force swiotlb. Jason