Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp789410iob; Wed, 4 May 2022 08:02:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEg0gKTI0XiHGohL0W3zBZCwuRUGHOgOTPjvWDeMNz8ibNfBbxWcH5fUa7j7XtUzagHWWt X-Received: by 2002:a05:6602:158f:b0:65a:8075:6840 with SMTP id e15-20020a056602158f00b0065a80756840mr4430234iow.163.1651676573132; Wed, 04 May 2022 08:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651676573; cv=none; d=google.com; s=arc-20160816; b=u6I8v8XKIkWTqHdJSRid76PAQ5MTlkxmUMNo7ZtscGhgApGgOT0ot7Oq+cxosxMgNY vXcVhnDvm2EHOwOqU3ud1/VLzwQUFQX4GxAcejf/Ft6yfwo/GX/2It0iG6cczGuTiQPj kzLkhhnmpokOQdLq2VV711q/q5I7u5Fwu1M0mJ3YOIRTIBrlFeVu31Bc9ElWJbAvpA+J lIL8jF3t7h+w4QCCuLa3s9PMKRBSpOJJPcL3QCTcN3H8tPvSxFNncmcCjbxiIIGNCd1r +W35wriNpxfJE3+uOXGYAys0p5IfgYHstAdhJ/d0ukLOSaAwbYJKqg6vQ7PCpsDxzwfw CUng== 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=ms3vBOzjdykqtqTIylMUH3d5wQ67nCMPvsMGcNx/MSY=; b=O52UevQ30ubP7d2fb3M6nmrhQZalCiwZ8edBOW07Cc4aBmACy0oZHGGghrDokA7XDf Av18Ntk646Xfvvf/yIGGKh/KFWlPhvSVbDTK6TKHZE90Z3R36keYGT0Q+Fq2Ac3cZtvU 0lURJvuQP90Qi9kIOaGBmUczSr+Lc7OEdU+hfnTQa6YIAr7/wJuDwZmd4t38+mFbfwt4 TtrAQuFGsQChtOwjoZcNJXHi3eU2LgkWRU7vp2MnyU+LmYlfvjD3FHMDIGHVGCu+Qy8E ijzlS+IxWSzRy9cdOA00sEKr81/sSfiRQ8etNNY/D4LV1qPj4nrkePnMnHwWQrHTRAh1 Io2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JkV7ezDP; 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 w11-20020a056e021a6b00b002cac7a4c1d3si10208996ilv.97.2022.05.04.08.02.36; Wed, 04 May 2022 08:02:53 -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=JkV7ezDP; 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 S1349798AbiEDMmJ (ORCPT + 99 others); Wed, 4 May 2022 08:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349647AbiEDMmH (ORCPT ); Wed, 4 May 2022 08:42:07 -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 630763153B for ; Wed, 4 May 2022 05:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651667910; 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=ms3vBOzjdykqtqTIylMUH3d5wQ67nCMPvsMGcNx/MSY=; b=JkV7ezDPTaOe9o2lRzKsg9mZSjrS2ihHG//xAFmAiUi1BzF3rypegjlTjLEaQKNmjkcjIN 9WHey1ApYoUnrdl15pu+qYyy6wWXbJnPlsTxatGtS2arkEeU5LRMpJ36fiPs1TGSXMyb0s dUTZ1xaCm6MnI3sAG6tI3LgN9IGTa4A= 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-669-bCngVF--NPapvpRhhg5BgQ-1; Wed, 04 May 2022 08:38:15 -0400 X-MC-Unique: bCngVF--NPapvpRhhg5BgQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE96E85A5BC; Wed, 4 May 2022 12:38:14 +0000 (UTC) Received: from starship (unknown [10.40.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5A36469A4E; Wed, 4 May 2022 12:38:12 +0000 (UTC) Message-ID: <8dd1c5cc4944145364bc1d16ced8ce0314be0ff5.camel@redhat.com> Subject: Re: [PATCH v2 08/12] KVM: SVM: Update AVIC settings when changing APIC mode From: Maxim Levitsky To: Suravee Suthikulpanit , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: pbonzini@redhat.com, seanjc@google.com, joro@8bytes.org, jon.grimm@amd.com, wei.huang2@amd.com, terry.bowman@amd.com Date: Wed, 04 May 2022 15:38:11 +0300 In-Reply-To: <8be586dab3a80d96c88018a1919d01f2163b595d.camel@redhat.com> References: <20220412115822.14351-1-suravee.suthikulpanit@amd.com> <20220412115822.14351-9-suravee.suthikulpanit@amd.com> <9307c734-3473-0bdc-57be-c39e96bca4d8@amd.com> <24b74f5bd8810c7f79777ed6898baeaf47bfe3e3.camel@redhat.com> <3196873f-0047-3411-d434-56d96ca31298@amd.com> <8a0b27436239a97cc486d8460662febb6b155069.camel@redhat.com> <8be586dab3a80d96c88018a1919d01f2163b595d.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.85 on 10.11.54.9 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 Wed, 2022-05-04 at 14:49 +0300, Maxim Levitsky wrote: > On Wed, 2022-05-04 at 14:46 +0300, Maxim Levitsky wrote: > > On Tue, 2022-05-03 at 20:04 +0700, Suravee Suthikulpanit wrote: > > > Maxim, > > > > > > On 5/3/22 12:13 AM, Maxim Levitsky wrote: > > > > > In the kvm/queue branch, I found a regression on nested SVM guest, where L2 guest cannot > > > > > launch. The bad commit is: > > > > > > > > > > commit a4cfff3f0f8c07f1f7873a82bdeb3995807dac8c (bisect) > > > > > Merge: 42dcbe7d8bac 8d5678a76689 > > > > > Author: Paolo Bonzini > > > > > Date: Fri Apr 8 12:43:40 2022 -0400 > > > > > > > > > > Merge branch 'kvm-older-features' into HEAD > > > > > > > > > > Merge branch for features that did not make it into 5.18: > > > > > > > > > > * New ioctls to get/set TSC frequency for a whole VM > > > > > > > > > > * Allow userspace to opt out of hypercall patching > > > > > > > > > > Nested virtualization improvements for AMD: > > > > > > > > > > * Support for "nested nested" optimizations (nested vVMLOAD/VMSAVE, > > > > > nested vGIF) > > > > > > > > > > * Allow AVIC to co-exist with a nested guest running > > > > > > > > > > * Fixes for LBR virtualizations when a nested guest is running, > > > > > and nested LBR virtualization support > > > > > > > > > > * PAUSE filtering for nested hypervisors > > > > > > > > > > Guest support: > > > > > > > > > > * Decoupling of vcpu_is_preempted from PV spinlocks > > > > > > > > > > Signed-off-by: Paolo Bonzini > > > > > > > > > > I am still working on the bisect into the merge commits. > > > > > > > > > > Regards, > > > > > Suravee > > > > > > > > > What happens when the guest can't launch? It sure works for me for kvm/queue > > > > from yesterday. > > > > > > > > I'll test again tomorrow. > > > > > > I have bisected it to this commit: > > > > > > commit 74fd41ed16fd71725e69e2cb90b755505326c2e6 > > > Author: Maxim Levitsky > > > Date: Tue Mar 22 19:40:47 2022 +0200 > > > > > > KVM: x86: nSVM: support PAUSE filtering when L0 doesn't intercept PAUSE > > > > > > Expose the pause filtering and threshold in the guest CPUID > > > and support PAUSE filtering when possible: > > > > > > - If the L0 doesn't intercept PAUSE (cpu_pm=on), then allow L1 to > > > have full control over PAUSE filtering. > > > > > > - if the L1 doesn't intercept PAUSE, use host values and update > > > the adaptive count/threshold even when running nested. > > > > > > - Otherwise always exit to L1; it is not really possible to merge > > > the fields correctly. It is expected that in this case, userspace > > > will not enable this feature in the guest CPUID, to avoid having the > > > guest update both fields pointlessly. > > > > > > Signed-off-by: Maxim Levitsky > > > Message-Id: <20220322174050.241850-4-mlevitsk@redhat.com> > > > Signed-off-by: Paolo Bonzini > > > > > > I can revert this one or specify pause_filter_count=0 pause_filter_thresh=0, > > > and then I can boot the L2 guest. Another question? Where does it help to set this? In L0 kernel or in L1 kernel? Best regards, Maxim Levitsky > > > > > > Regards, > > > Suravee > > > > > > > This is really wierd. > > > > Could you share the qemu command line for L1 and L2 guest, and as much as possible > > info on what happens when you boot L2? I tested latest kvm/queue and I don't see > > any issues with booting nested guest. > > > > Which hardware you test on? I test on Zen2 (3970X) mostly. > > > > How many vCPUs L2 has? Could you do a kvm trace of the L2, from L1, > > to see what it does prior to hang? > > Also assuming that you boot the L2 with -cpu host, could you not expose these two > features to it? > > -cpu host,pause-filter=off,pfthreshold=off > > Best regards, > Maxim Levitsky > > > > > > Best regards, > > Maxim Levitsky > > > >