From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02902C433E0 for ; Thu, 21 May 2020 09:23:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B79242072C for ; Thu, 21 May 2020 09:23:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ivPnmQIZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ioeYo7XF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B79242072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9HvJ6dMqd+MB98bh89OmqIJ3J/ycvUbWDnlv2pZ+UBY=; b=ivPnmQIZRk3V32 4FVKIqYJf0UvVSeYwz/rt1Y8h9VcaplgcAh7u/WLwxodw4zNCS+Kq4pO/9pvqy3+2MrAgmth3MtPu LqPRDXOIDlHQfzqssYtv+KNbyYzaTgm5xu6n0SYUl2EKslcgCAZUAg5r9AHu+3c3TvOOrwqgiZOYt k+D+Jzjlx9pN+/cD4Qak/gCRqxCpq+pFg/zR3r6XbMzBRidxlDfJsGmjTRTIITsQ285pdCuo0neq6 b1SE7XWz9TmyCPx7tO35RnITqfS1HuoknKBqjKWeuftDenZ5Pg5V5ePuEUcnSCJu60mTpGouvjaLO cxeR1dARTiVU5vk22IEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbhQ9-0000Qt-GV; Thu, 21 May 2020 09:23:21 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbhQ5-0000PQ-G1; Thu, 21 May 2020 09:23:18 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9997A2072C; Thu, 21 May 2020 09:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590052997; bh=37Qx3oxaJAYRWohGHUkEGO6YOTHJz1lmfbAnHjSkp5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ioeYo7XFA87XTNXeQJEAty+eG2jS18ifXdr8sw2BZATw6FFGqv7auONLr2w6jCf8p WJrLNS43HJQh32kBnAxJ0ASpl1SCv7WL1k4Y6KY6xZj5Bw503cpJ/R8E/l6MPbJPYq Lq0gYjh6jUQ5U1HhwjgeljGUM8l/uEoQIlNgfOCE= Date: Thu, 21 May 2020 10:23:12 +0100 From: Will Deacon To: Prabhakar Kushwaha Subject: Re: [PATCH][v2] iommu: arm-smmu-v3: Copy SMMU table for kdump kernel Message-ID: <20200521092311.GB5091@willie-the-truck> References: <1589251566-32126-1-git-send-email-pkushwaha@marvell.com> <20200518155545.GO32394@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200521_022317_555813_68309CBF X-CRM114-Status: GOOD ( 14.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ganapatrao Prabhakerrao Kulkarni , Marc Zyngier , Bhupesh Sharma , kexec mailing list , Bjorn Helgaas , Prabhakar Kushwaha , Robin Murphy , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 19, 2020 at 08:24:21AM +0530, Prabhakar Kushwaha wrote: > On Mon, May 18, 2020 at 9:25 PM Will Deacon wrote: > > On Mon, May 11, 2020 at 07:46:06PM -0700, Prabhakar Kushwaha wrote: > > > @@ -3272,6 +3281,23 @@ static int arm_smmu_init_l1_strtab(struct arm_smmu_device *smmu) > > > return 0; > > > } > > > > > > +static void arm_smmu_copy_table(struct arm_smmu_device *smmu, > > > + struct arm_smmu_strtab_cfg *cfg, u32 size) > > > +{ > > > + struct arm_smmu_strtab_cfg rdcfg; > > > + > > > + rdcfg.strtab_dma = readq_relaxed(smmu->base + ARM_SMMU_STRTAB_BASE); > > > + rdcfg.strtab_base_cfg = readq_relaxed(smmu->base > > > + + ARM_SMMU_STRTAB_BASE_CFG); > > > + > > > + rdcfg.strtab_dma &= STRTAB_BASE_ADDR_MASK; > > > + rdcfg.strtab = memremap(rdcfg.strtab_dma, size, MEMREMAP_WB); > > > + > > > + memcpy_fromio(cfg->strtab, rdcfg.strtab, size); > > > + > > this need a fix. It should be memcpy. > > > > + cfg->strtab_base_cfg = rdcfg.strtab_base_cfg; > > > > Sorry, but this is unacceptable. These things were allocated by the DMA API > > so you can't just memcpy them around and hope for the best. > > > > I was referring copy_context_table() in drivers/iommu/intel-iommu.c. > here i see usage of memremap and memcpy to copy older iommu table. > did I take wrong reference? > > What kind of issue you are foreseeing in using memcpy(). May be we can > try to find a solution. Well the thing might not be cache-coherent to start with... Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel