From nobody Thu Apr 2 18:46:11 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 942823EBF1B for ; Thu, 12 Feb 2026 09:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770889031; cv=none; b=Ckze04oZ6UBm4CsXLjYnBjMg0xq+lQpnQmukLCt+GkTpjQaM/zU1XI59rzzp/azQB7aJI2NBFHd9nP0ts4ffOMjFSO+fdowkIgHGSLaqWtB0Yh3s6cLr9Ic3nWlkW//fmqAavNmdGUmN1XEe3Qa+3/pyIt8xx4coOfIMnlHxD40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770889031; c=relaxed/simple; bh=yLLP+gNMSQHLslHm4S3HBMPS+r6vSGjMB1RGBPwragA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=oSRJW0DOpsAgHZkEUnhu4HdsdjTpqDAmLr6ssjbbB23xwR++bW3exdqV/X2QvEo1ALgWW8RKd4u/vdpGk1ZMA2qr8eBlgkfExTfy9bYQ7JCBpyk3UlkxScqAFP30GuEbdvUONHUZEpvG9KP7p3f6+HerDiJ8/s10NAIT0lSyh90= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TZJMdbNe; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TZJMdbNe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1770889030; x=1802425030; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yLLP+gNMSQHLslHm4S3HBMPS+r6vSGjMB1RGBPwragA=; b=TZJMdbNeQTZF/Esx0pkwuFkCo2R1nBpkbQIuBb5IRf5A/mKae7zF2PP6 VG40EVTV/gnG7JSLH4o6i00RB2AFhQ6bb+OLG872h3GL5v9oatoWxoArT 95/tdg5CwBE/qg7rKPt127GGNo7oXbiwco+YdUCmpHzyKYvypTEFacZTz q/2BkuUkDCeJ2L8Q3k2ZaWRLwO2JTt5GwXfoCEfZwySOe28cruWfxdpdV c4XAKSSwMvdc5fgURLJ6kZlzyb65O6sYBWnD/CbznJ8FGNttgwMI1X6kP R33O8zQJT6Y+Jz6a6uQR+sq+pv+iGnqeUQlrCN1N7rBz7P9z1jOJoCrro g==; X-CSE-ConnectionGUID: 1oxF1radTku/7kNymy5mXQ== X-CSE-MsgGUID: aHNcfkr0QhWAMAwScVu5ig== X-IronPort-AV: E=McAfee;i="6800,10657,11698"; a="74655950" X-IronPort-AV: E=Sophos;i="6.21,286,1763452800"; d="scan'208";a="74655950" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2026 01:37:09 -0800 X-CSE-ConnectionGUID: aqI8lXALTMqRtEiqHOYegQ== X-CSE-MsgGUID: AzoO2VBkTgiom2IkjW1vRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,286,1763452800"; d="scan'208";a="217504443" Received: from ubuntu.bj.intel.com ([10.238.152.35]) by orviesa005.jf.intel.com with ESMTP; 12 Feb 2026 01:37:06 -0800 From: Jun Miao To: tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, m.szyprowski@samsung.com, robin.murphy@arm.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, jun.miao@intel.com, aakarsh.jain@oss.qualcomm.com Subject: [PATCH v3] x86/pci-dma: add a SWIOTLB_ANY flag to lift the low mem limitation Date: Thu, 12 Feb 2026 17:37:01 +0800 Message-Id: <20260212093701.4165275-1-jun.miao@intel.com> X-Mailer: git-send-email 2.32.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be us= ed in swiotlb_memblock_alloc() to allow allocation of SWIOTLB memory beyond lo= w=20 memory restriction. Power SVM already supports this, but X86 still faces the same limitation. Commit: 8ba2ed1be9 (swiotlb: add a SWIOTLB_ANY flag to lift the low memory = restriction) Reviewed-by: Aakarsh Jain Tested-by: Aakarsh Jain Signed-off-by: Jun Miao Acked-by: Marek Szyprowski --- V1 -> V2: 1.Updated commit message and description. 2.Add Reviewed and Tested. V1 Latest Feedback : https://lists.openwall.net/linux-kernel/2026/02/11/483 v2 -> v3: We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log. --- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 6267363e0189..73b9320c4a7d 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void) */ if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { x86_swiotlb_enable =3D true; - x86_swiotlb_flags |=3D SWIOTLB_FORCE; + x86_swiotlb_flags |=3D SWIOTLB_ANY | SWIOTLB_FORCE; } } #else --=20 2.47.1