Message ID | 20240508113419.18620-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 EBC00C04FFE for <linux-mm@archiver.kernel.org>; Wed, 8 May 2024 11:36:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A9026B014E; Wed, 8 May 2024 07:36:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 632366B014F; Wed, 8 May 2024 07:36:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D3646B0150; Wed, 8 May 2024 07:36:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2A01B6B014E for <linux-mm@kvack.org>; Wed, 8 May 2024 07:36:30 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D8E96141465 for <linux-mm@kvack.org>; Wed, 8 May 2024 11:36:29 +0000 (UTC) X-FDA: 82095025698.12.B13501C Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by imf18.hostedemail.com (Postfix) with ESMTP id EF9AD1C000B for <linux-mm@kvack.org>; Wed, 8 May 2024 11:36:27 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=ZkVQwMzY; dmarc=none; spf=pass (imf18.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.221.49 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=1715168188; 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=YjF53pcaj/yGjGTpjAVQTr7MgOlbB8tP76+bW2/H4mKmolq/VvMfcrQhMpWANZ/nj1OSCV TThNYduXLe81jJkwlgjYW3wDfpLwW/GB/pYKXjbKIyIN2kwe2VdQEeKUptn9IXP/nZqle0 WXDjqKa5vMeHfcV7gIqaGV56tKQjvF0= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=ZkVQwMzY; dmarc=none; spf=pass (imf18.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715168188; a=rsa-sha256; cv=none; b=2HLRqoeUBQODC/F5aJb6LdCvcp6s5oHJHmvnxt8SUGUXR+GqkTK1lLtTcmJm6N7OeF7wqN pDns1DeBMmlpN5dvYs3RHe8MbscheKCn0eE3YHCMpYWx3eW61qri6EbxuEhKfGKMm6iJRx PE8Pk6tWTGeiKRZO7R3BtNuG+5GRqaA= Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-34d7a32bdd3so2263735f8f.0 for <linux-mm@kvack.org>; Wed, 08 May 2024 04:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1715168186; x=1715772986; 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=ZkVQwMzYb2OShs4hxPokEjopWEZOnpYLrZPd8QeuaDgPWhdvKJ5ufQDMHUpmXJuJlg 9PoRmQX9IUW8d+lV+sMdIRRbnbcakGlaSM5mCQ4TUCumN9uiPEJd5DgMAx8xVtOzE3mS fg61ibfckRc4+im4LaVOApRJXUo4aRa+6UCUjWeghPin5+bVsv5OLp/IXIWe/7PsXyBn QgsKjoy6vzqIuDYUQcQUlZ5cj8d3OfTj95+GomqT2i5G1DICT1jUNnbKNzAve1L4oL2G yd+LXBiuGi2lnTCUET2MMYN0+DDC6vJhalCUDiIeRXdWSLTzD3MWQDqDoKxhYsjRSpSd LrGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715168186; x=1715772986; 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=lOPhP2WqSbUkEIa1bPP5Ew17/MmI4rTkAeScBjRy7bfrcUWSpukv+FszCCpPKnHBn6 06bRZHQ1oGlVIy/2Y7zYqQWW9XVEVtAbOaqQymKLyQ08/Dm3zNH7Nhk6/e3ybVVDJXrp dylzTCU6hOA+IYE6BtTgdiDL+Kvgmh2+OcNsUjQf8reUeQF/0/amoG1y+Ul9KH3BJsEP jI9f23VFGWuSHO5m+ucBTIcGY0NejomoYfMj1AQ4mCRCOHjgFZufuN+LFq66eZCxFpuV EyB6tdKtjydf9JrHfYe+OWKm8L8RRhprv80LG0WXyf6e1IK2lpE2jPeuu9qq4vePiG/d TuLw== X-Forwarded-Encrypted: i=1; AJvYcCXeujz+KTddTSHH7CeImLDpyS9EO0DYnkIC6cX/KX0PKGUKe1UxiRRkYpU+n2IDoCeX1cTePIEWnlC/lVN9VLfpzMg= X-Gm-Message-State: AOJu0YxvIZJSueRD/vlOxJpi5aOttLUCX23t3V1oA0QRYifTP08qY7jg DVNMmU6QdzqRBocbTGHImZcOIrYyNUWhJpsa2WVSW+BlcG/7H4z/ZsTOHEeO0Gs= X-Google-Smtp-Source: AGHT+IHVO5vcmWKipbJIGDQ+CDJ8RhNP/JYjB5jDnNbYNNxR9pALzbWj/fP/sjh1jhNLJi0qhKSTGw== X-Received: by 2002:a05:6000:508:b0:34c:77bd:2545 with SMTP id ffacd0b85a97d-34fca810737mr1911157f8f.70.1715168186464; Wed, 08 May 2024 04:36:26 -0700 (PDT) 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 dn15-20020a0560000c0f00b0034d9012e74bsm15283014wrb.72.2024.05.08.04.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 04:36:26 -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 RESEND v2 2/9] riscv: Safely remove huge_pte_offset() when manipulating NAPOT ptes Date: Wed, 8 May 2024 13:34:12 +0200 Message-Id: <20240508113419.18620-3-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240508113419.18620-1-alexghiti@rivosinc.com> References: <20240508113419.18620-1-alexghiti@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: EF9AD1C000B X-Stat-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wAGjscbQvk2K8HRzmaW2qnWnjUxhDBbwTqL3fIibkqf54+62eoiYk+kv4nv4vy9XijvlUQV4FtTYnXR1VMUNukcD1388lV/pOgeyEuBDZx94isaS2UBoOqnP6dBrGg/shRLq/R63mld6PA3CRgPrd78Q8khopPy3KgHCuPp69OCnPZMxMO9IUdFsXqDUiRhNwEb2x9ob6UWa9hG6uTJB+eSg9qT1GXNwSK+eZV2auwjqPWk0UpvSgMROaNPnF5BpS8jz6wQok745vOH3q1heY5l41+ne2x+SMDqpTInsce1msV6a+dKvkcQBCEYrZXhB9vbgZIMAspnDePidVAzZzegtKuqCr5yg58h3kBgRgI/4/uEoILr3S/n6kqGsPO6s6qSTPb7+1sjsJ4BOm4iNLd6ic39GHOIl5ImNQPBkAfM7/AxaMWBbhrT+cDkuHP/JeTgQLda8LoyMiATw== 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(-)