From patchwork Fri Jun 5 14:11:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 6554501 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00204C0020 for ; Fri, 5 Jun 2015 14:17:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 246192070C for ; Fri, 5 Jun 2015 14:17:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E577205C6 for ; Fri, 5 Jun 2015 14:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422640AbbFEOMg (ORCPT ); Fri, 5 Jun 2015 10:12:36 -0400 Received: from 8bytes.org ([81.169.241.247]:59194 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423046AbbFEOLV (ORCPT ); Fri, 5 Jun 2015 10:11:21 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 13403AF5; Fri, 5 Jun 2015 16:11:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1433513473; bh=lvXf3GCN/aLt/6f/hdWy9c2c3dkP+TYwj1qUSTStIcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bU5RivmP3PmezeulnwbJ80dBZTKpn3V0MHr7jh4TFqEpm564sEqeBBVCByTT2vY/v 9Z84upL0WnjJr/71X7COr2oFHa0mgn0ZskmwUGmw1ecLg0ve4XrpMstvy+iDbK52B9 ax2SSeecvhxz/sNfMc2PpkE+POE7a/WtV/B5FxKZM63jcysG433Sb8ZWOOddZOY+Bl oM56o9fVIK1Ccs5vD6G70A0zksty3syp6xUmGWUEmXtmgMaDLBISLnd635uMjg4OiD kGB0rdN+46sstTwgsbqNx63SoVWiaCndRD7/H0X/F6qCSmlSSOhperKLQzswN+ZPlS /hYgyiLkBE5Rw== From: Joerg Roedel To: iommu@lists.linux-foundation.org Cc: zhen-hual@hp.com, bhe@redhat.com, dwmw2@infradead.org, vgoyal@redhat.com, dyoung@redhat.com, alex.williamson@redhat.com, ddutile@redhat.com, ishii.hironobu@jp.fujitsu.com, indou.takao@jp.fujitsu.com, bhelgaas@google.com, doug.hatch@hp.com, jerry.hoemann@hp.com, tom.vaden@hp.com, li.zhang6@hp.com, lisa.mitchell@hp.com, billsumnerlinux@gmail.com, rwright@hp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kexec@lists.infradead.org, joro@8bytes.org, jroedel@suse.de Subject: [PATCH 17/17] iommu/vt-d: Remove update code for old ir-table Date: Fri, 5 Jun 2015 16:11:03 +0200 Message-Id: <1433513463-19128-18-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433513463-19128-1-git-send-email-joro@8bytes.org> References: <1433513463-19128-1-git-send-email-joro@8bytes.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joerg Roedel The code to update the irq remapping table of the old kernel is not necessary anymore because we switch immidiatly to the new table after we copied the data over. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel_irq_remapping.c | 44 ------------------------------------- include/linux/intel-iommu.h | 2 -- 2 files changed, 46 deletions(-) diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 07a8e82..b49aa8c 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c @@ -22,7 +22,6 @@ #include "irq_remapping.h" static int iommu_load_old_irte(struct intel_iommu *iommu); -static int __iommu_update_old_irte(struct intel_iommu *iommu, int index); static void iommu_check_pre_ir_status(struct intel_iommu *iommu); static void iommu_disable_irq_remapping(struct intel_iommu *iommu); @@ -202,9 +201,6 @@ static int modify_irte(int irq, struct irte *irte_modified) set_64bit(&irte->low, irte_modified->low); set_64bit(&irte->high, irte_modified->high); - if (iommu->pre_enabled_ir) - __iommu_update_old_irte(iommu, index); - __iommu_flush_cache(iommu, irte, sizeof(*irte)); rc = qi_flush_iec(iommu, index, 0); @@ -266,9 +262,6 @@ static int clear_entries(struct irq_2_iommu *irq_iommu) bitmap_release_region(iommu->ir_table->bitmap, index, irq_iommu->irte_mask); - if (iommu->pre_enabled_ir) - __iommu_update_old_irte(iommu, -1); - return qi_flush_iec(iommu, index, irq_iommu->irte_mask); } @@ -1327,9 +1320,6 @@ static int iommu_load_old_irte(struct intel_iommu *iommu) __iommu_flush_cache(iommu, iommu->ir_table->base, size); - iommu->ir_table->base_old_phys = irt_phys; - iommu->ir_table->base_old_virt = old_ir_table; - /* * Now check the table for used entries and mark those as * allocated in the bitmap @@ -1342,40 +1332,6 @@ static int iommu_load_old_irte(struct intel_iommu *iommu) return 0; } -static int __iommu_update_old_irte(struct intel_iommu *iommu, int index) -{ - int start; - unsigned long size; - void __iomem *to; -void *from; - - if ((!iommu) - || (!iommu->ir_table) - || (!iommu->ir_table->base) - || (!iommu->ir_table->base_old_phys) - || (!iommu->ir_table->base_old_virt)) - return -1; - - if (index < -1 || index >= INTR_REMAP_TABLE_ENTRIES) - return -1; - - if (index == -1) { - start = 0; - size = INTR_REMAP_TABLE_ENTRIES * sizeof(struct irte); - } else { - start = index * sizeof(struct irte); - size = sizeof(struct irte); - } - - to = iommu->ir_table->base_old_virt; - from = iommu->ir_table->base; - memcpy(to + start, from + start, size); - - __iommu_flush_cache(iommu, to + start, size); - - return 0; -} - static void iommu_check_pre_ir_status(struct intel_iommu *iommu) { u32 sts; diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 5aa8834..9fcdd9a 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h @@ -302,8 +302,6 @@ struct q_inval { struct ir_table { struct irte *base; unsigned long *bitmap; - void __iomem *base_old_virt; - unsigned long base_old_phys; }; #endif