From patchwork Thu May 18 05:34:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 9733897 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 33486601BC for ; Thu, 18 May 2017 11:42:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 202DA2621D for ; Thu, 18 May 2017 11:42:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1507B269DA; Thu, 18 May 2017 11:42:56 +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=-2.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, 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 BB8E02621D for ; Thu, 18 May 2017 11:42:55 +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 1dBJnR-0004gZ-Me; Thu, 18 May 2017 11:40:45 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBJnQ-0004df-1i for xen-devel@lists.xen.org; Thu, 18 May 2017 11:40:44 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 53/21-17076-B388D195; Thu, 18 May 2017 11:40:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsVywNykQteqQzb S4ESLscWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmrH85Bb2gvO8FRfPNbM0MP7k6mLk4hASmM4o cXDZZ/YuRk4OCQFeiSPLZrB2MXIA2QESmzrZIGo6GCVmnb8EVsMmoC5xYvFERhBbREBa4trny 2A2s8A+Rok3z1VBbGEBH4krn3+zgcxhEVCVeLjJBiTMK+AqsWLSVRaIVQoSUx6+ZwaxOYHi27 beAosLCbhINC7sZZ3AyLuAkWEVo0ZxalFZapGukYleUlFmekZJbmJmjq6hgbFebmpxcWJ6ak5 iUrFecn7uJkZgMNQzMDDuYHx13O8QoyQHk5Io7+EC2UghvqT8lMqMxOKM+KLSnNTiQ4wyHBxK Erx87UA5waLU9NSKtMwcYFjCpCU4eJREeFNA0rzFBYm5xZnpEKlTjIpS4rxeIAkBkERGaR5cG ywWLjHKSgnzMjIwMAjxFKQW5WaWoMq/YhTnYFQS5q0CmcKTmVcCN/0V0GImoMXND6RBFpckIq SkGhjVN5o9rJ/d13fr/fvXb2c2VNnXv4/1nzBTOLHEg/eq2FWP34xGKz5zS9y8zHpiT/fhXYs U1n+on+iSkxLUvSrTZ1tzw/m/qXfdj3NcNXDfkxnp4r8/b2X5e6bbAgwV2v5Hlgge2fTaLdbz YeNMQZNfdnGpXVWc1b73ZJxlrJlVH5ZtT9m20UeJpTgj0VCLuag4EQDVfZWQgAIAAA== X-Env-Sender: tianyu.lan@intel.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1495107635!101206705!3 X-Originating-IP: [192.55.52.120] X-SpamReason: No, hits=0.8 required=7.0 tests=DATE_IN_PAST_06_12 X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11690 invoked from network); 18 May 2017 11:40:42 -0000 Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 18 May 2017 11:40:42 -0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2017 04:40:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.38,358,1491289200"; d="scan'208"; a="1149660091" Received: from sky-ws.sh.intel.com (HELO localhost) ([10.239.48.124]) by fmsmga001.fm.intel.com with ESMTP; 18 May 2017 04:40:40 -0700 From: Lan Tianyu To: xen-devel@lists.xen.org Date: Thu, 18 May 2017 01:34:45 -0400 Message-Id: <1495085696-10819-16-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1495085696-10819-1-git-send-email-tianyu.lan@intel.com> References: <1495085696-10819-1-git-send-email-tianyu.lan@intel.com> Cc: Lan Tianyu , kevin.tian@intel.com, wei.liu2@citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com, Chao Gao Subject: [Xen-devel] [RFC PATCH V2 15/26] x86/vvtd: decode interrupt attribute from IRTE 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 From: Chao Gao Previously, interrupt attributes can be extracted from msi message or IOAPIC RTE. However, with interrupt remapping enabled, the attributes are enclosed in the associated IRTE. This callback is for cases in which the caller wants to acquire interrupt attributes. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vvtd.c b/xen/arch/x86/hvm/vvtd.c index c993a15..57932cb 100644 --- a/xen/arch/x86/hvm/vvtd.c +++ b/xen/arch/x86/hvm/vvtd.c @@ -545,6 +545,25 @@ static int vvtd_handle_irq_request(struct domain *d, return -EFAULT; } +static int vvtd_get_irq_info(struct domain *d, + struct irq_remapping_request *irq, + struct irq_remapping_info *info) +{ + int ret; + struct iremap_entry irte; + struct vvtd *vvtd = domain_vvtd(d); + + ret = vvtd_get_entry(vvtd, irq, &irte, false); + if ( ret ) + return -ret; + + info->vector = irte.remap.vector; + info->dest = irte_dest(vvtd, irte.remap.dst); + info->dest_mode = irte.remap.dm; + info->delivery_mode = irte.remap.dlm; + return 0; +} + static void vvtd_reset(struct vvtd *vvtd, uint64_t capability) { uint64_t cap, ecap; @@ -639,7 +658,8 @@ struct viommu_ops vvtd_hvm_vmx_ops = { .query_caps = vvtd_query_caps, .create = vvtd_create, .destroy = vvtd_destroy, - .handle_irq_request = vvtd_handle_irq_request + .handle_irq_request = vvtd_handle_irq_request, + .get_irq_info = vvtd_get_irq_info }; static int vvtd_register(void)