Message ID | 20250117163001.2326672-16-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 23013C02188 for <linux-mm@archiver.kernel.org>; Fri, 17 Jan 2025 16:30:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8F096B00A8; Fri, 17 Jan 2025 11:30:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A167A6B00A9; Fri, 17 Jan 2025 11:30:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B7256B00AA; Fri, 17 Jan 2025 11:30:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 669C56B00A8 for <linux-mm@kvack.org>; Fri, 17 Jan 2025 11:30:39 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0C56C1404E2 for <linux-mm@kvack.org>; Fri, 17 Jan 2025 16:30:39 +0000 (UTC) X-FDA: 83017482198.08.2768BC7 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by imf03.hostedemail.com (Postfix) with ESMTP id 2C3F02001F for <linux-mm@kvack.org>; Fri, 17 Jan 2025 16:30:36 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=tc0cWyCr; spf=pass (imf03.hostedemail.com: domain of 3q4WKZwUKCCQTABBAGOOGLE.COMLINUX-MMKVACK.ORG@flex--tabba.bounces.google.com designates 209.85.128.73 as permitted sender) smtp.mailfrom=3q4WKZwUKCCQTABBAGOOGLE.COMLINUX-MMKVACK.ORG@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=1737131437; 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=sA2koc6FnlEdGg8+Jdk53M7JzqxYQGk2KRekvS8wCYA=; b=2z8vQqeTQYOxLyb3k/xq/O1SzBu/e4MmQlC58CU0elMPnC77J/2/AIuc16Wp0+aRlKcND0 oKvw8IWf8wyWKfGp3kOhDaK7jZnrT62OWqQr/cBS71CIKU0jzAAYkAKKC1EwgmRF0anmW/ txxrX8VqYgRzjvxBbhllJb+MB3SX+mc= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=tc0cWyCr; spf=pass (imf03.hostedemail.com: domain of 3q4WKZwUKCCQTABBAGOOGLE.COMLINUX-MMKVACK.ORG@flex--tabba.bounces.google.com designates 209.85.128.73 as permitted sender) smtp.mailfrom=3q4WKZwUKCCQTABBAGOOGLE.COMLINUX-MMKVACK.ORG@flex--tabba.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737131437; a=rsa-sha256; cv=none; b=X3DkKSrWm7SKS4x6Yaebp9ouI9Hb8wJLGcRQNDslvdZx2PTtiB/lbIZsf0Wh32Ei02sxbF zPR/O4bK7vkWiamlaL10TP+PNonZSQC4bn00bIqrbgU/4YQnDn0TCp/AC6QgN+pB7cuheP 1TZZ637jmDJlNp1d7rgzk08td1XtIgU= Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-436219070b4so11027465e9.1 for <linux-mm@kvack.org>; Fri, 17 Jan 2025 08:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737131436; x=1737736236; 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=sA2koc6FnlEdGg8+Jdk53M7JzqxYQGk2KRekvS8wCYA=; b=tc0cWyCrFGcuomx3TI4qRYl/TDkK4SVCFfyqyPkRj9VOxfot23yu/+cozEaHVYizU3 +ObHA0nZZmH1m1Jr50Mm0Yjy1xXaIjdcTIQRDC7YyBSKdWsCaVbHosF848FBhJm2eGxk +g+hRmKCztV8GYkCSZjc89E4IUIMxD9+6tDXjSo2zhrCMplJsx2czye9Ohb8sK8O9HZO atQCnWqKljwwtkYRK2hk09nsgLrOX7700OGRc9XAROcjHq6jdN/AcsAo+Aeyvb1GL2Eb 97TooWf+i0JidxvPTMwJ9tRwdLdVV9b3P2ra+jxVkUbUI9rsr7zBqqIwimH2wAi2taKA EB5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737131436; x=1737736236; 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=sA2koc6FnlEdGg8+Jdk53M7JzqxYQGk2KRekvS8wCYA=; b=Tni7uw8DtVkfa2BU7qqLVQsk/frjrKNXZig+ELSeRx25PXKy5VpXpFUn3R5Hk6N2RP nACRRhmlWkVHs9G8AgObnqgjUHzq8pIP3D3KhuSr328uV7IhABWIikehQDOY6OjiGgF1 f7uIH7FDN/IOSOwmaaWlDPNI6D63Tk20Xw5Iue8Rr7J4KeN4aOoCJ4a4SK89DtL3QRmO V8js2w7KTYd5q1cIyKZD5Fm4sdxGfl75v8uiX3ovL1diUiErKTzRC7KNTodObPtbCVW7 IaVNiFgBq0Y24c7R/7xcMftiUUBh+xqt//ozQFnQ3DT4Ya/hmEEa5Bn9ddq3jjmgc/aC vafg== X-Forwarded-Encrypted: i=1; AJvYcCWKNB+JD3K6EmfOq/XvlMzQHdMxa+XYUPvWUmuLjMLF2dnUe7clgYwDL1RQz+NFq7mmujPg/ganqw==@kvack.org X-Gm-Message-State: AOJu0Yzmi4Y8Pvz0/pvLHaY76imt57OQIORa/No3L8u1IP35ZAiHsm8G C1sRb0UL9XGUosvLlpZhZIOXfNLWZWyLo0iSiVd9Ple6PrTCTu+Ut+107S73lqZiNSKg6PCO4Q= = X-Google-Smtp-Source: AGHT+IH7ncc07mfLHgb8ED3VwsB7jAbdBmUiBlZXXQcjVPwCGbKKIuWYuOy6q8Z5dH2n+Fog8Taxczd8hg== X-Received: from wmrn7.prod.google.com ([2002:a05:600c:5007:b0:436:185e:c91d]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:5486:b0:434:a10f:c3 with SMTP id 5b1f17b1804b1-438913cae48mr33877825e9.9.1737131435727; Fri, 17 Jan 2025 08:30:35 -0800 (PST) Date: Fri, 17 Jan 2025 16:30:01 +0000 In-Reply-To: <20250117163001.2326672-1-tabba@google.com> Mime-Version: 1.0 References: <20250117163001.2326672-1-tabba@google.com> X-Mailer: git-send-email 2.48.0.rc2.279.g1de40edade-goog Message-ID: <20250117163001.2326672-16-tabba@google.com> Subject: [RFC PATCH v5 15/15] 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-Rspamd-Queue-Id: 2C3F02001F X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 8efwfty5smcp54i643sjta5dd4t5uoy7 X-HE-Tag: 1737131436-873399 X-HE-Meta: U2FsdGVkX1/kUGDPpon/hRzJR2v8zVA8IFXwfB2ut0K69VnL3FzyJAZqp1Z4wWJtscTYup3y7hc3Z5VchmIJDF8CReS/qIIVzDmogRUe3yYIDNK8kAutyx0RIZug5yube9SAWhroiHDjzy3trrYHIxB7ma80A0DadQX4hMUg6WeR/x7x7f6zNy3/oPOyTSDvvUnD0ewZjVzXa14ELv8e4pSb/ojwWfKlTNpan4CQ7fLqS+mswQ/6l3u2EPVNxAqKNuH52hISER9yJmcnooqbF7y5z31vH4Bf8uFln0thdSx3FrpE+8cgIQLejvBpL8MXEgivfEr4RhGqa9oN/gGSS+XQTGE+4nWH32KdCOHIIF7nHa/k1+bYNAfh/8sTdUabyS6oataEI39L3xPpT86S5VvFjwaG9XcwjcpAD4ZzVptilEkgSaaFcZkdTVtVq+dXD2NVEDv8uOpDTrmlvzIuqZMsQ1wptpPaTnFj2cWqyHq84yr5Qy2xaFnk1BnOI/W+PoSWrJO/BbHIsqaitQF64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SK8IocQ28XWXggUUnAR8qS618uyYVM9i5uDFNkngJz5EY90xlY8vSeqfj5thmosYMRa5VtSZT7Wiv/KRuLUY 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: 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(+)