From nobody Sat Oct 11 02:51:58 2025 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 0D1052E0B58 for ; Wed, 11 Jun 2025 22:47:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749682069; cv=none; b=pWCuO4Erj29rXeIOiQivVVbyEwBqMcKtetVoSF5QDCha51e2hFMXiMJzSZ+V9Egvfg15Gf0ZNbbmqqx8Ba0o2dw1+i+VCPTPyEZJN9opeDRZUaFxMAv6NXuFwdYCIhRKRkGJB5KEbBkq+dt550mNw9QwJzQFmBKYg6hlkeIh4mU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749682069; c=relaxed/simple; bh=qt8zb5uI4+X1TebyXBfKCY7Oiv/Cu3N97xLB9PqUJ80=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VG6RbtGvt3w09hoBomQjbqTnBriU+f5lpGbZVO2yPhG5Q0D3SwS3BWWbORqo3GvogPKYkPLQX9QY1DH8LGi6H0iyshSRJk5k5fQcELWZcYFZ8B2NZKsu9a2Pc1nCz760i2TQseoyoVRmoLiHrLDSXLmZcFWly5UVKsYo6Ps4RYY= 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=EhIxE4HN; arc=none smtp.client-ip=209.85.215.202 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="EhIxE4HN" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-b26e4fe0c08so131914a12.3 for ; Wed, 11 Jun 2025 15:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749682067; x=1750286867; darn=vger.kernel.org; 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=+DtVGJXTI5NZcLSNxUulZl3FS9wdQHA/Njni8dB9YZ8=; b=EhIxE4HNhFmRuPIVVCm18pZe6jYoP9eu9Nx0i9b2bCuQ1UgkWR5e4YYthjQBuo5sSC Qb72cBFZ452hfK4tMm8HY+UVRyUUI9D87ydc8eCVlweWvKNbeNE2nRBER/mCmmfDfwJ5 3VX7O16LUt7Ds3kutwGsY/X4AGaUDw9Ps04QWKw7o/JuoPmGxIt8DBtkULf/H2Z5evMZ pwF9Y2moSvVvGHTqLNF5WAz1kwSKlq23hBdDAtp9OJ4BIZ5lqfsAkBgEHHgVggA0qJ2n NdfjfkGEaSltE0UDKNvGIvyCzOQZ/HEhF7YI126q7N/CxCLRXRg+NWosJMYlTI134b1j y/SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749682067; x=1750286867; 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=+DtVGJXTI5NZcLSNxUulZl3FS9wdQHA/Njni8dB9YZ8=; b=eLEOVq7glCDHzbERjLW+6moRORoHXfv/LVq8TPWowzFtt0m1bCLr2GkO6KyoK554pt gPMsOGcub8jiIMz7alId2lfdn0UbzLIUDBSFXlDn/QpBeonuitQu7H3ipet9ofr1hKRg 3Wo14oZ9Dzpbr4zFaOdNTUa8vAbiQn50pv4zk7Ej+GUyPV9RdDDAubyliWyikqL9BdGy KPbdCtT8XMZBcZ+I1p5zYSE5gwxLET58JLZcXhK1HtHHOjyTrIK8kK8IAOJ7MRYNO+Xu Rwno+SEVp4tPXldt4CEO31fIJgYgKTWfUp23H5Rdov/WonlQygYmEbPElwaEgvEUEDk7 4gfA== X-Forwarded-Encrypted: i=1; AJvYcCX6WN1gxU5I7jYxjCZryK5wL0MnN7OLkmY8hzL5tHvdZe1mGFWWSc1NnxR51cjcsIWKZ8ibv0cM6G7rhqc=@vger.kernel.org X-Gm-Message-State: AOJu0YyXTUm4+yKaX92aDl81CWZf6Lus/CkkEWKqREVYWofKlGyIOk4z bj+76J226iSVzYXTRiwKkNCLaSkJjD9zg81y8a8IQurPmYJywEj2HCx2+IiRLszxn0HF4A3I+9R lcH0ERA== X-Google-Smtp-Source: AGHT+IFyGDdeorUwj3sAfzICdRUEdg2fKYugNVe8KlRyB4tgk6PAyMC59w8WcXLbD69NI4qphVBoJu3KIY4= X-Received: from pflc8.prod.google.com ([2002:a05:6a00:ac8:b0:746:1e60:660e]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:2589:b0:21f:53a9:b72c with SMTP id adf61e73a8af0-21f86754dbemr7156966637.38.1749682067486; Wed, 11 Jun 2025 15:47:47 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 11 Jun 2025 15:45:33 -0700 In-Reply-To: <20250611224604.313496-2-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250611224604.313496-2-seanjc@google.com> X-Mailer: git-send-email 2.50.0.rc1.591.g9c95f17f64-goog Message-ID: <20250611224604.313496-32-seanjc@google.com> Subject: [PATCH v3 30/62] KVM: SVM: Clean up return handling in avic_pi_update_irte() From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Sean Christopherson , Paolo Bonzini , Joerg Roedel , David Woodhouse , Lu Baolu Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Sairaj Kodilkar , Vasant Hegde , Maxim Levitsky , Joao Martins , Francesco Lavra , David Matlack Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Clean up the return paths for avic_pi_update_irte() now that the refactoring dust has settled. Opportunistically drop the pr_err() on IRTE update failures. Logging that a failure occurred without _any_ context is quite useless. Tested-by: Sairaj Kodilkar Signed-off-by: Sean Christopherson --- arch/x86/kvm/svm/avic.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index d8d50b8f14bb..a0f3cdd2ea3f 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -807,8 +807,6 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd,= struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq, struct kvm_vcpu *vcpu, u32 vector) { - int ret =3D 0; - /* * If the IRQ was affined to a different vCPU, remove the IRTE metadata * from the *previous* vCPU's list. @@ -838,8 +836,11 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd= , struct kvm *kvm, .is_guest_mode =3D true, .vcpu_data =3D &vcpu_info, }; + int ret; =20 ret =3D irq_set_vcpu_affinity(host_irq, &pi); + if (ret) + return ret; =20 /** * Here, we successfully setting up vcpu affinity in @@ -848,20 +849,9 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd= , struct kvm *kvm, * we can reference to them directly when we update vcpu * scheduling information in IOMMU irte. */ - if (!ret) - ret =3D svm_ir_list_add(to_svm(vcpu), irqfd, &pi); - } else { - ret =3D irq_set_vcpu_affinity(host_irq, NULL); + return svm_ir_list_add(to_svm(vcpu), irqfd, &pi); } - - if (ret < 0) { - pr_err("%s: failed to update PI IRTE\n", __func__); - goto out; - } - - ret =3D 0; -out: - return ret; + return irq_set_vcpu_affinity(host_irq, NULL); } =20 static inline int --=20 2.50.0.rc1.591.g9c95f17f64-goog