From patchwork Wed Jul 10 23:42:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13729877 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 C1A4CC3DA41 for ; Wed, 10 Jul 2024 23:45:14 +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=TURU+uj4JjtASnposo8ch9F78eTbKidxkEMdeXOCkww=; b=ZqEP5MVSO7CSU62dc97vawXAV2 Uy31KZ97D0uoMvO7AvSbwO/Vjk3mmehfve6LACkOHsC3yHUZ63gNl4t88eCV2JzT2BbQDuQnHKnNU pMso471JBvHBneLWrtk1pOR1Pq2hmGJYFlfx7yE5/86C0e+lYwsOpPB0ZPlPXfrQjeRfiSZQ4/D2Y 8tlWCFu83x4+Oe/SKi53xvTxVdp5j8hLxRHzJlTF/GPM+ErRkYTVwKZOmrY5qMJ2asuVcQLc38c5y 5rV/viVrXBoqCm6NSd/vXUOTQKts+qmev84cFkXLe/lxE+wSynQyAbybZYrbkMXAF4/PnibgL0Z/T CFkQQpOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRgzh-0000000C8SB-2GRb; Wed, 10 Jul 2024 23:45:05 +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 1sRgxS-0000000C7By-3GB9 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2024 23:42:48 +0000 Received: by mail-vs1-xe4a.google.com with SMTP id ada2fe7eead31-48fde1e8d72so86321137.2 for ; Wed, 10 Jul 2024 16:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720654965; x=1721259765; 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=TURU+uj4JjtASnposo8ch9F78eTbKidxkEMdeXOCkww=; b=oy1A0rDv39k44/6DCtXg1gcgxmLCmJamiLiSnC9+f37NDQMubejIq2u1mQsK1gLnrN KeqVbXOoalP2bMC640uSSScpTR6plqF038IHSgZNBJnQiz06Va0+Aa7KhiZrZu4k9BYR pA1RRFQx6sMB5BtRx3kg0W/Y+Zu3l2MEoznRD7dHOFo/84RT2+0ZQ+DTIGiRO8no4C/h BU0u/p+W5dIZh52DElmMgqfb9jW+OcL0vKxi/b2b7j1nqVY8xlxClrIN0sqR9OgbfbYa 6nX9+MC+Xp1v6MkCgR+cA+fwOIvGgLDw0h8M28xsncKk2HXyCOgKGu1EwLZ2ffh16Yd8 BnTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720654965; x=1721259765; 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=TURU+uj4JjtASnposo8ch9F78eTbKidxkEMdeXOCkww=; b=p1dhbSQ+RUFrlv0FdUQtoAg8H/fdGoxwu0n2qbsk6wXP6NAKuEhEbufU/MVWuTYEcD Jys+b1UMBScSQfEJ7Fs+2HobsVg8OGvHIkdQcIRndQ+VdhVtXwtfTMzQG+JQpquf99oI gZHjgm0yxpcbAl5xAnTWotOHzR/+Xf+As/QSBMl1Ny5PzCh02FbRHb/r314qIXlBdgdm C3vGjRRumCfkY5h1jG9Z7yBj7clXuvuK3BVnn8CFkJUw5wvGejrU8++VCiazmKZbi/NY PDkvjWA+BjVh0ZrZ6wE/FsxDhd19WKH59VsnuzuRZadmvbBwp5bGnzm5nINAC0lghXbA E5IQ== X-Forwarded-Encrypted: i=1; AJvYcCXNUtJwEHqmWlkFzycHqFMtepx5QP+L03S09UZNclc3gR6/K6EiyOpL9e4Y+VFstHHvA7NzqPV19iUQZ6O0w7YQjdIhdVOzP0PsJ10O6bb3fTUbn9w= X-Gm-Message-State: AOJu0Yzye0Eyh4KLNMRUbosAgEH9To8FjcsU+EcY7BbkSzMXoB7aUhKf S1TqS5rzkl5wmRYLKxciXsQpQ0mI2y6iWDV3LJrHmxkCJnHvVNNykA7/hr0brXp7YwGbVw6E3+Q 2AcDu4AyPCCe3Ep2XuA== X-Google-Smtp-Source: AGHT+IHwjQCn8pz3/iqiomOrjrLQUXcW8j3Cmfdd9IBi0Npw4AjyC0JLSC59kn9LukO94PmnEj6ZVNwxW2iE6Npb X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:6102:2929:b0:48f:137a:78b2 with SMTP id ada2fe7eead31-490321d3690mr113577137.5.1720654965123; Wed, 10 Jul 2024 16:42:45 -0700 (PDT) Date: Wed, 10 Jul 2024 23:42:11 +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-8-jthoughton@google.com> Subject: [RFC PATCH 07/18] KVM: Provide attributes to kvm_arch_pre_set_memory_attributes 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_164246_843342_086C8B12 X-CRM114-Status: UNSURE ( 9.95 ) 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 This is needed so that architectures can do the right thing (including at least unmapping newly userfault-enabled gfns) when KVM Userfault is enabled for a particular range. Signed-off-by: James Houghton --- virt/kvm/kvm_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 840e02c75fe3..77eb9f0de02d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2514,6 +2514,7 @@ static int kvm_vm_set_mem_attributes(struct kvm *kvm, gfn_t start, gfn_t end, struct kvm_mmu_notifier_range pre_set_range = { .start = start, .end = end, + .arg.attributes = attributes, .handler = kvm_pre_set_memory_attributes, .on_lock = kvm_mmu_invalidate_begin, .flush_on_ret = true,