From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 3BA483A75A3 for ; Wed, 8 Jul 2026 21:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783545377; cv=none; b=hwhlWQYIK7lV/tvI0zwWCldn4T5ydUM7SY85DzOlYCvXqC//DYI6CaNzBT3RPcqch7ZdO8k1Zt1mtEkaKmWgIAzI3Kdvt/crEdRSI62yjQziabS5ZIYzbuhSsqLQ7+gKm2AKNF7NmUo7dqYk2ckNdK/FmN33RaCx8pBXNlQ1mDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783545377; c=relaxed/simple; bh=b9IXuZEhLEq8kcoaJ9iHTDPfKz7Q+etiiYjfpVDU2uI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Zk+fktSnJedE8YqzUsIhEA1JHJz1qpaysXSco9pDUTUPZG2CiEHIu3uTVR8tVZfdzrwkOZmRmp7Ack9xXob7VYxpXQRNsSq69nUSBJagdLA9bEgfkEuxyofV5cAnCKuWKOg2YXFjE54dEpayxCAj4XsS8W7JIh8bMSzwOGCHwXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gHZw5QW2; arc=none smtp.client-ip=209.85.214.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gHZw5QW2" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2cc88e22f92so26204725ad.1 for ; Wed, 08 Jul 2026 14:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783545375; x=1784150175; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=q+YJvj0J4VBCeG53gEFWtVblMViyxqA7caDQne1cfRA=; b=gHZw5QW2FQWhEgrH4A4MFJZCoiyckmVMYkQRswD8kslBnDqjZMNKON3j1+vzyxjcJH KP4tJjKovzUIYy8MM6I2wuvjqdyiL2gaOxrR/DdwZUx/nYYcEtBX5n22h7MpsCgRrWvp v0ymOVQXUMeh+5RxZC1Yqqu31TbJFWfOyHBCuYdFA6gDl+DsuUrV97CPvq+Mt+t1XlSX xRsIeLgVEtZBy6CQsA4OwuPYGZKGU9I5QjK9TUJGzgfH3Y2nWe4MdIqrQimJXzLRC06F V3rz57j8QoI9TB5ZeTQXdi1Zrw+BQIKfNEHXF+6LtvMiU7Mb+0lrPlAoMIPlyXnEVX/+ cT+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783545375; x=1784150175; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=q+YJvj0J4VBCeG53gEFWtVblMViyxqA7caDQne1cfRA=; b=dq/G6xkl4tl5SrOA1NBxjQx9C9RxqPoB8rb2evGyqZjEfcTIv/5N0U5hheQcMnx6CN 4JtwCx4tycYGWW9gr5zA7ozV1OPmY8hdFpOg5dgCtpTvnrEiqsbZ+tAXlZsaUbU7d1Xk pngiKeDy8vRaMY/nutj+GY5oCjm5nCzXVS9VEiKK+9w18BYpCJBJJMMMUgyCEheZFWIu 6e5/6k9WamXX6FY/B4gFAiTkP9LZCwJIjP+zi9a74S6q2cZsP5tWu2fwwinaqiVOUD8B 4rmks/9G8TmOSb1PkUOyJQwh8gdYKazeR5CuysiEgNlAAZl/cAunXgvGVlV7wfMhy8b7 1KBw== X-Forwarded-Encrypted: i=1; AHgh+RrcMWlHa7g9gx8+ioScWmaZAwwKubcKkyXJAxSDe9VrzB10xuPPXeyxx/3UEFkVASKfnr/O6hHxLxl14V4=@vger.kernel.org X-Gm-Message-State: AOJu0YzhWNkiNffJVsZZu6kZU6LadovobFwdy5W/QoOsRXCOlZau3I8n SuR9HOtYdwsEM4lV9HhLXuZAJNs+XrswLXgw6NDQ2vGN2gBB/OVZyKNmw2KPN6yvrxHsuPqXsF+ AeJhmog== X-Received: from plbld3.prod.google.com ([2002:a17:902:fac3:b0:2ca:f171:2082]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ce87:b0:2ca:f8ef:33e4 with SMTP id d9443c01a7336-2ccea30689amr37483195ad.17.1783545375091; Wed, 08 Jul 2026 14:16:15 -0700 (PDT) Date: Wed, 8 Jul 2026 14:16:14 -0700 In-Reply-To: <08c9bf2f-75be-4244-b99c-153ec1f604ca@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260629100301.GA1743876@pedri> <23a9173f6e278ca7dfedce3374626c6ea3e1b47a.camel@intel.com> <6a445e4be6b12_3a3568100db@djbw-dev.notmuch> <9df36c49e6be69dd9eece71f70a404a84b1563ab.camel@intel.com> <20260704054342.GB2169894@pedri> <08c9bf2f-75be-4244-b99c-153ec1f604ca@intel.com> Message-ID: Subject: Re: [PATCH v2 16/17] KVM: TDX: Add in-kernel Quote generation From: Sean Christopherson To: Dave Hansen Cc: Peter Fang , Rick P Edgecombe , "djbw@kernel.org" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , Xiaoyao Li , "dave.hansen@linux.intel.com" , "baolu.lu@linux.intel.com" , Adrian Hunter , "kas@kernel.org" , "tony.lindgren@linux.intel.com" , Yilun Xu , "linux-kernel@vger.kernel.org" , Sohil Mehta , Zhenzhong Duan , Kishen Maloor , "yilun.xu@linux.intel.com" , "x86@kernel.org" Content-Type: text/plain; charset="us-ascii" On Wed, Jul 08, 2026, Dave Hansen wrote: > On 7/6/26 10:57, Sean Christopherson wrote: > > What is "the S3M" though? Is it a separate chip a la AMD's PSP/ASP? Is it a > > per-package thing? Per-core? > I'll give you my rough software guy mental model of what it is: Each > package has its own S3M. They are microcontrollers which are discrete > from the CPU cores. Each S3M gets some CPU physical address space routed > over to it. > > > How is it accessed, and what are the "rules" for for those > > accesses? What types of latencies are we looking at? > > As far as I know, the latency for one round trip to/from S3M is on the > order of a "real" device. It has a physical address and when the OS > wants to talk to it, those addresses are mapped with ioremap(). It's > similar to any modern I/O device control plane. Note, though, that for > TDX, there's no ioremap() because the I/O is hidden in the TDX module. > > The real overhead comes because the I/O window is essentially 4 bytes > wide (IIRC) and all the data that comes in and out of it has to be > squeezed through that window. It reminds me of a UART, but with a > slightly more arcane interface. > > For TDX, though, the craziness is mostly hidden in the TDX module. > > > What else uses the S3M? Do we have to worry about contending with > > non-TDX usage? > There _are_ different users of S3M. But each of them should get their > own I/O address and S3M firmware has to handle talking to those > different users at the same time. The TDX I/O window is owned > exclusively by the TDX module. > > So, while S3M has and long and growing list of jobs, the random software > (like the host kernel) poking at one I/O window doesn't have to know > about the other piece of software (the TDX module) poking at another. > > I'm sure I got a detail or two wrong in there, so folks that know this > better: please correct me. But I think that's a halfway-decent 10,000ft > view. Thank you, very helpful!