Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp927523pxb; Wed, 13 Jan 2021 21:02:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrEMkXn/oTHFTleocr1Kts8H3o0zt1bUcYY9q2/oz2JUaQbk8XIfG52xpsNNdsn+kzhSql X-Received: by 2002:a05:6402:158:: with SMTP id s24mr4536239edu.19.1610600522710; Wed, 13 Jan 2021 21:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610600522; cv=none; d=google.com; s=arc-20160816; b=Jj6C33TR9KqyhdLZ39INkq9DJ6rMvp+/NnOqb7CKIYgV2lUuPAv+O6fhIV/fELeVG4 XwUSEOJGq24N4vOkfMjaoTkY3x3NBESP21o8X3m2EW7wUqkmwXoJ0uw3e4BDx/WakRo7 iv/cjUoWVeHmfCd7ItDgZ+EzmEbuhAGEtZxmUWyyaEuIKhxO66MrwuhwXE8uXfTo9D3h EeXGgt0HUwqI72HuSM+5P9gNMFcGZXNxmGpeNQCyGeqi9rAQuSgIU75v1Xr5ouEBzO6i 61uDqHma6gGRBz9XdKSDpP2/Axg4TORLzBKsfFdmSZl8wEusQFtG2vehqB8atKZVc8B2 eUww== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=ZmdvymZ2qR4M/qVQyd7uYkLb/p5vBHQAHMPmoaJ6QXk=; b=Mo0wDo9+IF7fu5/jWL+VdZNELQOhu/lbuT6OGOVZdrpWORWSqmtY1OiwqOcfP/Qxw3 lrBSuuqGnW74fmO4esFR9ZmGeEkeszjvAPUvTZ48SaimEF7RKknDxyz7IjFMEW/BRrjy +Efaw0b7j6Lh+H1XDVvEK0NXo7U3I+5Cv8UFrlVrZ1afJr9nimC0unV+l7oRZM99QCKj JvkaHDk/BXqw4fLdFQ8JOvWXxrexJBKSHDpsfhccL84tYTRjseXuoKGv3INOJt9lrQBT TwM06F7xkU2BOA0CScuOuO6RZR01pkp3NwYTlzixLGx+9EoUefTA28JbqFVzzi47ByHA 1PQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=rkJ6uQ+C; 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 p15si1794316edw.6.2021.01.13.21.01.39; Wed, 13 Jan 2021 21:02:02 -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; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=rkJ6uQ+C; 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 S1726110AbhANE6a (ORCPT + 99 others); Wed, 13 Jan 2021 23:58:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbhANE63 (ORCPT ); Wed, 13 Jan 2021 23:58:29 -0500 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4861FC061786 for ; Wed, 13 Jan 2021 20:57:51 -0800 (PST) Received: by mail-pg1-x532.google.com with SMTP id g15so2951664pgu.9 for ; Wed, 13 Jan 2021 20:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=ZmdvymZ2qR4M/qVQyd7uYkLb/p5vBHQAHMPmoaJ6QXk=; b=rkJ6uQ+C605Q6EPuu9YPwJJbBYW0XB14gDEmJLZz2PUOcvKxzjE0qwMHHpIWYaCZBJ Wha8QlgLwnkBgsVTSNoe5Xbo5t3a54xVmtuq+9og4XRPpTDgqgdsMo47uyOp1xJWURsi S69zWlGNMYZbLbdRCOvAq79H3RBMoLMK4A4udGIDJW3gugzdBlsNIVncy+/D/y3g4Xpe RYNlWEz4oSs45/ZfROjOYdj0eLzsm4OpK//cgFNqhjDk/Uel8ElpeMjsGcm9rAOQHXns o9uUEkOb2lCDrDPrdDSNYZdf4gGC4296AcejCEsRCd6NHEemI4KxKrYXbC/WNXpwQdlt /zNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=ZmdvymZ2qR4M/qVQyd7uYkLb/p5vBHQAHMPmoaJ6QXk=; b=IyQVyFqeYNrunS4HmA27wyafkT6A7F/Op7EpGc2lujHcQQFguNj1gn0FeZveL0I2kV Rh00k6cMhboCjazj8pvmJPSFme1+HlZmAqKrLuAqf67l1us7ehD3NHrg391o+uZqANWf 8PL2qstmZbw93bmDJNSC6XP2z7i8X6ewYxMG+jgaPhYkKLDw7o5yxoGN7eL6HtWPj/mB E47kf01/7RnAy+MIZqLJkYQXjs3DPQKvXxFqrUii1StVuRuSjPydr7Cb4axSuFDic3PJ Rm9QNFtYmoDiu+zNVMdwM2RHu6H3/HpF1knc395aUzRwSh00QTqPUOjXkXxyNpHYx84a dbEQ== X-Gm-Message-State: AOAM530DEvXH0KMZa9XxAV0WWF1wwBLtGGiCeqm5OCmJ6IselUF3GB6J EGdEy1vKN2wvBU4QYuL/9sUDER7swuyeKQ== X-Received: by 2002:a63:e40e:: with SMTP id a14mr5586177pgi.345.1610600270765; Wed, 13 Jan 2021 20:57:50 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id az6sm3857596pjb.24.2021.01.13.20.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 20:57:49 -0800 (PST) Date: Wed, 13 Jan 2021 20:57:49 -0800 (PST) X-Google-Original-Date: Wed, 13 Jan 2021 20:56:52 PST (-0800) Subject: Re: [PATCH 1/1] riscv: Fix KASAN memory mapping. In-Reply-To: <20210113022410.9057-1-nylon7@andestech.com> CC: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, aou@eecs.berkeley.edu, Paul Walmsley , dvyukov@google.com, glider@google.com, aryabinin@virtuozzo.com, alankao@andestech.com, nickhu@andestech.com, nylon7@andestech.com From: Palmer Dabbelt To: nylon7@andestech.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Jan 2021 18:24:10 PST (-0800), nylon7@andestech.com wrote: > From: Nick Hu > > Use virtual address instead of physical address when translating > the address to shadow memory by kasan_mem_to_shadow(). > > Signed-off-by: Nick Hu > Signed-off-by: Nylon Chen > --- > 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 12ddd1f6bf70..a8a2ffd9114a 100644 > --- a/arch/riscv/mm/kasan_init.c > +++ b/arch/riscv/mm/kasan_init.c > @@ -93,8 +93,8 @@ void __init kasan_init(void) > VMALLOC_END)); > > for_each_mem_range(i, &_start, &_end) { > - void *start = (void *)_start; > - void *end = (void *)_end; > + void *start = (void *)__va(_start); > + void *end = (void *)__va(_end); > > if (start >= end) > break; Thanks, this is on fixes.