Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp327147lqo; Wed, 15 May 2024 16:26:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWC3g3Qt2ZXTqr88/nqLVVgZ3wKnU2QfUjBo/enqMISmgbrzF1oeWYLQU68RGMlbRmGvsDOdKDl9bF9zpWCJESEm2fltsMk9MTQTLvrWQ== X-Google-Smtp-Source: AGHT+IHhgokhSxnIYv7nM2j618AA9T+ELArUXaVfi+GOJqaaFEBNYGJTJYEIXBVd3fyZ8aLKQ6rL X-Received: by 2002:a17:903:2310:b0:1f0:99c9:c8b with SMTP id d9443c01a7336-1f099c90e93mr11942905ad.22.1715815619157; Wed, 15 May 2024 16:26:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715815619; cv=pass; d=google.com; s=arc-20160816; b=ewSXIEPY2y33KMk5+IU1vMM8CqLnZSENJxVE5wIPu5naIzWGQGuMJ4v8wWdJqOyBHg NXKdbKxtX728UH/22E7rm2HdfKW6XQqQ61DF/gTLMApijjrCCj41KbD/Gie9qNvAD2O9 U5h2vXG+Kgj8dAEVt08tRRPko5v9tt6cHmsFpkI4BHCXYyw7dskc9ZndW3Ojwn0dis0n /pOeY0O06C8U0fs6GlctXZVH4A4DMK9rrlrbyyMaxyc5Pz+XkzxTVqGHatcJdzwbQLOX 0vaZgyZhWadHMh3g2PrJsEZxi2Na5WqRPXSNuUIwrmWV3yfXYSTaHbjLSk5V5ntRsQ5c oHyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=2Y9HYnVAi1MX2b83pHesfVOmcysatjNtN2ksEqhG4Gg=; fh=E0F18hOXwEyef2BfCtxGUHWYAEQ7ZfauwPpMowhIbK4=; b=ciN01leMguYJi3+EZbYUJwKasppsF8rYX3WLS7pWfsrG+MDbLDsaLNNJEJ/mgOshVv /j9LWoByMbG+hGJPG2uiHNkQ4ZzC3v71JeaVzQvHPQpmQvuqXjdln05FEZ9amEg0xrCH +5itfXWC9vhWNjHcggaV2Pd1Aj9q9PeBeWQ7XzIKXM7loVaaW4fMEQDrxkVGfPhlXX6K sFzhfiah8UB96PhuwS+lgg8nDpBXS2kzLj9ifZD8fodNwaWeJUvcO6gxle/0jLD+pQaS J3ddsBwF8SWE1a27K6uY1+8AlEEF6vWZn8an7c0QkM66r83kFjptoEjE2EThAbjmummL lAfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Bxqb4oyn; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c039f35si138764925ad.381.2024.05.15.16.26.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 16:26:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Bxqb4oyn; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5A3DBB2185A for ; Wed, 15 May 2024 23:26:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8868A50278; Wed, 15 May 2024 23:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Bxqb4oyn" Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (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 80A392A8D7 for ; Wed, 15 May 2024 23:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715815579; cv=none; b=JnUyEh3tnV/EOV9Zpe3NXSuGvrU0lRXmQQcfhQAw/k7kBVIcydqUXoH5ZIkq71FEMN5Aj7yJh85eRB6mclVhO5kL1y3BOvRj+iaHnxifKF9RBK2G4FDjksfQXpZbxqowjC9NQfq6MOL5rqcEcO16w4DooT9XH58bbPXvofnCBHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715815579; c=relaxed/simple; bh=2Y9HYnVAi1MX2b83pHesfVOmcysatjNtN2ksEqhG4Gg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CEaq5REocVbRiMkaiCd4NKsJDX3uBbo4v/1czG9Pcs+1WRnAxwZA2WcSC8885E4onjRfkq33kCfL7+oayeATC9E92nJvhVcIZ4sQlZo7H0IUPR4X1eFHKldnYkzF4JuIjrTHrIB+xXDkOfYfIhwwcq/wYtwQ3WeUxbJ5cAPptP4= 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=Bxqb4oyn; arc=none smtp.client-ip=209.85.214.202 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 Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1eea09ec7ecso73528335ad.2 for ; Wed, 15 May 2024 16:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715815578; x=1716420378; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=2Y9HYnVAi1MX2b83pHesfVOmcysatjNtN2ksEqhG4Gg=; b=Bxqb4oynMQqIRcuj5r880CXfuw2YOillXM1xLTybMhvy25wQt+LPrBnXL7hevpfy3/ zxTTbbCFHb4O7RBMsuI0qutXWs6WmbZspApLkzEa/KyBsoYKjzrII0U/7WHu8yywXk0E EoqZ1EbjRS7EMPO5R5PKk3h+FTegwJXGF8SYltL65GOwwm4LAQO7jZBJDn7FfdnUKesh zwxN/Pis0VhrjHWDOkESZ5x8YJ1RcG5kKIMESa/yKjWMlFAK0qoqtCqDyYJ78ZrnAM9y VN+KMdt+F6t7ZdivsMfAaFa6dF5owq4ma1AjgfpazCOSeDUd2I5rPO0pAjfMUbt0ukZj OCVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715815578; x=1716420378; h=content-transfer-encoding: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; bh=2Y9HYnVAi1MX2b83pHesfVOmcysatjNtN2ksEqhG4Gg=; b=G8Z0VQNrZf1BO2QBSBFmkYQcQA68d7Th4m+UTyUW/ZPqZLQfZNkBIaRCx8kfV+IY7D 5ogCTT8cAoCFzNoJAIwK8jeFIpBhZIzZ3ndSDYgfLMboKglS3j04JLcm4J98XGgApPOh qM9EV6NPVHBEc1fjL9pNTyuYEGB5hQjUog/5mJSpyB0yya2mTSfyyPcJ8KbPYckxnEKS 1sz8Ci9/UjcRYLHCrcZpHWGMMk2i1xmQViatLDh1T18ToZPvCu4wXZq2cSmJWtdSEgg1 uijqseMVHLEjFF1/b3UvWCOyA2HsoGNaXuEH8tB8kVv3wG7hphAplc9H7zxFf1Jp6hYI iHFw== X-Gm-Message-State: AOJu0YyulCeVyTgBO1bxjfxssY0qO2WJOQiKrj+jFubhUQmRyDenEAPU 7Sx0ZB0cPVNWkKABxj1Y67HwaUc+CGxwfVPBe+VjiiPzYw6irRtGilGNEXrYHJHxRsTjXkAOoDT KHw== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:d2c8:b0:1eb:d72e:82aa with SMTP id d9443c01a7336-1ef43d2eb43mr3260165ad.7.1715815577568; Wed, 15 May 2024 16:26:17 -0700 (PDT) Date: Wed, 15 May 2024 16:26:16 -0700 In-Reply-To: <72a18e11e09e949e730d01a084ee9f1a94c452ad.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240515005952.3410568-9-rick.p.edgecombe@intel.com> <747192d5fe769ae5d28bbb6c701ee9be4ad09415.camel@intel.com> <77ae4629139784e7239ce7c03db2c2db730ab4e9.camel@intel.com> <72a18e11e09e949e730d01a084ee9f1a94c452ad.camel@intel.com> Message-ID: Subject: Re: [PATCH 08/16] KVM: x86/mmu: Bug the VM if kvm_zap_gfn_range() is called for TDX From: Sean Christopherson To: Rick P Edgecombe Cc: "linux-kernel@vger.kernel.org" , "sagis@google.com" , "isaku.yamahata@gmail.com" , Erdem Aktas , Yan Zhao , "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "dmatlack@google.com" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024, Rick P Edgecombe wrote: > On Wed, 2024-05-15 at 12:48 -0700, Sean Christopherson wrote: > > > It's just another little quirk in an already complicated solution. Th= ey > > > third > > > thing we discussed was somehow rejecting or not supporting non-cohere= nt DMA. > > > This seemed simpler than that. > >=20 > > Again, huh?=C2=A0 This has _nothing_ to do with non-coherent DMA.=C2=A0= Devices can't > > DMA > > into TDX private memory. >=20 > Hmm... I'm confused how you are confused... :) >=20 > For normal VMs (after that change you linked), guests will honor guest PA= T on > newer HW. On older HW it will only honor guest PAT if non-coherent DMA is > attached. >=20 > For TDX we can't honor guest PAT for private memory. So we can either hav= e: > 1. Have shared honor PAT and private not. > 2. Have private and shared both not honor PAT and be consistent. Unless n= on- > coherent DMA is attached. In that case KVM could zap shared only and swit= ch to > 1. Oh good gravy, hell no :-)