From nobody Tue Apr 7 14:20:56 2026 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 1265F34A79E for ; Fri, 13 Mar 2026 06:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773382389; cv=none; b=Owuw232TOUGJpBQHiwcj1PcS179/zExx116JwtMTsrsbcM9hvEDKuPnXH33GuQBTmwdqO9dTJ8Qkg8LIROG1JX/gEzcURDwjC2F0m6Si+Fj3ZQIir6vvyhEH4wVaPLbg76Jn69CNVE4fpWh8Upr5rutqi0sa7awRaFti3eIZx/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773382389; c=relaxed/simple; bh=+yxvt6miDsLo0aPzGIl2cuUjXFw4HY73dvLlkFiduNY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WWHRJrCyv/fOK5Jadz2zZAYtj3/fYIMFA7IjMONQTGeXnEZ9kIMVPjQarXX1vvBNEHP3XcNgDJhWLwi2BML0jZQunlUbb00UxFTPbp5JA5fDGZ4H/kg672Bup8rkwTE5LR1d0TcGXIKLQAYYFUklSb1hC18SkIA5HSoAiFA+tyM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ackerleytng.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=L11UPzTQ; arc=none smtp.client-ip=209.85.216.74 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--ackerleytng.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="L11UPzTQ" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-35678f99c6eso1346226a91.1 for ; Thu, 12 Mar 2026 23:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773382386; x=1773987186; 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=b75o2IzoSOCf08/jbE8J7pfDBRNnIyHyOWOLbNdF1vQ=; b=L11UPzTQZsjVyClKszCwVBPJIrNF+Lz8QhVKb65MhKcV6iGa29FOaTCr1GzQB7tq4y EkgBAOzbT+ij3CdEbQfesgvj6AWS40x2fdqnlO9UaW2z58sIRIXvtePGKKdxFTWIO7mU C5HgYPEnTl4RTxSxE2yzpgqF5CHm3Yq8ryH0r5NK2sN/X2pZGxZvOyP9FMq0+FLLWg1h /2u3VIQBMwjtl9S4c1fErcSYWoXfZ4qEpSBeKz5caw0rnVthWev48VFdCemS6Gh8oXIA Rl1YKQNlDdehxL9AF3xgH+D9I8B76DQ7JxIwaN2IKFuPUhTlQNgV/udksfk86pfXnK2f PDQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773382386; x=1773987186; 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=b75o2IzoSOCf08/jbE8J7pfDBRNnIyHyOWOLbNdF1vQ=; b=ALbeMncdL/CEWeHqWS4tNnazEHw11wgpEADKt/NtcDJk4IbIG10nADSUYJ/OHcLwlD K7JJ38AvtWpmeiij8PJL/vhLiPUJSUzA4VrY1KJcyJJE74otlScR7o/ZkZ1FQG2naHFY akTfEQko2DFMD5Tw5R31/3vRdMXeo6hFck13iTipcQZ5Z8mF6Ug5qJg7ME6jqFRq8YN3 jUaP819kLjlMNzq1g6MjrEgrVZ6QKCqgLznfQyiuQHFuTGzMy1Jn5aw3quUzjfne+EEO m5F4jGpNv9kHGFYWKpSr0uyOPEcGSkkvxBflJbTFH6c4nsW+1vESc/1kAZufuLbcR6Tx c86g== X-Forwarded-Encrypted: i=1; AJvYcCXE0QiGKd/9EX7q5OHhErJ71LHvQIHIqaKxdY+2Gl0YIIaF1ndOvkM10JAOkblxAJcOlEryo6p+/FWzCtc=@vger.kernel.org X-Gm-Message-State: AOJu0Yz02lkt0401PwaUqph6/pzH700dEruL4ECeQmdhzGzN4GD7LeAM bujGNfwlj4/qLIuuLORspg49R0CaZ7G7NwyrRpcm1xY72g0T5Tq4lDWX5BAAn7Bczuhguyhjify 8Wh1xD1FWWfAIl+L6/IDnR7sH2g== X-Received: from pjni7.prod.google.com ([2002:a17:90a:8387:b0:359:78a3:a05b]) (user=ackerleytng job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1e45:b0:359:f2e1:5906 with SMTP id 98e67ed59e1d1-35a21e3958emr1821235a91.4.1773382386033; Thu, 12 Mar 2026 23:13:06 -0700 (PDT) Date: Fri, 13 Mar 2026 06:12:50 +0000 In-Reply-To: <20260313-gmem-inplace-conversion-v3-0-5fc12a70ec89@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260313-gmem-inplace-conversion-v3-0-5fc12a70ec89@google.com> X-Developer-Key: i=ackerleytng@google.com; a=ed25519; pk=sAZDYXdm6Iz8FHitpHeFlCMXwabodTm7p8/3/8xUxuU= X-Developer-Signature: v=1; a=ed25519-sha256; t=1773382364; l=1751; i=ackerleytng@google.com; s=20260225; h=from:subject:message-id; bh=9Ip75FUnko/0RMTmmR8hpogS1RIjLLZ87GSWphxWeLk=; b=TeyrKLRZr7KdaZpJOnTQ82Tnubf0KxrjYIwwgyxVitGP6OaiDEw2tA9byUcAF7CMB/WOPpYan mVI26pDsudzDK60E97MrrbP9QYf3ETOPcuNtgVvZGbWGXV3ovh0UE2P X-Mailer: b4 0.14.3 Message-ID: <20260313-gmem-inplace-conversion-v3-11-5fc12a70ec89@google.com> Subject: [PATCH RFC v3 11/43] KVM: Move KVM_VM_MEMORY_ATTRIBUTES config definition to x86 From: Ackerley Tng To: aik@amd.com, andrew.jones@linux.dev, binbin.wu@linux.intel.com, brauner@kernel.org, chao.p.peng@linux.intel.com, david@kernel.org, ira.weiny@intel.com, jmattson@google.com, jroedel@suse.de, jthoughton@google.com, michael.roth@amd.com, oupton@kernel.org, pankaj.gupta@amd.com, qperret@google.com, rick.p.edgecombe@intel.com, rientjes@google.com, shivankg@amd.com, steven.price@arm.com, tabba@google.com, willy@infradead.org, wyihan@google.com, yan.y.zhao@intel.com, forkloop@google.com, pratyush@kernel.org, suzuki.poulose@arm.com, aneesh.kumar@kernel.org, Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jonathan Corbet , Shuah Khan , Shuah Khan , Vishal Annapurve , Jason Gunthorpe , Vlastimil Babka Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Ackerley Tng Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Sean Christopherson Bury KVM_VM_MEMORY_ATTRIBUTES in x86 to discourage other architectures from adding support for per-VM memory attributes, because tracking private vs. shared memory on a per-VM basis is now deprecated in favor of tracking on a per-guest_memfd basis, and no other memory attributes are on the horizon. This will also allow modifying KVM_VM_MEMORY_ATTRIBUTES to be user-selectable (in x86) without creating weirdness in KVM's Kconfigs. Now that guest_memfd support memory attributes, it's entirely possible to run x86 CoCo VMs without support for KVM_VM_MEMORY_ATTRIBUTES. Leave the code itself in common KVM so that it's trivial to undo this change if new per-VM attributes do come along. Signed-off-by: Sean Christopherson --- arch/x86/kvm/Kconfig | 4 ++++ virt/kvm/Kconfig | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 26f6afd51bbdc..b6d65ee664d0f 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -80,6 +80,10 @@ config KVM_WERROR =20 If in doubt, say "N". =20 +config KVM_VM_MEMORY_ATTRIBUTES + select KVM_MEMORY_ATTRIBUTES + bool + config KVM_SW_PROTECTED_VM bool "Enable support for KVM software-protected VMs" depends on EXPERT diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index e371e079e2c50..663de6421eda2 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -103,10 +103,6 @@ config KVM_MMU_LOCKLESS_AGING config KVM_MEMORY_ATTRIBUTES bool =20 -config KVM_VM_MEMORY_ATTRIBUTES - select KVM_MEMORY_ATTRIBUTES - bool - config KVM_GUEST_MEMFD select XARRAY_MULTI select KVM_MEMORY_ATTRIBUTES --=20 2.53.0.851.ga537e3e6e9-goog