From patchwork Sat Feb 6 08:35:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lecopzer Chen X-Patchwork-Id: 12072025 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT 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 9EB23C433E0 for ; Sat, 6 Feb 2021 08:48:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 5A39B64E75 for ; Sat, 6 Feb 2021 08:48:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A39B64E75 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OFZjasxNxriAe0YCs1C6RxVl+HPQLCyAsWxzrU0oEzI=; b=zgXvbMOryuqa1P4TBsmF7avzy 6T8zABt0Hin3crnvO1Hnxb3wmNKd7xVIUeYyfiVFNjk5MSU3wgiNp90qf9m6Dpi0WsLZRISqGHYel dMgjzsIJrNR8IioY7YIm/lhQaUKhE2TKnyg2bal0WLRIYb7JgAFIuXVVfSgFDp3qvK08C3OAa2RS9 ahRkDQXhfDCjjwWAwRzuBFT/lMEi8XW85uENjvj8pcvEr8UYXzZQ4SPmA6JRxWk3hBMZ9aDr5h8du H/UIA0KUV71xkXk2caOWHPqoKVO3/Apzl0Ph1uGO/YRq5f3cR9jASVNd4hXNbDZSULcAsX/NjzTHP +INzHH8Nw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l8JF2-0003KP-I3; Sat, 06 Feb 2021 08:46:56 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l8JEk-0003CJ-97; Sat, 06 Feb 2021 08:46:42 +0000 X-UUID: 6ea7862059b44ddc9bc4750c2a8ba54c-20210206 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=IPc0iVOpVcmSALexHBM0WreR8NOA87BRabYlmIKgKMY=; b=su8VRUAFnMq4KcGot2J5SQmQl854NlzBCuI7Ev607e43n7pihIEmE3JDjyblBFNF0plKYdgKu8c4eSBzrtyC9jl9j9vF1chWPnX1MYBgujJMnW1RX9eklCFOIofRDWYeS+va8Ojn0lxy6DH32DSI0IROPBcjcCjFY1hBMTaZKUA=; X-UUID: 6ea7862059b44ddc9bc4750c2a8ba54c-20210206 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1861260640; Sat, 06 Feb 2021 00:46:21 -0800 Received: from mtkmbs08n2.mediatek.inc (172.21.101.56) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 6 Feb 2021 00:36:19 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 6 Feb 2021 16:36:06 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 6 Feb 2021 16:36:06 +0800 From: Lecopzer Chen To: , , , , Subject: [PATCH v3 2/5] arm64: kasan: abstract _text and _end to KERNEL_START/END Date: Sat, 6 Feb 2021 16:35:49 +0800 Message-ID: <20210206083552.24394-3-lecopzer.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210206083552.24394-1-lecopzer.chen@mediatek.com> References: <20210206083552.24394-1-lecopzer.chen@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: CF0202CE0B8FA8FEB182A1174645C4228FB0989FBF8CEF182189BA36F623AC222000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210206_034638_719104_23D3FB18 X-CRM114-Status: UNSURE ( 7.78 ) X-CRM114-Notice: Please train this message. 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: tyhicks@linux.microsoft.com, Lecopzer Chen , glider@google.com, yj.chiang@mediatek.com, gustavoars@kernel.org, andreyknvl@google.com, ardb@kernel.org, lecopzer@gmail.com, broonie@kernel.org, linux-mediatek@lists.infradead.org, linux@roeck-us.net, rppt@kernel.org, catalin.marinas@arm.com, aryabinin@virtuozzo.com, dan.j.williams@intel.com, vincenzo.frascino@arm.com, robin.murphy@arm.com, akpm@linux-foundation.org, dvyukov@google.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Arm64 provides defined macro for KERNEL_START and KERNEL_END, thus replace them by the abstration instead of using _text and _end. Signed-off-by: Lecopzer Chen --- arch/arm64/mm/kasan_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c index 20d06008785f..cd2653b7b174 100644 --- a/arch/arm64/mm/kasan_init.c +++ b/arch/arm64/mm/kasan_init.c @@ -218,8 +218,8 @@ static void __init kasan_init_shadow(void) phys_addr_t pa_start, pa_end; u64 i; - kimg_shadow_start = (u64)kasan_mem_to_shadow(_text) & PAGE_MASK; - kimg_shadow_end = PAGE_ALIGN((u64)kasan_mem_to_shadow(_end)); + kimg_shadow_start = (u64)kasan_mem_to_shadow(KERNEL_START) & PAGE_MASK; + kimg_shadow_end = PAGE_ALIGN((u64)kasan_mem_to_shadow(KERNEL_END)); mod_shadow_start = (u64)kasan_mem_to_shadow((void *)MODULES_VADDR); mod_shadow_end = (u64)kasan_mem_to_shadow((void *)MODULES_END); @@ -240,7 +240,7 @@ static void __init kasan_init_shadow(void) clear_pgds(KASAN_SHADOW_START, KASAN_SHADOW_END); kasan_map_populate(kimg_shadow_start, kimg_shadow_end, - early_pfn_to_nid(virt_to_pfn(lm_alias(_text)))); + early_pfn_to_nid(virt_to_pfn(lm_alias(KERNEL_START)))); kasan_populate_early_shadow(kasan_mem_to_shadow((void *)PAGE_END), (void *)mod_shadow_start);