Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp79113iob; Tue, 3 May 2022 11:59:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYJ3Qack3raCv9S2VKcUAYkOUT9MlW6HcZBnAuzI2fROxoiAw00H0P51X20QijpierJx70 X-Received: by 2002:a65:6e8b:0:b0:3ab:a3fb:e95a with SMTP id bm11-20020a656e8b000000b003aba3fbe95amr14833351pgb.433.1651604390255; Tue, 03 May 2022 11:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651604390; cv=none; d=google.com; s=arc-20160816; b=FJafPAgqriaRK/erAZbepvTGccGDp6zThe5vY0fuB+cjsgOoj5/8TrR2wzy2oWzZlG 5B4zI1I6yXNhUftuMjmzreDZprG32g7JuvoKTxqpGAel3AGORwXJNdHuxG5XhkToC6iJ 0fwjF9zkHaG8jdztuIHKYNU9PQb/L6uk4ILMPLDDIYNRbMEgVnuJ2Fg/Fin1NmIElEsE 2RJV0xqpcl2zNthX/qxdLeIt9W6172yGylT6hlWo8/SIDlbN5ahanotKT5YOZbhtHxDZ G9mnGSsOIkHYxpMqtltUXEHmNOxemAfH10iYPIC528aJ1xXI8b+bWrQRERBfivdUuSxu JamA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=jUYy8b+KeqsrmdeQpON3aR0duOx1u2ctuvoiS753EAk=; b=jJDCR5Yxz3tRrxvWueTGrvFc4qgeGiHDGCuyPso8PlisGmHlkvva2BZy4AFIROzBXg 5Gp7sHAO14QCSVutQQsyQip3sNXqryXs4nuUn2EXxQp0WcFMC95AIDK+e3Eyr5BqKYAg hm5KJDpjN8jbQWoi48vsfHBmXbbx5xEpVEGI3l3rK94kj0jer7ddQ4C2fTcFdBMbE/R9 RE0agakcbeyatcY1rYMdke+UT0WqxP0gPxXJRrAiwefQ1hlf+bQHAsrnNLWDuW1GoUzm jmiJay3updSG1kHIF1fZA4sJjZ5hQiy8bs0YYykKT3jNJp9d4L+aapznhDfCb3ZqB0r+ J4fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WavCwDAH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a056a00170c00b004fa3a8dfffcsi19681104pfc.179.2022.05.03.11.58.44; Tue, 03 May 2022 11:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WavCwDAH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238289AbiECPZl (ORCPT + 99 others); Tue, 3 May 2022 11:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238042AbiECPZj (ORCPT ); Tue, 3 May 2022 11:25:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3BD80C24 for ; Tue, 3 May 2022 08:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651591326; 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: in-reply-to:in-reply-to:references:references; bh=jUYy8b+KeqsrmdeQpON3aR0duOx1u2ctuvoiS753EAk=; b=WavCwDAH7afkOYue23K6nUg2BmTw9EIvR+2g9te8nA8U29tnU/ZPt9FGV6+EeMFIVZtAoU Rab+/t3KDMMAIE+ZdWdenRG/6u8lOHbcX48WVLHffSOC5FKafisWx92sev1YgZo+zBWxzX MecMFXYExaJRPIW0oRpqn3rn7eJRF0E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-wGa7T4S7MCuxQUmvbAlhTg-1; Tue, 03 May 2022 11:21:21 -0400 X-MC-Unique: wGa7T4S7MCuxQUmvbAlhTg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C7AE6952760; Tue, 3 May 2022 15:12:13 +0000 (UTC) Received: from starship (unknown [10.40.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 680D92024CDC; Tue, 3 May 2022 15:12:11 +0000 (UTC) Message-ID: Subject: Re: [PATCH] KVM: x86/mmu: Do not create SPTEs for GFNs that exceed host.MAXPHYADDR From: Maxim Levitsky To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Gardon , David Matlack Date: Tue, 03 May 2022 18:12:10 +0300 In-Reply-To: References: <337332ca-835c-087c-c99b-92c35ea8dcd3@redhat.com> <20e1e7b1-ece7-e9e7-9085-999f7a916ac2@redhat.com> <82d1a5364f1cc479da3762b046d22f136db167e3.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-05-03 at 12:12 +0300, Maxim Levitsky wrote: > On Mon, 2022-05-02 at 16:51 +0000, Sean Christopherson wrote: > > On Mon, May 02, 2022, Maxim Levitsky wrote: > > > On Mon, 2022-05-02 at 10:59 +0300, Maxim Levitsky wrote: > > > > > > Also I can reproduce it all the way to 5.14 kernel (last kernel I have installed in this VM). > > > > > > > > > > > > I tested kvm/queue as of today, sadly I still see the warning. > > > > > > > > > > Due to a race, the above statements are out of order ;-) > > > > > > > > So futher investigation shows that the trigger for this *is* cpu_pm=on :( > > > > > > > > So this is enough to trigger the warning when run in the guest: > > > > > > > > qemu-system-x86_64 -nodefaults -vnc none -serial stdio -machine accel=kvm > > > > -kernel x86/dummy.flat -machine kernel-irqchip=on -smp 8 -m 1g -cpu host > > > > -overcommit cpu-pm=on > > > > > > > > > > > > '-smp 8' is needed, and the more vCPUs the more often the warning appears. > > > > > > > > > > > > Due to non atomic memslot update bug, I use patched qemu version, with an > > > > attached hack, to pause/resume vcpus around the memslot update it does, but > > > > even without this hack, you can just ctrl+c the test after it gets the KVM > > > > internal error, and then tdp mmu memory leak warning shows up (not always > > > > but very often). > > > > > > > > > > > > Oh, and if I run the above command on the bare metal, it never terminates. > > > > Must be due to preemption, qemu shows beeing stuck in kvm_vcpu_block. AVIC > > > > disabled, kvm/queue. Bugs, bugs, and features :) > > > > > > All right, at least that was because I removed the '-device isa-debug-exit,iobase=0xf4,iosize=0x4', > > > which is apparently used by KVM unit tests to signal exit from the VM. > > > > Can you provide your QEMU command line for running your L1 VM? And your L0 and L1 > > Kconfigs too? I've tried both the dummy and ipi_stress tests on a variety of hardware, > > kernels, QEMUs, etc..., with no luck. > > > > So now both L0 and L1 run almost pure kvm/queue) > (commit 2764011106d0436cb44702cfb0981339d68c3509) > > I have some local patches but they are not relevant to KVM at all, more > like various tweaks to sensors, a sad hack for yet another regression > in AMDGPU, etc. > > The config and qemu command line attached. > > AVIC disabled in L0, L0 qemu is from master upstream. > Bug reproduces too well IMHO, almost always. > > For reference the warning is printed in L1's dmesg. Tested this without any preemption in L0 and L1 - bug still reproduces just fine. (kvm/queue) Best regards, Maxim Levitsky > > > > Best regards, > Maxim Levitsky