Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4297977pxb; Mon, 8 Feb 2021 12:48:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPvdrJBJMOkmQdfwYTngtaZGH5X3DC7YMmFhtvaFTDRGDp3lJTci/Omu5nZcrvIrLTmT3I X-Received: by 2002:a17:906:b042:: with SMTP id bj2mr18802684ejb.261.1612817290203; Mon, 08 Feb 2021 12:48:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612817290; cv=none; d=google.com; s=arc-20160816; b=NabMTrTFH5LjdQ/piCJv6zuN++yveHqjufC92yyjxsX7DqvJ54e3qzaTsSz55dDjTD ALM/UXToDNYmutr1bLOaAsBfYpEO2vlTiGyCE6B2rrZrFDjp9pvTAYL6aCGQA0MXKbiq 28XptYUXpLjhDOgTNWTWcCM9tk453JdlTB5ic8FkgY66NQDFw5uY8zFOrkWotj1CeqnU 8hr6JWCUIHyCkUNYt3j88DJyFw2MtprQRqBJxthknFLYfOGvt/8kA3outtgT4T0ZH5Rc L0UELRlGMhPSMbwq06dCmGolwXBDuIzaBTcMhHDS7jWWr+pS/GrIAhGY5n2Twky6bZ5m 8hUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8tJgeMwHEnTrMYaq3sc/Gwc3+jwtekWJatbRqm4+Zns=; b=Uc2kWKWOeeGPpnJ7Ky/N5eb4hLaCp7wtcfQaDxYNh/xLBYwdUrKcwDH93ziN7U9dH6 10G5rhkj23elPXNBPvI3KyM1Etj+r3Dn4KdnWR7HiewNMBXyz4am7iM8k57BdcE+apZn F2bICZQqxvWHyC7CaGftbPo8BHyNJImUqoIBJlV6BLi/h63MXZqqqiWiOjuRcyomldJR FJ4XqsRgw4AzY3urNt3bP3+ThsNtSFNflTXpegIQgtDz5H2bYTHQKYtsXyMiAWPlf+GM yq2TkxG8dReI+jUnJ25L+ECE6YHsTxtCApxNGtm08jFY8VGH0TgQyN3oIxjVx1yboChY nrKg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si11547553ejz.419.2021.02.08.12.47.45; Mon, 08 Feb 2021 12:48:10 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232295AbhBHUn4 (ORCPT + 99 others); Mon, 8 Feb 2021 15:43:56 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:37573 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235208AbhBHTdR (ORCPT ); Mon, 8 Feb 2021 14:33:17 -0500 X-Originating-IP: 2.7.49.219 Received: from debian.home (lfbn-lyo-1-457-219.w2-7.abo.wanadoo.fr [2.7.49.219]) (Authenticated sender: alex@ghiti.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 287DA20003; Mon, 8 Feb 2021 19:32:28 +0000 (UTC) From: Alexandre Ghiti To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Paul Walmsley , Palmer Dabbelt , Albert Ou , kasan-dev@googlegroups.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH 2/4] riscv: Use KASAN_SHADOW_INIT define for kasan memory initialization Date: Mon, 8 Feb 2021 14:30:15 -0500 Message-Id: <20210208193017.30904-3-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210208193017.30904-1-alex@ghiti.fr> References: <20210208193017.30904-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of hardcoding memory initialization to 0, use KASAN_SHADOW_INIT. Signed-off-by: Alexandre Ghiti --- arch/riscv/mm/kasan_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c index a8a2ffd9114a..7bbe09416a2e 100644 --- a/arch/riscv/mm/kasan_init.c +++ b/arch/riscv/mm/kasan_init.c @@ -80,7 +80,7 @@ static void __init populate(void *start, void *end) __pgprot(_PAGE_TABLE))); local_flush_tlb_all(); - memset(start, 0, end - start); + memset(start, KASAN_SHADOW_INIT, end - start); } void __init kasan_init(void) @@ -108,6 +108,6 @@ void __init kasan_init(void) __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_ACCESSED))); - memset(kasan_early_shadow_page, 0, PAGE_SIZE); + memset(kasan_early_shadow_page, KASAN_SHADOW_INIT, PAGE_SIZE); init_task.kasan_depth = 0; } -- 2.20.1