Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1305867imm; Wed, 10 Oct 2018 12:20:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV63SmtrnYlDfUeI1jj+Tq3V1LtZnNNnWqPc6x7vZykc24+oaaT7E6X2bBGfHZYOmTySVrZOw X-Received: by 2002:a17:902:be01:: with SMTP id r1-v6mr278990pls.143.1539199246980; Wed, 10 Oct 2018 12:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539199246; cv=none; d=google.com; s=arc-20160816; b=dbynEE/bfvKHbm+/sS2PgfswkGq0osdsPpS3T+Nw1m7AgnRMuG/xbJuqW7UAebC864 uFgIL7sEUntqd5Bbvg+3KjjgHWbrXGs+nXo6B5VCm9Gr0aTy+uFuboQ8fBjaXydMc0KF iw5o6Cl5PUjYZ+gHVJRaYTk+kAAgZgKjmHQzjYLhpDXkk3cDmwYdzXNtQrxPOgy6Y6rW KD8CfuNMrYArcL345zIJZ2E15+F0RpDAlIN4cNvrzb0O/XCN2NY2A/QU5gmWeampk56R 7XAA37mMOqQcwmF4oWD9p6ZmpIh/ONBUcNvI/9Z0NG2K2zS9vpA113PDPfHs0V7wNzp9 CPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=avL0yVyyGmG9lD2qDm/egAoOKdIR8VZqXdzDwquWtkk=; b=SzenELhPlrlClzglce82P465sNJ9jyaMDi7w/5ODyg+CENsAU+ZpDYLcOhKQYoqLab Sh87ZN4UD/bxQ86qPRd20ijiqnNPbTLcbTt8gNtmZSOIdilg6wbIYRl9nR6TakR9AycM FOqLDOTiPLP59ToAeoVwRxyORChdeFeOcbeFZFtSMMN07b6Sa5rDjkF6NKD1Xdiiv0Nn QN9ipivS+iPUdFuYKxfpFE3Y+eUqUKTHJ0B4OEFNfBzLCoReSCXgvWubWOE0vxM7FCLG q7GYtPepJuGNVYY+F4835qPuJ8iwSiNMwo03V4y7uirHglb8U+YPR3K7/GuLXFBdwVoR T0uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=VUdPWg0Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb6-v6si4659373plb.175.2018.10.10.12.20.31; Wed, 10 Oct 2018 12:20:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=VUdPWg0Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbeJKCnc (ORCPT + 99 others); Wed, 10 Oct 2018 22:43:32 -0400 Received: from mail.efficios.com ([167.114.142.138]:60850 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbeJKCnc (ORCPT ); Wed, 10 Oct 2018 22:43:32 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 53342183B08; Wed, 10 Oct 2018 15:19:58 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id umeA5F604wE5; Wed, 10 Oct 2018 15:19:57 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 89394183B04; Wed, 10 Oct 2018 15:19:57 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 89394183B04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1539199197; bh=avL0yVyyGmG9lD2qDm/egAoOKdIR8VZqXdzDwquWtkk=; h=From:To:Date:Message-Id:MIME-Version; b=VUdPWg0ZD9JL6hrLESP15q8JuPRPAIH26BKRPUaw+Mai+wTGuq51tD+arDEuVJ5y1 z3zYQmoMJ93/SsaWdHRLQZNrxT/bFFaNUdbIbf2yRLgFiIVa7MYfXX5bGq+l2P6kxS Mg2/7n48KtpPZfICvVvEjSl7x2L85QzA55XFUxZ3F8tibBGrqjPXtnruLNb6RiQsWN dS8MeHt05+Eu6++q/9IlYcr9oofXP21hBeh4o/9Kn2qmLFVNk7lSdUpRmo/ZHFgCIn dHvlUpmztmxhsJu4ZO1lWtwIbve+iHv5EqQ+K+CehZx2sZ4BjAb58qZcUtwmxJ1pn2 NecB1ZT4BfLug== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id PKK1HMOKqWSQ; Wed, 10 Oct 2018 15:19:57 -0400 (EDT) Received: from thinkos.internal.efficios.com (192-222-157-41.qc.cable.ebox.net [192.222.157.41]) by mail.efficios.com (Postfix) with ESMTPSA id F0021183AFF; Wed, 10 Oct 2018 15:19:55 -0400 (EDT) From: Mathieu Desnoyers To: Peter Zijlstra , "Paul E . McKenney" , Boqun Feng Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Thomas Gleixner , Andy Lutomirski , Dave Watson , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H . Peter Anvin" , Andi Kleen , Chris Lameter , Ben Maurer , Steven Rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Joel Fernandes , Mathieu Desnoyers Subject: [RFC PATCH for 4.21 00/16] rseq updates, new cpu_opv system call Date: Wed, 10 Oct 2018 15:19:20 -0400 Message-Id: <20181010191936.7495-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Considering it's already late in the 4.19 rc cycle, I'm submitting this patchset as RFC for 4.21 to give everyone plenty of time to provide feedback. This series contain: - rseq selftests (this could be 4.20 material): - Added reference counter within user-space __rseq_abi structure, for integration of rseq application/libraries with future use by glibc, - Adapt number of threads to the number of online cpus. - cpu_opv (4.21 material): - Implement push_task_to_cpu() (scheduler), - Introduce vm_map_user_ram()/vm_unmap_user_ram() (mm), - Provide is_vma_noncached() (mm), - Introduce cpu_opv system call, with vmap space limiting, - Wire up cpu_opv on x86, powerpc, arm, - Provide cpu_opv selftests. The cpu_opv system call covers the use-cases that rseq does not handle, namely single-stepping with debuggers, moving data between per-cpu data structures without interfering with cpu affinity masks, and using rseq from signal handlers nested between thread creation and rseq registration by glibc, or between rseq unregistration by glibc and thread teardown. Thanks, Mathieu Mathieu Desnoyers (16): rseq/selftests: Add reference counter to coexist with glibc rseq/selftests: Adapt number of threads to the number of detected cpus sched: Implement push_task_to_cpu (v2) mm: Introduce vm_map_user_ram, vm_unmap_user_ram mm: Provide is_vma_noncached cpu_opv: Provide cpu_opv system call (v8) cpu_opv: limit amount of virtual address space used by cpu_opv x86: Wire up cpu_opv system call powerpc: Wire up cpu_opv system call arm: Wire up cpu_opv system call cpu-opv/selftests: Provide cpu-op library cpu-opv/selftests: Provide basic test cpu-opv/selftests: Provide percpu_op API cpu-opv/selftests: Provide basic percpu ops test cpu-opv/selftests: Provide parametrized tests cpu-opv/selftests: Provide Makefile, scripts, gitignore MAINTAINERS | 8 + arch/arm/tools/syscall.tbl | 1 + arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.h | 1 + arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + include/linux/mm.h | 24 + include/linux/syscalls.h | 3 + include/linux/vmalloc.h | 4 + include/uapi/linux/cpu_opv.h | 114 ++ init/Kconfig | 17 + kernel/Makefile | 1 + kernel/cpu_opv.c | 1190 ++++++++++++++= +++ kernel/sched/core.c | 42 + kernel/sched/sched.h | 9 + kernel/sys_ni.c | 1 + kernel/sysctl.c | 15 + mm/vmalloc.c | 64 + tools/testing/selftests/Makefile | 1 + tools/testing/selftests/cpu-opv/.gitignore | 6 + tools/testing/selftests/cpu-opv/Makefile | 39 + .../testing/selftests/cpu-opv/basic_cpu_opv_test.c | 1362 ++++++++++++++= ++++++ .../selftests/cpu-opv/basic_percpu_ops_test.c | 295 +++++ tools/testing/selftests/cpu-opv/cpu-op.c | 353 +++++ tools/testing/selftests/cpu-opv/cpu-op.h | 42 + tools/testing/selftests/cpu-opv/param_test.c | 1187 ++++++++++++++= +++ tools/testing/selftests/cpu-opv/percpu-op.h | 151 +++ tools/testing/selftests/cpu-opv/run_param_test.sh | 134 ++ tools/testing/selftests/rseq/rseq.c | 32 +- tools/testing/selftests/rseq/run_param_test.sh | 7 +- 30 files changed, 5096 insertions(+), 10 deletions(-) create mode 100644 include/uapi/linux/cpu_opv.h create mode 100644 kernel/cpu_opv.c create mode 100644 tools/testing/selftests/cpu-opv/.gitignore create mode 100644 tools/testing/selftests/cpu-opv/Makefile create mode 100644 tools/testing/selftests/cpu-opv/basic_cpu_opv_test.c create mode 100644 tools/testing/selftests/cpu-opv/basic_percpu_ops_test= .c create mode 100644 tools/testing/selftests/cpu-opv/cpu-op.c create mode 100644 tools/testing/selftests/cpu-opv/cpu-op.h create mode 100644 tools/testing/selftests/cpu-opv/param_test.c create mode 100644 tools/testing/selftests/cpu-opv/percpu-op.h create mode 100755 tools/testing/selftests/cpu-opv/run_param_test.sh --=20 2.11.0