From patchwork Thu Nov 23 09:06:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 840708 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yjD4n1rGhz9s3w for ; Thu, 23 Nov 2017 20:08:09 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yjD4n118VzDrMk for ; Thu, 23 Nov 2017 20:08:09 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lvivier@redhat.com; receiver=) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yjD3J1mQ7zDr4J for ; Thu, 23 Nov 2017 20:06:51 +1100 (AEDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51D045F755; Thu, 23 Nov 2017 09:06:48 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-116-209.ams2.redhat.com [10.36.116.209]) by smtp.corp.redhat.com (Postfix) with ESMTP id E37C15D6A3; Thu, 23 Nov 2017 09:06:45 +0000 (UTC) From: Laurent Vivier To: linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive() Date: Thu, 23 Nov 2017 10:06:33 +0100 Message-Id: <20171123090633.873-1-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 23 Nov 2017 09:06:48 +0000 (UTC) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , kvm-ppc@vger.kernel.org, Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, Sam Bobroff Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This is needed to map kvmppc_xive_set_xive() behavior to kvmppc_xics_set_xive(). As we store the server, kvmppc_xive_get_xive() can return the good value and we can also allow kvmppc_xive_int_on(). Signed-off-by: Laurent Vivier --- arch/powerpc/kvm/book3s_xive.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c index bf457843e032..2781b8733038 100644 --- a/arch/powerpc/kvm/book3s_xive.c +++ b/arch/powerpc/kvm/book3s_xive.c @@ -584,10 +584,14 @@ int kvmppc_xive_set_xive(struct kvm *kvm, u32 irq, u32 server, * we could initialize interrupts with valid default */ - if (new_act_prio != MASKED && - (state->act_server != server || - state->act_priority != new_act_prio)) - rc = xive_target_interrupt(kvm, state, server, new_act_prio); + if (state->act_server != server || + state->act_priority != new_act_prio) { + if (new_act_prio != MASKED) + rc = xive_target_interrupt(kvm, state, server, + new_act_prio); + if (!rc) + state->act_server = server; + } /* * Perform the final unmasking of the interrupt source @@ -646,14 +650,6 @@ int kvmppc_xive_int_on(struct kvm *kvm, u32 irq) pr_devel("int_on(irq=0x%x)\n", irq); - /* - * Check if interrupt was not targetted - */ - if (state->act_priority == MASKED) { - pr_devel("int_on on untargetted interrupt\n"); - return -EINVAL; - } - /* If saved_priority is 0xff, do nothing */ if (state->saved_priority == MASKED) return 0;