From patchwork Thu Mar 16 11:20:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9627961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78FC16048C for ; Thu, 16 Mar 2017 11:21:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AE1F285B5 for ; Thu, 16 Mar 2017 11:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E66D28628; Thu, 16 Mar 2017 11:21:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18223285B5 for ; Thu, 16 Mar 2017 11:21:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coTR4-00084Z-Bu; Thu, 16 Mar 2017 11:19:14 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coTR2-0007zo-Mr for xen-devel@lists.xenproject.org; Thu, 16 Mar 2017 11:19:12 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id D9/6F-14551-0B47AC85; Thu, 16 Mar 2017 11:19:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRWlGSWpSXmKPExsVysyfVTXd9yak Ig70/lSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oylP9YyF3zlqZj59Rp7A+Mkri5GLg4hgc2M Et++trJ1MXICOcsZJZrfeoDYbAK6EjtuvmYGsUUEQiXm/HwEZjMLVEpc/LAfrF5YwFxi1tWTY HEWAVWJpuk9jCA2r4CNxOdlM8BqJATkJBrO3wer4QSKd5zcA7XLWuLz0c/sExi5FzAyrGJUL0 4tKkst0rXUSyrKTM8oyU3MzNE1NDDWy00tLk5MT81JTCrWS87P3cQI9G49AwPjDsbXP50OMUp yMCmJ8pb/OBEhxJeUn1KZkVicEV9UmpNafIhRhoNDSYLXRfhkhJBgUWp6akVaZg4wzGDSEhw8 SiK8SSBp3uKCxNzizHSI1ClGRSlx3lKQhABIIqM0D64NFtqXGGWlhHkZGRgYhHgKUotyM0tQ5 V8xinMwKgnzfhMCmsKTmVcCN/0V0GImoMVvP5wAWVySiJCSamC0/Mh/SbdJdtbWpzMXNVmsWP XvYo/ykvRLE1ZX7wgp6/k7LWP1+4qEJeo7vJKWi96J2+IfJ2q957aIzfOzDmtrvm1tLEv7cmD KiliuNbuNWZ3CPDZvKJF6dXK13r3+O20pWs8d1s7mFTa0aBCtnMuXl8q/a7d0o+lslzn3uw34 S6T3FlwwPKmsxFKckWioxVxUnAgAtiosFmgCAAA= X-Env-Sender: andre.przywara@arm.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1489663151!90547124!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15097 invoked from network); 16 Mar 2017 11:19:11 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-14.tower-31.messagelabs.com with SMTP; 16 Mar 2017 11:19:11 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C6127152D; Thu, 16 Mar 2017 04:19:10 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C1B413F5C9; Thu, 16 Mar 2017 04:19:09 -0700 (PDT) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 16 Mar 2017 11:20:20 +0000 Message-Id: <20170316112030.20419-18-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170316112030.20419-1-andre.przywara@arm.com> References: <20170316112030.20419-1-andre.przywara@arm.com> Cc: xen-devel@lists.xenproject.org, Shanker Donthineni , Vijay Kilari Subject: [Xen-devel] [PATCH v2 17/27] ARM: vITS: handle INT command X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The INT command sets a given LPI identified by a DeviceID/EventID pair as pending and thus triggers it to be injected. Signed-off-by: Andre Przywara --- xen/arch/arm/vgic-v3-its.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c index e808f43..23476f9 100644 --- a/xen/arch/arm/vgic-v3-its.c +++ b/xen/arch/arm/vgic-v3-its.c @@ -244,6 +244,26 @@ static int its_handle_clear(struct virt_its *its, uint64_t *cmdptr) return 0; } +static int its_handle_int(struct virt_its *its, uint64_t *cmdptr) +{ + uint32_t devid = its_cmd_get_deviceid(cmdptr); + uint32_t eventid = its_cmd_get_id(cmdptr); + struct vcpu *vcpu; + uint32_t vlpi; + uint8_t prop; + + if ( !read_itte(its, devid, eventid, &vcpu, &vlpi) ) + return -1; + + prop = vcpu->domain->arch.vgic.proptable[vlpi - LPI_OFFSET]; + if ( prop & LPI_PROP_ENABLED ) + vgic_vcpu_inject_irq(vcpu, vlpi); + else + set_bit(vlpi - LPI_OFFSET, vcpu->arch.vgic.pendtable); + + return 0; +} + #define ITS_CMD_BUFFER_SIZE(baser) ((((baser) & 0xff) + 1) << 12) static int vgic_its_handle_cmds(struct domain *d, struct virt_its *its, @@ -267,6 +287,9 @@ static int vgic_its_handle_cmds(struct domain *d, struct virt_its *its, case GITS_CMD_CLEAR: its_handle_clear(its, cmdptr); break; + case GITS_CMD_INT: + its_handle_int(its, cmdptr); + break; case GITS_CMD_SYNC: /* We handle ITS commands synchronously, so we ignore SYNC. */ break;