Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7206301rdb; Wed, 3 Jan 2024 08:01:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeZk5pwDii0Cp/rHeFR0wV4KtJeuDKEiffsG4AT7Y0Dze1TaGjzstB6coYeYTNAXwLdapj X-Received: by 2002:a05:6a20:2446:b0:198:f146:b2da with SMTP id t6-20020a056a20244600b00198f146b2damr514740pzc.93.1704297659941; Wed, 03 Jan 2024 08:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704297659; cv=none; d=google.com; s=arc-20160816; b=revn0ZqQXYFjwXaBcsv1IITtzjEMsep/2VO0o4lNFZH61rfTcx9mQLFwviAUOOSMus WUkYanLjEqUa1Td4WXX2pWz72dxcnpsgBWmbCqnnWEDKM2BEr0VAcFKP24qtnCxkDa8d ZSvslAmYqw7JYWNzZvWB3PEKBf/iDBn3rn7wRVdtITAxSi4EXn/org8mFDAd6phKuLnw Ma29fXC04MhreMZiLAV8kedQql35yxwlEWA0p3s+dW2OwaZoeYlOva+gvxwZ0azbHC1h +DwxFBdNHo410mSykSvpjwaiabw2wBKTLkS45OycVm1323zeER/XI7d0+X3FJtkXaPaq L/Rg== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from:dkim-signature; bh=kntl/nAgkMTrS0b6uVdfD+vMpj63I1IJoYMsR9G9+XQ=; fh=eBmKK8cc9weSPBuHTqRRSad+J3mMZA8jBAg7hzQqtjA=; b=LY5LSNhwJEf8hxqD3DHIkVcz+M5MY+glNrrPVdHkPm1iEqoEyN4+PpyCOw9E2FCk3i 849yXoj2frUX6VWn7n0SDUX7dTguLC6utDzbF1GKKoPkjT34mVxuF8rzEW8KBBARHmuZ N/cg00gFPKuFU7Ow++73R9pBvLLjn7ce9vMx2LFhrIcVitn1cJIiQAurG+cv8bYmhFqT Pk+5Cc+lzqgzW+SsPF3kLdnoGbnzea6abiME2m1Ca3hK3syoEeh/OcahSr1ld0HeeynL Qi7ibCJkSqO0J2eipXa9IhhabnYj3Ej6zC2nKUjClnZoYgrt8/bP2Zlxbsj49kgDeFS7 lNBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fTvmohkT; spf=pass (google.com: domain of linux-kernel+bounces-15722-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15722-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j19-20020a635953000000b005893a7c438esi22132384pgm.689.2024.01.03.08.00.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 08:00:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15722-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fTvmohkT; spf=pass (google.com: domain of linux-kernel+bounces-15722-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15722-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9845F2863FB for ; Wed, 3 Jan 2024 16:00:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D42B1B28C; Wed, 3 Jan 2024 16:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fTvmohkT" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 6BDF11B27B for ; Wed, 3 Jan 2024 16:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704297650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kntl/nAgkMTrS0b6uVdfD+vMpj63I1IJoYMsR9G9+XQ=; b=fTvmohkT27M9sZw0hhTut1xP5PGfQE+wpIaIBeTzUiyqH3yGd2LgwviBMsRX6VtqxEmxOc 3h6fgGvs6alUyUd7WzBwNIT0VpQDc74knxTlCIyYBiYQT+Q1tfdY0zDuWN1ebNNmcty1nc FTXTNgIAQPNdcRzP1YXFPpDuVohPme4= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-bcQ_eT6XNmSPz8nYL4ORrQ-1; Wed, 03 Jan 2024 11:00:48 -0500 X-MC-Unique: bcQ_eT6XNmSPz8nYL4ORrQ-1 Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-28cb44ab1cbso2250209a91.3 for ; Wed, 03 Jan 2024 08:00:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704297647; x=1704902447; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kntl/nAgkMTrS0b6uVdfD+vMpj63I1IJoYMsR9G9+XQ=; b=d8IzJmYuJ26CeXaIDM8VkCXudVSJ/Y8VjvFpzqAR73WTlGWc2C3loywixorxOA3E/u EqiEUJW2NHFBP+p/Nsu7uZvQ5vW5BI4WcWRUGcs3kI1ih7KLjah+c+g86UGL+yQy/5sz 8VvXVbkJ8IawfNsFG6z4w9zFatIR70gIdBXbjVfLXMqIWqSoJiXTy3cv41PlDqqgo5Lf P1M2DpZMKEgPtvyLC5ab1qw8EnROtiTRaZ4VgHI1wTeLwyYDDdYdAhToWWXYFjO5wKTI 1oKSUyNz6WgVaERJiDMNhPJV8CVKdljGYh7b0F2jq5bvaoctpJ92oKAIvCRhx5JE6mKv x0aA== X-Gm-Message-State: AOJu0YwJ+6uTi1I1fcZswkLxdbo47woQmkIxuAmv3PtJwxSEIvE0qo1N wYysTAZxTJnW8bR83GL/JQNaWePX9t5bLE671GhFdaT/411agFW4vRPwnVXTg8unRM2wWJ0/GfP Tc8ao0KeXYzZT1wMmeSyiWp9LPD1B+aZq X-Received: by 2002:a17:90a:8904:b0:28a:cbce:71ab with SMTP id u4-20020a17090a890400b0028acbce71abmr6468977pjn.13.1704297647430; Wed, 03 Jan 2024 08:00:47 -0800 (PST) X-Received: by 2002:a17:90a:8904:b0:28a:cbce:71ab with SMTP id u4-20020a17090a890400b0028acbce71abmr6468965pjn.13.1704297647085; Wed, 03 Jan 2024 08:00:47 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7ec:911:6911:ca60:846:eb46]) by smtp.gmail.com with ESMTPSA id qc8-20020a17090b288800b0028b1fce7c01sm1922253pjb.37.2024.01.03.08.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 08:00:46 -0800 (PST) From: Leonardo Bras To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Eric Biederman , Kees Cook , Oleg Nesterov , Leonardo Bras , Guo Ren , Andy Chiu , Conor Dooley , Xiao Wang , Vincent Chen , Charlie Jenkins , Greg Ungerer , Andrew Morton , Kemeng Shi , Alexandre Ghiti , David Hildenbrand , "Matthew Wilcox (Oracle)" , Qinglin Pan , Greentime Hu , Baoquan He , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v1 0/5] riscv: Introduce compat-mode helpers & improve arch_get_mmap_end() Date: Wed, 3 Jan 2024 13:00:18 -0300 Message-ID: <20240103160024.70305-2-leobras@redhat.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit I just saw the opportunity of optimizing the helper is_compat_task() by introducing a compile-time test, and it made possible to remove some #ifdef's without any loss of performance. I also saw the possibility of removing the direct check of task flags from general code, and concentrated it in asm/compat.h by creating a few more helpers, which in the end helped optimize code. arch_get_mmap_end() just got a simple improvement and some extra docs. Changes since RFC: - Fused with other patchset: Improve arch_get_mmap_end() macro - Renamed from "Introduce & Optimize compat-mode helpers" Leonardo Bras (5): riscv: Improve arch_get_mmap_end() macro riscv: Replace direct thread flag check with is_compat_task() riscv: add compile-time test into is_compat_task() riscv: Introduce is_compat_thread() into compat.h riscv: Introduce set_compat_task() in asm/compat.h arch/riscv/include/asm/compat.h | 19 +++++++++++++++++++ arch/riscv/include/asm/elf.h | 11 ++--------- arch/riscv/include/asm/pgtable.h | 8 +------- arch/riscv/include/asm/processor.h | 16 +++++++++++----- arch/riscv/kernel/ptrace.c | 6 +++--- 5 files changed, 36 insertions(+), 24 deletions(-) base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a -- 2.43.0