From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 656B126B971 for ; Tue, 3 Mar 2026 12:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772540112; cv=none; b=HjeDXb/yCu5HyRy3fd+OrUs0vMXXBSmORGpjpZtGt69bj3VvurTAF1dFbltpcckqed9esjL2I4s/I055KjLTYeMaexol3OLuUzH7mduZcShWYPczufcFf/niNsU3fk1aTaiF9WpUeAQMa88+sHTO6y0PW7OwSuEkTjjJgYxE5t0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772540112; c=relaxed/simple; bh=7Rc9j3LNiGnIyTeHz2J0Avp/KOXJP6cs2JgWLFyvSoI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UD22UZ+KuRkka832Vts3ewnmywTKvceph5XwHbZBWM+8/tIyvYCS247GpxkfYMO9wyKHROZlnLhhW3BArj+Kymt1J8GDAHHINw2ZSoWoZFcP5XAhXaU4qYrQAZFjBA9KlbEOlFtavexKAuOTlkzzA4goOLrr0j97f768Aj1mORU= 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=Xi9hTjQX; arc=none smtp.client-ip=209.85.160.177 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="Xi9hTjQX" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-50698970941so68868461cf.0 for ; Tue, 03 Mar 2026 04:15:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1772540110; x=1773144910; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3MM4W4u3ny+cRpfXrxu8DnH970Z9q8VF2tWXlyBc85c=; b=Xi9hTjQXci5LpOXbCPKiygALDSRfu87R3o1ecGvrUT9JcQZayA37DX8wKo7FWuU/Ss DGy/hw1qNq+fCpNUaWmrUqz6xUbzVj3kKS33Yoy5tW6cDlvvsMN4Vbjm3/K8DWxUcW/O SvJIvzXO+4ah8oP9zc7edsqWininE/2EhJJ35uACW5teVJaBJfcKI4fDDRvF18JHcjOO eQ64C7iz2eTpKM+doTs8lq+zrc/4Dhh2x97Lueyk3dWxjNFntCknXcKk5LYo8P+F5KZh 2uVqbTJ8LwpE3ZV6+0fq56VTkfHOAg+Z51M2fjrh+dHM5MMNJjDW3edk0q0thnAzAHGA u1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772540110; x=1773144910; h=in-reply-to:content-disposition: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; bh=3MM4W4u3ny+cRpfXrxu8DnH970Z9q8VF2tWXlyBc85c=; b=ao68x7eWyRJsM1SCdqNsGsF5ze+RAjkt/DAwe1941GO70EYTLONdHT0mjKRSpzLJwr K4MWuqwOaurnyrqT+kZlZtFDAeFEmAudd2jn9QZ2XZOZjVWH/CeKzAZ0rMlgLByh6+qF gGFIuZOeBq14QMiX6Uyl4rqB5wi2riKTLHT0pJx8hY+FkyiXYR4+vBp9ud5wjMmYgooH QomeiwHk/MVJ13virEbt7TBe7A7plwKcWLqy3b6DMfkDoeMfqMh8J8Af07CLy5KwQ/HE MNVyHFFXVPGBfs2z3CcxjKXurCqATF7aBtQoatus54tSluPNheYwf7QqY0guo4t1VRCp P4Aw== X-Forwarded-Encrypted: i=1; AJvYcCW8vceSIXlqNwI1cZ+ilsqoz6FzYP/MVS3dymjokHOiSGzySKbIsRo5vw2kSlXIyN0hCGZh8g47Ps3tvHE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz76AeP+ie8GUU+a13LDMPUTJTMBVi3GE9Uj6wq+Ym7kOKXPX8X 6W+UTRS+U8FDl720Sr4hDi0J863EkPMGRuGXsOa276j54rDrZrHLssKmvG3FDId3x98= X-Gm-Gg: ATEYQzzUNLr9nzDrh482opEFOv/lTCiLB0MN7b6i9BsR32V2yd0vD6NNgHhp0R85Zd4 gSAE0IzSVsasDh4FKZDLQxHSkP/wzPjS/VjR/ng8+1+BzX0NcSW/YesgfDsBjdbi32e5kcQDJuF Eg2N2OjqEgLMvbJn6YWVPlJsJzHInDFBdAiqOqqapH3IKsxyqdJgN93Oea3g00U2xhQH1sWDqEK MctK0Uumibeos6A8a13AI3wUvNU4/tXxBS8d3xRtcRnjgzoWM+KAiIU3q9EXvKooUI2nGaJGp2L SiblE79gTwbhJEp5kfOyNo2YOFfo9wgPeQP19g6guu1B5J+sEOHtvF09vfJAUkmsKDTMrjPGZ+3 SMH6j0QyuunZQy0JcLESeCxp6Srj5bICzLVzKaTyI21hgOeds0dYl0cEPVAOdDgWsP3GFp9Q9rb wNf4aYzUKh2TWlRL9/AuEP/o6t/wAiU7by0pjjZkjr2ecw7lwYvq1g5X5+gHzoN+Pne+Sc+enYq 40Mam9t X-Received: by 2002:ac8:5908:0:b0:506:a287:a87 with SMTP id d75a77b69052e-50752849955mr200806971cf.40.1772540110255; Tue, 03 Mar 2026 04:15:10 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5075feb4db9sm79588961cf.22.2026.03.03.04.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 04:15:09 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vxOea-00000004CWJ-1Uzg; Tue, 03 Mar 2026 08:15:08 -0400 Date: Tue, 3 Mar 2026 08:15:08 -0400 From: Jason Gunthorpe To: Alexey Kardashevskiy Cc: Robin Murphy , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-pci@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Sean Christopherson , Paolo Bonzini , Andy Lutomirski , Peter Zijlstra , Bjorn Helgaas , Dan Williams , Marek Szyprowski , Andrew Morton , Catalin Marinas , Michael Ellerman , Mike Rapoport , Tom Lendacky , Ard Biesheuvel , Ashish Kalra , Stefano Garzarella , Melody Wang , Seongman Lee , Joerg Roedel , Nikunj A Dadhania , Michael Roth , Suravee Suthikulpanit , Andi Kleen , Kuppuswamy Sathyanarayanan , Tony Luck , David Woodhouse , Greg Kroah-Hartman , Denis Efremov , Geliang Tang , Piotr Gregor , "Michael S. Tsirkin" , Alex Williamson , Arnd Bergmann , Jesse Barnes , Jacob Pan , Yinghai Lu , Kevin Brodsky , Jonathan Cameron , "Aneesh Kumar K.V (Arm)" , Xu Yilun , Herbert Xu , Kim Phillips , Konrad Rzeszutek Wilk , Stefano Stabellini , Claire Chang , linux-coco@lists.linux.dev, iommu@lists.linux.dev, Jiri Pirko Subject: Re: [PATCH kernel 6/9] x86/dma-direct: Stop changing encrypted page state for TDISP devices Message-ID: <20260303121508.GD964116@ziepe.ca> References: <20260225053806.3311234-1-aik@amd.com> <20260225053806.3311234-7-aik@amd.com> <20260228000630.GN44359@ziepe.ca> <2a5b2d8c-7359-42bd-9e8e-2c3efacee747@amd.com> <20260302003535.GU44359@ziepe.ca> <500e3174-9aa1-464a-b933-f0bcc2ddde68@amd.com> <20260302133527.GV44359@ziepe.ca> <9cf2e2e6-0fe2-4804-9c62-bc60c89d57c1@amd.com> 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: <9cf2e2e6-0fe2-4804-9c62-bc60c89d57c1@amd.com> On Tue, Mar 03, 2026 at 07:19:36PM +1100, Alexey Kardashevskiy wrote: > > It seems from your email that the CPU S2 has the Cbit as part of the > > address and the S1 feeds it through to the S2, so it is genuinely has > > two addres spaces? > > S1/S2 PTEs have Cbit. Addresses to look up those PTEs - do not. So we are back to what I was saying before: using phys_addr_t to encode a PTE bit is probably a very confusing idea - especially when contrasted with the other arches that have a legitimate address bit. > > Same way it knows if there is no S1? > > If no S1 - then sDTE decides on Cbit for the entire ASID (with the help of vTOM). Sounds like the intention was the IOMMU shared/private space would be controlled with vTOM which actually does a create a legitimate address bit in the phys_addr_t. A sDTE global control is OK for non-TDISP devices, or even devices that haven't entered RUN yet, but it is not OK for a TDISP device that must still be able to access shared memory. > I understand I am often confusing, trying to unconfuse (including myself)... Thanks, It seems to me the AMD architecture itself is pretty confusing. :\ Jason