From patchwork Fri Feb 9 22:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 20184 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1162937dyd; Fri, 9 Feb 2024 14:19:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4Pjl5f9LLpRx6i1I+2J6mDR1Ce1h0nq8SUBp3lFB75w6FqsTZYGmDr+nOC4mHldcaTCwufgomeoo9nImx7fwFlUsF6w== X-Google-Smtp-Source: AGHT+IFATm6ByFhStTojcY/RlPYJjr1KLKx00hSINClLqk5sCxkQir93H10+/yctJqdxNIqgHTVu X-Received: by 2002:a17:906:3455:b0:a3b:da9b:b0a2 with SMTP id d21-20020a170906345500b00a3bda9bb0a2mr292710ejb.58.1707517188775; Fri, 09 Feb 2024 14:19:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707517188; cv=pass; d=google.com; s=arc-20160816; b=t1fd9uDvKsGOXtztQ9X/dS4mCFY8FYR9932JymdD9aCbmYg0kODE9ghuvSyln0SNNJ eP7kMHP9p6uiAxmlt18yjZPfKsygcQBzx5GutkeqekW3ntHXAnUNHOyqPeDxjIRERHdD CrkIiDKKo50VFOXSBvwe0BACNBBCRhoCpz1ttQ18cugqkul65ZFqVcz2IGZ40UJBrJgi B7qHRl3oWvjMVNGrFtk0gHEmIUUOXA5Zs9jIJPso/Wjep6jw4dYcoLtVtnwLACsyN2+M yIFmOfVaQ9/L/dF2ORDnRu2kDERV9b7F9PjbxfGea+45W5/K193KMyV0Y+NBgsAZ6P0D sEXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:reply-to:dkim-signature; bh=fzYnSOsBsYlPOE5QaqJSJoUlPUKgrEZB23Y9jp7yz4E=; fh=BD3pM2Q6//NYc0l8ZxvHFuEgnvc49VuVtWX5o2jrfQU=; b=RiBAlIYHcMJsAtpwTzty0l1caHDuI0kNhh3WRjHZ9CVMZN/O3A68bdRutWNE5qB0N9 psFQnZoNIpgNp0wIQoHOlhNKvFto4YbOzhkP6eRnkgu26osfyeLeJWjie/UugtgCb6Vl LBwB+XfOOhJFddUgBSx1RauksfJwqOL14I8fzDkBqeuEcVuZ07W2V932k9IPTZb0KT+V LM9EgWsTQsBttyXsSmNBw2u7eD2tchJvEtZPBLw7U6PuSmm35VI/QtNEEr+vPm2pH+Vq iVH2eR9dRK+dRostUGFEUt6/6vNjmEG/4LePT94zNZlNlhkiTZx6dKvEFQrFhaY+urMB 19uQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Kzb/vOQV"; 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-60087-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60087-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVV8rXTJGiW/i7pQH3q3asWan7gOAL/k7POYgpB9aX3+3hEpRaebIkmmV63O7EZLLLrAYQyBOEBX9VUdwqa4WpYCTYwUA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y21-20020a170906071500b00a35341252e6si1206448ejb.1037.2024.02.09.14.19.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 14:19:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60087-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Kzb/vOQV"; 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-60087-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60087-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 647601F2418F for ; Fri, 9 Feb 2024 22:19:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAA913B1A4; Fri, 9 Feb 2024 22:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Kzb/vOQV" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.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 C07163AC0C for ; Fri, 9 Feb 2024 22:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707517025; cv=none; b=Xd1sVZPiTOVrAHHYRS775IQE0htGdZoG0kORv4tWJT0MVQQuXNrnAiR3qMHhzVg3+uLY1yVlzMU/8R4FznVqCiRtyb8Q7hwQa6FMShYVXTuoycrNBXi3O5yJkBhqq3aFAw0TIPvLvEFPIl4iO7egfZt2ktFnFzWBBhRYsh5xevk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707517025; c=relaxed/simple; bh=9JikdSipvdk4CPkQDRKibPhnWzuH+2gXV7H2wPj8RH0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=PvDLzHXiZw/sNY2Yrd+d9UJ8HU8r0scnmpoFYAwSzIMTxHXitF6Xlk3WfQ/F+IMygQHkuYTDVsE7qnj0+0hBb5Bh8x7P5Zr2qtTJvryUhcvrBOICr5UB+u/zB9rRLG/TGBZ/3UD0N56xFSXY7q2u9kwRUZLPrHGxm9Gm1i9pBgg= 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=Kzb/vOQV; arc=none smtp.client-ip=209.85.219.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 Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6b26ce0bbso2663335276.1 for ; Fri, 09 Feb 2024 14:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707517022; x=1708121822; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=fzYnSOsBsYlPOE5QaqJSJoUlPUKgrEZB23Y9jp7yz4E=; b=Kzb/vOQVGXFxluQMdzApSmKU5C8iNVCugLYOVQ0mSgFiVT4NQa+Wf8xBORmt6wTERy gi/LVyr7tgEzZJK7CbBEY8Uj8Qg0jK+AIglt5zwYwrgvajkfrSRfrbxrNRMJqL9g4PeV pz/axuu/Hfa8gQ9K9gwwU9rT6BxOGeVW82DLfUKNnX6TgcjAjOqMei5gX+FzyqKGiQiZ bsnL3b05G/OMziKHcS6629Dm3OUy2vPRrUoDyqG9AnWOQSif0CR/dZdRdJiduje9zNai 8Ww/HSDGoFIaZfB5OzQ2udhQ0H1hVSZCxHjhmLfm77AJn4SSa73B2GVizJ6iooj3WtH2 owMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707517022; x=1708121822; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fzYnSOsBsYlPOE5QaqJSJoUlPUKgrEZB23Y9jp7yz4E=; b=YEPrGYa86Y9tFmNIQl4xykUefNwJOijkuaqFL9PmdsIAX65M+qxhSaj42DGVw4+x3z YT8+DCkd0yPfdr4fjo7haKCHSK3MJHwXPMJrXNfStXuNANb3P7kBGrCVyT8uKnXpxNSD B8RrLRgrJ/+xNSnUJD9SbSNnCgG1j8dIj+ol9qzAGbtHG0AKBKFSF6R7dJ2cttVgFa0n Bmsx1XZcF5zLdMemXM5E7ZTfVaIri5iVCRx5BqiDTVFWA5/ONP/Xgp4/vF3TxwAVIZBf jWPjiaSgR9sQOvCJwA1p1xQlZ4UZcOEjWvxMvx1E6uS4s8y5TZbG+KOP4zjUpCf1MydR UeUw== X-Forwarded-Encrypted: i=1; AJvYcCVjbJcaWSz0X/atf2eUaeMMgEA53BtZRgAD1ZO62QKC7MnvMObSjfusevtq94C0tFsFBG3tBNDNpnMF4wI7pCOHkluyJu8UowONW8Vm X-Gm-Message-State: AOJu0YydplpkkxMw1XGtO6mv1Jjd4m4e9n1m9X7XnaCBT3oWq9YC1eD3 yEUkEW6RaZtm0p/DsQUYFWZ/beN26/KpRBfxBwkY97Zz5u+Dz+RFyyWZwEpzmAiFECr0dxK0IeW kag== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:100b:b0:dc6:fa35:b42 with SMTP id w11-20020a056902100b00b00dc6fa350b42mr111020ybt.2.1707517022804; Fri, 09 Feb 2024 14:17:02 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 9 Feb 2024 14:16:57 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <20240209221700.393189-1-seanjc@google.com> Subject: [PATCH 0/3] KVM: nVMX: nEPT injection fixes and cleanups From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790461543616172527 X-GMAIL-MSGID: 1790461543616172527 Fix a minor bug where KVM doesn't clear EXIT_QUALIFICATION when injecting an EPT Misconfig into L1, and then move exit_qualification out of kvm_vcpu_arch to avoid recurrences of the bug fixed by commit d7f0a00e438d ("KVM: VMX: Report up-to-date exit qualification to userspace"). Sean Christopherson (3): KVM: nVMX: Clear EXIT_QUALIFICATION when injecting an EPT Misconfig KVM: x86: Move nEPT exit_qualification field from kvm_vcpu_arch to x86_exception KVM: nVMX: Add a sanity check that nested PML Full stems from EPT Violations arch/x86/include/asm/kvm_host.h | 3 --- arch/x86/kvm/kvm_emulate.h | 1 + arch/x86/kvm/mmu/paging_tmpl.h | 14 +++++++------- arch/x86/kvm/vmx/nested.c | 30 ++++++++++++++++++++++++++---- arch/x86/kvm/vmx/vmx.c | 2 -- 5 files changed, 34 insertions(+), 16 deletions(-) base-commit: 7455665a3521aa7b56245c0a2810f748adc5fdd4