Message ID | 20241213164811.2006197-15-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 8DFDCE7717F for <linux-mm@archiver.kernel.org>; Fri, 13 Dec 2024 16:48:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E7E86B00B1; Fri, 13 Dec 2024 11:48:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7218E6B00B2; Fri, 13 Dec 2024 11:48:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5036B6B00B3; Fri, 13 Dec 2024 11:48:47 -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 29F036B00B1 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 11:48:47 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DCE321C7F09 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 16:48:46 +0000 (UTC) X-FDA: 82890519054.30.3906358 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by imf06.hostedemail.com (Postfix) with ESMTP id E57E5180017 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 16:48:26 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Vj4DhF1C; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3a2VcZwUKCOgdKLLKQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--tabba.bounces.google.com designates 209.85.128.74 as permitted sender) smtp.mailfrom=3a2VcZwUKCOgdKLLKQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--tabba.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734108513; 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=QFDTUdjhMWOhr77i5TfIxa/V7OmOhu1GE3Wb7is6IxQ=; b=FokPszBH7g+mWc5+69J6dwPmFCi+A7S0MReGSIkPx5wuuKQEq3w0l37mu9Ee9diCv4BZJh TA5/ZykwtCdi91uBeKPr/e94ExIwh7bGnvG8QJmZJzhIRpzQ/4xm3H5rED6o3igWzJapU3 yarSyQIMaWNx4ptvGLhP8qQ/WHwXzRc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734108513; a=rsa-sha256; cv=none; b=MHaV8BFIVjk68fhweQYuv08TVh/EN6HwfXsCWrgXSsJIxAoUVCU126+Vl2EswQo91CSX5N yZhhi81o1YqLiEjsqIHLzgx0muwYTTmz68bj9KIdqouxT/p8Fh+JwFR5tgeVEqUW0l0gX9 FJtSHILm7MzEIJm/gYzp45CeGYZkewo= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Vj4DhF1C; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3a2VcZwUKCOgdKLLKQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--tabba.bounces.google.com designates 209.85.128.74 as permitted sender) smtp.mailfrom=3a2VcZwUKCOgdKLLKQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--tabba.bounces.google.com Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4361c040ba8so4599425e9.1 for <linux-mm@kvack.org>; Fri, 13 Dec 2024 08:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734108524; x=1734713324; 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=QFDTUdjhMWOhr77i5TfIxa/V7OmOhu1GE3Wb7is6IxQ=; b=Vj4DhF1COkwznv7Bqf55iDoXDBvDfJfO9DLBUlK97Yu2MIcQOb2wrLtoHrmSfM9LT/ 22vrfZGrW+zuOan8h3IN2XcdXu9FhnbaqwccDEkyYHQXHqSVRJVY9lCr7Im9ijwJa9qs Egk3iI2gttmRcbXLX82VtJuN1tMcyGyzeR6petyjlj8WxVAk6Fffi/Xs1ZXUSETe7mi0 UhrWFuEVe06EWWHctFkiOGmT1GYx8TKrm1dKAd89Lx3G0ruPNjHVCWvEsfcCl5bS2QNR f473XCAaxG5jvU3zC1AhaIBduyfr3+XZUTQg9e8BuFXkBV3fMlWzooxibYCGLG35YZX3 v0Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734108524; x=1734713324; 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=QFDTUdjhMWOhr77i5TfIxa/V7OmOhu1GE3Wb7is6IxQ=; b=L2rl4Q1UtReozR+Na51GWd3RHxetUlgYzVK/R//4cM7f3gQyY+vVB7r4wjw2lZvSCJ Pei8XWwI+nO+PXSUcuKj/B6mpDTXpxOeNkP/+URYtrHlGHVm+BcLWVOluSyFwNtUY9jU HfaAgmc6DFJK/cKYfrrxdq8v5w4B5ZOQpRHCf93Y0l2m4LECBUsAiaEr4XiWkvzI6JEd rT85WOpXKgyoucqNnFv9OQffvr9U6n1OgolPXlBziJGMmJl+uJO8/FetSu3I60zWnHiM mZMyeoioLVkWs0Q+Iw4txzYxC76IV8bDahm1gtaaTiV2OQvdiNhmErdVlM5aaVe4C/D1 84ww== X-Forwarded-Encrypted: i=1; AJvYcCX1UN/XxkUct/db4uKiKex3AODCchH5+6HLk+bK7wHyZ7/ZbQVxWwyX1yB7hF7H3OxJeL5NnLgJ1g==@kvack.org X-Gm-Message-State: AOJu0YzDGNajhNVx9jnJa+DXHhvrV/Mx9kkFbRMY/9vZIhzbrHGKXMxP Uz19tMGeuXY+QM3pPfV+E08EAg86/JNu+zjGYDg8Xs5YlCFBMggMHowMLehTqnDIfiATVL3VtA= = X-Google-Smtp-Source: AGHT+IEdZjijVCjCEZr3PkrGBsAlFaK1miBXntQYNoOTRqQcvW0yt5qcatWxqC8z3zg7zC5MHMXcUa8eHQ== X-Received: from wmbd13.prod.google.com ([2002:a05:600c:58cd:b0:434:9dec:7cc5]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:717:b0:385:ebea:969d with SMTP id ffacd0b85a97d-38880ad91f1mr2174346f8f.22.1734108523614; Fri, 13 Dec 2024 08:48:43 -0800 (PST) Date: Fri, 13 Dec 2024 16:48:10 +0000 In-Reply-To: <20241213164811.2006197-1-tabba@google.com> Mime-Version: 1.0 References: <20241213164811.2006197-1-tabba@google.com> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog Message-ID: <20241213164811.2006197-15-tabba@google.com> Subject: [RFC PATCH v4 14/14] KVM: arm64: Enable guest_memfd private memory when pKVM is enabled 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-Stat-Signature: jaqu6qkn6ahsqykd3eh49kkwaffc4m8h X-Rspamd-Queue-Id: E57E5180017 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1734108506-961556 X-HE-Meta: U2FsdGVkX18eJmrY2UJ9/WUIinH+cXks+BgOKtRp5PP3NRirlJun8iKxaLRYl357m/iMmtK3p/6S+fAP0KvE4vJnCc+TTsbviiNCz4jp9TQ/sPx+LzKYc07c2IYA52Ud3zpciZiyQe5kgj8H/L2Psz+GZlIhbx8v5XjVXbzPcJkhcLCiRe8Rzd9vIFJYPkxp2O9EOimpgS6BLhqA2OikGCvCa27UXbsfqLh6jxrKRtn9tnQLj3CrzsTEr7XHrBybIHrsNdHaht6jeICSybS7pJn43zPbj79moNcKuFt2+Xnxo/6SRdkp6yTmL6OgU2cKwEiEjZAlA2hSrJl+Km37ksfmjwDy/h69y/id9x2EALjze8X704NdOcGHxR/hseY2+RmAbWfid4CQqDcB5uB2QQYlI4YWBCeE2Q4QdgAmeS64HMcoC3PQ5eP2eHUfCY6X0rCrywrabtHZPCHLp+sMpcO5/w9lMhP5FEVYpEasztpUixCgo8tt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VMdzdQai/UWLVvXJ0CGcd4Yk1+a6TImJ8X6Fe84Pu1iqBDwurnh2YcTejBTize804HOnz87Lo1mr5nqS7Mg/ddJ5g57Ea2eeYZZnMaAcbeHy X-Bogosity: Ham, tests=bogofilter, spamicity=0.067067, 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: Restricted mapping of guest_memfd at the host and arm64 support
|
expand
|
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index e18e9244d17a..8dfae9183651 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -1529,4 +1529,7 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val); #define kvm_has_s1poe(k) \ (kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP)) +#define kvm_arch_has_private_mem(kvm) \ + (IS_ENABLED(CONFIG_KVM_PRIVATE_MEM) && is_protected_kvm_enabled()) + #endif /* __ARM64_KVM_HOST_H__ */ diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index ead632ad01b4..fe3451f244b5 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -38,6 +38,7 @@ menuconfig KVM select HAVE_KVM_VCPU_RUN_PID_CHANGE select SCHED_INFO select GUEST_PERF_EVENTS if PERF_EVENTS + select KVM_GMEM_MAPPABLE help Support hosting virtualized guest machines.
Implement kvm_arch_has_private_mem() in arm64 when pKVM is enabled, and make it dependent on the configuration option. Also, now that the infrastructure is in place for arm64 to support guest private memory, enable it in the arm64 kernel configuration. Signed-off-by: Fuad Tabba <tabba@google.com> --- arch/arm64/include/asm/kvm_host.h | 3 +++ arch/arm64/kvm/Kconfig | 1 + 2 files changed, 4 insertions(+)