From patchwork Wed Jul 10 23:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13729870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7F58C3DA41 for ; Wed, 10 Jul 2024 23:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/kOa+bY4z73FQuKac3t3a5fniJTGUgyq//kzfHQQRXg=; b=EDWRDQxtYOu2NqR5GC2Jp7u/h/ uUkz5jxoDMWKOr2VAMhn8a+Jck8Jj8WvB0JxPioEU4SQNJG3NDvW1WN0oAWvh8QP/1RTXM6E1Kj3s BF2I72TuQd+3XVtpSvH2cUxrUolmJw2M8fOI58/oM82MEWge1qMxM32D6ELtsHGcJVIoj0eJFCPO/ OlkVCNT8KLcGr3XPAdyu0UJLXjUsegWTb3eNq2Fzvn+v/hYVtDCrf9zf9l0kZ0Oi5vas+xJnrWAsq 656YC5+5BHn0B3XszKdprQ+zrS5BS5cEK75uQxqX9pALFaQGKztI6xT9qel/h2LyXXWz/ypawvoWQ HR/ED0Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRgxr-0000000C7S3-37HQ; Wed, 10 Jul 2024 23:43:11 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRgxL-0000000C76q-32AG for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2024 23:42:41 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-65a14a9241bso5236087b3.0 for ; Wed, 10 Jul 2024 16:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720654958; x=1721259758; darn=lists.infradead.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=/kOa+bY4z73FQuKac3t3a5fniJTGUgyq//kzfHQQRXg=; b=t6yz+EG3v0gK/+UMBjhwa1scZEwRQIerUoSvxFN8KzovrFjNwufuZNp+mstvG1LsDD 3HO7e4cnLchBbNiQegElVU0fBQKk4d5lHffAYMn1etox/TIXQ7hlZ2CR55bDmqi3Oo5y L65MIwgI8D5+sLFGQ4ETafBFensKDxQ9cvebP7FLJj0M6CfqaC6ng1zW4V5WIGa0azNu G6zWdGrpGVqinMasTe/N2ykjOHBl5+DRgTStMf3RdI0YyrvnyltKq48x0ve196brmqsH aR0xHXXATjD1EBMprEwdzurtDeT5mcS1GNDgcRlvLgZhygnnE5wNYR4t8gHJoOhcxeYr 7wUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720654958; x=1721259758; 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=/kOa+bY4z73FQuKac3t3a5fniJTGUgyq//kzfHQQRXg=; b=bx85j5JeGALXqJlqhcbdfwqxphYdCIvUXvS/Kci4Qlyn48VulRdFd15fs+93QFritl 9N2kI6jmJNI2qBEXfzU1WWFmvhp2Ebu+dhbDruFXYgUq9EikQM7jPqvuM1TvHrbSNCBC tKEjuC0al+SsC3QFBShjggz7W8n8nHXVISAzbTM6FMXF52vpXsTjeK7tgOD5InG448W0 SwiRH61pJqvnL0lPvY6X+9na9jpd3B0RCLvwr5qRqQc1eW3x2E5dX0Rrtj/LjzgLu2aP yzK4G7LQs3/H3TmjoCrGFaveNe3VRIXdhDtELGIHCH+a4A0CWXp8KtaHJVZj0PqZ9oqm XpCg== X-Forwarded-Encrypted: i=1; AJvYcCUO7p+QxL0yrJc7rPljWZX/BXtJib2MV7FiCE7GMiWEutgkF9FhJJkmmP706XoSgxV97njunekvsJyeQhhSPvNIh589B2kh9zK+75MhaNzZcWrVLSI= X-Gm-Message-State: AOJu0YwQXGcOjHqVoayM1o4KqpotmB3Ka5KkXSg6Es4OyhZOQ1XWlPEL LAtqpNRME5U5PzBLGV/RRWGwfIZIsP+jcI0rG0KlOwEXK6VDAx02c6WdFw0v7r7MbVtpWX1qGV8 47occA1JPu0zDn0uF8w== X-Google-Smtp-Source: AGHT+IEQILe/Q46nVYjT6VvqMQTMH6KcT24WPu+37xvorf2J37tSktUkMizR+hLJi1VSG+Olb8BNJuoCHzqVyuyh X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:6902:161a:b0:e02:6dcf:e9ab with SMTP id 3f1490d57ef6-e041b0688b2mr15353276.6.1720654958570; Wed, 10 Jul 2024 16:42:38 -0700 (PDT) Date: Wed, 10 Jul 2024 23:42:05 +0000 In-Reply-To: <20240710234222.2333120-1-jthoughton@google.com> Mime-Version: 1.0 References: <20240710234222.2333120-1-jthoughton@google.com> X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog Message-ID: <20240710234222.2333120-2-jthoughton@google.com> Subject: [RFC PATCH 01/18] KVM: Add KVM_USERFAULT build option From: James Houghton To: Paolo Bonzini Cc: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Sean Christopherson , Shuah Khan , Peter Xu , Axel Rasmussen , David Matlack , James Houghton , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240710_164239_847108_65549CC6 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some architectures will not support KVM_USERFAULT, so we need to have a build option to avoid including it for those architectures. Signed-off-by: James Houghton --- virt/kvm/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index 754c6c923427..f1b660d593e4 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -117,3 +117,7 @@ config HAVE_KVM_GMEM_PREPARE config HAVE_KVM_GMEM_INVALIDATE bool depends on KVM_PRIVATE_MEM + +config KVM_USERFAULT + select KVM_GENERIC_MEMORY_ATTRIBUTES + bool