Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp8748lqb; Sun, 10 Mar 2024 01:36:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVNnw09umvkKcAC75LAFNiL5UOE/wUFidrBHM9qfuhOp8jSyHb8OnxjdqU6QLQyIuz2RxOYFcjDoIGXTsFv85d0uuSE/RkBrOyKMk3t9w== X-Google-Smtp-Source: AGHT+IGh/AqWheWg57g/ATTsFAqsQqC2xnVyk6Zq1SLb1+H6NgfUvvHZSFW4PdSftjo2TULpXQ2C X-Received: by 2002:a17:907:994d:b0:a3f:5ad2:1ff0 with SMTP id kl13-20020a170907994d00b00a3f5ad21ff0mr2377068ejc.46.1710063374030; Sun, 10 Mar 2024 01:36:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710063374; cv=pass; d=google.com; s=arc-20160816; b=SW1kdw0/hcvmq3ZkPCu5FY5uLGusOWBu2FSC51XHlxt5otXe4IpQeU43XNnRVi1vw8 p/ee3y8SZihmVuYBKdHkFEyuOj76555OKhgdrhu4Jj6nxEcRC2uW+3Om2jFaE0D3syYU otdO4PZwXORciI597Y6amwUxTTzWhIOqNasRLTAlC/OXnZzx1d0PdgHwjarYSZax7zlh FLqeyBG05+uCpHqHUWZS2fL1II5M930Cy5z+IP71hsm5fYkNN/6kvhkUg/h2/vyuijYy nRJUGauFms0GF/Rz05Fn6uepLVURgJcb2FrM19C9/0zXy9x5XxlkcGagZ5D2a1gprc31 I5Cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ewYyqZGEFtGRF9uF/AbyS4xwOgMo8zaoUtbs4DsxlK8=; fh=RXl73CWCYIm5aDIRwkpfnnURSCU9og7XETYThrQEo9o=; b=DRG/SRM2O6N7R+3+dcKDhh+x0uAMP4H0Hzjq4nmKWSZB9sKynG5NMEHbV/oZ4ra9yb tgTU8UH7Ffs0grflxd1lTqJcG6Yd4u8UQWDBt2WAyzn4uzydG9enLO88ugm5nDEBv8e8 8KRWyI2BPSuLCb5SxMSFSIeXFPMMzJzjtZu9Zp5BDWo8KEWmzMnnM6mHpri00TWq4j5a 46ioWyHLkHkD02U17rPBF54tNe1XIKdAVfo975L/oI55T4Z2Is1/D4rZjdmTuHFSmtmi a7rnMicsP/ZXKjnD7VgW+tMw1PZBtu3O1E+VThaQ+nPRwO+mEOO7iQbqFBse2hRD/xTH dlVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GAascpdI; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-98169-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98169-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hb20-20020a170906b89400b00a4556b071e0si1435997ejb.502.2024.03.10.01.36.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 01:36:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98169-linux.lists.archive=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=@redhat.com header.s=mimecast20190719 header.b=GAascpdI; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-98169-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98169-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 955CA1F21ABE for ; Sun, 10 Mar 2024 09:36:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EAA21EA7D; Sun, 10 Mar 2024 09:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GAascpdI" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24BE416FF43 for ; Sun, 10 Mar 2024 09:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710063366; cv=none; b=dLtJcg7PKX7PAthq2yMpeIbYcOnhbXe8SGkFWjmm5cm7XFau8lFoL2tq/EshcmprEYMVT0+R/Hwh0T7XJ9BB/m5Vj5HqfO7kUAvgvaZYvWMUFcC4WHiVhE846S2E7S0Q32GINmwkvfARfDUBdfIlBjHynom2He61GvdWzgEVt4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710063366; c=relaxed/simple; bh=++KjARGJ8nOD8jfz8bqml8G9vV6c0LtPQdkxRUz48aI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VbijmUnOPB/0wTt+2DuVegH8FxgkivQAVAGXznjqZ6mNYXVXQCotnjK2P2YBMOO9wMp06VJRJqzDk5jIMqND35mlrK7jRzkCYBI8EasaKqJuZZj4WlqOQCZiUwTTUbDyxdQwE/irFo71WXivk8YDH3XnjuLy7JRJv9lKhIMvgzc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GAascpdI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710063361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ewYyqZGEFtGRF9uF/AbyS4xwOgMo8zaoUtbs4DsxlK8=; b=GAascpdImZoYD3gz3OMJwZngatvAzQYIdPqpoI12R/nNkOGhzag7Xv/ukaUjUVg5Z15e99 tx8bb2gEjb2c4szHejy7bPZ1JcgaqgWweAJbDUdVVY9CKUqkRaMGOLB4wNANULXfTH0UCV bcVvDawa17XZJXdTnmXkLKUgLZUqFyg= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-iAb5GYG2O_G5X5HMZUkzdg-1; Sun, 10 Mar 2024 05:35:59 -0400 X-MC-Unique: iAb5GYG2O_G5X5HMZUkzdg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a456c9d0717so164508366b.3 for ; Sun, 10 Mar 2024 01:35:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710063358; x=1710668158; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ewYyqZGEFtGRF9uF/AbyS4xwOgMo8zaoUtbs4DsxlK8=; b=NxOx0SqtBn7pdR64JvSnUcrIKwqm7Q4eweMvv/sjvl4PNaSS+WYkXE2fQuFurywhGn 1KvXDsYd+IL9v/xJV2Fp9/IeZhumQh+ZvyFvyqYYDPJ4bdu++A1XfCsNLoAkajX9mtqC zu8NkjxhEZFchw224ztJ28bI3Ap0CfRPVIKyIbo11bNwgKayUHr9NUMtx5lc21GebdFa 1HNG6VaPkMwwEgvfVEdAYfBy4u5AqjtFuVqJ9dCpKrF++JhZV0oAPcogipGto0eEA9dB DivkYxTPD7RPSCGN1Mf5cjViWnN9eBZ+vigOcG22T7j2mrb0i/RVo+hQ6HAkZMWo4Qmo 5peQ== X-Gm-Message-State: AOJu0YykLPBNJk/bd23sVGQ6NrHpvkrcFhIS2WWaRkYteLU7H2JmXHhS Fsb8lIDxy0CJNL5SUbDeZLEGSJ03COtTVY1vuDs2he2mOa89fqt6bJlJFsG/gE7Eedp1UL9Vfbi Ft+LZldaG7kQiRPzr06YO3QvQ+9Nb1SYlYV5xbbHoAjs8vF4ekAKwZtwu/Odq3Q== X-Received: by 2002:a17:906:cd1a:b0:a45:89f3:3947 with SMTP id oz26-20020a170906cd1a00b00a4589f33947mr1827716ejb.74.1710063358416; Sun, 10 Mar 2024 01:35:58 -0800 (PST) X-Received: by 2002:a17:906:cd1a:b0:a45:89f3:3947 with SMTP id oz26-20020a170906cd1a00b00a4589f33947mr1827710ejb.74.1710063357981; Sun, 10 Mar 2024 01:35:57 -0800 (PST) Received: from [192.168.10.118] ([151.49.77.21]) by smtp.gmail.com with ESMTPSA id c6-20020a056402100600b0056850d5ee00sm530799edu.15.2024.03.10.01.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 01:35:57 -0800 (PST) From: Paolo Bonzini To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [GIT PULL] Final set of KVM fixes for Linux 6.8 Date: Sun, 10 Mar 2024 10:35:56 +0100 Message-ID: <20240310093556.653127-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Linus, The following changes since commit c48617fbbe831d4c80fe84056033f17b70a31136: Merge tag 'kvmarm-fixes-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD (2024-02-21 05:18:56 -0500) are available in the Git repository at: https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus for you to fetch changes up to 5abf6dceb066f2b02b225fd561440c98a8062681: SEV: disable SEV-ES DebugSwap by default (2024-03-09 11:42:25 -0500) Sorry that this comes in a bit late. It's a bunch of fixes mostly involving confidential VMs; in particular, many of the commits constrain the new guest_memfd API a bit more, so that we're not stuck supporting more than it's necessary. However, there's also a rare failure to mark a guest page as dirty and a fix for awful startup performance with preemptible kernels (including CONFIG_PREEMPT_DYNAMIC in non-preemptible mode) of guests with many vCPUs. ---------------------------------------------------------------- KVM GUEST_MEMFD fixes for 6.8: - Make KVM_MEM_GUEST_MEMFD mutually exclusive with KVM_MEM_READONLY to avoid creating an inconsistent ABI (KVM_MEM_GUEST_MEMFD is not writable from userspace, so there would be no way to write to a read-only guest_memfd). - Update documentation for KVM_SW_PROTECTED_VM to make it abundantly clear that such VMs are purely for development and testing. - Limit KVM_SW_PROTECTED_VM guests to the TDP MMU, as the long term plan is to support confidential VMs with deterministic private memory (SNP and TDX) only in the TDP MMU. - Fix a bug in a GUEST_MEMFD dirty logging test that caused false passes. x86 fixes: - Fix missing marking of a guest page as dirty when emulating an atomic access. - Check for mmu_notifier invalidation events before faulting in the pfn, and before acquiring mmu_lock, to avoid unnecessary work and lock contention with preemptible kernels (including CONFIG_PREEMPT_DYNAMIC in non-preemptible mode). - Disable AMD DebugSwap by default, it breaks VMSA signing and will be re-enabled with a better VM creation API in 6.10. - Do the cache flush of converted pages in svm_register_enc_region() before dropping kvm->lock, to avoid a race with unregistering of the same region and the consequent use-after-free issue. ---------------------------------------------------------------- Paolo Bonzini (3): Merge tag 'kvm-x86-fixes-6.8-2' of https://github.com/kvm-x86/linux into HEAD Merge tag 'kvm-x86-guest_memfd_fixes-6.8' of https://github.com/kvm-x86/linux into HEAD SEV: disable SEV-ES DebugSwap by default Sean Christopherson (8): KVM: x86: Mark target gfn of emulated atomic instruction as dirty KVM: Make KVM_MEM_GUEST_MEMFD mutually exclusive with KVM_MEM_READONLY KVM: x86: Update KVM_SW_PROTECTED_VM docs to make it clear they're a WIP KVM: x86/mmu: Restrict KVM_SW_PROTECTED_VM to the TDP MMU KVM: selftests: Create GUEST_MEMFD for relevant invalid flags testcases KVM: selftests: Add a testcase to verify GUEST_MEMFD and READONLY are exclusive KVM: SVM: Flush pages under kvm->lock to fix UAF in svm_register_enc_region() KVM: x86/mmu: Retry fault before acquiring mmu_lock if mapping is changing Documentation/virt/kvm/api.rst | 5 +++ arch/x86/kvm/Kconfig | 7 ++-- arch/x86/kvm/mmu/mmu.c | 42 ++++++++++++++++++++++ arch/x86/kvm/svm/sev.c | 25 +++++++------ arch/x86/kvm/x86.c | 12 ++++++- include/linux/kvm_host.h | 26 ++++++++++++++ .../testing/selftests/kvm/set_memory_region_test.c | 12 ++++++- virt/kvm/kvm_main.c | 8 ++++- 8 files changed, 121 insertions(+), 16 deletions(-)