Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp343339pxf; Thu, 25 Mar 2021 05:36:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1/Zc0sweEIelCt2fFGh/gRjrRPqz6RF24cXIlPlCIn4Iy4FQoFCBI54PD/znRMFWk0qWN X-Received: by 2002:a05:6402:1691:: with SMTP id a17mr8918940edv.336.1616675763698; Thu, 25 Mar 2021 05:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616675763; cv=none; d=google.com; s=arc-20160816; b=MQVCNwY62qRJTSeWVYglN75gysPaON827TXQMZajq5fKlVnyeLHHbsmhO8tTbGM/R8 pWMPX4gAPs1I+F/JYVjtXELbgrK43AsktNJ+iwKjX+YpNhk4QYjmO4eyGLkbuVggmiLf Eutyam5HUQRpvM1K/f4KqOQKqHVzpRdYggDyLPZYU6h1C+b6Rz7vAJuV/CcpI4MB9Ima xU4dF4+ehzIFWrDFM/gKrlKW7VmVxN7rVYVRCem57V7z/iU6/krqggoKDjD9k/N6Cpp5 2KDVrGayzL9iBPJ8fOIElOhrq5+xSRUIKLKuRasrJA5/PwRhbTzgwVMR4/MayxRh4vEr 6Kng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=HNpZF80ZjfLKLKvOlp6VmBBOVDw2bxrKWEYw/cI/Jtw=; b=ee/M9PqLk7PXNBBs83P8o6b/KU2t7il/yc7hRwMD3uMh1mIhUcM3t7Mmci+tyI/xCc qO/7wbLFjvW+NbSF9/4C8xE2pF4k6RYXYrOUpVPgi+rxtkfUAY2Fjf5aPcSxmD24YlCU Stws2xpt+03AiJlTCtNhueQGvC2z/hFPlGiRiBdRjyVU26AYbx7HnnG4HfhhrQt8rpaq 7ITwrIyE75Wxw/D3L0t3smZ7N32LpyZs+GssUOJOIhqI5SiRgSgkMMAndnA00vm9I9B7 LVhDCT60Ce282dv03atu0JkeHsLoYTJzyVZLQHVvgHH5293FPhG/CoS7yTKq0tv+O3Vy lryA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz19si4613261ejb.246.2021.03.25.05.35.40; Thu, 25 Mar 2021 05:36:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbhCYMeb (ORCPT + 99 others); Thu, 25 Mar 2021 08:34:31 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14538 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbhCYMeS (ORCPT ); Thu, 25 Mar 2021 08:34:18 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F5kxV6zFgzPlmL; Thu, 25 Mar 2021 20:31:42 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Thu, 25 Mar 2021 20:34:07 +0800 From: John Garry To: , , , , CC: , , , John Garry Subject: [PATCH v2 2/4] iommu/vt-d: Remove IOVA domain rcache flushing for CPU offlining Date: Thu, 25 Mar 2021 20:29:59 +0800 Message-ID: <1616675401-151997-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1616675401-151997-1-git-send-email-john.garry@huawei.com> References: <1616675401-151997-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the core code handles flushing per-IOVA domain CPU rcaches, remove the handling here. Reviewed-by: Lu Baolu Signed-off-by: John Garry --- drivers/iommu/intel/iommu.c | 31 ------------------------------- include/linux/cpuhotplug.h | 1 - 2 files changed, 32 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index ee0932307d64..d1e66e1b07b8 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4065,35 +4065,6 @@ static struct notifier_block intel_iommu_memory_nb = { .priority = 0 }; -static void free_all_cpu_cached_iovas(unsigned int cpu) -{ - int i; - - for (i = 0; i < g_num_of_iommus; i++) { - struct intel_iommu *iommu = g_iommus[i]; - struct dmar_domain *domain; - int did; - - if (!iommu) - continue; - - for (did = 0; did < cap_ndoms(iommu->cap); did++) { - domain = get_iommu_domain(iommu, (u16)did); - - if (!domain || domain->domain.type != IOMMU_DOMAIN_DMA) - continue; - - iommu_dma_free_cpu_cached_iovas(cpu, &domain->domain); - } - } -} - -static int intel_iommu_cpu_dead(unsigned int cpu) -{ - free_all_cpu_cached_iovas(cpu); - return 0; -} - static void intel_disable_iommus(void) { struct intel_iommu *iommu = NULL; @@ -4388,8 +4359,6 @@ int __init intel_iommu_init(void) bus_set_iommu(&pci_bus_type, &intel_iommu_ops); if (si_domain && !hw_pass_through) register_memory_notifier(&intel_iommu_memory_nb); - cpuhp_setup_state(CPUHP_IOMMU_INTEL_DEAD, "iommu/intel:dead", NULL, - intel_iommu_cpu_dead); down_read(&dmar_global_lock); if (probe_acpi_namespace_devices()) diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index cedac9986557..85996494bec1 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -57,7 +57,6 @@ enum cpuhp_state { CPUHP_PAGE_ALLOC_DEAD, CPUHP_NET_DEV_DEAD, CPUHP_PCI_XGENE_DEAD, - CPUHP_IOMMU_INTEL_DEAD, CPUHP_IOMMU_IOVA_DEAD, CPUHP_LUSTRE_CFS_DEAD, CPUHP_AP_ARM_CACHE_B15_RAC_DEAD, -- 2.26.2