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 959DF36B047 for ; Mon, 12 Jan 2026 17:42:26 +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=1768239747; cv=none; b=u6gnsAZwo2S2V9whcYDCLFFQvKI/scurF5astp1gFe818a9GpdKCBVBjltO13AAukK6pAtwnTN+8uNYE8HaKr70dSeMoEDAhDY+FJOMVt6fQvYIwHNGXtydVvB2egYsod62SUOT1V+xNjwmMfqmq7kBV6bZEJ92Wg7gVPOfYo6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768239747; c=relaxed/simple; bh=nLzC59QVg5wxNjld3JJPj0J8pqqhVkwuWatN4BGrdJI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I6MlY4JPcT7DPdbRsJD5oD7+NlS/h4whwl4QE2cEwumR/R94ms9J7rsECTOSxw0Zvntbguyh5RdEcFaWg4C8n/wFzQcyPMYM1vbGms+gE1m7j3srBXu7xJmvwcz2PpxwhUPopkIo8FwTT+Ls+u9Axi3J4ySG9dUs2YQsYKb4qGw= 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=KM+rI03t; 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="KM+rI03t" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-29f1450189eso48328145ad.1 for ; Mon, 12 Jan 2026 09:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768239746; x=1768844546; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Duc3I+pOD/chbIn6Qhm2ZICCw8a+HZxM0oXYju10wy4=; b=KM+rI03tJhbJzGlelVBcFd2LOAPfnTJ+aV9LBSAl1ByCkE4twrZgoqUVxqGG77CiYb Li8dbn7qqaYBRc9Hy6OuvAWG4ZpmC2HZwcdJx0Tnj6u1PDin7RSvnAvDWfYYJi7lAAR8 pVrCVTzTx1Izeg5DCvD1RDZ369YYym/vtCHtKLts7Fln8meOdJ0Be29V0/7FelAZ2JlP /g/T9LhlLCT3Bh9srAU85rFSvAwKIsgWYQwiwbJqJPzeMKqeQWHCaDoTr5MrJ1n00KfD xFyE1oOA4z7DjWBfdn3ke8fp72NTGI9PmWu+dIJNZ3cMRr8HvXT0Qpn9FT7FGUni+HfQ FFtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768239746; x=1768844546; h=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=Duc3I+pOD/chbIn6Qhm2ZICCw8a+HZxM0oXYju10wy4=; b=S8Ju2ZV6UaN9j19tj5QrOZR1JSxnCa+N8z46bxD0CyZXskOcPheUAAxTytUAaNBSxL RFRKd9UxHyjacwZS5jfvtx5h2RjggS+/vkkBsrIHjupQZhl3JHuxjqlKsKR31OtQ1fk9 4xofEdXXOJ2WPG5tE+9Ng19015eIU0d2NCbQiG3aFFxiMexnaK1i700z4YRU4axmJV9Z a/iN/73vjkKLGvoLNqgiLCskwrR7SQSsBCgo4kwRw+x3fB1Ibt1mnbxU6UHK0XR4RviC dwTrPSPT2aL4O3b1CJYSk46jQI3fewLFazhCfbEtkLs3OKaK8a4504nuTXbOp+HsD5E4 1UEA== X-Forwarded-Encrypted: i=1; AJvYcCVC8Wv3PO+/axHOcKrK6k8CuzByhiGHJNYioniwI/l0LYZRgVdKEZJtjYgBPtn4uo7ClsLtSphiJXLsgoc=@vger.kernel.org X-Gm-Message-State: AOJu0Yxkv/8bXwyfvhfSnJZNYgRZuAMD6jE+akpO3BbuXCR556ArUILo QXG9tbuJK9p7MRrQkJcBIqYD8m25dJwfrm1n38WMWdmn9a64nB2UyHvqxu+M9SDPSCzORECkYrS 17eUmfA== X-Google-Smtp-Source: AGHT+IFn8ZPY20Auyud2qiTlPihGQBoA1f0v3MRk46Zm+KFu7Pytwkzlw4T3eS2LOGX1ToTFS0cu89UxGI8= X-Received: from plor8.prod.google.com ([2002:a17:902:8bc8:b0:29d:5afa:2d9]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:22c5:b0:295:28a4:f0c6 with SMTP id d9443c01a7336-2a58b414e07mr1772975ad.0.1768239745880; Mon, 12 Jan 2026 09:42:25 -0800 (PST) Date: Mon, 12 Jan 2026 09:39:04 -0800 In-Reply-To: <20251121222018.348987-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251121222018.348987-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <176823901501.1371726.15879387751613608587.b4-ty@google.com> Subject: Re: [PATCH] KVM: VMX: Always reflect SGX EPCM #PFs back into the guest From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kai Huang Content-Type: text/plain; charset="utf-8" On Fri, 21 Nov 2025 14:20:18 -0800, Sean Christopherson wrote: > When handling intercepted #PFs, reflect EPCM (Enclave Page Cache Map) > violations, i.e. #PFs with the SGX flag set, back into the guest. KVM > doesn't shadow EPCM entries (the EPCM deals only with virtual/linear > addresses), and so EPCM violation cannot be due to KVM interference, > and more importantly can't be resolved by KVM. > > On pre-SGX2 hardware, EPCM violations are delivered as #GP(0) faults, but > on SGX2+ hardware, they are delivered as #PF(SGX). Failure to account for > the SGX2 behavior could put a vCPU into an infinite loop due to KVM not > realizing the #PF is the guest's responsibility. > > [...] Applied to kvm-x86 vmx, thanks! [1/1] KVM: VMX: Always reflect SGX EPCM #PFs back into the guest https://github.com/kvm-x86/linux/commit/ff8071eb3aa5 -- https://github.com/kvm-x86/linux/tree/next