From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11A0BC77B75 for ; Mon, 15 May 2023 17:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244860AbjEORyS (ORCPT ); Mon, 15 May 2023 13:54:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238964AbjEORx7 (ORCPT ); Mon, 15 May 2023 13:53:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD3516931 for ; Mon, 15 May 2023 10:52:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F217062F79 for ; Mon, 15 May 2023 17:51:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F05FAC433D2; Mon, 15 May 2023 17:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684173119; bh=rQ3FrYk+oa260UtBvkt/WLPMa0huM27LPJHj4RefhsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZUJCYE/pDk2u85OwxLJW2QnzB9xtWQ/fT4h4VfXX15MS0HD/Uw19QWVJafI4Z8cdm R//iGB0wV62qrOUyy0oeU8u4ZPARvO7gykjJBDu7IhY9H+TAjnhBWSZZDOqcjeTiW1 GYX6jp7n4DhLMvzhK3FePBUkJbVDZU0fXCA133DI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sean Christopherson , Paolo Bonzini , Rishabh Bhatnagar , Allen Pais Subject: [PATCH 5.10 373/381] KVM: x86: Remove obsolete disabling of page faults in kvm_arch_vcpu_put() Date: Mon, 15 May 2023 18:30:24 +0200 Message-Id: <20230515161753.799005679@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161736.775969473@linuxfoundation.org> References: <20230515161736.775969473@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rishabh Bhatnagar From: Sean Christopherson commit 19979fba9bfaeab427a8e106d915f0627c952828 upstream. Remove the disabling of page faults across kvm_steal_time_set_preempted() as KVM now accesses the steal time struct (shared with the guest) via a cached mapping (see commit b043138246a4, "x86/KVM: Make sure KVM_VCPU_FLUSH_TLB flag is not missed".) The cache lookup is flagged as atomic, thus it would be a bug if KVM tried to resolve a new pfn, i.e. we want the splat that would be reached via might_fault(). Signed-off-by: Sean Christopherson Message-Id: <20210123000334.3123628-2-seanjc@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Rishabh Bhatnagar Tested-by: Allen Pais Acked-by: Sean Christopherson Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 10 ---------- 1 file changed, 10 deletions(-) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4143,22 +4143,12 @@ void kvm_arch_vcpu_put(struct kvm_vcpu * vcpu->arch.preempted_in_kernel = !kvm_x86_ops.get_cpl(vcpu); /* - * Disable page faults because we're in atomic context here. - * kvm_write_guest_offset_cached() would call might_fault() - * that relies on pagefault_disable() to tell if there's a - * bug. NOTE: the write to guest memory may not go through if - * during postcopy live migration or if there's heavy guest - * paging. - */ - pagefault_disable(); - /* * kvm_memslots() will be called by * kvm_write_guest_offset_cached() so take the srcu lock. */ idx = srcu_read_lock(&vcpu->kvm->srcu); kvm_steal_time_set_preempted(vcpu); srcu_read_unlock(&vcpu->kvm->srcu, idx); - pagefault_enable(); kvm_x86_ops.vcpu_put(vcpu); vcpu->arch.last_host_tsc = rdtsc(); /*