Message ID | 20240301091455.246686-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 3CD4AC5475B for <linux-mm@archiver.kernel.org>; Fri, 1 Mar 2024 09:17:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8BCA6B0098; Fri, 1 Mar 2024 04:17:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A14FA6B0099; Fri, 1 Mar 2024 04:17:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BF766B009B; Fri, 1 Mar 2024 04:17:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 752806B0098 for <linux-mm@kvack.org>; Fri, 1 Mar 2024 04:17:17 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 57A6BA190A for <linux-mm@kvack.org>; Fri, 1 Mar 2024 09:17:17 +0000 (UTC) X-FDA: 81847916514.10.15A1801 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf21.hostedemail.com (Postfix) with ESMTP id 7567D1C001B for <linux-mm@kvack.org>; Fri, 1 Mar 2024 09:17:15 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=HGfdlAVE; spf=pass (imf21.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709284635; 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=celeezlUFfnCgdabriQL+vY9x87nEUlib9jbsT9nzg0=; b=kXjMICP40G+JJw+nJZMUQPqwJZrrAqg2zwlk10LHGmA/73C/AgIJy85SbSPmZDKfKbf6Kl 09hJHu51Y7U6h4Ztwtb5ED/mBqmZO4kH5UgQCRPBWBnAYykc9HlLIrW4n2MLGBaIBTm3dN 1fSQBTrVYNArgcWLcDjkpTSIUxZpgFg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709284635; a=rsa-sha256; cv=none; b=ShJ2HpplMEVvCzpBDxvzlzL2GvWXAeWEe6r34tTaPx3EzrIw0m9gzMN2vVgvr6f/grCRoq Cmj3VBVjiSx3R2P33K8Piyso7KH3KzkgLs6O3h/hwX2X4tJRdGMVDgzEFRMP0waV+07hjw xYxf3w1uYBbxopPSRpv09m0A8f4p1Po= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=HGfdlAVE; spf=pass (imf21.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com; dmarc=none Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-412a3371133so13602335e9.2 for <linux-mm@kvack.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=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=celeezlUFfnCgdabriQL+vY9x87nEUlib9jbsT9nzg0=; b=HGfdlAVE1vVjqZs0tqQTqy2MTb8PyUTNhorG8M2l7Mz6z7kZZDUs0tFIz6YqIF/zHB U80oeiGr5NMznF3ehVSE7/v+pKh41vMktkoc8miiR+GaTUgBHwwgpCDzCOGBcQK9U9f8 Cm7Nah9mdPsL36jX7z/kmOVmFFGX4veTvBu4chT7Q3YlVmGT4nW7h3WPDZDgMcYJp7Ss YC3A44ntkQNRcNOkYD1mo0ej51SCwAxV3GvuElwBpg+2Jlm95iOc5yJUVZdDOsHiFlMN TxVOMUOnnlsDFdCyKPJfnlGX3km/AwaGE8KAs0imw72xtHyFD6Viwe6V697ho5TEY2PO /kcg== 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=FVTe1fh1TMB3BRA/1c4SqtwRyLako4Li6qNWILT0hQFV6IifUoeX/sVGIyH4YbtwoN 98SBHhsH/KBT1ekTO75aRuVehZd0w5w/Fta9Pb9/hhspS2r0zeCW0QwOyM5U9t0RgVth xo+2NhM+/b7KKBjAhDfQ/B7Cwu0e3dPEWEnJAkazm6LJAc5QUD62HyvCoPEfT+ozHRkt LwMglMryvE1pBhnyA6YzVORkzPqZcR/T5HXd2gTyX3G9IKVvMXU80qSL4ZKWEocyJH7n NvVwgHPU3Kk+0qoWp8WFBrVKjhibOBiPzeGKC4iilxetCtwjhWG5TWuw5DlphO35YAfO QJAA== X-Forwarded-Encrypted: i=1; AJvYcCXFK6anAVe6eC1erCsAKrEIbNIDdQgeP9ImnJcHYtd5vAcVpHzC5naM1FU2vySJJpT/XMw6FIYPN1yo/hxWMHNyQ0A= X-Gm-Message-State: AOJu0YzBe4qRrJ5M6BvAJ0AWDkVaHp6/RfGlBKrz5Sr8wSaoXsYy4zYB G5f0K9i2DKipoPZABKl89ctaXrdrHfefoU9RF4L0YDNia5pDSFJlJCgR+EfUZY+gDCL9LJKRA82 p X-Google-Smtp-Source: AGHT+IFB0pFFxU/+IPg3Lb+DpLxmFSKXoGv4IrPSAZpcxiUzICaAY8iLg+9vVvkiiGxUNIP5Ue4QKg== 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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: oqkhpsxyiew7ms67z41wfjskey51ciwt X-Rspamd-Server: rspam10 X-Rspam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F2EQiqZYh5JjZD3W1DMtFg86HYW2NPHrShQSEf4e0tDjS6svqCDgc7cGVK8NT369neBY3ky7gk/7iPmFoCOV84df/R6AK5dELx7dl2+yCqrF6KpD9dD9qlFmQU2NZC1KdJzBhJU41aFxK9j+CRx9Ki/F8844E5bCrKER5RZtpLmQMBTM6d0SA+Zmz7pmjISIto+ZLpiT+ab/2dNArF/UeCTBZnIzQbhA6K+CdrAA9yBUyEaz9cRPaUl60mPoNopWcYeHQWtXpU3RyJE1clZe7lsWmObC+Lk7lU197p3Aems5YrYVUPtxinUxboJWy8Cqmld93Nk+Kv1NfaD59Mv6K2nerggZbVP4OU1QuFFOeCxaeRGc78lwnQGqB1Zbb5eAawUVJplDGsjoSbx6WvfxAwU4ChT+hZgqVpu823ug427rSz1g7sqL/vk21kvDEir37Ji03A66YPxpy16oqAohpmmZVrQ== 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 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);
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(-)