From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7A2921A444 for ; Mon, 15 Dec 2025 19:38:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765827485; cv=none; b=BtvkdZPoV19LkoVBKuPVewjuj29lsTz0gvP5ImO2j/4x4Jq2iJHhV9RZCIi7+/e+XYDr0F1T8PIQn9gOBiOOtNnOeMTi5XbJa7sNi1LdwwdeMnKSlYoYCi04MiYyiNi3wLnDPAJ8RkHF0HEgL/phrVlwSDOesW60zeeb95q9qVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765827485; c=relaxed/simple; bh=QSVCuDZHeXlv5qRq1cwLUzWtmhl9PphTRk/SWKQ108E=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cSMUD8orPsha9ajbIEQB3YH1NDs6wN+cv8wVjDlCcdmMJXaVw+KJdO4wQ/T3G9bmVdp+dbuICgcAxFJJOnxhirVmZ0Rkuzm3D84TsuSlTRazr+7tGGmACyZ9zxIPdKmpS/gtWmbvhlQ4+2dVadH2yE34hJHDV65PSzkuEAb9tv4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=4FFU6wXB; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="4FFU6wXB" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-34c64cd48a8so4392700a91.0 for ; Mon, 15 Dec 2025 11:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1765827482; x=1766432282; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DKjoJyRjos7coqbgkgOB5Xmzn+82ea4/Olyic+3yMeI=; b=4FFU6wXB4mYlu0wU1D8pd5JZ8XrF6QZa65bb+Dps9aKVxdC30MfOfu8tXtsW/bnpHU xxH1uOx2Sf/Gfv1JRa7E5z3BZFZVOKsCyWd1LSc5WZHr+jkuxyAByoBmbsZRWxmlyJyn bYbvkUxzQ5AZ/ABrZ7T8+wSiTvGvxPZm/sI0u1KAHwa9sGELfXSRJDBvRVQe37Q8NpzF DJc5jkh8Kl9dNSgIB9ZgbX0G+E+Kk2mlNIxC+LM5adB93w+38lzYactfDgxB70fWfx5N g6GUbIHSqB6R7D0LJGuCRlKvA+obXPUF6aM2oRpW3v1JhifHEOo/t1d7R3UtIf5f6jd/ UliQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765827482; x=1766432282; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DKjoJyRjos7coqbgkgOB5Xmzn+82ea4/Olyic+3yMeI=; b=coIMqavg7YhlVpbUdo+bn819wkzzJ0SrBBJ3I8q+3Lpm8aao4PxjPh/KkrWAHyLlvt LZnr0lDUBJ2Y+gxWx69WcoqzbA+Pufu2M6b67+OWhZswwGtBOnrlhwddoA3LO1PwqeFy +E3ywEVSmMAo5trQCti7bBBSeu3HNoeck0JdO7L7zvmmbj5jAzPpdU9qNj/RY8C+S5kL Tzbvhj88eJ8oGrwlWh3jf1j75KXG0MVEIjcb4PvBSygN/CJa3rm0ZSJKvoBipEuRlgF8 qmQt4a0w5KoIXee0WRdfScTxk50AJjpBXineaVx/7VfgfNP1ZMmbxt4wDEKdq9Uh9Pam kF8g== X-Forwarded-Encrypted: i=1; AJvYcCXj9IFWOaB38/KIYxLI/aLJeJbueON+s4UPLG/LU2jPqDUq1ZtyTRG4x63FsV0n03EGjUcaVVFYRaadFGg=@vger.kernel.org X-Gm-Message-State: AOJu0YxWRzJ3zyI7a+1ur3CopYJDUJIA+gkjZMGXgVwIbBemuyPYLm/t MlecIbF6MpTc92za2DhZACRpOHuQiMZCWiyKi/DOXTUd5OvtA7ooKX685IL7p/lnQ2diD/QBnYD Is6pnVA== X-Google-Smtp-Source: AGHT+IHit10ZHn9UY8WNy/CzbinoH55sfpFrNDcKrt3yEBE1gwmZXOnkKtIYr9huTvRfD3JmRO8fKHX4RDM= X-Received: from pjbqc2.prod.google.com ([2002:a17:90b:2882:b0:34c:489a:f4c9]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2684:b0:340:bde5:c9e3 with SMTP id 98e67ed59e1d1-34abe478030mr11650081a91.23.1765827482112; Mon, 15 Dec 2025 11:38:02 -0800 (PST) Date: Mon, 15 Dec 2025 11:38:00 -0800 In-Reply-To: <3rdy3n6phleyz2eltr5fkbsavlpfncgrnee7kep2jkh2air66c@euczg54kpt47> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251215192722.3654335-1-yosry.ahmed@linux.dev> <3rdy3n6phleyz2eltr5fkbsavlpfncgrnee7kep2jkh2air66c@euczg54kpt47> Message-ID: Subject: Re: [PATCH] KVM: SVM: Fix redundant updates of LBR MSR intercepts From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Mon, Dec 15, 2025, Yosry Ahmed wrote: > On Mon, Dec 15, 2025 at 07:26:54PM +0000, Yosry Ahmed wrote: > > svm_update_lbrv() always updates LBR MSRs intercepts, even when they are > > already set correctly. This results in force_msr_bitmap_recalc always > > being set to true on every nested transition, essentially undoing the > > hyperv optimization in nested_svm_merge_msrpm(). > > > > Fix it by keeping track of whether LBR MSRs are intercepted or not and > > only doing the update if needed, similar to x2avic_msrs_intercepted. > > > > Avoid using svm_test_msr_bitmap_*() to check the status of the > > intercepts, as an arbitrary MSR will need to be chosen as a > > representative of all LBR MSRs, and this could theoretically break if > > some of the MSRs intercepts are handled differently from the rest. > > > > Also, using svm_test_msr_bitmap_*() makes backports difficult as it was > > only recently introduced with no direct alternatives in older kernels. > > > > Fixes: fbe5e5f030c2 ("KVM: nSVM: Always recalculate LBR MSR intercepts in svm_update_lbrv()") > > Cc: stable@vger.kernel.org > > Signed-off-by: Yosry Ahmed > > Sigh.. I had this patch file in my working directory and it was sent by > mistake with the series, as the cover letter nonetheless. Sorry about > that. Let me know if I should resend. Eh, it's fine for now. The important part is clarfying that this patch should be ignored, which you've already done.