From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 BDBF334B1A2 for ; Thu, 25 Jun 2026 00:42:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782348124; cv=none; b=hR0NCX1HA79xtXf/RmIoZE2FVPMljtUGOK2L8wAUvtA+/v8JwHB8wObF+t5F6qoS2KpvuRkV+9NNAOKfiO/37UB+g6+KPSP5ccA30XCuN1HMJbi6J2Kp6NOO1w3SrWyoyMOUGGvYnLj/sAiCPDqzS6K3e+BugFe/nx1OvhExzA0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782348124; c=relaxed/simple; bh=YB5GE7E3Xs7izwgjr3ob/9chSpyxHi2CWbqKKsIl2LU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DzaTYzTUKsVbOZuVRb3HxCLMJfwyQC4h8edfCgDHSYILsNnBpdlp4I/xqrBGXe7w7k81o2sZRrlog3/91kR3msYu3gmvXhJB5ZDRGKqgLkM0cn8mdHoQQBf5bSYYP7+nas5IwIUXUOybdhrmOSe6L7IoQr29aBRXfNhNmInTrKA= 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=ld0sQ5pn; arc=none smtp.client-ip=209.85.215.202 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="ld0sQ5pn" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c894391f000so1877484a12.1 for ; Wed, 24 Jun 2026 17:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782348120; x=1782952920; 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=4DFjavBCbzblLm5XoFLaw3Sc1sbInL5uPLu8y3/D5AM=; b=ld0sQ5pn/27icAX0On2IPZvHVbb1d6nmZGTJ77Xwd3AqbJmmFP1dbrJ1KIK7QVr+Sr OOHdZwUb8C6QCd6v+gV4lerzyvAV6L472C86xkkL377yEUo9vI0t6C49OfkXqBTv2SgO AgAOwUGiioi3H941wg4zObSQCX8NjKD71d7bU8Yki6O4Mc8y+zbaQUO8q43PjwqXusQo pNGjKy+0V13aLP5zAXBSZnCEQhl6JgDvrAF4KuV+V7qqhJrtmPWjWHFaFKfpPrWVDSVQ vACTwlCEzHh62qfUm9rDoKAwTB1z+/Ey8VDCdKWDLum/x3s5KhLBtawQNrjtYoX8vkNv fjJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782348120; x=1782952920; 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=4DFjavBCbzblLm5XoFLaw3Sc1sbInL5uPLu8y3/D5AM=; b=VZ/afoKoYyVdDZ3kWrn4SJYeaLC0U9CLRcRg5L2jEoPJf4wTpKbiLNtDocth2hd5z5 FZkj+1idcgXDN8zM5K2bFQx68r5lnVll0OI4/EsoE3lTFyGH6HqIMsbLRRMfRZvh4YI5 nKVs4DroQPubjnf57P+B519n5W9owpjb6euKGsfUiE4ST0DEkKLFZN751Bot3l//kxQo 3bF38t0HFrNTiFfbag+ewD4opwP//E9pU6SJNdkZsbrLjt0cHZczdBKJl8I+NT+74x1e SjcsuqjIrPT2fO5kIYVZbG/4zHGVOG2F+BS0+DWxzocV1kddYmq57Gm9EvEfaDOVUyFG ER2A== X-Forwarded-Encrypted: i=1; AFNElJ8BuKqyLXI7CgDR9l4uO7gNqSi6zqVemk9DjmBA1aGkpuFUEHP58xSzqwOYtzS331hHSGy1mGYJjrWOOx0=@vger.kernel.org X-Gm-Message-State: AOJu0YwjAfZpJ2eGrUr6Tp4TzNwgEV+Lhf5nImJtoY+SCkhamuLg7njn 58V8f5XvesAWEmPcx/VCnTmw0uhUvJsxqgoqD70pjlz61vBBUW8d8/wXoBxZ16ZYftocVF5lGzk Ur0dR8A== X-Received: from pgbbo12.prod.google.com ([2002:a05:6a02:38c:b0:c80:296b:72cc]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7fa3:b0:3b4:8bc6:138 with SMTP id adf61e73a8af0-3bd4ae9cd56mr397852637.23.1782348119218; Wed, 24 Jun 2026 17:41:59 -0700 (PDT) Date: Wed, 24 Jun 2026 17:41:58 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260618-gmem-inplace-conversion-v8-0-9d2959357853@google.com> <20260618-gmem-inplace-conversion-v8-24-9d2959357853@google.com> Message-ID: Subject: Re: [PATCH v8 24/46] KVM: guest_memfd: Make in-place conversion the default From: Sean Christopherson To: Ackerley Tng Cc: Yan Zhao , aik@amd.com, andrew.jones@linux.dev, binbin.wu@linux.intel.com, brauner@kernel.org, chao.p.peng@linux.intel.com, david@kernel.org, jmattson@google.com, 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, forkloop@google.com, pratyush@kernel.org, suzuki.poulose@arm.com, aneesh.kumar@kernel.org, liam@infradead.org, Paolo Bonzini , 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 , Andrew Morton , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Youngjun Park , Qi Zheng , Shakeel Butt , Kiryl Shutsemau , Baoquan He , Jason Gunthorpe , Vlastimil Babka , 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, linux-mm@kvack.org, linux-coco@lists.linux.dev Content-Type: text/plain; charset="us-ascii" On Wed, Jun 24, 2026, Ackerley Tng wrote: > Yan Zhao writes: > > With gmem_in_place_conversion=true, userspace can create guest_memfd without the > > MMAP flag. In such cases, shared memory is allocated from different backends. > > This means this module parameter only enables per-gmem memory attribute and does > > not guarantee that gmem in-place conversion will actually occur. KVM module params are pretty much always about what KVM supports, not what is guaranteed to happen. - enable_mmio_caching doesn't guarantee there will actually be MMIO SPTEs, because maybe the guest never accesses emulated MMIO. - enable_pmu doesn't guarantee VMs will get a PMU, because userspace may elect not to advertise one. - and so on and so forth... Yes, there's a small mental jump to get from "KVM supports in-place conversion" to "I need to set memory attributes on the guest_memfd instance, not the VM", but I don't see that as a big hurdle, certainly not in the long term. And once the VMM code is written, I really do think most people are going to care about whether or not KVM supports in-place conversion, not where PRIVATE is tracked. > > To avoid confusion, could we rename this module parameter to something more > > accurate, such as gmem_memory_attribute? > > I asked Sean about this after getting some fixes off list. Sean said > gmem_in_place_conversion is named for a host admin to use, and something > like gmem_memory_attributes is too much implementation details for the > admin. > > Sean, would you reconsider since Yan also asked? If the admin compiled > the kernel knowing what CONFIG_KVM_VM_MEMORY_ATTRIBUTES means, then the > admin would also be able to use a param like gmem_memory_attributes? No, because it's not all memory attributes, it's very specifically the PRIVATE attribute that will get moved to guest_memfd. I don't want to pick a name that will become stale and confusing when RWX attributes come along. The RWX bits will be per-VM, while PRIVATE will be per-guest_memfd.