From nobody Thu Dec 18 07:51:18 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0AC9C19F4F for ; Tue, 15 Aug 2023 21:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240362AbjHOVg1 (ORCPT ); Tue, 15 Aug 2023 17:36:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240347AbjHOVgE (ORCPT ); Tue, 15 Aug 2023 17:36:04 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 379A31BDD for ; Tue, 15 Aug 2023 14:35:58 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-53f6e19f814so6452868a12.3 for ; Tue, 15 Aug 2023 14:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692135358; x=1692740158; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=5htqcXlGR48S3bix4KQFlJHZscL9sK8wNsMNCEa/blA=; b=Zk+tB7gzteBvpoOVWZ93sOqgDN/4qLNDGkzUSOPo8c/LXzjJ8h85ibn1YLVhAERiz8 cEEUxZJ1MbfFQUVKhtuCw9/mueNfpYJmEN/qoahPn78RJ5HFmGVZyfkenmqPYndKsFDG d//ppkrYcZ2gdlFiTgmJUSZ0MyYKX3saNwgRaZMm4nz8PvzRc6ZGIOgit523gFh+DZgh u07AxJDGrhNUg6otI1ZGHL6OzrYzrJijDEJAhtLfxzjue6eU3MirrcJqOBD8sSZgwcwX Q32dJUZAxPwNE+ARQ4ubEy0VPVxEO5L64+V75raPf+hF0cUsvxckNki3sphpTLYyXwmi 12lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692135358; x=1692740158; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5htqcXlGR48S3bix4KQFlJHZscL9sK8wNsMNCEa/blA=; b=f3KpqQTF97/mioBzMWJC8E6hEbsXUT2V5GlUDQAeTH9K9MXgWx/DxGlonN7cbm6+aE lY+8IIu/j2Vt9pn1h3M4pJZpaP7sok4eZIFtkbUROTn9xPLVDM+NvIS9cmuOVCRfvYS2 6ugjfC/bnSr5P36Dg7WvHWSpf+gXKQpJNRI38h5pEqByotWT7p/3pcPiBseBVQKt0zvK p2MncB4PHzXuaOmdTbKEPPKjuchQyeHLElcxV0KGfl++uLrWLjZiFNZ+y5g8Jv1y5ZdY WjFZDxVuwdVPLs6VnM+cnxvxDqUeEwQOZ0iKcEBpabAGn6zG6kqFVvsgxhu7RXPv09Bc x47Q== X-Gm-Message-State: AOJu0YyKzbwxqaOFtmt9Cb5wH+IroZd8zN9iCyzjF+7RIYv0IFmolhC2 CDgjUF8yR4C8hG6CXOxnt7qHbHKu3OQ= X-Google-Smtp-Source: AGHT+IGcI4ph95Gs7JodHbEwJ7O1llYZ+9O4HY1NoWEkoEoV07dwpOKAONjIa8qpQqKt1nWRe0LQ+mQlSlI= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:77cc:0:b0:564:1f95:71e5 with SMTP id s195-20020a6377cc000000b005641f9571e5mr13554pgc.2.1692135357795; Tue, 15 Aug 2023 14:35:57 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 15 Aug 2023 14:35:33 -0700 In-Reply-To: <20230815213533.548732-1-seanjc@google.com> Mime-Version: 1.0 References: <20230815213533.548732-1-seanjc@google.com> X-Mailer: git-send-email 2.41.0.694.ge786442a9b-goog Message-ID: <20230815213533.548732-11-seanjc@google.com> Subject: [PATCH 10/10] KVM: SVM: Rename "avic_physical_id_cache" to "avic_physical_id_entry" From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Joerg Roedel Cc: kvm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Maxim Levitsky Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rename the vCPU's pointer to its AVIC Physical ID entry from "cache" to "entry". While the field technically caches the result of the pointer calculation, it's all too easy to misinterpret the name and think that the field somehow caches the _data_ in the table. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/svm/avic.c | 10 +++++----- arch/x86/kvm/svm/svm.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index 6803e2d7bc22..8d162ff83aa8 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -310,7 +310,7 @@ static int avic_init_backing_page(struct kvm_vcpu *vcpu) AVIC_PHYSICAL_ID_ENTRY_VALID_MASK; WRITE_ONCE(table[id], new_entry); =20 - svm->avic_physical_id_cache =3D &table[id]; + svm->avic_physical_id_entry =3D &table[id]; =20 return 0; } @@ -1028,14 +1028,14 @@ void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu) if (kvm_vcpu_is_blocking(vcpu)) return; =20 - entry =3D READ_ONCE(*(svm->avic_physical_id_cache)); + entry =3D READ_ONCE(*(svm->avic_physical_id_entry)); WARN_ON_ONCE(entry & AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK); =20 entry &=3D ~AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK; entry |=3D (h_physical_id & AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK); entry |=3D AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK; =20 - WRITE_ONCE(*(svm->avic_physical_id_cache), entry); + WRITE_ONCE(*(svm->avic_physical_id_entry), entry); avic_update_iommu_vcpu_affinity(vcpu, h_physical_id, true); } =20 @@ -1046,7 +1046,7 @@ void avic_vcpu_put(struct kvm_vcpu *vcpu) =20 lockdep_assert_preemption_disabled(); =20 - entry =3D READ_ONCE(*(svm->avic_physical_id_cache)); + entry =3D READ_ONCE(*(svm->avic_physical_id_entry)); =20 /* Nothing to do if IsRunning =3D=3D '0' due to vCPU blocking. */ if (!(entry & AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK)) @@ -1055,7 +1055,7 @@ void avic_vcpu_put(struct kvm_vcpu *vcpu) avic_update_iommu_vcpu_affinity(vcpu, -1, 0); =20 entry &=3D ~AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK; - WRITE_ONCE(*(svm->avic_physical_id_cache), entry); + WRITE_ONCE(*(svm->avic_physical_id_entry), entry); } =20 void avic_refresh_virtual_apic_mode(struct kvm_vcpu *vcpu) diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 8b798982e5d0..4362048493d1 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -261,7 +261,7 @@ struct vcpu_svm { =20 u32 ldr_reg; u32 dfr_reg; - u64 *avic_physical_id_cache; + u64 *avic_physical_id_entry; =20 /* * Per-vcpu list of struct amd_svm_iommu_ir: --=20 2.41.0.694.ge786442a9b-goog