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: 840707 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yjD3H2dWCz9t2f for ; Thu, 23 Nov 2017 20:06:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbdKWJGu (ORCPT ); Thu, 23 Nov 2017 04:06:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53246 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751690AbdKWJGs (ORCPT ); Thu, 23 Nov 2017 04:06:48 -0500 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 Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Paolo Bonzini , Thomas Huth , Sam Bobroff , Laurent Vivier 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) Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org 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;