From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 086AD378832 for ; Mon, 23 Feb 2026 21:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881956; cv=none; b=Cwt8a427W3EgsZAnsuv184Cnhd1ZUf9dUT4+cbGO0VYp5yvQJkLFUMLBRZ9/8AC6/kg2Wfrwl+V3Ui35HVpfMdE8QGT13r4HiX+cCYDIMtxJe/sdEw0HXUcd7sSU613+EDJR35M+AZ/jrJu2QY6ZuFVGBwv7f7Nko5E9rxMcHY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771881956; c=relaxed/simple; bh=5qrxHX3bbBe6uAJtF0a/rnfGROb7vCb843CW5WKefvA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=uRv9DyUIon4MMCSioTMQsBmUFQQUtzBTY92idQMTnhBAHxkgIWh+7vxdDP0UblZG2eoo4t2v8RcgR9fbDZSpg29KpnEksUTLyjc6sVcd+7M+mITVi/u3jEBQbBebepoBXjtXroOYh7XS7q75+5dVsj2WQkbClpl19lUVg5xonYw= 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=R9lrV1Kp; arc=none smtp.client-ip=209.85.216.73 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="R9lrV1Kp" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-3562370038dso4290568a91.3 for ; Mon, 23 Feb 2026 13:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771881954; x=1772486754; 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=vCvwJ+2gLIpJ0sJnMXjuHPVyD3E0eG9cwiLrsfl8ftM=; b=R9lrV1KpOje8PFAH0xuYF2jvc/szKqtyy9HOiA4b9VOx4R3mm7fswiaWfvScu9UjW0 6QNJS5QlNINOwgeEwg4UWEI+AgRFeSq0bgVSMKSV9vyq2LH2ilIZFOkxtmyyGElF5Bez 8NjqrQR/VeTAFH0duq7m26qe78pVMpLoJNCTiK2nVzCAQstJwDfvxcLt5HIbyrk9Hkcz Cg9IVXcYTVvGiIKQQfblK3b310ePF9BziD9ounZIuGLckkPFd4DRgCMYb0y+ZxNZRJzg JrInjB5E36hQ1Pd4veHeejd+75rGj7XBuNVePZvs4Hyc3mOtbWrM/80M8Y3hNpNjktL/ 6QNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771881954; x=1772486754; 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=vCvwJ+2gLIpJ0sJnMXjuHPVyD3E0eG9cwiLrsfl8ftM=; b=YyD0JiVvYOJbxoiHVcIxZP9YgOtbqpbw0AuwrgYikEgUWQz650CbHHVgVfBjvpXUxx Yove0NS0XOk+Va8JiJSPCgvb9eBR9pH5dpvls7LEmZNG9R9No9fbjSJwQ6QBE7rhhrLm pyky9z2molkOcXL1EPrwFWD69GoLQKuuUJt/pljTxY0KzJEdNIgvuR3g3FOT6fX+6YSX 0OUjOCcymhqZn/hn5ha4XyP2djkBsXInFjANDU4O1KVf4j0fTFev5tHSGAEBqrzMvIUH fNgvi2BHgkYjA1Pi1M+A8/qwAj4HuKYgMfyrZF61mkI0k0hBOfnBOcpXz2TzDo6VALD3 iZug== X-Forwarded-Encrypted: i=1; AJvYcCUV5PkOdyiEF6iIwCDXXxKt26cNavMlm0SSHlUvjPKScuu87CX6Fa40k0dpePTQbHeOHxldpYfpNsVGeyM=@vger.kernel.org X-Gm-Message-State: AOJu0YxmkNr7uO2dXxlIxnmuEBpvpfcQE//aSFpDsvr+9QREzJK5X7QV NFpz5nK5aIFzrkQIWs1Ci1/TrDv951l/dMZ4MEGVqxNK81mPQQqdezT3+PXnmLLPu9Xt8pKgdZ4 uSBVBKA== X-Received: from pjbkl12.prod.google.com ([2002:a17:90b:498c:b0:352:c413:d36b]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2e0f:b0:32e:3829:a71c with SMTP id 98e67ed59e1d1-358ae8b23damr9479940a91.16.1771881954244; Mon, 23 Feb 2026 13:25:54 -0800 (PST) Date: Mon, 23 Feb 2026 13:25:52 -0800 In-Reply-To: <9e899034687731c7ee6d431ae49dbe3f5ca13a6c.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260219002241.2908563-1-seanjc@google.com> <5a826ae2c3549303c205817520623fe3fc4699ec.camel@intel.com> <9e899034687731c7ee6d431ae49dbe3f5ca13a6c.camel@intel.com> Message-ID: Subject: Re: [PATCH] KVM: x86/mmu: Don't create SPTEs for addresses that aren't mappable From: Sean Christopherson To: Kai Huang Cc: "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "linux-kernel@vger.kernel.org" , Yan Y Zhao , Rick P Edgecombe , "yosry.ahmed@linux.dev" Content-Type: text/plain; charset="us-ascii" On Mon, Feb 23, 2026, Kai Huang wrote: > On Mon, 2026-02-23 at 08:54 -0800, Sean Christopherson wrote: > > On Mon, Feb 23, 2026, Kai Huang wrote: > > > But the odd is if the fault->addr is L2 GPA or L2 GVA, then the shared bit > > > (which is concept of L1 guest) doesn't apply to it. > > > > > > Btw, from hardware's point of view, does EPT/NPT silently drops high > > > unmappable bits of GPA or it generates some kinda EPT violation/misconfig? > > > > EPT violation. The SDM says: > > > > With 4-level EPT, bits 51:48 of the guest-physical address must all be zero; > > otherwise, an EPT violation occurs (see Section 30.3.3). > > > > I can't find anything in the APM (shocker, /s) that clarifies the exact NPT > > behavior. It barely even alludes to the use of hCR4.LA57 for controlling the > > depth of the walk. But I'm fairly certain NPT behaves identically. > > Then in case of nested EPT (ditto for NPT), shouldn't L0 emulate an VMEXIT > to L1 if fault->addr exceeds mappable bits? Huh. Yes, for sure. I was expecting FNAME(walk_addr_generic) to handle that, but AFAICT it doesn't. Assuming I'm not missing something, that should be fixed before landing this patch, otherwise I believe KVM would terminate the entire VM if L2 accesses memory that L1 can't map.