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 A9995C433EF for ; Wed, 27 Apr 2022 17:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244227AbiD0RlS (ORCPT ); Wed, 27 Apr 2022 13:41:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbiD0RlO (ORCPT ); Wed, 27 Apr 2022 13:41:14 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B898D42485 for ; Wed, 27 Apr 2022 10:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651081080; h=from:from: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:content-transfer-encoding; bh=2KUyCoiEHPf/p/KtGFih/HCG6J722e31ffORGn/JYbg=; b=bz7/cQLbG7FtPqoE3jB34w763UgDHKKUjShKXxVWz9i828uIMGCOKVyy6kgxo619fakTcB rgp+1vgpDXSEPQDCBq8zGw6bNggoViiJFf3G4yzkobK7hXvatGXrX4vGh9kxqLkE3/SbQP WY4ZHvpsMpOnSmo6o+T9rFC0wI+bs/I= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-456-DK4qiIa7OxeBfD5eO3pC9w-1; Wed, 27 Apr 2022 13:37:59 -0400 X-MC-Unique: DK4qiIa7OxeBfD5eO3pC9w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D854381078A; Wed, 27 Apr 2022 17:37:59 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC657407DEC3; Wed, 27 Apr 2022 17:37:58 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: mlevitsk@redhat.com, seanjc@google.com Subject: [PATCH 0/2] KVM: x86: never write to memory from kvm_vcpu_check_block Date: Wed, 27 Apr 2022 13:37:55 -0400 Message-Id: <20220427173758.517087-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maxim reported the following backtrace: [ 1355.807187] kvm_vcpu_map+0x159/0x190 [kvm] [ 1355.807628] nested_svm_vmexit+0x4c/0x7f0 [kvm_amd] [ 1355.808036] ? kvm_vcpu_block+0x54/0xa0 [kvm] [ 1355.808450] svm_check_nested_events+0x97/0x390 [kvm_amd] [ 1355.808920] kvm_check_nested_events+0x1c/0x40 [kvm] [ 1355.809396] kvm_arch_vcpu_runnable+0x4e/0x190 [kvm] [ 1355.809892] kvm_vcpu_check_block+0x4f/0x100 [kvm] [ 1355.811259] kvm_vcpu_block+0x6b/0xa0 [kvm] due to kmap being called in non-sleepable (!TASK_RUNNING) context. Fix it by extending kvm_x86_ops->nested_ops.hv_timer_pending and getting rid of one annoying instance of kvm_check_nested_events. Paolo