From patchwork Sat Jan 9 10:32:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lecopzer Chen X-Patchwork-Id: 12008079 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 18EFFC433DB for ; Sat, 9 Jan 2021 10:33:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC7A820897 for ; Sat, 9 Jan 2021 10:33:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC7A820897 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 50B176B0184; Sat, 9 Jan 2021 05:33:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BAB28D0002; Sat, 9 Jan 2021 05:33:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A8E06B0186; Sat, 9 Jan 2021 05:33:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 233796B0184 for ; Sat, 9 Jan 2021 05:33:29 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DD7FB181AC550 for ; Sat, 9 Jan 2021 10:33:28 +0000 (UTC) X-FDA: 77685874896.27.army51_2504d34274fa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id C4F163D663 for ; Sat, 9 Jan 2021 10:33:28 +0000 (UTC) X-HE-Tag: army51_2504d34274fa X-Filterd-Recvd-Size: 4964 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Sat, 9 Jan 2021 10:33:28 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id q4so7019673plr.7 for ; Sat, 09 Jan 2021 02:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3UgUJ81KV4RLYeQfSGzwX3AUr5zkvCkqoF7/Wom4eVQ=; b=tIBodBVvD3dM/tPcoS7jhBbToG4VyWQROjl7yols9+8ORS/CcPAm5b20IC5Jbs9tWr yVOLQtwCCXvMimceRWBUO3zhKGWQjw7EHrfg5RSASgGqK8LLFbezIk2DCr5vc/pfiFnF JV6iQ2JA+Tw6kQMauQ4Z99oHP/u9IuHGhrJnVZaraWhMs00rxoSZ3aZ/hnNT+XYPjx/e UKfTzi1j/93nWOO+MObZpu/CQ5vP357FBpGxyOqQ4YFTPgngWp8raasL/lH/dTgxRD7p PLNtLI5oX9npD+u8BZKHa2tHKv0Fubd+WvDVhI9ejaqOXD0W5NgE6ZHTUmiYwluIMzHv lwYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3UgUJ81KV4RLYeQfSGzwX3AUr5zkvCkqoF7/Wom4eVQ=; b=jFqCbqc9RimdkkkqwOxkCiqq+o/riyjydk8Gc5Dgbi9RsVfUVOv7+k7h8jtFzD/dNR 5JzT0IucnbjWmuongayzaADgSF87gd1dNOineq4FOYIU6+g+S1kfMC3DvsLhSjW9IZbs xEUozJi4dobCtvPVaiEGQXr+ASYiR6azULKC0db5/39dVGIFKoaLS69C19p9GQkUFnqa lR9ggKlBR2PahpCQLyFqPKQYqj9whcdyFa99yr1VOhdGtOPP2ALYafurw7FP6HNIHOc0 uEmpEbrJwV8zwqc7mtyBLppoXBJxV3z94gjOZCujTbkg9mjjeL3Tu7aS1OD8/SoMrkq9 J3SQ== X-Gm-Message-State: AOAM530lr5MEQFpy8rv44WLuumHgHokkKrJiouTl2Ssfbt3ijNWxQ9Mc 2j4weRndbpydyQKB6fRFxycbJf3znoE3PA== X-Google-Smtp-Source: ABdhPJy4QsiaNLvy4Wi6V3VyP08TTOZIk5pdsPpG8vK4ovPwJSYRAs9Lig3+CqO4Uia7rBMWDffypA== X-Received: by 2002:a17:902:9a02:b029:dc:3481:3ff1 with SMTP id v2-20020a1709029a02b02900dc34813ff1mr11034416plp.28.1610188407451; Sat, 09 Jan 2021 02:33:27 -0800 (PST) Received: from localhost.localdomain (61-230-13-78.dynamic-ip.hinet.net. [61.230.13.78]) by smtp.gmail.com with ESMTPSA id w200sm11691572pfc.14.2021.01.09.02.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jan 2021 02:33:26 -0800 (PST) From: Lecopzer Chen To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org Cc: dan.j.williams@intel.com, aryabinin@virtuozzo.com, glider@google.com, dvyukov@google.com, akpm@linux-foundation.org, linux-mediatek@lists.infradead.org, yj.chiang@mediatek.com, will@kernel.org, catalin.marinas@arm.com, ardb@kernel.org, andreyknvl@google.com, broonie@kernel.org, linux@roeck-us.net, rppt@kernel.org, tyhicks@linux.microsoft.com, robin.murphy@arm.com, vincenzo.frascino@arm.com, gustavoars@kernel.org, Lecopzer Chen , Lecopzer Chen Subject: [PATCH v2 2/4] arm64: kasan: abstract _text and _end to KERNEL_START/END Date: Sat, 9 Jan 2021 18:32:50 +0800 Message-Id: <20210109103252.812517-3-lecopzer@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210109103252.812517-1-lecopzer@gmail.com> References: <20210109103252.812517-1-lecopzer@gmail.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Arm64 provide 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 39b218a64279..fa8d7ece895d 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); @@ -241,7 +241,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);