From patchwork Wed Jul 13 13:20:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 71943 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1106105qga; Wed, 13 Jul 2016 10:00:54 -0700 (PDT) X-Received: by 10.66.25.171 with SMTP id d11mr15138625pag.3.1468429253870; Wed, 13 Jul 2016 10:00:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si1837279pfg.205.2016.07.13.10.00.52; Wed, 13 Jul 2016 10:00:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751747AbcGMQ5t (ORCPT + 30 others); Wed, 13 Jul 2016 12:57:49 -0400 Received: from mail-sn1nam02on0044.outbound.protection.outlook.com ([104.47.36.44]:6752 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750963AbcGMQ5l (ORCPT ); Wed, 13 Jul 2016 12:57:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LR3WOotMD3Lmarf/nx+fQwns4uJBveU82ZHma+XHkfk=; b=5c1d5zKQsi5dQS+KLRQt5PcjapklaEnqW0tpgx7zApUYLdmZlS/1s1nKQ2JZ9wR0lKm2qfwPN+jGxZmsJMnEGD6eCwW0f1AxlOpgR0aGZ6LixCdzayD3FwfGegmjp8fbPxKTiq31QBEjtJsBpnoO/R+s4poy8asILZ1rO+x4SXA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; Received: from localhost.localdomain (114.109.128.54) by SN1PR12MB0445.namprd12.prod.outlook.com (10.162.105.139) with Microsoft SMTP Server (TLS) id 15.1.534.14; Wed, 13 Jul 2016 13:21:21 +0000 From: Suravee Suthikulpanit To: , , , CC: , , , Suravee Suthikulpanit Subject: [PART2 PATCH v4 04/11] iommu/amd: Add support for multiple IRTE formats Date: Wed, 13 Jul 2016 08:20:25 -0500 Message-ID: <1468416032-7692-5-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468416032-7692-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1468416032-7692-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-Originating-IP: [114.109.128.54] X-ClientProxiedBy: SIXPR04CA0024.apcprd04.prod.outlook.com (10.162.171.14) To SN1PR12MB0445.namprd12.prod.outlook.com (10.162.105.139) X-MS-Office365-Filtering-Correlation-Id: f3452a8f-cc32-47c9-05fe-08d3ab209632 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0445; 2:xsHHHjJ35l3Fid1YrxyCi4AI1wJxzITeMd5hC7ZU2sRiaXioIKbDBRwEZbgQA9CNnF+/GYS5xyRJSuAixPcCAYfJKwV1lE94Q16GHCD9B9slYxyae30ZxiJSI2xeajR9Vay70E35XLliQud3525ROixZjakWJtHb0PVdmGimnqw3Uq/BL2RmTQTY1+RTv2Mz; 3:l01pcCQ8m5/4gKGKUF1Sn6yt5SqpRu9JZUpZ0gJQG1bu7yVrvTi4evkzFSRzvZkxJkRQVW5j8TMX5KCwk8N8YJAe/NYIyqkQuuo5gpT8woTtVHLUBns+EFWCVupyXiFI; 25:xSmNlIsWSF6tiuDxgYV1C8FIhYQKNYSaIMdqe+a1lX++Y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tsEYOGZmnqTNtxYpcrE6+GD6mSXrQVZBp+MQwvIVJcPlzLUv2+hYUpBO5nlfmqorm9SqyN0xyEuapQasMxecHsJmMxP9Ivs6Sd2wuAbxMLoMlKGHzhLtIkKu83zs; 4:+7qlCOY1v8LeLZBfSG6tqcqeRMV4IUHm4jwbSWL/SIQE/k/k0zCHMOPPqH5xNACkyPvSn7IFwtzm9h8hJ9Jwq6OVAfr9SpmLCaEPqFhFD75mHNQJ8JGsAFoGi3ezOMvmaobdhlmB3Z1x1X+J+oI8Cunabt1bKKL1YLsZf1e68fRRaGClgcZqWmQ+/J6FjExOlnA2qXEmwlE5DWxfOkylRiak2+T6BjtECFoc5k0DI9lHinEaKXWBaCGIV/P4iNGLEkL4yOY9iNxuS4kjMP3X+QTJg+o3atJkVtVKZ3mub4tqDowoSRGmqtEB10UK5FAMxl23spV+8qUCWcvbZno3PWQOvsoTiSyxtIIOG+lqr2iXhGz3Q7pQ0hw6Pt7HDQjKfn8hhQqlVLe3v97/a1q/VbrfVrJmyje48Tka9YR3iss= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0445; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0445; X-Forefront-PRVS: 000227DA0C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(229853001)(101416001)(77096005)(8676002)(6116002)(2950100001)(42186005)(586003)(81156014)(81166006)(2201001)(3846002)(50986999)(4326007)(76176999)(50466002)(36756003)(5003940100001)(68736007)(105586002)(305945005)(47776003)(66066001)(86362001)(7846002)(50226002)(2906002)(48376002)(92566002)(106356001)(19580405001)(7736002)(33646002)(97736004)(189998001)(5001770100001)(19580395003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0445; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0445; 23:+tXHauSgbDMJBNexGkx+Xfh70bpLKV6p4YYzYq4F/?= =?us-ascii?Q?OI5PgOHe/XgbI0HHneuNe6PC9BvY2tlmXobmXyk69yqLapDUHseGbJ/Pejpu?= =?us-ascii?Q?vuxWtynNZsK/PLKJL54BM+n+CsRPHesece3bHLN09BSTjGtukXyHXc/DITX6?= =?us-ascii?Q?MtuLyQCu5Niyx1ekVIo6SWspOJu7C5FkqHbaTa5Cs2qyCJhkLAGtHzuRW3GY?= =?us-ascii?Q?EXn+B7cpPArMQ6Tn0cxUyx3zBIYlKrZlPIeeTChH6m/+DKCi2lEWRsFPtgem?= =?us-ascii?Q?i1Xw7bjMeF3R98pZdNS5CDcjuqlvLwCguFufFPDtXmkbkMc251kpRptOJYvc?= =?us-ascii?Q?bWOqmt9GkP8Et0D1i9pnfX05MFGuRhTqjx92o+1XNbM/eO8+3f0mN47bLas1?= =?us-ascii?Q?eQ7JIT2qvBYiKD+TA7QyFRUcuWgIuptC9Z5MKcCTIR2B4yfzPYQkiKd/kNVA?= =?us-ascii?Q?zCLh3mfbVTpL5lJhQGYNdJ7+hNCXZGgk7qCSen8xtiaDGfuEyUJVy7hdqBT5?= =?us-ascii?Q?+5N7mPVZIX/xM9lsVU6yMz7gEwkwqON0kSHqEXUHGc5qV/6yM/PGCy5CqM3h?= =?us-ascii?Q?8xgojILs4JKrjcc+xTI6H8OWaMxPXYvZ5ckjwuzxKPRFS3D1OkETCvUj18nd?= =?us-ascii?Q?23WshVS3N+vltlzBVq1xHCjhL0no4mVImn1CWTltVL9IgbfBHNi/cWTwD1eT?= =?us-ascii?Q?+5VpNOKMDq/eEi5iexYP2X2l7j6z0aISmCywL5FiG9oczt/zHHn+Ly/CYuxn?= =?us-ascii?Q?H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hDGtaFjmN3Ee2Yt14PkYrVEquiVSIxQdgPMusR+tAIFqF8gfALhXZ7v6xQD/3f5pkIP0KEm6RfdKceg8jw7pRUIO2SWmg6nN5B79Bt8RuBAIYgh0i5pulPriBN/W2z221GF6Hk9mkbICDvVAf+r0j5fab0EjEPh5e5BuQqAoD0Zhq268/IQFZjy+VPCm0yV8mpaMJI4I5oNQfuScoDiie/oBTBiBIBuQ62AtAMEhpd1A5aKBTpT8A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0445; 20:+/cu3AEpgzQd/Xxr6oyc+Xc7sNX1gpzf2vELvQIxeIiXbAZELpY3T1UmTBLdUfGsLqz+Rs4Qmw4bt/zVY9XEnDznEY435QH4Pz7g0mu1r2+JThBAZnulJI/CyEf2iQgsLziFfWXmY5WdEGHc8OhVKBsRig62xPY/FwkXMWlssaQN1IO8VKMCvTPupkqtXQU2MNolIpvdmam5xVeopC+FQn0RmQKPQobLSBDImdZm7HmYbmomKe0AtR2Y4Hh3nEHx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2016 13:21:21.1353 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0445 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suravee Suthikulpanit This patch enables support for the new 128-bit IOMMU IRTE format, which can be used for both legacy and vapic interrupt remapping modes. It replaces the existing operations on IRTE, which can only support the older 32-bit IRTE format, with calls to the new struct amd_irt_ops. It also provides helper functions for setting up, accessing, and updating interrupt remapping table entries in different mode. Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd_iommu.c | 72 +++++++++++++++++++++++++++-------------- drivers/iommu/amd_iommu_init.c | 2 ++ drivers/iommu/amd_iommu_types.h | 1 - 3 files changed, 50 insertions(+), 25 deletions(-) -- 1.9.1 diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 139ea8b..abfb2b7 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -3714,8 +3714,6 @@ static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) amd_iommu_dev_table[devid].data[2] = dte; } -#define IRTE_ALLOCATED (~1U) - static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) { struct irq_remap_table *table = NULL; @@ -3761,13 +3759,18 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic) goto out; } - memset(table->table, 0, MAX_IRQS_PER_TABLE * sizeof(u32)); + if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir)) + memset(table->table, 0, + MAX_IRQS_PER_TABLE * sizeof(u32)); + else + memset(table->table, 0, + (MAX_IRQS_PER_TABLE * (sizeof(u64) * 2))); if (ioapic) { int i; for (i = 0; i < 32; ++i) - table->table[i] = IRTE_ALLOCATED; + iommu->irte_ops->set_allocated(table, i); } irq_lookup_table[devid] = table; @@ -3793,6 +3796,10 @@ static int alloc_irq_index(u16 devid, int count) struct irq_remap_table *table; unsigned long flags; int index, c; + struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; + + if (!iommu) + return -ENODEV; table = get_irq_table(devid, false); if (!table) @@ -3804,14 +3811,14 @@ static int alloc_irq_index(u16 devid, int count) for (c = 0, index = table->min_index; index < MAX_IRQS_PER_TABLE; ++index) { - if (table->table[index] == 0) + if (!iommu->irte_ops->is_allocated(table, index)) c += 1; else c = 0; if (c == count) { for (; c != 0; --c) - table->table[index - c + 1] = IRTE_ALLOCATED; + iommu->irte_ops->set_allocated(table, index - c + 1); index -= count - 1; goto out; @@ -3900,7 +3907,7 @@ static void free_irte(u16 devid, int index) return; spin_lock_irqsave(&table->lock, flags); - table->table[index] = 0; + iommu->irte_ops->clear_allocated(table, index); spin_unlock_irqrestore(&table->lock, flags); iommu_flush_irt(iommu, devid); @@ -3990,6 +3997,7 @@ static void irte_ga_set_affinity(void *entry, u16 devid, u16 index, modify_irte_ga(devid, index, irte); } +#define IRTE_ALLOCATED (~1U) static void irte_set_allocated(struct irq_remap_table *table, int index) { table->table[index] = IRTE_ALLOCATED; @@ -4119,19 +4127,17 @@ static void irq_remapping_prepare_irte(struct amd_ir_data *data, { struct irq_2_irte *irte_info = &data->irq_2_irte; struct msi_msg *msg = &data->msi_entry; - union irte *irte = &data->irte_entry; struct IO_APIC_route_entry *entry; + struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; + + if (!iommu) + return; data->irq_2_irte.devid = devid; data->irq_2_irte.index = index + sub_handle; - - /* Setup IRTE for IOMMU */ - irte->val = 0; - irte->fields.vector = irq_cfg->vector; - irte->fields.int_type = apic->irq_delivery_mode; - irte->fields.destination = irq_cfg->dest_apicid; - irte->fields.dm = apic->irq_dest_mode; - irte->fields.valid = 1; + iommu->irte_ops->prepare(data->entry, apic->irq_delivery_mode, + apic->irq_dest_mode, irq_cfg->vector, + irq_cfg->dest_apicid); switch (info->type) { case X86_IRQ_ALLOC_TYPE_IOAPIC: @@ -4187,7 +4193,7 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, { struct irq_alloc_info *info = arg; struct irq_data *irq_data; - struct amd_ir_data *data; + struct amd_ir_data *data = NULL; struct irq_cfg *cfg; int i, ret, devid; int index = -1; @@ -4239,6 +4245,16 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, if (!data) goto out_free_data; + if (!AMD_IOMMU_GUEST_IR_GA(amd_iommu_guest_ir)) + data->entry = kzalloc(sizeof(union irte), GFP_KERNEL); + else + data->entry = kzalloc(sizeof(struct irte_ga), + GFP_KERNEL); + if (!data->entry) { + kfree(data); + goto out_free_data; + } + irq_data->hwirq = (devid << 16) + i; irq_data->chip_data = data; irq_data->chip = &amd_ir_chip; @@ -4275,6 +4291,7 @@ static void irq_remapping_free(struct irq_domain *domain, unsigned int virq, data = irq_data->chip_data; irte_info = &data->irq_2_irte; free_irte(irte_info->devid, irte_info->index); + kfree(data->entry); kfree(data); } } @@ -4286,8 +4303,11 @@ static void irq_remapping_activate(struct irq_domain *domain, { struct amd_ir_data *data = irq_data->chip_data; struct irq_2_irte *irte_info = &data->irq_2_irte; + struct amd_iommu *iommu = amd_iommu_rlookup_table[irte_info->devid]; - modify_irte(irte_info->devid, irte_info->index, &data->irte_entry); + if (iommu) + iommu->irte_ops->activate(data->entry, irte_info->devid, + irte_info->index); } static void irq_remapping_deactivate(struct irq_domain *domain, @@ -4295,10 +4315,11 @@ static void irq_remapping_deactivate(struct irq_domain *domain, { struct amd_ir_data *data = irq_data->chip_data; struct irq_2_irte *irte_info = &data->irq_2_irte; - union irte entry; + struct amd_iommu *iommu = amd_iommu_rlookup_table[irte_info->devid]; - entry.val = 0; - modify_irte(irte_info->devid, irte_info->index, &data->irte_entry); + if (iommu) + iommu->irte_ops->deactivate(data->entry, irte_info->devid, + irte_info->index); } static struct irq_domain_ops amd_ir_domain_ops = { @@ -4315,8 +4336,12 @@ static int amd_ir_set_affinity(struct irq_data *data, struct irq_2_irte *irte_info = &ir_data->irq_2_irte; struct irq_cfg *cfg = irqd_cfg(data); struct irq_data *parent = data->parent_data; + struct amd_iommu *iommu = amd_iommu_rlookup_table[irte_info->devid]; int ret; + if (!iommu) + return -ENODEV; + ret = parent->chip->irq_set_affinity(parent, mask, force); if (ret < 0 || ret == IRQ_SET_MASK_OK_DONE) return ret; @@ -4325,9 +4350,8 @@ static int amd_ir_set_affinity(struct irq_data *data, * Atomically updates the IRTE with the new destination, vector * and flushes the interrupt entry cache. */ - ir_data->irte_entry.fields.vector = cfg->vector; - ir_data->irte_entry.fields.destination = cfg->dest_apicid; - modify_irte(irte_info->devid, irte_info->index, &ir_data->irte_entry); + iommu->irte_ops->set_affinity(ir_data->entry, irte_info->devid, + irte_info->index, cfg->vector, cfg->dest_apicid); /* * After this point, all the interrupts will start arriving diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index d0930b1..6635cdf 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -1883,8 +1883,10 @@ static void iommu_enable_ga(struct amd_iommu *iommu) /* Fall through */ case AMD_IOMMU_GUEST_IR_LEGACY_GA: iommu_feature_enable(iommu, CONTROL_GA_EN); + iommu->irte_ops = &irte_128_ops; break; default: + iommu->irte_ops = &irte_32_ops; break; } #endif diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index cc59fc5..84d3918 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -792,7 +792,6 @@ struct amd_irte_ops { struct amd_ir_data { struct irq_2_irte irq_2_irte; - union irte irte_entry; void *entry; union { struct msi_msg msi_entry;