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 290E73A9D91 for ; Tue, 24 Feb 2026 17:37:44 +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=1771954666; cv=none; b=MK+MDC8zFyEZOBbRcPfeLRmjAfYSIKlG42n/mQNHsHiLJyN4ocbJ7N+hDJQWTl1oFLa/m2IxqMspbNQ+8aeyDTmYYiY+rMcdGCDOrLYT8AAXgGvE2yd80o7iBqm2aO5PhjL/hNvt3Zg6AHDxENWvEIwyG5ROb2QRK3nUQGIvOE4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771954666; c=relaxed/simple; bh=mCCVv6L04cWt7rC+dXX4D8L5HIoEgr+4KNHsOMYBn7k=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=buhQwbNA90fgEpQxjtmq4ZDlS2iB4v/di+8Kwh7I89dG/YEzj5zFa8jjaDCOvo3Y7QAMO7wL/vibukbvwFxujJiwOW7fcU02YXwRFqseAwBHkqtxRsboQyRbxfvMcn5a3w5p5+td7+NM+WiM8+GcCgD74iWHYXMa0OGt0kPubvY= 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=KyVvMOVA; 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="KyVvMOVA" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-358df8fbd1cso1149347a91.0 for ; Tue, 24 Feb 2026 09:37:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771954664; x=1772559464; 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=YBYOBVXP4vivMMEN8JfHO64Zg9pUzxocpjlkKoATuFs=; b=KyVvMOVAcn/btlvd/NKGj5h3hwxorHzG32TFQT1aBEtKnWCNTLM6RlofhDWaN/C0Go vI1Ry9GDRSxD1ahrr4eBO/7TjE64uBbrOsbatNccMBDYU9ajOTGsWtOU3LTuy7soBs58 8DXhLAC17Q+XzpJYmjh0Xl0pOnaDirUw0yH3Q9crzNAz9Cg0xPzT4MuN4UcpQ9+bzZ5c Qfb94FL5WKDOjt9xkxcahfiUr81KNJqJ3csD1Yr3X67RPTVavVTwT89dtd28i+x8xBOX BbSQpG7Q996iyFb0CGrHqctPZSuWjsuf20i0fCu8E7Q7TqzWxSdki6T/y0LP6goqTBuW f4eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771954664; x=1772559464; 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=YBYOBVXP4vivMMEN8JfHO64Zg9pUzxocpjlkKoATuFs=; b=gUhu2vTps+Rbtt8PWpPN612RtRwio43Z5WKZUyM7qhtXsoKDBXhwuh8GFwYplFupom B2e1ID+UIm61l1PL0O7IIUxPh6tigDm6ayDNGU+VCimzawxlmUqkK40/DL0p4/by0v4I oJclGVuBHo193W1zcQfMrrMh/erXGA6/16bCnPpDT6ldLe4Fg+rSpNUfj1kEZLuJU6N/ 6NgtfrhXwyEAElSuuJsVb+cOgUiyicw1+EmHsRYrfysF516SjPvTHKPlR9qtfNus2qvY r5ou+gCD9N+MspYE415e4tiKMBWg2lz7cnavFCEb6JwBzkO4++04xMJVuG1HjSLmXFta 1SJw== X-Forwarded-Encrypted: i=1; AJvYcCXTaRCt2FcX+5geLaE3q3DFmH54LiKxaffHFVVLtCAZyHPAVte2F23Lkc5kJ0AS0+v4NhOmpEv12OoUFAw=@vger.kernel.org X-Gm-Message-State: AOJu0YyZgnj+quNrTf4+pRSsP7QMMIjTiL8VemeB1IX2pzzBtSMxwhSJ +fYkTRqojhN+cwklr6ooVe02J8mf6sWXAHOjMe8tA2UHB82XghiPuPEnpe4wee6O8Udcba62J4T zUR7XNg== X-Received: from plbiw20.prod.google.com ([2002:a17:903:454:b0:2a0:7f81:6066]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:32cb:b0:2aa:d816:e1a9 with SMTP id d9443c01a7336-2ad744e0aeamr104939405ad.28.1771954664283; Tue, 24 Feb 2026 09:37:44 -0800 (PST) Date: Tue, 24 Feb 2026 09:37:43 -0800 In-Reply-To: <20260224071822.369326-5-chengkev@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260224071822.369326-1-chengkev@google.com> <20260224071822.369326-5-chengkev@google.com> Message-ID: Subject: Re: [PATCH V2 4/4] KVM: selftests: Add nested page fault injection test From: Sean Christopherson To: Kevin Cheng Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, yosry.ahmed@linux.dev Content-Type: text/plain; charset="us-ascii" On Tue, Feb 24, 2026, Kevin Cheng wrote: > Add a test that exercises nested page fault injection during L2 > execution. L2 executes I/O string instructions (OUTSB/INSB) that access > memory restricted in L1's nested page tables (NPT/EPT), triggering a > nested page fault that L0 must inject to L1. > > The test supports both AMD SVM (NPF) and Intel VMX (EPT violation) and > verifies that: > - The exit reason is an NPF/EPT violation > - The access type and permission bits are correct > - The faulting GPA is correct > > Three test cases are implemented: > - Unmap the final data page (final translation fault, OUTSB read) > - Unmap a PT page (page walk fault, OUTSB read) > - Write-protect the final data page (protection violation, INSB write) > - Write-protect a PT page (protection violation on A/D update, OUTSB > read) Either in this test or in KUT, we need coverage for validating faults that are reported by hardware, i.e. for faults that _don't_ go through the emulator. E.g. there's this "todo" of sorts in KUT: case VMX_EPT_VIOLATION: /* * Exit-qualifications are masked not to account for advanced * VM-exit information. Once KVM supports this feature, this * masking should be removed. */ exit_qual &= ~EPT_VLT_GUEST_MASK; Or maybe both? I generally prefer selftests for maintenance purposes, and you've already written this test...