Message ID | 20240301091455.246686-3-alexghiti@rivosinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-88159-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp955706dyb; Fri, 1 Mar 2024 01:17:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWka2KLbEYS3yKNkp/r7MNxtXJICZKZ5zsUn5D89B5PyEJSgVuXNB7OSnaCxiCeMLaDGcItUqzEBIzUgFo6cmyNLA7g4A== X-Google-Smtp-Source: AGHT+IHBo7vIfsMFIQ64GPJJstbzdjWh7SqgNwZt3mt64gl5DATAvpe8fBVZufDUNHdbfOTY20Ei X-Received: by 2002:a17:906:e09a:b0:a44:4ab9:9bde with SMTP id gh26-20020a170906e09a00b00a444ab99bdemr833904ejb.67.1709284650363; Fri, 01 Mar 2024 01:17:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709284650; cv=pass; d=google.com; s=arc-20160816; b=UH+WPxknpbvr85ecryBtuV9Vpdx/itWH+ZuOHJ9a6WeyZCe8r8aWPVaFxDZ3G79LjK pPenYFDtRhYvdTZOBrCoAa5kYyJVTO0ToLAb9uraqsI+CFOnsoe/UhLhS+aFHfwwFqhE +7fQixgOUPchwN8peIhDzOIzyQXRttqhPzPvqZ21TsZRAZg8ZrmxVdeaQjpiMHguVBZl BIgO3hh8H+TLFd74AUL0De21oVVlv8b0jzSO/+FR/p00Y0bPx9zC+cusa3LAj/Bwm1SX Hua//e0/tu738zW7cINtuGwMKQAaxUBlROB1iqinHVev+lHtedQ/L6GO4dymxG6dI5+B ltTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=celeezlUFfnCgdabriQL+vY9x87nEUlib9jbsT9nzg0=; fh=vHHWMN1vayDJejSdiXX3+qoOY8wL3B5V/LH/bwmcIFM=; b=J8h2itSwifVf/2fEzUd2bpnTSfU9HNWrQ32DYarPWTQS9pR0dwerG3Q7EyxVvGxOEb RH2QVWfhwaAQXAuqTz/M6WyoO+7nLNr0UiYI4z4YYtKIDHURzpamuxHZWJ3Wkf+uJAI/ fMyp4nyTZTNVl+JJ5/VJpawcZHGab8FlK6VgNsnq7RZnV4r+FkYeyQ4M3XX9hScHd0f2 mKU3qhmEKodveXC8fNheeqF85Mtc1XyglSJIkHcicpVv/5BevpG/GYs/y9Jb4VmXyvrU 7Z6+3G1tQs5APZXtu0O6Gn25wYFm1gFfU9DPtUD+N86IKhSwQiWTuJ6BJWNdthIl9ifz DFgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=D88vBHfu; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-88159-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88159-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gn11-20020a1709070d0b00b00a3f15778a0dsi1296483ejc.1037.2024.03.01.01.17.30 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 01:17:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88159-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=D88vBHfu; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-88159-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88159-ouuuleilei=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id F238F1F22572 for <ouuuleilei@gmail.com>; Fri, 1 Mar 2024 09:17:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 180886A35B; Fri, 1 Mar 2024 09:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="D88vBHfu" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E23926A32B for <linux-kernel@vger.kernel.org>; Fri, 1 Mar 2024 09:17:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709284637; cv=none; b=FVf3TPV75fNtktcWW3uKRXKEHBt+fkxI9XkZqqUEwL8GadUl7UPjGnA8RlMeKGkdh4vEEbXDZjLT8vH0lTI32WizyRVRQvIp793lDrtkbLBWpiKLBqGOfVNzyl2CyuWzSe+vFRVDlGV6J3mNYuhHxKmb7/mZptDgygsWhFYNiOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709284637; c=relaxed/simple; bh=fuD7xzNQmvbDUfKc84q5eANZ/OlUzjddCa7IPcGLM+Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=A7gdKBmoTEDstWPNNzb3/EbR/tCrqhA706RINdwmklR6mEw4WVlgb84xawihLjAGn0tUfM88UhR0uI5smxQAAoVozBPlrOKSVDYwtN8YT8iouVHlNYPdfhgVVEaEcc/59cY1l/veCv/aL3UOr+G90q9N8BgKhvs4gkqkR5tBCXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=D88vBHfu; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-412c3f4c6b9so5408265e9.0 for <linux-kernel@vger.kernel.org>; Fri, 01 Mar 2024 01:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1709284634; x=1709889434; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=celeezlUFfnCgdabriQL+vY9x87nEUlib9jbsT9nzg0=; b=D88vBHfuqkU82KVn1HZ6QnjU7/+Qr0plRkucMAzTdrRDPeTHInZEZ4lou5fdl+6UVS PGGbFQx614obSDwJTuxuiYv2ejwBhLWyHgyidPHdj8Te+rcIqTSTFhyGEXCroa9x/e9u 3VJrHcT/tegbFcjEGWZNRqBXp7mAXx0uYu1vqOxKv+aKmrx05TuLhfgK7aB+6gMVk/nV xqNh8AFZAP9SvSdBk8y3hQxvgP8RFGUYDSFUGhfDVqUeEHp8+XoGtDL9FeUyDFbl+4/5 yl3yO0cq/zhQcscPNoWJfkZvURqsoOa22qPf/B1UrwQgHIH64H7vVtEucnL2SY9VgyCi N7fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709284634; x=1709889434; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=celeezlUFfnCgdabriQL+vY9x87nEUlib9jbsT9nzg0=; b=QrHQLe/jE/cS9jts/ANrVJlxPYNx1aUcP601HoBkw9H7yiYkyG3Y3UHG0UhScIUanU Rt3rlzQFya1+CreQKeqRf3A+yGyZMdnITMRiHEhXU6LX1hyD4HY8wTekMOpP/QelsrYF dgcA35UJAz964IxYxAyFm+6WNA2XwnNITUIroblzzTAk4HhoKx1HOfQs9FWsX5r6rEeg vdMxjzsh+NaQ9ZMiPt3LY6pK0K/3S9YdXY2ibDjb7q7v1e7Yhu8eLt1Szv6dmIYbo3az Yr1hoM8NFfzCQtJihMuoGT0xAy/qeOfx3HjmDUFbp8CoIYKfoTxtkJjS6f1QPkD1L/6I 3DnQ== X-Forwarded-Encrypted: i=1; AJvYcCXpFCbXno4xeXax518+uWSPsxdWFMgHrqJ1xCuSf0DHRC9ugTbb9Dnnu7UFDYyhd39Fq02XewHeaknY8h7Y07w4hfC82ca5odfSFLsW X-Gm-Message-State: AOJu0Yy1R4xj0y/PSWTavc/Pt/K/Wgs5mREBkwFxiegZOOkkS0UNy8N4 oD1Rj+d+nFf06fhTN8dApSGBB1HZHVTUE/TH61ZAh84+F/plbQK0hv7owIXNLaU= X-Received: by 2002:a05:600c:3b26:b0:412:c810:fd18 with SMTP id m38-20020a05600c3b2600b00412c810fd18mr995837wms.18.1709284634158; Fri, 01 Mar 2024 01:17:14 -0800 (PST) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id l33-20020a05600c1d2100b00412ca88537dsm358022wms.0.2024.03.01.01.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 01:17:13 -0800 (PST) From: Alexandre Ghiti <alexghiti@rivosinc.com> To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Ryan Roberts <ryan.roberts@arm.com>, Mark Rutland <mark.rutland@arm.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Andrew Morton <akpm@linux-foundation.org>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mm@kvack.org Cc: Alexandre Ghiti <alexghiti@rivosinc.com> Subject: [PATCH 2/9] riscv: Safely remove huge_pte_offset() when manipulating NAPOT ptes Date: Fri, 1 Mar 2024 10:14:48 +0100 Message-Id: <20240301091455.246686-3-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240301091455.246686-1-alexghiti@rivosinc.com> References: <20240301091455.246686-1-alexghiti@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792314861277161143 X-GMAIL-MSGID: 1792314861277161143 |
Series |
Merge arm64/riscv hugetlbfs contpte support
|
|
Commit Message
Alexandre Ghiti
March 1, 2024, 9:14 a.m. UTC
The pte_t pointer is expected to point to the first entry of the NAPOT
mapping so no need to use huge_pte_offset(), similarly to what is done
in arm64.
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
arch/riscv/mm/hugetlbpage.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c index 3d84fbc5c572..2477d20c1497 100644 --- a/arch/riscv/mm/hugetlbpage.c +++ b/arch/riscv/mm/hugetlbpage.c @@ -274,7 +274,6 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma, return ptep_set_access_flags(vma, addr, ptep, pte, dirty); pte_num = arch_contpte_get_num_contig(ptep, 0, &pgsize); - ptep = huge_pte_offset(mm, addr, pte_num * pgsize); orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num); @@ -319,10 +318,8 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm, } pte_num = arch_contpte_get_num_contig(ptep, 0, &pgsize); - ptep = huge_pte_offset(mm, addr, pte_num * pgsize); orig_pte = get_clear_contig_flush(mm, addr, ptep, pte_num); - orig_pte = pte_wrprotect(orig_pte); set_ptes(mm, addr, ptep, orig_pte, pte_num);