Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4984319rwb; Tue, 8 Aug 2023 18:07:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEALUXd4OaUOqmjjbOHFcrreGVwDSrNJxbjLbCamuB7U2FyfGDGs/zWf2roufKePzUsgxqZ X-Received: by 2002:a2e:a171:0:b0:2b6:c8ba:90dc with SMTP id u17-20020a2ea171000000b002b6c8ba90dcmr597775ljl.36.1691543270256; Tue, 08 Aug 2023 18:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691543270; cv=none; d=google.com; s=arc-20160816; b=kCETqDqTbmh8KvGDT9LWQlOo0cna8yabSE6Cc4O0fIkT6FZm2MNKB/LjEcDCgwZYFX EW9z0iRwrnrwdfvzGBOSW+7d6YL3kWUQl/x/FBnsDAuzWPAhzy4BxGboBMZ4ZPGbrgGQ KDpgCtWruAKfh3vn752n9WGyXahCcI6IdMrCfJi/T3VSbNASSvjY2FTFiyxigZYKoh3E i11luM4XPUZhjEygzjcvrVfMn+sO0yiFRfOUMN3oDCc6BqpvR/seHCx9/sCNdymiecPB uhza9MysVE9Rx0Ot9snsMOHUE8woZmKqdqAd0yyIJWsImSH7VshDjEfw6pToBFHkiuU1 9G0w== 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=vCWDiaOK6oBwC1N/JsFyjgQDQveeX0EIpcqjh3sU/K4=; fh=+ELRAU7IOTw9hBstKSPZFpPSQQ24hjx/lmc1fLMNzO0=; b=pljwl0QgvOCBOWyHaCK4vZ4ZYYOGnIS4G/sNeFs6EPpbaeFM+NH7gJynE/C655A6Ld dt+DSXs0UPzFTWUSlioCkI+ASJERKZoe27DFGAWWcbxjvZG/5pb+RpMB0TgOBp1kiG7v rqhF9SC11UzX82eU2Izdabn4S307eE5x0pNhKhn4QLC/a0vTJnyYtshnWubk2Na3aJh7 GHYWgR2iGEf8BSZ6U/Ew3NgYxW5eRkEznyyxKrzivQkpoIf/AnMwd3d1nZGmP2YPetwW glPCc8oEUjsWYn5c5cMG7/J1OV2gSxmSwfJ+oRQCwPpzNwV19L0pzyoZMKpoB3oDLe+h k7Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Inx83viY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a1709063a4300b00991f834e0b3si8132531ejf.194.2023.08.08.18.07.25; Tue, 08 Aug 2023 18:07: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=@google.com header.s=20221208 header.b=Inx83viY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbjHHXbg (ORCPT + 99 others); Tue, 8 Aug 2023 19:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjHHXbf (ORCPT ); Tue, 8 Aug 2023 19:31:35 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2321BC7 for ; Tue, 8 Aug 2023 16:31:35 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-53f6e19f814so3928877a12.3 for ; Tue, 08 Aug 2023 16:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691537495; x=1692142295; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=vCWDiaOK6oBwC1N/JsFyjgQDQveeX0EIpcqjh3sU/K4=; b=Inx83viYix2Se7Jb1ETomI+W1Zw6vezUhCgHSmdSAr8poGqBpfWExnh5zNfCaAJqXx Y0JBaPAPbfQLVyRAdZfMDAQ/y4UvdjF6bt0IlXWo5+AdxOZ17Mn4ODYEL4gKctWoF/iy rj9ApP11OCYcfsub/g94LJVrRjTnyl2LCnM2B+PJ9XviM5EWnO5fz0UAOBGGiZYek0SJ ZPJCjyNePTJiz2bnoiyUDkEYdeGPRraYeewj9cXixHHQlniuajeh4PF6gO03hIZQ4+9U APYuojQpT0AOdjAdd+GveUVCw3KTcfjkfTJ6+1777gSre8pX/ZW2MJ4pw7k4M3uEbfCK uqtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691537495; x=1692142295; 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=vCWDiaOK6oBwC1N/JsFyjgQDQveeX0EIpcqjh3sU/K4=; b=fgUo1b9ryx0V6lb/Zm4ONQSw286BvritYeBc3zG/DGSm2BJN23WvlGic5Y1tbmwSjs nY5clSQX40gT5a6/j1GaRpEkiTSVWpyTxEkfanaLraVq+uwwxpV3Zyb38GdGiw9EHFtm 9+AqUn0td1YMZAPLILvB6FY3zZ07apDuOogUm0XNDlyPd07ll8+BSqfgx4E6vLymcJ/U xiMJxJzRRjCRNRawm67D7lZ4fbcYR5VIslWwgoXKKxyQhxt7giUlETKytmRZrrDAllYd ur1GU26sRw3hI6SYwZeGPJuIoFQ21PlzL5PCg6jkzTJ95rtebjZ0dv1wBiuHhelBRDdz u0MA== X-Gm-Message-State: AOJu0Yz62J7ZHYoy7y1UTOLIxnedmi5xMzr1hCKbWZfjwV1xpBssPZZQ DG2tL9EpatINeAwMHoK3N3922l2bouQ= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:d485:b0:1b7:c803:4818 with SMTP id c5-20020a170902d48500b001b7c8034818mr22359plg.0.1691537494674; Tue, 08 Aug 2023 16:31:34 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 8 Aug 2023 16:31:30 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog Message-ID: <20230808233132.2499764-1-seanjc@google.com> Subject: [PATCH 0/2] KVM: SVM: Set pCPU during IRTE update if vCPU is running From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "dengqiao . joey" , Alejandro Jimenez , Joao Martins , Maxim Levitsky , Suravee Suthikulpanit Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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 Fix a bug where KVM doesn't set the pCPU affinity for running vCPUs when updating IRTE routing. Not setting the pCPU means the IOMMU will signal the wrong pCPU's doorbell until the vCPU goes through a put+load cycle. I waffled for far too long between making this one patch or two. Moving the lock doesn't make all that much sense as a standalone patch, but in the end, I decided that isolating the locking change would be useful in the unlikely event that it breaks something. If anyone feels strongly about making this a single patch, I have no objection to squashing these together. Sean Christopherson (2): KVM: SVM: Take and hold ir_list_lock when updating vCPU's Physical ID entry KVM: SVM: Set target pCPU during IRTE update if target vCPU is running arch/x86/kvm/svm/avic.c | 59 +++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 8 deletions(-) base-commit: 240f736891887939571854bd6d734b6c9291f22e -- 2.41.0.640.ga95def55d0-goog