From patchwork Wed Jul 10 23:42:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13729886 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 1B825C3DA42 for ; Wed, 10 Jul 2024 23:47:48 +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=KrWHeRDFVlfzCLm2guf0VTYM9h/W1rUjUnfwvHRBaDY=; b=Sjr/ibO2m5U2prlTRs0dgopedv 9d/ZaFMyYBGxpwnSNBr5ph+FDb0KW49H38IOTi1TBb3GteEl0dmQGa+eExOi63twOcWl3Zc3I19ez 9FyxG9N/HamCoOYids3frXWtKxIDTteGkJ2eyhmMq01c2YCYH11fjizNhApTwRlZh1dkV4Proljwq epfCwGO3/Eii9MNwXRNf8wYrGKo9V84eyRLEM+BIpZvylFyUphzZs5DpXFOXSoecqu5XWPOu9CLeh +1T21PUSZs2kU0EHj5xKyHsse9n2+vp3oUqlrbksjer5k1+QCz6xB1cVsIhhvIznW6yUGsvOeLtwe B8EsZQFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRh27-0000000C9p1-2FG1; Wed, 10 Jul 2024 23:47:35 +0000 Received: from mail-vs1-xe4a.google.com ([2607:f8b0:4864:20::e4a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRgxb-0000000C7Jk-1EP2 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2024 23:42:58 +0000 Received: by mail-vs1-xe4a.google.com with SMTP id ada2fe7eead31-48ff6c5d2e3so81461137.1 for ; Wed, 10 Jul 2024 16:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720654974; x=1721259774; 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=KrWHeRDFVlfzCLm2guf0VTYM9h/W1rUjUnfwvHRBaDY=; b=p4lvRezLKxNvotvUfBmcPx7KeDMPBP1qgY82iZrNCX7jlfLRrpY7Kjva23ljHy0JDv 066lwoxjbphxxjvXhUKgIQ24X35aY3RQVoe0jMQnBis694rNg+ElzWGfbduJYnl9EnRj 0/jefKN7zsQPgFN+qaAAoYcWdDZeozyzV78TyqYTiyt+vals0lX/lEGO4gPOpGQRhkGV x79m6OGZOyZbZqoxNjrHdTi3kfyCzIFTpA7817kRDMRo4e9wis2WGBqo2Dto1yA5ucJu 86VKeJ41IZ6W1nsMmBqdqUzlWKXwNiYOBCEPViozWAPyb1QtrtRgXWhzg1jZRlD+YF4k x9DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720654974; x=1721259774; 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=KrWHeRDFVlfzCLm2guf0VTYM9h/W1rUjUnfwvHRBaDY=; b=wbLoYwgZhkAGgrGGT65s7KPsVPiM+yKR1nF7Mmr8VIScx8YsdFmRvYGMQiYiN9Jr86 yyefGoE41X9Akz7msTulzB12YDqvvdjJ0j7rNyg8GRHzPEo3SQ6E1llNA00Hx6tKio0l JW00Xv4R7ePr5l+HFdKx8bhLlXLm6ayshLfGlfxcb+v9Cws6AEuPFZ3eDpacdOFGhkoG RbKJuKB4soHSJwXjF3Gvf7sWJBu8oRJL8doUfjS/pdohSU18ZaVbqPxizQPJK/0scXh1 UiZ9kRC7Dk+sk3WG1ZccCNt2gRoK2lS3uJHdIq7WQE5rgkpJZ3c4lG9pD/QpWDAQn/Ss CukQ== X-Forwarded-Encrypted: i=1; AJvYcCVDMkJhe1QL8aEg27hVsht146WrvE+puY//8mJvQeEsuBl5NBkM977l01NVLchkB4A3euN9Lguo2M7U2NAo8XLVvWB8QO7RAS7OtdsZnl/01RnyVkU= X-Gm-Message-State: AOJu0Yy4IBUfeBPY1BF3sBAQ1mz5lCO6fkjJk9pGP2uD5ePO+LCvh17L U20D3+IWE9dyr9FXM1rWs8M1ZjoepBwfHi2tJtZJcKgyY6jsDQKfZiP2dRoEk5GsRd78S0YQVVf dMkhX4WjEuV/7vfvNeQ== X-Google-Smtp-Source: AGHT+IEk1FL65vqiK6UE5KirHXI/3mEOw3BUqoQ0HFsCZaEXrmaSc1CqWM95u18pik8VbBJeKyVeyhW9FRI1OD+8 X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:6102:5490:b0:48d:89b6:85d2 with SMTP id ada2fe7eead31-49031dbea2dmr435474137.0.1720654973979; Wed, 10 Jul 2024 16:42:53 -0700 (PDT) Date: Wed, 10 Jul 2024 23:42:20 +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-17-jthoughton@google.com> Subject: [RFC PATCH 16/18] KVM: Advertise KVM_CAP_USERFAULT in KVM_CHECK_EXTENSION 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_164255_448567_C90ADA89 X-CRM114-Status: UNSURE ( 9.54 ) 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 Advertise support for KVM_CAP_USERFAULT when CONFIG_KVM_USERFAULT is enabled. Signed-off-by: James Houghton --- virt/kvm/kvm_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d2ca16ddcaa1..90ce6b8ff0ab 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -4916,6 +4916,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_USERFAULT + case KVM_CAP_USERFAULT: + return 1; #endif default: break;