Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4959488rdb; Fri, 15 Sep 2023 19:17:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOCVkIKbm8Ogjb2G7BrRgg8LeIUczZWbrYGbE8LoeD/R6bLsO9lDQU4J/kkhDLYP02pirv X-Received: by 2002:a17:902:c609:b0:1c4:4efc:90a6 with SMTP id r9-20020a170902c60900b001c44efc90a6mr759990plr.38.1694830663729; Fri, 15 Sep 2023 19:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694830663; cv=none; d=google.com; s=arc-20160816; b=kQVsJ+njyNic7rM5jKoqajUSgiKw13U1jrQXvrCtu9b/AyA6tICc1070bBupuIvRJZ 6jS23LGSpoRCOhCpeWuNthfd2Kj71gJxQsWH7JzpjKc6hZPpbV4eRtzRho/sAmX+5RXL DiPQ3wg6qvnUcCGpzv99Z5jWZYTMz+FvN1jukbcKDReU/kR1OaC6eXDIo7GX/mwxoU8E c+97GkxxVlCRq+6FQqpFjRH7G/vKDhYR2C/3MiLDEGIWN9oRh4itavWbVdcPbfVl7fxA cpboz9/NoQYkJ4Dgs0ZHXSmhh40Fn1xH2dtXfRmO1AKvIOLaODanOnZiDZfplQiFhK4t b9sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :reply-to:dkim-signature; bh=yZtAaYugiQBYsP7UK5NhW64OM+nEYMlgpbQrdmJ2hNk=; fh=Ule+EmZomMuZFAbJQ8lqmeAEXCatKRnnjo4FlrQw2P0=; b=fDQg9XXvDqbISBMIXSQuNj+w7EGJg4rNbJ5nj7cEWOl1y7DZMqpHMgk7x7YKPoJzFr DZYzhpgH/brNBeDNLQv8u+VnpTGBu5l4RtdxmutHMhWcjqoMsiN2B6aZqIYllMmjVARc akJiFT9vFB2nPJMPSD9K+AafBFU4kNRq5HoOUJZ7mNZ9cTpWSNeCI4pYtymK38krSLRj 0wNd9O7VABZMIYQAQyu/wEbrtUzpS7H9V0qqooNT+qazcC4PYXqo6CsSCwNS1vVynUy9 E+8joUbQo+/svKNlOtSgprC7RfRR7IREILolsZHU24pPPj8Vf6Z0phQNlQSMTzR/b4Ot ATPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="rH+/jU0d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b12-20020a170902e94c00b001bc553d16e0si4266724pll.507.2023.09.15.19.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 19:17:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="rH+/jU0d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1497F832A06A; Fri, 15 Sep 2023 17:46:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238451AbjIPAqM (ORCPT + 99 others); Fri, 15 Sep 2023 20:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238719AbjIPAqK (ORCPT ); Fri, 15 Sep 2023 20:46:10 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F331AE for ; Fri, 15 Sep 2023 17:43:19 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-59b5d4a8242so34253447b3.0 for ; Fri, 15 Sep 2023 17:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694824758; x=1695429558; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=yZtAaYugiQBYsP7UK5NhW64OM+nEYMlgpbQrdmJ2hNk=; b=rH+/jU0dz/5fz2bFeh63ONbNdHyG9KSiwq9CleagzvVJ1jvfZWZomUTA4Tacb3sS9r 3wH1Ig8pztf2XFBvVqnrx3EhvjBw9KSFP95F36TaT8UMjSIpoHnYHiRPhgAAYOI3DSZD /0ge3JM06L2hpIws4mGTc9mAfOz9UarwaInZ/dZG0AklHFmFRyG2Z8UAtFZJKSGqG7J7 yPwfNf8zA8Q5f4+ZaKc2rgeHUSZ6gJUmZRI2XyIgcBsDBJphSPOHj5PQOeyYmAX4b6CC Lr9VxZkPYwvciKRA3NALCYy0+IeM0gYRGQdBvyiEaFTxJlI0iYMOjkKsmbJlNniObt7V epKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694824758; x=1695429558; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yZtAaYugiQBYsP7UK5NhW64OM+nEYMlgpbQrdmJ2hNk=; b=lpWJaZz5hMq+SrUpPmcA9do+A9Q/DmVbK95OEePwuN966dP0ubJ2zppouyIUXQw7UW XO7zaEPDGP1I3meIufYOTK5szvYVZpJOszpQM9/ofUir5LAjwm80X1z7J8GS1PWPocxm gk9/nwrkycQ3uQ9iUGJMfCaPSpszcJeA4Y5zDs5hcxmFXPdtfHv5TlrBpm5YvZGGS4ML ZPTis6V4Th0cZ2Gg+ZK11AWF6FDk5rAJM6NG8T1tDnosK4V4TmNk5yEK/K5B/S8T6MRC +E/6ZgPhGLxyvxNEdMF48DW9D2+PXI77HYBGMlwKfCpH/TEN9rdoS3+zoQomu2HpS61N nP7Q== X-Gm-Message-State: AOJu0Ywq3diXczMpj3GoyRowIxdzgr5q84o13QLSM0ca+5uDbvoj+ic6 KAX3mqwcyfRySjsn9+4Ef8d5dVa5wOY= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:af28:0:b0:584:3d8f:a425 with SMTP id n40-20020a81af28000000b005843d8fa425mr91792ywh.10.1694824758613; Fri, 15 Sep 2023 17:39:18 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 15 Sep 2023 17:39:13 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog Message-ID: <20230916003916.2545000-1-seanjc@google.com> Subject: [PATCH 0/3] KVM: x86/mmu: Drop async zapping of TDP MMU roots From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Pattara Teerapong , David Stevens , Yiwei Zhang , Paul Hsia Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 17:46:43 -0700 (PDT) Yank out the asynchronous zapping of TDP MMU roots. In some setups, using unbounded workqueues can consumes all CPUs for extended durations, and create significant jitter in the system. Specifically, the behavior causes audio glitches in ChromeOS VMs with virtio-gpu when running games in the guest. Gory details in patch 3. I tagged all of this for stable so that this gets back to v6.1 (I already did the backport to verify it's not awful). This bug is bad enough that the workaround for the ChromeOS usecase is to simply disable the TDP MMU, which I really do not want to do for the v6.1 kernel (or the v6.6. kernel). Sean Christopherson (3): KVM: x86/mmu: Open code walking TDP MMU roots for mmu_notifier's zap SPTEs KVM: x86/mmu: Take "shared" instead of "as_id" TDP MMU's yield-safe iterator KVM: x86/mmu: Stop zapping invalidated TDP MMU roots asynchronously arch/x86/include/asm/kvm_host.h | 3 +- arch/x86/kvm/mmu/mmu.c | 21 ++--- arch/x86/kvm/mmu/mmu_internal.h | 13 ++- arch/x86/kvm/mmu/tdp_mmu.c | 147 ++++++++++++++------------------ arch/x86/kvm/mmu/tdp_mmu.h | 5 +- arch/x86/kvm/x86.c | 5 +- 6 files changed, 80 insertions(+), 114 deletions(-) base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d -- 2.42.0.459.ge4e396fd5e-goog