From mboxrd@z Thu Jan 1 00:00:00 1970 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 ED6E71741C3 for ; Fri, 12 Jul 2024 15:13:38 +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=1720797220; cv=none; b=ZhWnd5Z4HddMBHIlilsWtqZAQmC1LeAYyDdrflzSZvt1bLNEhk51A0XbqjCMxnFaGRe+r0ZT6LdFd5kd07GksFYsC7kbHT+nRawjw4cqshAYhCrE12JbbjmgEGtlCf2sdUSWnOQU0ettbV1Xx3Eb3aSq0IscUuXUKnWr04WivYI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720797220; c=relaxed/simple; bh=fHx8roCBigOuv5dL+stx4nu0lHPpoaj2yAnLzpWevyk=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=gX0AB/+EoRA7HSjKot3Xj1uieFzdPZZSmELGBDsL5oACW6Nxsrv11iW2t/VCreZombk2wB64DmJNJ+qIRR6C+hLBzQuqup05w30uNwA+dPAQdTuMlCeItVG95MuJNMexK3HYqmqf/tUW3xoZngiHcnAmBKxTBmz59lLPKt95L10= 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=2HV4JFHS; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2HV4JFHS" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e0335450936so3884482276.1 for ; Fri, 12 Jul 2024 08:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720797218; x=1721402018; 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=pMBbMkJX7zmz4UDXazHpxT2FCAKHZXQ8TyK0Rbrgj28=; b=2HV4JFHSmXnWx8mAIJDjoIYa/DoksToXVwAJKVVY8fzZqXGUpvJ/Dmj6AoBo71WSSY Yy8kV3ruB7z4LjgxmlYfYCiFGM7C9B/UukJCZZA6UMebXCbeC/M2cfrQe4kwbScy9ZHy Czbj43zzPRlsMLS/kY+o+2MU2kXFpyCsLQ5Sn1cBj9HKsm5VcseM0APmjJ1IDnEP2C0N B8GHS2F0LShSgoy86JlqBKqb94JysKJpFhM9Uha6fxd4hxTa6cvU7+r1876V2tYqMEpE dHBAsUyFf7fTgxmslJerLDSbPnpsKE0/kX7usXP/BYfPDmgPc7v+CK8x3mK76ui4bYw3 llcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720797218; x=1721402018; 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=pMBbMkJX7zmz4UDXazHpxT2FCAKHZXQ8TyK0Rbrgj28=; b=Z0ts+juqgulWjtiYgJKQaxR63IKf9OOKiQIOhwWmpfrQYjuDxJwoOPdsRmsv9pCbLx M1BMbbRGhy5mOQjf/CUI0jwwcxVkjnBumvFO9Eaqe0dIIGSQW8qt9Em7Z3q2GGHxj2D3 X5GfwY0xgP48Q+gs3oWC+gKxUqmj16K/X44CW0NJbqNtSQIePzVE+Wo7Ea8gqiQZNg4n pbdOzMg31L1/aTZc30LIMH1eDxbW0WSIK4sUUNK8zqFI8g7pStKXi84MpbO53JdF+hFs Gu1jW5V3OXpjsOIsmuZhcYPH+H1vvDaZUVZR+h+Jy4s1eNnfM1NqTjeMz8ioDRJpvizP jcDQ== X-Forwarded-Encrypted: i=1; AJvYcCWpo/jYbq5J7n2SNeEzthRsrCZ+fuVzZ1I3sAoMRVKnWW4Xdyt9JelZXhh9wmji2YiHQ2lMyoAdohJ1vtSoTlUTaNWFLJvvNzdy6EmE X-Gm-Message-State: AOJu0YzPjhR0kigsQf+kqUOs9+tkPFvpR5kA2k+2OtsZdohyZcgSJApx O2vUWuo2XLld0lyTeLWLuUIXRz+sDPZc+//VMWwm6H9JksnVhfT9jXXQwmjcX9hgVG1lrQjIAwn kjA== X-Google-Smtp-Source: AGHT+IH0rczfJl9S7uUejXGuj2VCmgs/pCiBU7IUiJYL350tuI8YPdO5kWLf5JJJSkCI5YzF+/Av5eqK09k= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:1002:b0:de4:654f:9ad0 with SMTP id 3f1490d57ef6-e041b058ccbmr24885276.6.1720797218047; Fri, 12 Jul 2024 08:13:38 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 12 Jul 2024 08:13:33 -0700 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.45.2.993.g49e7a77208-goog Message-ID: <20240712151335.1242633-1-seanjc@google.com> Subject: [PATCH 0/2] KVM: x86/mmu: Clean up hugepage split error handling From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack Content-Type: text/plain; charset="UTF-8" "Fix" an impossible scenario where KVM would install a '0' SPTE instead of using SHADOW_NONPRESENT_VALUE. In quotes because (a) there's not truly anything to fix (the code should never be hit), and (b) bugging the VM doesn't guarantee KVM won't get confused (though it's still better than installing an empty SPTE). The main motivation for this is to eliminate installing a '0' SPTE so that future audits of the MMU don't complain about not using SHADOW_NONPRESENT_VALUE. Sean Christopherson (2): KVM: x86/mmu: Bug the VM if KVM tries to split a !hugepage SPTE KVM: x86/mmu: Clean up make_huge_page_split_spte() definition and intro arch/x86/kvm/mmu/spte.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) base-commit: 771df9ffadb8204e61d3e98f36c5067102aab78f -- 2.45.2.993.g49e7a77208-goog