Message ID | 20240508111829.16891-3-alexghiti@rivosinc.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3873FC25B5F for <linux-mm@archiver.kernel.org>; Wed, 8 May 2024 11:20:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C22E66B009D; Wed, 8 May 2024 07:20:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD3CD6B00A9; Wed, 8 May 2024 07:20:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9BE66B00AC; Wed, 8 May 2024 07:20:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8AAA46B009D for <linux-mm@kvack.org>; Wed, 8 May 2024 07:20:42 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3FE2B1C09B0 for <linux-mm@kvack.org>; Wed, 8 May 2024 11:20:42 +0000 (UTC) X-FDA: 82094985924.23.2AA999A Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf07.hostedemail.com (Postfix) with ESMTP id 5A37140011 for <linux-mm@kvack.org>; Wed, 8 May 2024 11:20:40 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=jQpShfqu; dmarc=none; spf=pass (imf07.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715167240; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oM+WuwVvF178uIr+5Dc8IcJyYSbzDoUf3sQGwgQ7LEI=; b=n07FUnf409/GWA+pq6NmLHSVTIWIPxiw5a8UI1CsS0ErmGTX3bNZ8ouGLWiDJtjGFfu+RQ dChlnTosea8aLbzzQSagV+py2dLZB7qmA/FAGm4VScTjIE83JjIswx8Tw9MEALlYSe7Qz5 BgOW9M3gydzuRqzoiugqL6vS5aF72Nk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715167240; a=rsa-sha256; cv=none; b=Go7MQSV9v/6PBoCwLIXIqFyoDZgK9e3dVIROAGR4/5FwiG8RUEd8u+Lo7GHsSxDVi83nFv nZoMCzvdoLzCSc0OAgIKJgAUWhd2+q+tzmPK7YGUebyadHzc/bKGO/Ik61IM5WEqyVWVQx QV3mI507qdTy1ax/A7jy4c/vZ2cvcLo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=jQpShfqu; dmarc=none; spf=pass (imf07.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-41b869326daso28586055e9.0 for <linux-mm@kvack.org>; Wed, 08 May 2024 04:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715167239; x=1715772039; darn=kvack.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=oM+WuwVvF178uIr+5Dc8IcJyYSbzDoUf3sQGwgQ7LEI=; b=jQpShfquj5GTn2UPO3dgwjixSssOdffM/zD4T48Z39tSUrEiPQuV69IZ7rYV5GCsNO 06dqAOD13qjjUw2eWQ5fzm4DHtTZi2ENDTKJVXi1qbwG/YC5usPaqZPaWpYBPCyBNFZs jKYOnNPJShgRegJEPS36RNUYctJoKGj59FCvicS5u15xHizKxGOoCIlhxfBHR0nJXnNq vz/s3STxMe0AMonrq9J+N1Lp6Zi8Zy3APJRs9IP+VsHNxO5aPl43DXFSA2HCrYPncPqt VfvQDgO2Y04RO+ic3KMpFHHb05zx2ByXfqZlRNFRqKfZdGaVHVX4vqJRuVe6Ejjfhk7p kXuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715167239; x=1715772039; 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=oM+WuwVvF178uIr+5Dc8IcJyYSbzDoUf3sQGwgQ7LEI=; b=cb7Q/QsbwOMC9eczX+5SJTgGABxfdQuQGWv8pqciZjo43HMx3n9NrIeDOhfOFM63Dw 0dEakL5KP+0XaaQZ9+0WxF1alb2VNLjGFV+VnP03PtEr6OF9w0oNqQv43QaShTvlmIbj 75FKOlKhNIrvXj4dWrttO+ZV2Nq86c2kuRQX81Pa/rvDgxizjAgbQytwEK1Appi54odV db/IiWBkQhf2GmwcKogcaREOmbiLLzVjwDPQKp+pvzzCry+HYPBNLln0cJVWysBUQC9K 0VA/dt7WWK2BO7P0P9IXNRuzdTnY9PTwFc38JClhbe+P5bIhYevd53oVLd05DFXfRTFG XONg== X-Forwarded-Encrypted: i=1; AJvYcCUIGisYqv/9Y2PEnJCGtafIItBfp0VMMrdqwPPIi4Hd7nvOanFmbjSxpTmBNxNtJCtB0NzrcSPCqZHn8Yxx0Ufvtbc= X-Gm-Message-State: AOJu0Yx9PH1NQdix4kUbmL/QFOUkj4iyvvdhvRPfR8k/nLkQMt8Sr10e ttD6aXLi6LOjXlT5GHxd2a+O1KswbZ3g9WFkS1mEPL2s1btJrB1dEb72dttLy3I= X-Google-Smtp-Source: AGHT+IEtMJJRHnAlx2d7EmAnwEp8LMaoiRtpdi+BWrYkSsfaWBlt5vRm4skQUYamx6SwwnjaoJRU9Q== X-Received: by 2002:a05:600c:1395:b0:41b:e201:eedb with SMTP id 5b1f17b1804b1-41f7269010amr20541325e9.41.1715167238957; Wed, 08 May 2024 04:20:38 -0700 (PDT) Received: from localhost.localdomain (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41f87c254f1sm19678785e9.14.2024.05.08.04.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 04:20:38 -0700 (PDT) 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 v2 2/9] riscv: Safely remove huge_pte_offset() when manipulating NAPOT ptes Date: Wed, 8 May 2024 13:18:22 +0200 Message-Id: <20240508111829.16891-3-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240508111829.16891-1-alexghiti@rivosinc.com> References: <20240508111829.16891-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5A37140011 X-Stat-Signature: iqan8mpqn75im3wtbt1sw3ye4m8ebsck X-Rspam-User: X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zpCIw+NceLXVIUqoR4UizUoxzmpXTxWyn9TPGojASZQ4sS8bqg6E5jLxYuc94SbxkL3om4y2y7jZGrVuHck0qa9hu4DhAVEUVkG38MqvWhvsDfEFsLsMo3koJoIr/KpgjTkshJmvL7ksVVWyfbWVorvgAaG97/9JwyM2Ak0KTxusOyeg269BjkHuNPsAMqbWbTkK6f5JpTvzNidi3qihP8a5/0RsZ4AW8B585KiSjF23ZxudfnabWvNkz/3qPfJ7+b9/exQ43gOuhZifbGXw31PSiLMum1/PSVXGLyo2/THVgh8Zhe+GSGD98ynSZYa6ry8psp/rq/hzZ2ZkJknKGzJEyCr+wmWHuEm6iTIAFkgOYAvQxNDPuIU0IVJX9NaoM1i6jDwcypFA85gf13VDWwybC6PJHQFmO41WiE4FePyrLffXhSw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Merge arm64/riscv hugetlbfs contpte support
|
expand
|
diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c index fe8067ee71b4..f042f5c8bdb7 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);
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(-)