Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2919621pxb; Fri, 8 Oct 2021 19:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/HrGQGSq+8s81AKNHkVaRXFasH4howC2tXN8MD6Z7pBX6RwTf9eZtcPRT2N7ItvoYZXLg X-Received: by 2002:a17:90a:4:: with SMTP id 4mr15204740pja.221.1633745905501; Fri, 08 Oct 2021 19:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633745905; cv=none; d=google.com; s=arc-20160816; b=lTI+FhAK5lRUSai3WNtxQ+ztdlPw57kAn0REZUHOX8i7gjLvoMF3C2Zrx0hcMPITHK 5XzooqRTVLSR4bvczFrklfcxAyfWy7a2H1TxhgSmlqw68zGHErtYJu21odAf+UlMVsm8 xMee0r503aCMGo714Po7aT27fv/yRmmT4y0U6drlmWxBrlG7VNuvas+10hjE55P8loAG 3uYpiGUjAyt47QBWpe860jUhoesUzpaZLGtDmBmIuuFaoRmOInc5a2thDYlKZ2EOTHoh /LDvYw6XzVNZheo/kCnD08R2/58DuPuIAlPMmt3gpNf1E+haSPUm1PAZJm+RbSvCnohY RA0g== 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:references:mime-version :message-id:in-reply-to:date:reply-to:dkim-signature; bh=7AydOUvkdJYa6Wlt5e9uwNZNJAdbyWC8Cf+8opg/Yr0=; b=k3x+Sy7pibEd2ouJODOLjSXDHmjqBl15shdwq5cRIwpXWzTzc/SrUkyc9TVAgpX21X eSWpKDYZOZA+R0wQG1dd8JJNSxJhhKz92QJVFYTwXTgjfvbQ10VjN6fqFfv+VIpibYRz 5p2Cxi1HWX+WbkE2WoXdGDsmck07Wdf0rjZXZPXkzE9sCNIaFcu9wBWqGWw2MMTGOJl4 H474gq294OXGla2nrnxydLgXJwt8u1MO1QS2NI/ZHQF6+XKeOxAfOYwz1Y2wy6Ouie/z MyziJFYsUEk6DwFYXcrisrOPp4WnvDZJ3Bjv0YEtzavzLG2RzAOVpvr2B48G30u5rc4J z/RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=F5A5ElVe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x184si1233013pfd.79.2021.10.08.19.18.12; Fri, 08 Oct 2021 19:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=F5A5ElVe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S244228AbhJICTX (ORCPT + 99 others); Fri, 8 Oct 2021 22:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244153AbhJICSu (ORCPT ); Fri, 8 Oct 2021 22:18:50 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE895C061772 for ; Fri, 8 Oct 2021 19:14:22 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id t2-20020a05620a450200b0045e34e4f9c7so9809995qkp.18 for ; Fri, 08 Oct 2021 19:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=7AydOUvkdJYa6Wlt5e9uwNZNJAdbyWC8Cf+8opg/Yr0=; b=F5A5ElVe2ZOpGelCD8RXcxlzS2YdsbWMTlTzwP14Z0DgtKolFahczSuhBXhCWiB7eh NnELj9ZTA5ErFZ1Ow79fstlN9c4/ZtbMRM8599X4XIGaWCtKgIyOuh7Lbv+UbYZ/PPbM g0ulVkl+iFczbzGTKrUUo2glF7/M3yo4REhhrKmsbxkn4vfC9KbCtghZums5FtWbQOo8 OtycXlioPw/pt6DxmpIj+7wp94P9in0FjxK37sJ1NDuAXa4Qi5RgxPsIzjtUPPY238Sh 7lWK+16G09Mmx1LZ71fHA4gr7m6egsSTAl0SJJ8FILJHRjlZrGakxe80P1e6/VbXoR38 UNGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=7AydOUvkdJYa6Wlt5e9uwNZNJAdbyWC8Cf+8opg/Yr0=; b=QNoNmT5R+HJzkj6mqKrwRn/+f2QVORJMu88NKG+juY2RJnv43j+FUKwUmdGIx/SS7W 38kYlKN/CEbbBrsehmMOhA5+0v9wsDGGuFIM0OcU0z9ZsOIcrm2uODQfyvCaRVTTZkLQ 2OK11OmO5+81CoowGMQaiskhKc5XoSh9AYvpxSK3AyUK7GglV4l2KQa8TeY6+T5WrTw0 89Jvkk4MwuCyjn18YTGu7/o0HiBurFjGBXxJXjWGnYhtTsrNjC7PNDUjb0k9BIE+9X7H EkVS0h87l3Z5uK83Hj9La5gMiRiNKJR60OrfI4lNM5ZE74T1WS6n6WyOYqZ8V5g1jEK0 d8+w== X-Gm-Message-State: AOAM530x7pu+bnJk5QqoYG0Vf8YR3trcSFDJAB8G9ZKzOZd5nb4LUAZ+ 9A26c0MxntDlHevgCxYJiteNr5q+m/0= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:90:200:e39b:6333:b001:cb]) (user=seanjc job=sendgmr) by 2002:ac8:594b:: with SMTP id 11mr1929826qtz.191.1633745662114; Fri, 08 Oct 2021 19:14:22 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 8 Oct 2021 19:12:34 -0700 In-Reply-To: <20211009021236.4122790-1-seanjc@google.com> Message-Id: <20211009021236.4122790-42-seanjc@google.com> Mime-Version: 1.0 References: <20211009021236.4122790-1-seanjc@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH v2 41/43] KVM: VMX: Pass desired vector instead of bool for triggering posted IRQ From: Sean Christopherson To: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Paolo Bonzini Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor the posted interrupt helper to take the desired notification vector instead of a bool so that the callers are self-documenting. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/vmx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 78c8bc7f1b3b..f505fee3cf5c 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -3928,11 +3928,9 @@ static void vmx_msr_filter_changed(struct kvm_vcpu *vcpu) } static inline bool kvm_vcpu_trigger_posted_interrupt(struct kvm_vcpu *vcpu, - bool nested) + int pi_vec) { #ifdef CONFIG_SMP - int pi_vec = nested ? POSTED_INTR_NESTED_VECTOR : POSTED_INTR_VECTOR; - if (vcpu->mode == IN_GUEST_MODE) { /* * The vector of interrupt to be delivered to vcpu had @@ -3986,7 +3984,7 @@ static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, */ kvm_make_request(KVM_REQ_EVENT, vcpu); /* the PIR and ON have been set by L1. */ - if (!kvm_vcpu_trigger_posted_interrupt(vcpu, true)) + if (!kvm_vcpu_trigger_posted_interrupt(vcpu, POSTED_INTR_NESTED_VECTOR)) kvm_vcpu_wake_up(vcpu); return 0; } @@ -4024,7 +4022,7 @@ static int vmx_deliver_posted_interrupt(struct kvm_vcpu *vcpu, int vector) * guaranteed to see PID.ON=1 and sync the PIR to IRR if triggering a * posted interrupt "fails" because vcpu->mode != IN_GUEST_MODE. */ - if (!kvm_vcpu_trigger_posted_interrupt(vcpu, false)) + if (!kvm_vcpu_trigger_posted_interrupt(vcpu, POSTED_INTR_VECTOR)) kvm_vcpu_wake_up(vcpu); return 0; -- 2.33.0.882.g93a45727a2-goog