From patchwork Thu Jul 4 16:25:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thibault Ferrante X-Patchwork-Id: 1956969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFMT26yY1z1xpP for ; Fri, 5 Jul 2024 02:25:42 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sPPH4-0001gC-Tf; Thu, 04 Jul 2024 16:25:34 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sPPH2-0001fo-LM for kernel-team@lists.ubuntu.com; Thu, 04 Jul 2024 16:25:32 +0000 Received: from Q58-sff.. (2.general.thibf.uk.vpn [10.172.200.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 2CA763F2E1; Thu, 4 Jul 2024 16:25:32 +0000 (UTC) From: Thibault Ferrante To: kernel-team@lists.ubuntu.com Subject: [SRU][N:intel][PATCH 0/4] Fix QEMU/KVM support for EPT paging level 4/5 Date: Thu, 4 Jul 2024 18:25:17 +0200 Message-ID: <20240704162521.3375266-1-thibault.ferrante@canonical.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2071628 [ Impact ] * Fix EPT paging level 4 using incorrectly memory range in specific configuration. * Expose support of EPT paging level 5 for compatible hardware (e.g. Sierra Forest). [ Fix ] Clean cherry pick upstream and associated self-tests. [ Test Plan ] On compatible hardware (e.g. Sierra forest): * Verify level 5 EPT capability flag * Execute self-tests Already tested by intel. [ Where problems could occur ] * Regression in KVM features. [ Other info ] Context: https://lore.kernel.org/all/170864656017.3080257.14048100709856204250.b4-ty@google.com/ https://lore.kernel.org/all/171754268137.2777430.1222935014468693201.b4-ty@google.com/ Peter Gonda (2): KVM: selftests: Allow tagging protected memory in guest page tables KVM: selftests: Add library for creating and interacting with SEV guests Sean Christopherson (1): x86/cpu: Add a VMX flag to enumerate 5-level EPT support to userspace Tao Su (1): KVM: selftests: x86: Prioritize getting max_gfn from GuestPhysBits arch/x86/include/asm/vmxfeatures.h | 1 + arch/x86/kernel/cpu/feat_ctl.c | 2 + tools/testing/selftests/kvm/Makefile | 1 + .../kvm/include/aarch64/kvm_util_arch.h | 7 ++ .../selftests/kvm/include/kvm_util_base.h | 13 +++ .../kvm/include/riscv/kvm_util_arch.h | 7 ++ .../kvm/include/s390x/kvm_util_arch.h | 7 ++ .../kvm/include/x86_64/kvm_util_arch.h | 23 ++++ .../selftests/kvm/include/x86_64/processor.h | 9 ++ .../selftests/kvm/include/x86_64/sev.h | 105 +++++++++++++++++ tools/testing/selftests/kvm/lib/kvm_util.c | 18 +++ .../selftests/kvm/lib/x86_64/processor.c | 47 +++++++- tools/testing/selftests/kvm/lib/x86_64/sev.c | 110 ++++++++++++++++++ 13 files changed, 347 insertions(+), 3 deletions(-) create mode 100644 tools/testing/selftests/kvm/include/aarch64/kvm_util_arch.h create mode 100644 tools/testing/selftests/kvm/include/riscv/kvm_util_arch.h create mode 100644 tools/testing/selftests/kvm/include/s390x/kvm_util_arch.h create mode 100644 tools/testing/selftests/kvm/include/x86_64/kvm_util_arch.h create mode 100644 tools/testing/selftests/kvm/include/x86_64/sev.h create mode 100644 tools/testing/selftests/kvm/lib/x86_64/sev.c Acked-by: Agathe Porte