Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp16996384ybl; Wed, 1 Jan 2020 19:13:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxyxbNvneFjOpcfdbHo5q05BB991TKkMcSD6uarW1ZC0iCjsddjv7ow5oeOxa+ioVQPo1Tc X-Received: by 2002:a05:6830:138b:: with SMTP id d11mr76318203otq.38.1577934821375; Wed, 01 Jan 2020 19:13:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577934821; cv=none; d=google.com; s=arc-20160816; b=Xdp1rIWCHOOTYDr4QJ+Q/6u0vNfy/88rq/VzqQUpelzva+TL/tyk7YhvQDahceAL7A qpF9QhoOvLB6VH7id3UByiwpsEP4g4lTIN7O/gCrhOYDybKW+UUuVdW1EiE3jB3G9OU6 K5Azj5T1VBNwgQokVBK0WAQJvaElEakVgz6Oe+bir3BOXX11E06hBzmQ/RDjOZieldLi J3MdckDBrHz9qxwOYDxasECAN7y2q0YItymi35GF9EtU8wnISGxyGSVWZIAtsP47ysVX NaDG+M//H8zLwLzqxXcXdasK/StRkn/f+IDMqpK6ErIOJS38t8PtBbWTSDkacFIZAH0E H9kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TMcYLN3IkMoBxMFdCkuvjs15n5cIfbofEAZTiuFMn6Y=; b=PHMyUcqv6KPWPrYWu2wradvI8z0a3UYbzWDG2ZB68AY9jamGDKBw2I81+TO/MZwoLn g3OBX4ikwS91KNSn3UQmobAj049uoiybkSNiAoPeEYTMawNlIHC93qiJ3Ptt6cUk8tFY eFgtnqjKA2D/CxMotZkzHPmp+3FNNxK6vz1kqPJAYDaGGPsE9BWIjNX3J57LBFqu8K4U PMK8x473/LwYglWDf705P1h6430WXAV9UQGM1vsc0tUMu3We1WYXcrZNEPJdKjmgSTOc IO8Dpp2ODfGurafZTIygyIUHFZf5uofEXhfg08oy0eNansNaQlWgmSOqRjsJ3cnYpPSJ aOkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=FdObOX2d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q131si15033728oig.203.2020.01.01.19.13.28; Wed, 01 Jan 2020 19:13:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=FdObOX2d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727553AbgABDMp (ORCPT + 99 others); Wed, 1 Jan 2020 22:12:45 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45342 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbgABDMp (ORCPT ); Wed, 1 Jan 2020 22:12:45 -0500 Received: by mail-pl1-f195.google.com with SMTP id b22so17290689pls.12 for ; Wed, 01 Jan 2020 19:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TMcYLN3IkMoBxMFdCkuvjs15n5cIfbofEAZTiuFMn6Y=; b=FdObOX2dsbDRlFC6cfrSgH4NJ8u/d+dDPwphvVvBQMbbrMyq/5qEKGfXT/55/7uL59 Jo3U18bfpPcWYIvMqK6ERmXXv/0/SxBSydcYObUABZdNVkXGEsSybeP2fYSRWCNWoS89 jjKQ+mme76LObO7nKf41OjNe56NjbwypL839Gv672GwQSyyd6BVt3HR4cicOdSqgh0Ac VKBimMsvkR7pHdMD5TB33+7lxYvAdQjOC/iLxYy97adq5ZB9Q6B9j0n4pHJzV6E+o6q7 yuK1vSHaINe+aEUibokjtTdNyaEI9nDbu4WlUQo7eiOZm3KmIiBg0mZoEEI9TSpdLu/x tr/Q== 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:mime-version :content-transfer-encoding; bh=TMcYLN3IkMoBxMFdCkuvjs15n5cIfbofEAZTiuFMn6Y=; b=W3szhblsOKFXzmNfRoU5AeLcVjVEzSDRb4nBJB65hYtlsDWunq7NkVZk4QQo4slw3T lj2XddO9QKFSyhEAO8mgQSjyGwWnc4qR92AxysIHpUICqkna63LdG4qWU6sBJ19kAX8e 7WYXYt7Yl6DfZ8o9pXx72V4i2U39QgjKFMkiZ/T5qsrZWOmThJb3ozuugm/IK2+b0hj4 CfCBSeGG18rFBQ01njz74C+dOp92GsbfJn4REDZhJBvpaHTegCkEkN6nWDW9yNve6HrN gqg2BT6mT/XzWRmx/oiOUMkUNcmqSrPZVEGwsBQ8M8yonp59kX+K137bdLIosszLLlrl N7YA== X-Gm-Message-State: APjAAAUcviMGAsDC2uD+HjWfxPtHAU6N6CQMflKL6j73iQvVJVsad4vt /NE/snO7JRH+tpzWohl7baE1VRtYvc4= X-Received: by 2002:a17:90b:3011:: with SMTP id hg17mr16969954pjb.90.1577934764625; Wed, 01 Jan 2020 19:12:44 -0800 (PST) Received: from hsinchu02.internal.sifive.com (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id l127sm57943938pgl.48.2020.01.01.19.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jan 2020 19:12:44 -0800 (PST) From: Zong Li To: palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zong Li Subject: [PATCH 0/2] riscv: mm: add support for CONFIG_DEBUG_VIRTUAL Date: Thu, 2 Jan 2020 11:12:38 +0800 Message-Id: <20200102031240.44484-1-zong.li@sifive.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch implements CONFIG_DEBUG_VIRTUAL to do additional checks on virt_to_phys and __pa_symbol calls. virt_to_phys used for linear mapping check, and __pa_symbol used for kernel symbol check. In current RISC-V, kernel image maps to linear mapping area. If CONFIG_DEBUG_VIRTUAL is disable, these two functions calculate the offset on the address feded directly without any checks. Zong Li (2): riscv: mm: add support for CONFIG_DEBUG_VIRTUAL riscv: mm: use __pa_symbol for kernel symbols arch/riscv/Kconfig | 1 + arch/riscv/include/asm/page.h | 16 +++++++++++++-- arch/riscv/mm/Makefile | 2 ++ arch/riscv/mm/init.c | 12 ++++++------ arch/riscv/mm/physaddr.c | 37 +++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 arch/riscv/mm/physaddr.c -- 2.24.1