Message ID | 20250122152738.1173160-4-tabba@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE455C02182 for <linux-mm@archiver.kernel.org>; Wed, 22 Jan 2025 15:27:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 141BD6B0093; Wed, 22 Jan 2025 10:27:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F1056B0095; Wed, 22 Jan 2025 10:27:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E85306B0096; Wed, 22 Jan 2025 10:27:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C9BB26B0093 for <linux-mm@kvack.org>; Wed, 22 Jan 2025 10:27:50 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5C8C0120379 for <linux-mm@kvack.org>; Wed, 22 Jan 2025 15:27:50 +0000 (UTC) X-FDA: 83035467900.19.DE335DD Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by imf19.hostedemail.com (Postfix) with ESMTP id 7F7F21A000A for <linux-mm@kvack.org>; Wed, 22 Jan 2025 15:27:48 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=PuB7O4Ms; spf=pass (imf19.hostedemail.com: domain of 3cw6RZwUKCBgHyzzy4CC492.0CA96BIL-AA8Jy08.CF4@flex--tabba.bounces.google.com designates 209.85.128.74 as permitted sender) smtp.mailfrom=3cw6RZwUKCBgHyzzy4CC492.0CA96BIL-AA8Jy08.CF4@flex--tabba.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737559668; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FPlZyanj/PcXychEccc3pvyCzWy399cCYc+EAQwmx4Q=; b=19B4lgd1adFYadLYEVQecouJJStFkur9b5hb0VV6mV/MwfkFCJ7NBIOTWxuWeODaRACjQp 66vVJ4/6jp7c0WpAyW8rs5vssNJLP6yYjV5OokGIGgXArpFZ5tjXqFFwIuwsPPlJZ2q2GH /6Nv0n5r29Vw9YNIGOSiJqB0IaBSxRk= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=PuB7O4Ms; spf=pass (imf19.hostedemail.com: domain of 3cw6RZwUKCBgHyzzy4CC492.0CA96BIL-AA8Jy08.CF4@flex--tabba.bounces.google.com designates 209.85.128.74 as permitted sender) smtp.mailfrom=3cw6RZwUKCBgHyzzy4CC492.0CA96BIL-AA8Jy08.CF4@flex--tabba.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737559668; a=rsa-sha256; cv=none; b=0soSqCi9rRvmfG5aGTcX8nbziudWGThFMMkFgrO/umrpBkJ0twq38mC5R560fHWomDT5En cHnu/hvwx4qwihtKvbxK1v5ve0Ht3vsfLAEBn07mDT9Waw24y2KfJUlifnBL9P9WUzp5QU n47W/5spju+AVgW891MuYJQpwyo5omQ= Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4361d4e8359so53591665e9.3 for <linux-mm@kvack.org>; Wed, 22 Jan 2025 07:27:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737559667; x=1738164467; darn=kvack.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=FPlZyanj/PcXychEccc3pvyCzWy399cCYc+EAQwmx4Q=; b=PuB7O4MsWZqiJMtSPocwglWmBY4/rJY+IW0jE296R698zRw4m/Ic4IS3EMdq7WX/PV 4fpXNgx21Z3pOWmg81N8kG0mRS7sLCe5jaNPCY7QCcczLtnDp4qfr91Kf1WEYHmCzKwA jy64wpqDwAFyxapN78X7Tny9A9ifswWYnb6XCI7wKv01STYl+oKwKvlPhy03sTtjx6bw 4oFMLWUmkSV13ZPHPai6sXqveiLn029PEgR1U8aT75ODAsJiP5pELkEbelDgn7lJY8Jm 9IDraQbWGEuxslSRDRMTY0S711SPxiCYPyMa3ThSHeFu9kP3gSNbvJCzaji+04ERILF6 9PBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737559667; x=1738164467; 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=FPlZyanj/PcXychEccc3pvyCzWy399cCYc+EAQwmx4Q=; b=nbQjapObDl9w/f3corypXAgW2Xd5+/q7gdxo6JwV7Ieym4X3nDwjbgSHFwTXzQtdjs 6xLTHNWaO+sSmF9qqPwbL+SirnJGGH2O/FNcF3WVIhN/svyzj+G7QkGMXt5z2SWTbL9F 4/6oCPFmw9Fo9hzfzbtYRmJb9GoADLKNU6J9FsRD9SRfWUmu8srZEdwo8CZ1Yzz8IOSl 7zUda3+83/sslvCpXVAUMddZhsMx6IH82xvgDAp2PPIHLk2xy3eR2r8V/dqaRiiB5Fs4 3V71vmZqPgTENQuQ+/9RRs95XqChnx8aSLF1XWgX7Maa3GLyWTCasLq0fja9uur3rwqg YT7Q== X-Forwarded-Encrypted: i=1; AJvYcCU5a+cxvxPiFVdDclqjIcbV4u5SnIVN1iLeHzO2FVy56gh2w7dTWq5Fp0nk/fCdWVy8dianPgSa8g==@kvack.org X-Gm-Message-State: AOJu0Ywo54P5cAZhKTDzyb2O86e/GIEuW0qOt56C1Q323UnADxS/Gvdb qtQRP4c2GVD3uxvR4wXzJg2CsklT9tcSMhS2MGsE/SkuvxxeDHghIEXAU68TFgg1Za8T0bPauw= = X-Google-Smtp-Source: AGHT+IErLAZbRWKwqQFdhagPuo0iBKk0JPSfX6aLNC1OqdIBiMLMztGVedsgoVH8z63knrYGAMOhcPpfwA== X-Received: from wmbbi26.prod.google.com ([2002:a05:600c:3d9a:b0:438:ad3b:591a]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3b0a:b0:434:9c60:95a3 with SMTP id 5b1f17b1804b1-438913ca93cmr223239065e9.11.1737559667157; Wed, 22 Jan 2025 07:27:47 -0800 (PST) Date: Wed, 22 Jan 2025 15:27:32 +0000 In-Reply-To: <20250122152738.1173160-1-tabba@google.com> Mime-Version: 1.0 References: <20250122152738.1173160-1-tabba@google.com> X-Mailer: git-send-email 2.48.0.rc2.279.g1de40edade-goog Message-ID: <20250122152738.1173160-4-tabba@google.com> Subject: [RFC PATCH v1 3/9] KVM: guest_memfd: Add KVM capability to check if guest_memfd is host mappable From: Fuad Tabba <tabba@google.com> To: kvm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mm@kvack.org Cc: pbonzini@redhat.com, chenhuacai@kernel.org, mpe@ellerman.id.au, anup@brainfault.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, seanjc@google.com, viro@zeniv.linux.org.uk, brauner@kernel.org, willy@infradead.org, akpm@linux-foundation.org, xiaoyao.li@intel.com, yilun.xu@intel.com, chao.p.peng@linux.intel.com, jarkko@kernel.org, amoorthy@google.com, dmatlack@google.com, yu.c.zhang@linux.intel.com, isaku.yamahata@intel.com, mic@digikod.net, vbabka@suse.cz, vannapurve@google.com, ackerleytng@google.com, mail@maciej.szmigiero.name, david@redhat.com, michael.roth@amd.com, wei.w.wang@intel.com, liam.merwick@oracle.com, isaku.yamahata@gmail.com, kirill.shutemov@linux.intel.com, suzuki.poulose@arm.com, steven.price@arm.com, quic_eberman@quicinc.com, quic_mnalajal@quicinc.com, quic_tsoni@quicinc.com, quic_svaddagi@quicinc.com, quic_cvanscha@quicinc.com, quic_pderrin@quicinc.com, quic_pheragu@quicinc.com, catalin.marinas@arm.com, james.morse@arm.com, yuzenghui@huawei.com, oliver.upton@linux.dev, maz@kernel.org, will@kernel.org, qperret@google.com, keirf@google.com, roypat@amazon.co.uk, shuah@kernel.org, hch@infradead.org, jgg@nvidia.com, rientjes@google.com, jhubbard@nvidia.com, fvdl@google.com, hughd@google.com, jthoughton@google.com, tabba@google.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7F7F21A000A X-Stat-Signature: apa5m7ufkwmccx1fhxnncf7ta99ju7n6 X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1737559668-694904 X-HE-Meta: U2FsdGVkX1+JxSbIJu55VnoAcnkbGUBruVcdduFllDiauggLgBS6xdQvU1R+3TL5a6Q18YN4rK26KIUTYT9r3A6xOGalE1iLqicMPox+dScvbAaJiIkInxoUXz3qQrZ4XzMFZOCDrvrrIV/7UxtGy5H6KJq1bhyIp6TbsG6ByuDIyXwB+jnUlbhcmLOUD7NxqP8hmsHdwgMINfYNbBmn/Vp0T+0boL/6TITctMM9Iq/ThzlbSofRYqwAmOhaX+F52k0JMG2EgvFFR4YtzZrw8ghHYs748YfaBwuDsoRQHI6r4vkfADbNNPhAgyMNtVXOt0CcnbtkCTo0gS0MTpS0ZeMCLfZRNRIdBk8qc0kTY1nkoy5OvskU0yXTkeBIIICdD4+rQ5ulXbt1kVM4A8YvVR/U+IRxpThmzoX+lKv33g1P0EIamwM3dTeqQkba2U/ptsrmN06pEDBE9GlUw8RgEs3gI1EFpqtxtbOo3S3xRa9kiuFHQyK5tYSMvCQX9UCa5IJ5fQangjuiYJB4uqBY4liGnz5Auom2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fTBMq3guHaegi3Nf/BmSvQPdWFWA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
KVM: Mapping of guest_memfd at the host and a software protected VM type
|
expand
|
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 502ea63b5d2e..021f8ef9979b 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -933,6 +933,7 @@ struct kvm_enable_cap { #define KVM_CAP_PRE_FAULT_MEMORY 236 #define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 #define KVM_CAP_X86_GUEST_MODE 238 +#define KVM_CAP_GUEST_MEMFD_MAPPABLE 239 struct kvm_irq_routing_irqchip { __u32 irqchip; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ad9802012a3f..9cd6690b7955 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4872,6 +4872,10 @@ static int kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) #ifdef CONFIG_KVM_PRIVATE_MEM case KVM_CAP_GUEST_MEMFD: return !kvm || kvm_arch_has_private_mem(kvm); +#endif +#ifdef CONFIG_KVM_GMEM_MAPPABLE + case KVM_CAP_GUEST_MEMFD_MAPPABLE: + return !kvm || kvm_arch_private_mem_inplace(kvm); #endif default: break;
Add the KVM capability KVM_CAP_GUEST_MEMFD_MAPPABLE, which is true if mapping guest memory is supported by the host. Signed-off-by: Fuad Tabba <tabba@google.com> --- include/uapi/linux/kvm.h | 1 + virt/kvm/kvm_main.c | 4 ++++ 2 files changed, 5 insertions(+)