From patchwork Wed Jan 31 05:51:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 19708 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1703553dyb; Tue, 30 Jan 2024 22:28:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEp6J2TFk4joQ1u4wvTjtdB+wHX9f2QnwA7xkbyqxWYQI9S7ZaDuKEfHHIouEn6Qjq2HVES X-Received: by 2002:a17:902:e80b:b0:1d9:1fdf:232b with SMTP id u11-20020a170902e80b00b001d91fdf232bmr826747plg.4.1706682482213; Tue, 30 Jan 2024 22:28:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682482; cv=pass; d=google.com; s=arc-20160816; b=a2H2l1mvPu5e740xiosy+8TflBqpsKlkaa2JPB2lkmrSezLtfpYMMFlbENeKccgpcx 4Wi4uXp9JPT2Sjs5KrGHUhI8ttG0PaSreqVoeoEvMRntAL89sEKGfiTdWcuTluFm65ny eDTNZcSPlxPq4soXJ3721UoHEDCqCihleI4AKob/kDN+KnZn/2vL2vatptazqepB7SuJ +exrjuLos1BowsTbnQPHSfsrr5kb39Wh3lVbTgCGVTN0aL/CKehPrH7wkWaH98KDHVXN dqkO2lOcjf0vqgEPL/Rh6scoQ4sUGFy/hYSsc5Ch4NRBP3zar76gMygjV0RXrl81MkNf H8IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=HrDdXXOAqsDD9LKf8FQWq7Zo9jLg+BleANk9L6c8CgE=; fh=UE+JvUfmiVnQi0vP8YQMij5fIRt806nPpvFR/03WE4A=; b=TMKvbsXBTLd/5WcNPXMDS6oDTeCr2qUGE9U9ZNE2skGhX7KDC4gd2R3JZ/102v/xSy M6d1l6j/YX9smQR8VwwhEAMTCFeGJtgQWfyKEV//UyCORFDVhc1QtfE+PvHYljbmHJ6g 6OdlfKux78EeETDmaVyCyax/fhYVqByvhkVg4/QUhKvruK0t8V6fD+SF4eAmOp2Fg5RD W+lTw9ZBQ5Gs+XvM6fjd50UEuopa3obgWNho0dU4Oh42Hu2zu9Xz9ZGbAyZJC/2dqAXf PHkG8mngoJdWehjg5Or1gIn5m9b3Yeaby5JKYlYFYF1O12Bff++oisJNHHJiFSpenzBO gPSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eAHplHh2; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45821-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45821-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCWCVPCorDlx1Idn51E0m6jlCXoP/cqPWghXlV4mvRpyQkbHV3s5f5pcu6Upn5nJ3z9Yuq28SGX6gvmUyBlorSRi/nzO5Q== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u8-20020a17090341c800b001d6ee361679si1122831ple.489.2024.01.30.22.28.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:28:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45821-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eAHplHh2; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45821-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45821-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 09188B26721 for ; Wed, 31 Jan 2024 06:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A15D63F8E6; Wed, 31 Jan 2024 06:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eAHplHh2" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B390C3EA7A; Wed, 31 Jan 2024 06:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682355; cv=none; b=fg+R+MdYbyl/E6UpHrGvPrH92kBU3oXuxWns8pV5kjr9xOkSND+T7B4Nt0JoRfwYA5mKAnf5uBVBHZp+IU7uZBOjq8FWvld8HVHF3WSwZIaAuz0o0h3r8W1SLm7HbHMB534vaaEnim58T82zLk8CQ5LeLGsMGSPtwW+pWjOE1Ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682355; c=relaxed/simple; bh=Dz+rEBJ1wZtGL4hQOfZUqa80XN/mQMePbBMimQSo/DE=; h=From:To:Cc:Subject:Date:Message-Id; b=I0cFyrxwB6CUjqhI5SpUDhovsFHQIqC5p+/pJU4IEqrPpVxsEzqW8DZe7ful/FQgKuPfcqY0guf8oFyyIOLM/i+dWAfcZQftqtWwmwQgDhs4WSvgXMxkfM3Ub88IyoFs6JNjvTG/OoZdaQ9yOBX9pHllMc/b6gEqgpKNbVlTRRA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eAHplHh2; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706682353; x=1738218353; h=from:to:cc:subject:date:message-id; bh=Dz+rEBJ1wZtGL4hQOfZUqa80XN/mQMePbBMimQSo/DE=; b=eAHplHh2S9pdRDzjgvzFHshNkiSArFrKroXo7QoWq/B812hZ6r8Z/UwD sabFCxTq56v5R+WcUv2ELz6qFPZf7sxg0eB+f066YRfU0IdP7mHIu57yy Mc1U3emt7Mo/Rk/kbsq9hBaM7ZcMRVcr6JVLNL8zaKW3+6KI6sCF6JimX 7fy5sWQwrIHjcSvWf3gIsHEi1pT9Mc7Izmj3Usuoh33qoWYC2+zxNHoG+ vLu8yFUWT8a05EKxed4Aq4Zislw0nUV2WtNDJkc5+W11qifFIaCHgrkVu xk6sCzv6YdEKUzaPWVId1Vxj70GBMsQcPrznm3JoRUiacWEHobr+jEQM0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="16888137" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="16888137" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:25:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="3939842" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:25:50 -0800 From: Yan Zhao To: arnd@arndb.de, linus.walleij@linaro.org, guoren@kernel.org, bcain@quicinc.com, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, Yan Zhao Subject: [PATCH 0/4] apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 13:51:59 +0800 Message-Id: <20240131055159.2506-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789586290830330514 X-GMAIL-MSGID: 1789586290830330514 This is a tiny fix to pfn_to_virt() for some platforms. The original implementaion of pfn_to_virt() takes PFN instead of PA as the input to macro __va, with PAGE_SHIFT applying to the converted VA, which is not right under most conditions, especially when there's an offset in __va. Yan Zhao (4): asm-generic/page.h: apply page shift to PFN instead of VA in pfn_to_virt csky: apply page shift to PFN instead of VA in pfn_to_virt Hexagon: apply page shift to PFN instead of VA in pfn_to_virt openrisc: apply page shift to PFN instead of VA in pfn_to_virt arch/csky/include/asm/page.h | 2 +- arch/hexagon/include/asm/page.h | 2 +- arch/openrisc/include/asm/page.h | 2 +- include/asm-generic/page.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3 Reviewed-by: Linus Walleij