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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham 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 E2875C6786C for ; Thu, 13 Dec 2018 02:24:54 +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 B1EF320870 for ; Thu, 13 Dec 2018 02:24:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XM4DCLEa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1EF320870 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com 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:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+qQpUW8daPD4FpaV534Utz4vCtM/RTtMD4lbMtJD4Ek=; b=XM4DCLEavWobhL r+TVcZ/X2lMv2BAvdQkFxE0c+Jm2T1vnADX1h9JPYJnVU/NmfKrnVkDJhfMNQlq+fw7YkkCmcpQeb UQpLTb/UptjGX0dfGrGGcJuUzD792+yipmt0vwyOchJ3QxgfounQPjEFTqknEzcSPuijeHF+Rd5F2 gnU4jFPG+GaIL3XHfD5MwKXu6akuzS75XspP3xoWKBQKdAunXQbavlzLnzk0DcfAmtRbhFIj+02Nu lw9FQF9+05+G20QKhuhVkWKKqAmJZNzT+micuYnCS113YoOMe0+z+3Es6klw57N5QsdsaS9vK5094 3bCbCfNSkWt+Ncu8achg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXGgE-0000A7-IH; Thu, 13 Dec 2018 02:24:50 +0000 Received: from [1.203.163.78] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXGg9-00008o-Mj; Thu, 13 Dec 2018 02:24:48 +0000 X-UUID: 1ca81a550d4744f9a545eadbf4d575d7-20181213 X-UUID: 1ca81a550d4744f9a545eadbf4d575d7-20181213 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1136412764; Thu, 13 Dec 2018 10:24:17 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 13 Dec 2018 10:24:15 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 13 Dec 2018 10:24:15 +0800 Message-ID: <1544667855.8755.7.camel@mhfsdcap03> Subject: Re: [PATCH] iommu/io-pgtable-arm-v7s: Don't check PHYS_OFFSET if RAMDOMIZE_BASE is enabled From: Yong Wu To: Robin Murphy Date: Thu, 13 Dec 2018 10:24:15 +0800 In-Reply-To: <50292758-47b1-1d08-5827-f7bdb3c33e1c@arm.com> References: <1544619737-6313-1-git-send-email-yong.wu@mediatek.com> <50292758-47b1-1d08-5827-f7bdb3c33e1c@arm.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181212_182445_956719_887E23FF X-CRM114-Status: GOOD ( 16.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, Nicolas Boichat , srv_heupstream@mediatek.com, Joerg Roedel , Will Deacon , linux-kernel@vger.kernel.org, Stephen Boyd , Tomasz Figa , iommu@lists.linux-foundation.org, CK Hu , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org 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 Wed, 2018-12-12 at 13:39 +0000, Robin Murphy wrote: > On 12/12/2018 13:02, Yong Wu wrote: > > If CONFIG_RANDOMIZE_BASE is enabled, the "memstart_addr" will be updated > > randomly, then the PHYS_OFFSET may be random. > > Oh, I hadn't ever realised that, good catch. However, since 29859aeb8a6e > I think we should probably just remove this check altogether. Thanks the hint. It looks that I only need revert 82db33dc5e49. > > > Fixes: 82db33dc5e49 ("iommu/io-pgtable-arm: Check for v7s-incapable > > systems") > > Note that this alone wouldn't be sufficient for stable prior to 4.18, > since CONFIG_RANDOMIZE_BASE would then allow the original crash to > happen again. Yes. the problem always exist. Nicolas is fixing this. I will delete the tag here. > > Robin. > > > Reported-by: CK Hu > > Signed-off-by: Yong Wu > > --- > > drivers/iommu/io-pgtable-arm-v7s.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c > > index 445c3bd..70941e6 100644 > > --- a/drivers/iommu/io-pgtable-arm-v7s.c > > +++ b/drivers/iommu/io-pgtable-arm-v7s.c > > @@ -709,7 +709,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, > > { > > struct arm_v7s_io_pgtable *data; > > > > -#ifdef PHYS_OFFSET > > +#if defined(PHYS_OFFSET) && !defined(CONFIG_RANDOMIZE_BASE) > > if (upper_32_bits(PHYS_OFFSET)) > > return NULL; > > #endif > > > > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel