From patchwork Thu Mar 19 09:26:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446923 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27BC01893 for ; Thu, 19 Mar 2020 09:30:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07F7320663 for ; Thu, 19 Mar 2020 09:30:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07F7320663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErVM-0004tt-4Q for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:30:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40915) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRx-0005Os-3i for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRv-0004Dt-Qb for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:49 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:46993) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRv-0004DI-HN for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:47 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M2Plu-1jHbXC338g-003s6h; Thu, 19 Mar 2020 10:26:32 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 01/16] target/i386: Renumber EXCP_SYSCALL Date: Thu, 19 Mar 2020 10:26:12 +0100 Message-Id: <20200319092627.51487-2-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:9HGTExg1wp02cp06LD11V11vWuFuKKYKX4/OK/2gXe1DIZUeoGB 20EERSaCpdqUGqmvoEI5Nh5SyjIg8L4mhrZdeCIPbKwI0Gjf19qkV3gN8tOT217QI8tqxR3 MacyWqyWWr2GP5UJBX2xKsgRjrw38DMnopCE2YVUrzxFd00Bwslcqgs4z28yAgPgh5D6klV sXCa+/K/tg4hnwL+oOVug== X-UI-Out-Filterresults: notjunk:1;V03:K0:FxU1ZPEB50I=:lLs9ykG/SKh10TtpeQvga9 3xc1ZjDSd4JD+c3LflwyHlBinrIL5T6zhC5+ZGG7uLmZFmZr/YnUo5vbVFbQJk1CzTAQW5CTv 2Rn/d8Y0A5hACnDVozwIopGFM5gufBtkiE27zhACx2v5URIjm4KjE/OnRb1pdyVAcvC4xoWNk btPGaIkXL9427j8aGW5Z+MVLRhihd5cgWMkPiZONIkFgsc3QdtXIzSL9omyjJduqIdeQXFGk2 XIizD/E4HdLXyMiNUG46VJ3yz2Av80fFz+Cs959Enrj6ULIQHYk4kZ4Cp6p82qyEK68Y5mAFh lXcjLd29krXI0H37ThxBSgB0bKzrl2HplqhR8P0Cn05YQdhnlLqEJQpynKPbIp/LZvKT99DbX 43k3b8nFui0DpGIO5NQlcbb8KrYzo43aJuFbutLTpiSK8LtWIGeKoVp4ejSqL0dS7DCGfWIsw i26GpZWy+uPcJhKqFydpDtgPJL0mHwYOAHWsel71O7vTmgCG41TtERbuW+371dmhZ1nLQO9px jXOeMxum8EUVdq5nXilxQSnRZp+9rOed0GNc3AMb7pEKRfa/wInerLKRr2YRDba0WM61/nRVV 4jm2nluxpbw4bv3OpYVcCYa3dKQgaPiWRxxPDZY77y1P24L2F1KxoIEMmdWY4wp7W0EySqMvR lZKzuUegDFnFeRDTflaGc4m1Eid3t0YQbG4FJtu4Ti5bLYSGHnr/Wd420yHpOtqHbCZmyFcbS v5GF98txBhFvB9kQBelwEKOil+1WMfkHUFglKDmh3wcmlIX+fjulWOrwWxKAg+/7MCNUqqlO9 e1ih0MTZinmNs9JfnMBBalqCB1vXcGQZXbPvUSvK3lP45qGLrTJ1tG0PyK0EEptEy+N7jEv X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Riku Voipio , Richard Henderson , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We are not short of numbers for EXCP_*. There is no need to confuse things by having EXCP_VMEXIT and EXCP_SYSCALL overlap, even though the former is only used for system mode and the latter is only used for user mode. Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/i386/cpu.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 576f309bbfc8..08b4422f36bd 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -999,9 +999,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define EXCP11_ALGN 17 #define EXCP12_MCHK 18 -#define EXCP_SYSCALL 0x100 /* only happens in user only emulation - for syscall instruction */ -#define EXCP_VMEXIT 0x100 +#define EXCP_VMEXIT 0x100 /* only for system emulation */ +#define EXCP_SYSCALL 0x101 /* only for user emulation */ /* i386-specific interrupt pending bits. */ #define CPU_INTERRUPT_POLL CPU_INTERRUPT_TGT_EXT_1 From patchwork Thu Mar 19 09:26:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446939 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21C1714B4 for ; Thu, 19 Mar 2020 09:32:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 026C220663 for ; Thu, 19 Mar 2020 09:32:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 026C220663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErXf-0000GC-2m for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:32:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40944) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRy-0005QJ-26 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRw-0004EV-Du for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:49 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:51571) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRw-0004DR-4x for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mth79-1jZ8Q21ls7-00v9Ha; Thu, 19 Mar 2020 10:26:33 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 02/16] linux-user/i386: Split out gen_signal Date: Thu, 19 Mar 2020 10:26:13 +0100 Message-Id: <20200319092627.51487-3-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Jo0Z5G9FVg3jJZgoxBWz3muaUTKrn2C79oThQC79xGBX9ZzU5vD sl7a07mQeF+whjDliZZ3OGM0oB2LWTxvhJ0YJ95IiTuG9X8SxRS3PZjqVedRXwleF2HIr4T 01PXr/dLGELE4NyVuaHZahbL7u4djtmA2eWpcR8RejTe+SxfVJiQlr4KoiLzj7kevZG5rWK cGXHWrPUzTHX8365X0/pA== X-UI-Out-Filterresults: notjunk:1;V03:K0:JfugAy3XM0Y=:G69lrxU3U3YcdUVFgjFWDC sN70aZ1ihMyPfrhBlMrz9O1n2/oXm9nTcYgAbalD5emeVcEkvXtXLAMZpDGCmJPRquUUWBr55 dWVsJ1AQ7+PxiiypqJAH67s+2kKM2CabtJv3RiueyJWuKwxkkV5qkmoD+U5J4pNiGbov5ehUO Ehv3tBC/w6Sx1PcoMwa/8MIPckLLQJMqogBycdgLaVmyrSn0s3Onb2UFnLw6Ujs3XGzwwxHFy Cgw6V734nf5J2N32jNSi23LPnC7gzVZh2LDnG+r29ktpI4DspnOzkKRMS3AV60BMsvYNbLTMM OK2utjcpfkPmpQc+Nh1Ibg1U+IOZoMXfWEShl7aZACIh2yWWzSYzil6OGcE+Wf4HXRxllTsZO E3GDeiC0e1fAsvNIt6RwX+UUyjIY+qQRGnQ/q7YuX3akAjnew+54kpviTIhfZMCHkuCafLHZ3 xItJjnxAubGSjRL6RxBaquHFcdLOtq7PGe/6O4dHoPt2ydVIxj7PrXxtq6k0I6ksMxspF1o9m ANl86/s42cNz37IWGkjJrT+GPPLOCYv3mTPxhGPpLY+tFi7ei5X+7udunQs8C/Sp2ydyd+EhX sNpxattLo11b90jRKjw+VEXyokRbX69wb/eqI1NluLHnmthQNfy0hoRd8bIMgcTB2hIEB+2Lb KSvVUUOi83s4O7EUhxija9uWq9sI6FuZvqG5RxTf6s2fa1P/IFLhFsrGi8NiQiMc8xl9mxu2y t8oSBwEw/nmWswZMatbWQBfPVKS1jaQONehET9j6AcZ26XwG3+tt+g91khOJg4AcBV0NBM79A VjQ5wJelN3rWvtxQW1PJgeCkVJocvUAeqOWZLsMRUVMZwLV1BZFqLs7jMgvjd+jkeAMaZbZ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Riku Voipio , Richard Henderson , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This is a bit tidier than open-coding the 5 lines necessary to initialize the target_siginfo_t. In addition, this zeros the remaining bytes of the target_siginfo_t, rather than passing in garbage. Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/i386/cpu_loop.c | 93 ++++++++++++++------------------------ 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index 024b6f4d588c..e217cca5ee1e 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -81,13 +81,23 @@ static void set_idt(int n, unsigned int dpl) } #endif +static void gen_signal(CPUX86State *env, int sig, int code, abi_ptr addr) +{ + target_siginfo_t info = { + .si_signo = sig, + .si_code = code, + ._sifields._sigfault._addr = addr + }; + + queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); +} + void cpu_loop(CPUX86State *env) { CPUState *cs = env_cpu(env); int trapnr; abi_ulong pc; abi_ulong ret; - target_siginfo_t info; for(;;) { cpu_exec_start(cs); @@ -134,70 +144,45 @@ void cpu_loop(CPUX86State *env) #endif case EXCP0B_NOSEG: case EXCP0C_STACK: - info.si_signo = TARGET_SIGBUS; - info.si_errno = 0; - info.si_code = TARGET_SI_KERNEL; - info._sifields._sigfault._addr = 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + gen_signal(env, TARGET_SIGBUS, TARGET_SI_KERNEL, 0); break; case EXCP0D_GPF: /* XXX: potential problem if ABI32 */ #ifndef TARGET_X86_64 if (env->eflags & VM_MASK) { handle_vm86_fault(env); - } else -#endif - { - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SI_KERNEL; - info._sifields._sigfault._addr = 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + break; } +#endif + gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); break; case EXCP0E_PAGE: - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - if (!(env->error_code & 1)) - info.si_code = TARGET_SEGV_MAPERR; - else - info.si_code = TARGET_SEGV_ACCERR; - info._sifields._sigfault._addr = env->cr[2]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + gen_signal(env, TARGET_SIGSEGV, + (env->error_code & 1 ? + TARGET_SEGV_ACCERR : TARGET_SEGV_MAPERR), + env->cr[2]); break; case EXCP00_DIVZ: #ifndef TARGET_X86_64 if (env->eflags & VM_MASK) { handle_vm86_trap(env, trapnr); - } else -#endif - { - /* division by zero */ - info.si_signo = TARGET_SIGFPE; - info.si_errno = 0; - info.si_code = TARGET_FPE_INTDIV; - info._sifields._sigfault._addr = env->eip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + break; } +#endif + gen_signal(env, TARGET_SIGFPE, TARGET_FPE_INTDIV, env->eip); break; case EXCP01_DB: case EXCP03_INT3: #ifndef TARGET_X86_64 if (env->eflags & VM_MASK) { handle_vm86_trap(env, trapnr); - } else + break; + } #endif - { - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - if (trapnr == EXCP01_DB) { - info.si_code = TARGET_TRAP_BRKPT; - info._sifields._sigfault._addr = env->eip; - } else { - info.si_code = TARGET_SI_KERNEL; - info._sifields._sigfault._addr = 0; - } - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + if (trapnr == EXCP01_DB) { + gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->eip); + } else { + gen_signal(env, TARGET_SIGTRAP, TARGET_SI_KERNEL, 0); } break; case EXCP04_INTO: @@ -205,31 +190,19 @@ void cpu_loop(CPUX86State *env) #ifndef TARGET_X86_64 if (env->eflags & VM_MASK) { handle_vm86_trap(env, trapnr); - } else -#endif - { - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SI_KERNEL; - info._sifields._sigfault._addr = 0; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + break; } +#endif + gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); break; case EXCP06_ILLOP: - info.si_signo = TARGET_SIGILL; - info.si_errno = 0; - info.si_code = TARGET_ILL_ILLOPN; - info._sifields._sigfault._addr = env->eip; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + gen_signal(env, TARGET_SIGILL, TARGET_ILL_ILLOPN, env->eip); break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; case EXCP_DEBUG: - info.si_signo = TARGET_SIGTRAP; - info.si_errno = 0; - info.si_code = TARGET_TRAP_BRKPT; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + gen_signal(env, TARGET_SIGTRAP, TARGET_TRAP_BRKPT, 0); break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); From patchwork Thu Mar 19 09:26:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88C9213B1 for ; Thu, 19 Mar 2020 09:27:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 663F120753 for ; Thu, 19 Mar 2020 09:27:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 663F120753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErSY-0006w2-Hz for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:27:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40820) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRq-0005DH-Mn for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRp-000488-8V for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:42 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:59829) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRo-00044i-VO for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:41 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mpkwn-1jdy0F05yX-00q9MK; Thu, 19 Mar 2020 10:26:34 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 03/16] linux-user/i386: Emulate x86_64 vsyscalls Date: Thu, 19 Mar 2020 10:26:14 +0100 Message-Id: <20200319092627.51487-4-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:nZQ3FBqNzQhrqOP5mWCt76B83fNEBxa51x7BfenTNo8DnmjVtP3 b0VqPquMvR2xeck7/JTVcMELFL25GO/+HFvkb95+cjNjHKMBuOD+760U/AodcAlqAMZnS56 VEBueio5q2kGiHeuWuXobzaMMWu+3HRyBIc/bddEZ8xL90/jmXKGSXYZE5+tFjvaO1zOY14 1JnwCbhRsWNc/WBrbMXCg== X-UI-Out-Filterresults: notjunk:1;V03:K0:GlgdFC3RNPE=:H4zz2fdGY1sZOV9p3v9HiU c3zyAwE5Ths8NQ/01/StHVdJmi7FZYFls8HjHGLKHNILx/NkzlxlwiNGjzRjCtWY9DEpGmsUE JV91X9S3J6QhEKnHbDqFsj6RoyY4eeIOufeUfW7cHBwUi6lNOPo7ysdN9M7R/69LZZ1HNi1Ps tx54Oh5sze/ASaIPElVLs3qsAvkrpRNsFSZwJW5suY6p7L0bitwCO6uKqYM/X/s3YoM0HyrRK fpOnYVhTpY0f3WwFPp7/P3gHM5dwTok8QUECQUTcNGy3ukxAqtIx3lw4YEsjfvnTkjbZOmuF7 eREaxHMLLRGbR9MTDu2BR8aZTsituxAB9+EraxRntFF7U5Eij+s2Ir/bhWm++usQWk6gkUfLR HgN35wS/iMk8IQkMh7qk8ylH668uOXMrvUU/zzGXxZrnHrtjaz7aqBv1EmO9jQwEO9t/Rsmz8 e2ylCs/501bdNs25Hnoq7ZG6Y/27qvdrzF68nhBquKNAUdqXQNJcFBkH3f+OybiUkgqDR8Gjr u37fJOCgOuL+YBtAeL3bS3cj7nz83t6dBUXylGYiAdw50CF+lwXIK0w8jFQ76l7AGaEzxpkSB M/Aq0nkcpnB9VZ8gS7YNdN3HHxh1x5DXhtLPxDsERubpscFOpPdcfGmqfi+7k2pB5QZbNv/Jj QtQ4Ptc1AdXeGfkybEvY6wxPhTWA58pfqy+/ru9OCceQuRznhdCCyhafuvJp4avdbcEsWpFNz 0+aP2JkFN53y84Wv37lDQq2QWUCshoW5nFriyZY6RLBna1IDaDD0u6nIop1IF9InP1gGBiiE2 hW3TTdkLdEatrhnna3c8Oa8AF3G9/jqFw5w7egBITKik+mBC1ASZRFtYF3ltyKiRkNJ8gTS X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Notice the magic page during translate, much like we already do for the arm32 commpage. At runtime, raise an exception to return cpu_loop for emulation. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/i386/cpu_loop.c | 108 +++++++++++++++++++++++++++++++++++++ target/i386/cpu.h | 7 +++ target/i386/translate.c | 14 ++++- 3 files changed, 128 insertions(+), 1 deletion(-) diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index e217cca5ee1e..70cde417e605 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -92,6 +92,109 @@ static void gen_signal(CPUX86State *env, int sig, int code, abi_ptr addr) queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); } +#ifdef TARGET_X86_64 +static bool write_ok_or_segv(CPUX86State *env, abi_ptr addr, size_t len) +{ + /* + * For all the vsyscalls, NULL means "don't write anything" not + * "write it at address 0". + */ + if (addr == 0 || access_ok(VERIFY_WRITE, addr, len)) { + return true; + } + + env->error_code = PG_ERROR_W_MASK | PG_ERROR_U_MASK; + gen_signal(env, TARGET_SIGSEGV, TARGET_SEGV_MAPERR, addr); + return false; +} + +/* + * Since v3.1, the kernel traps and emulates the vsyscall page. + * Entry points other than the official generate SIGSEGV. + */ +static void emulate_vsyscall(CPUX86State *env) +{ + int syscall; + abi_ulong ret; + uint64_t caller; + + /* + * Validate the entry point. We have already validated the page + * during translation to get here; now verify the offset. + */ + switch (env->eip & ~TARGET_PAGE_MASK) { + case 0x000: + syscall = TARGET_NR_gettimeofday; + break; + case 0x400: + syscall = TARGET_NR_time; + break; + case 0x800: + syscall = TARGET_NR_getcpu; + break; + default: + goto sigsegv; + } + + /* + * Validate the return address. + * Note that the kernel treats this the same as an invalid entry point. + */ + if (get_user_u64(caller, env->regs[R_ESP])) { + goto sigsegv; + } + + /* + * Validate the the pointer arguments. + */ + switch (syscall) { + case TARGET_NR_gettimeofday: + if (!write_ok_or_segv(env, env->regs[R_EDI], + sizeof(struct target_timeval)) || + !write_ok_or_segv(env, env->regs[R_ESI], + sizeof(struct target_timezone))) { + return; + } + break; + case TARGET_NR_time: + if (!write_ok_or_segv(env, env->regs[R_EDI], sizeof(abi_long))) { + return; + } + break; + case TARGET_NR_getcpu: + if (!write_ok_or_segv(env, env->regs[R_EDI], sizeof(uint32_t)) || + !write_ok_or_segv(env, env->regs[R_ESI], sizeof(uint32_t))) { + return; + } + break; + default: + g_assert_not_reached(); + } + + /* + * Perform the syscall. None of the vsyscalls should need restarting. + */ + ret = do_syscall(env, syscall, env->regs[R_EDI], env->regs[R_ESI], + env->regs[R_EDX], env->regs[10], env->regs[8], + env->regs[9], 0, 0); + g_assert(ret != -TARGET_ERESTARTSYS); + g_assert(ret != -TARGET_QEMU_ESIGRETURN); + if (ret == -TARGET_EFAULT) { + goto sigsegv; + } + env->regs[R_EAX] = ret; + + /* Emulate a ret instruction to leave the vsyscall page. */ + env->eip = caller; + env->regs[R_ESP] += 8; + return; + + sigsegv: + /* Like force_sig(SIGSEGV). */ + gen_signal(env, TARGET_SIGSEGV, TARGET_SI_KERNEL, 0); +} +#endif + void cpu_loop(CPUX86State *env) { CPUState *cs = env_cpu(env); @@ -141,6 +244,11 @@ void cpu_loop(CPUX86State *env) env->regs[R_EAX] = ret; } break; +#endif +#ifdef TARGET_X86_64 + case EXCP_VSYSCALL: + emulate_vsyscall(env); + break; #endif case EXCP0B_NOSEG: case EXCP0C_STACK: diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 08b4422f36bd..39be555db3da 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1001,6 +1001,7 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define EXCP_VMEXIT 0x100 /* only for system emulation */ #define EXCP_SYSCALL 0x101 /* only for user emulation */ +#define EXCP_VSYSCALL 0x102 /* only for user emulation */ /* i386-specific interrupt pending bits. */ #define CPU_INTERRUPT_POLL CPU_INTERRUPT_TGT_EXT_1 @@ -2215,4 +2216,10 @@ static inline bool hyperv_feat_enabled(X86CPU *cpu, int feat) return !!(cpu->hyperv_features & BIT(feat)); } +#if defined(TARGET_X86_64) && \ + defined(CONFIG_USER_ONLY) && \ + defined(CONFIG_LINUX) +# define TARGET_VSYSCALL_PAGE (UINT64_C(-10) << 20) +#endif + #endif /* I386_CPU_H */ diff --git a/target/i386/translate.c b/target/i386/translate.c index d9af8f4078b3..5e5dbb41b0ce 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -8555,7 +8555,19 @@ static bool i386_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu, static void i386_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); - target_ulong pc_next = disas_insn(dc, cpu); + target_ulong pc_next; + +#ifdef TARGET_VSYSCALL_PAGE + /* + * Detect entry into the vsyscall page and invoke the syscall. + */ + if ((dc->base.pc_next & TARGET_PAGE_MASK) == TARGET_VSYSCALL_PAGE) { + gen_exception(dc, EXCP_VSYSCALL, dc->base.pc_next); + return; + } +#endif + + pc_next = disas_insn(dc, cpu); if (dc->tf || (dc->base.tb->flags & HF_INHIBIT_IRQ_MASK)) { /* if single step mode, we generate only one instruction and From patchwork Thu Mar 19 09:26:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 240B313B1 for ; Thu, 19 Mar 2020 09:27:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0428B20753 for ; Thu, 19 Mar 2020 09:27:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0428B20753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErSS-0006gu-Tt for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:27:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40786) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRn-0005Cr-Qu for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRm-0003zC-QF for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:39 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:41479) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jErRm-0003uH-Hi for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:38 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MzkK9-1jRyUF2MV7-00vghs; Thu, 19 Mar 2020 10:26:34 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 04/16] linux-user: Add x86_64 vsyscall page to /proc/self/maps Date: Thu, 19 Mar 2020 10:26:15 +0100 Message-Id: <20200319092627.51487-5-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Sgje0iFrVPMb2dQMJ0RAnWbHBX/NKwa72+1hEXPBC8ZRpsF/lQz JJLjCn6KXzrrmrh5Cko64vSzRlCqZOh0n0NAlkViYBO9kErl5adXYgAoyhBHFZbpi2ddG5r UFQNEjAWhrcFmg/V1Hw1jG6CAmAYO6ErR+h6N6HeE5ZnkbCeEAV7au4ZUo8ssbmTrSQe3V4 mgpK+5fhFMFCbr1bjd4Sg== X-UI-Out-Filterresults: notjunk:1;V03:K0:/yUYey2NAI0=:qu1ieyKu6NOSvSU4dgJKDo KTQjX48b3F19iNScHWMHer67nlD6XUTXzlLoow6Gx1F/3DvYr8pMcZ3cwQK8aiNmM0JIfXm1w 8CXA8/gvKPpDPc20Ti+voNvo0ip/02WFUKKwzhDshyk5nufBVYFF+RH4aQZMv/6mtJy5W2lvS hKCWC2w375FZW8HG2DbtzrYX5FUpkm8ieeu/Yt1rjkks1KFl+lMOCSfg5lyzbz/BG/rvtlaPQ 82nVaj7gAHfzCrlm6yDY/fEqxW3Mv0NSiNP24isrPV0nOTTZHuZLQJTdUzQRzIUltijTcT2Nd Wy/02PzXUWy9g1ChSqOB/iXJ7AFZnCIWdKjTL/M2gP40B/71lygWlS8sA5EUXmmZ00vJtDWnD 28Ppq/3zNbxmNxiGIfTLUx2MdBqlDim5vMP5G3OEfqOp6hAcWrRzCXpVtj5BTUiKfKAA2vdx/ RuQMMOoAOvPHzE8OsFMh8Q1CUYtlNEZstj1lpq9Xc4rowWViCHPloqRd2/C+ciAhtMd0DLWJx iZOBN6Syovhh8Ge1ZStv3FmtKU3YjLQtgWy9dUCNAo6CVVfLER6eguCc3KOjjcvZyEztcfc2V LwGUXm98U7aLBeXwevXcEOmGV6vCkfTxydOgpgMzKge8Ly1Ym5gmOzayPZnNGX5c8C7SmtMGQ pQ24SWP0q7Qpi6OecPiieJfWiSg7DIHKE6rQfHCVtXYcrE/Xjapty5j6QL0NmKk3ewj4I3VI9 g2hUxg6omzCrodLxCGwvjhuJk54wjtJF8hjS+mUWA5+PsVe2L5alBfU47DrseFJtZ9s53akN1 UB7KEjEEQFxNrY8Y9r+eYk9TucU1KKNDSC1Io71fcKiXwOB/rMBwOv4W3iZi8dsV2K/Evbn X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The page isn't (necessarily) present in the host /proc/self/maps, and even if it might be it isn't present in page_flags, and even if it was it might not have the same set of page permissions. The easiest thing to do, particularly when it comes to the "[vsyscall]" note at the end of line, is to special case it. Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-5-richard.henderson@linaro.org> [lv: remove trailing whitespace] Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8d27d1080752..5479d67a10be 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7079,6 +7079,16 @@ static int open_self_maps(void *cpu_env, int fd) } } +#ifdef TARGET_VSYSCALL_PAGE + /* + * We only support execution from the vsyscall page. + * This is as if CONFIG_LEGACY_VSYSCALL_XONLY=y from v5.3. + */ + dprintf(fd, TARGET_FMT_lx "-" TARGET_FMT_lx + " --xp 00000000 00:00 0 [vsyscall]\n", + TARGET_VSYSCALL_PAGE, TARGET_VSYSCALL_PAGE + TARGET_PAGE_SIZE); +#endif + free(line); fclose(fp); From patchwork Thu Mar 19 09:26:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 163FC14B4 for ; Thu, 19 Mar 2020 09:29:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB50320753 for ; Thu, 19 Mar 2020 09:29:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB50320753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErU7-0002BK-3h for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:29:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40875) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRv-0005MQ-MY for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRu-0004D2-Gj for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:47 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:40723) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRu-0004Ce-7I for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:46 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mw9oq-1jXlmB0qrU-00s8TV; Thu, 19 Mar 2020 10:26:35 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 05/16] linux-user: Flush out implementation of gettimeofday Date: Thu, 19 Mar 2020 10:26:16 +0100 Message-Id: <20200319092627.51487-6-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:A1gRnY8zWnzS4FbXY6sw/gIdS9rOUf6PKVl0Fh7zabe1Ojordm3 j5Gv34XV1xEmN61PjkE9sUVX8be70NciUyXyGotX6s1PoGezB9kfMmIuYKO4kcJcjC93ABb GNd7QHnldbAve6Zg36G7ZJqMhaBFy6A+QGDBR5D9CqnxPGKRsxTMBXnh7xspkh/aZjpHgyG ozv8bXJw4Tg+7S/FFOMAQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:eDuNZpO6p+w=:BkUi6WE3VEQf4xndonIecB 6XV0ZGNdHbWo1ocLy3J7d3hqL7h2UOQc7zLv4YP6i7XprYj+vKPSsYw93ORm+8WsmQIbNtT16 P+TTaVrO8a2Ojfy7Qh8VSKD/T/ROvb5K+CCRm4iX9ASuidnx9dC1DQdzS2V+VcgSwHVl+QJ82 wefAwIif8qHNerL2JRkck24XBmMjOVi0JO7UDom9W/XzzlWOamDeNI/CiP3y5zWWXDi2hKX4n hcj3H+DOB7E+JvcpxcYZU5aqRIDI6cl0LCYAU1YI+xMXLZmxmuwFpPSAiYcHp4RhUv/tPd+Qi Inf9B5Z82SkgSGr77+1sgp+qL8l//JyFB7c/K33RUuwZW3HNYjcOzW0Tpc4XzaHb4Mh2Jr8v5 TEp6I9/L2gG5QDI97ERhlkjy0AYvYYcwzokM34UqFHImRVbxjD3gg7VMlHKCu1LI5mGQoU6h6 DdVFC9OeMNKm8LhwqcAa1lQ1d90/GgwdiI5ZSSAepc2enkQxztB2uhD4umszWDYFQwxPdIdQO 3A4uK62KQ2YlcAdSVBfWFf545hm9ccqsQrKXp8b9CTW1iu6MJmogDKDy74aYqNyS2qfsE6I6B H8NmBIgazIMDgy8w5H69huIHUraBaAY05sCg/QTeApH7xKC+LvPu7Dh/qPG5cb0wO/AOeSDvS BAt1kLV87z+wENJgSmw85tlWCDuG64WmIzXgXlLkHfRsdXRZk7Oyc8+6ohZ8m42x71JWByRzD QKBBHdA9GrEccxXbJpW4FPO9mTR8K1JeUWVKs6WoQhtTomVcScFZlNWIwD9YPMirun3nDF9aR JO1ZaVN/7q3loOZ2ha8CREiFYWbuYnohsv66v3FAHchCDrmIgkVprr85qikrxouWhMKgP7J X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Riku Voipio , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The first argument, timeval, is allowed to be NULL. The second argument, timezone, was missing. While its use is deprecated, it is still present in the syscall. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5479d67a10be..811495c3a0bc 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1228,6 +1228,23 @@ static inline abi_long host_to_target_timespec64(abi_ulong target_addr, return 0; } +static inline abi_long copy_to_user_timezone(abi_ulong target_tz_addr, + struct timezone *tz) +{ + struct target_timezone *target_tz; + + if (!lock_user_struct(VERIFY_WRITE, target_tz, target_tz_addr, 1)) { + return -TARGET_EFAULT; + } + + __put_user(tz->tz_minuteswest, &target_tz->tz_minuteswest); + __put_user(tz->tz_dsttime, &target_tz->tz_dsttime); + + unlock_user_struct(target_tz, target_tz_addr, 1); + + return 0; +} + static inline abi_long copy_from_user_timezone(struct timezone *tz, abi_ulong target_tz_addr) { @@ -8642,10 +8659,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, case TARGET_NR_gettimeofday: { struct timeval tv; - ret = get_errno(gettimeofday(&tv, NULL)); + struct timezone tz; + + ret = get_errno(gettimeofday(&tv, &tz)); if (!is_error(ret)) { - if (copy_to_user_timeval(arg1, &tv)) + if (arg1 && copy_to_user_timeval(arg1, &tv)) { return -TARGET_EFAULT; + } + if (arg2 && copy_to_user_timezone(arg2, &tz)) { + return -TARGET_EFAULT; + } } } return ret; From patchwork Thu Mar 19 09:26:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446907 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4382114B4 for ; Thu, 19 Mar 2020 09:27:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2354020753 for ; Thu, 19 Mar 2020 09:27:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2354020753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErSg-00079d-9A for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:27:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRv-0005MD-Hj for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRu-0004D8-H3 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:47 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:39709) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRu-0004Ch-7o for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:46 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MdwRi-1jokQf2xF8-00b143; Thu, 19 Mar 2020 10:26:35 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 06/16] linux-user: Add AT_EXECFN auxval Date: Thu, 19 Mar 2020 10:26:17 +0100 Message-Id: <20200319092627.51487-7-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:3xiK71eCnLP9OVwnkNfXqn1RhykFYo0OKb+RbwyTZRLRs+4jXSj zihILX19+8MzJbkP8mKelVuVPlqLFCr6VoP9U6J0QvRndfxpHEZIUnHooZVtuPcU6IZ6bTH yMZMAJLzt1JsnyOF6Kmj0dm8JprQRQkiqLJKPWDzHLaQKQXFyN04bo8fNk10WJ0jJOPw2so rPq+OZqnBlIBbvMif9zvA== X-UI-Out-Filterresults: notjunk:1;V03:K0:WsIW9bez7L4=:DocxGW5Ac1Z5JsB5KUTcoz ld4AjfpMESzpi7bf2GikzEWH+GYeHwT0bSHykI9DvTrLusoVK0pMtnV6OhXTuxa/XMGGjixzG /6sDFZiiLbIL+NoU6K/w48oYuFFlRDKN7GTeNp6/ku8o80VXrB+GwmDltjqZhyYRgKYREOhyP MCVyysUwfVJjN7kg38RN+0Z2vuYYZoOifAPZA/crPy0LZ1VLcJ24PXm+0Cg6dauwxRv49PjrY R6lvKC5AzZIof6GYkSXm89t/RfVRKTeXM6Hsg+ylmviC/E5wjY5UrZQNX97+kWPmHKd/TJlur JdEK2Q9Oca8Tn+2mJ/cHjXgbS54ed7aREwlwlAsaEnAEoxFOGk3ywZxQKnqQq8m8ZYsIHONfP WU5IX8w4zmv5j2bbTBqws//s2OpB6933ahQ4lAgsUbGSJpi73Cuv0afw+nH/j+ZQzfow1KOcz Vd+tg5r8PlRYlfJx5x+b1hT18wRh3fa0nfAiGyv/6vgErrHSbX9IZXlnEpwqnVM+Fn+unerVL ApYsdofO0Lh8HtAqt8Gag86dBM9f13rHIpENP4Ez0w+oxknOOv4UbK2hQMsSw/GwGgNmBfZL3 wTRxAIJC93G4h2RcFO8sAf6kYnfKMADqpNjWE3tDnIFqPqS0SthrucOtN9fQow9O7/eswi4FF VnM8145VOOD1+OQ/6sNiT0/tGPSiOO3cL1Xuz/f3ce5dYiDwX8lPw10InYdxIhgaabwavDhld Vec0D3bzB9c+ocPGCrnxxldIc3UdEgwzxsScPbLqvmIqD34TZg/j/73bkEakU/vzbI8rviSo/ jxJRbW4xmtcb34S9dGcn9thkjegWdPyZKRz14YzFHZ/pfLBzMA/3PdjCgRDskGdgp7lMuY4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , Lirong Yuan Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Lirong Yuan This change adds the support for AT_EXECFN auxval. Signed-off-by: Lirong Yuan Reviewed-by: Laurent Vivier Message-Id: <20200302193153.66415-1-yuanzi@google.com> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index db748c58775f..8198be044604 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1573,7 +1573,7 @@ struct exec ~(abi_ulong)(TARGET_ELF_EXEC_PAGESIZE-1)) #define TARGET_ELF_PAGEOFFSET(_v) ((_v) & (TARGET_ELF_EXEC_PAGESIZE-1)) -#define DLINFO_ITEMS 15 +#define DLINFO_ITEMS 16 static inline void memcpy_fromfs(void * to, const void * from, unsigned long n) { @@ -2037,6 +2037,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, NEW_AUX_ENT(AT_CLKTCK, (abi_ulong) sysconf(_SC_CLK_TCK)); NEW_AUX_ENT(AT_RANDOM, (abi_ulong) u_rand_bytes); NEW_AUX_ENT(AT_SECURE, (abi_ulong) qemu_getauxval(AT_SECURE)); + NEW_AUX_ENT(AT_EXECFN, info->file_string); #ifdef ELF_HWCAP2 NEW_AUX_ENT(AT_HWCAP2, (abi_ulong) ELF_HWCAP2); From patchwork Thu Mar 19 09:26:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A67413B1 for ; Thu, 19 Mar 2020 09:28:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A23120757 for ; Thu, 19 Mar 2020 09:28:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A23120757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErTs-0001cW-Ac for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:28:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40800) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRo-0005Cw-Pg for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRn-00043Z-Pr for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:40 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:37157) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jErRn-0003zU-H7 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:39 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1McZfZ-1jrDX714V3-00cvwS; Thu, 19 Mar 2020 10:26:36 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 07/16] linux-user: do prlimit selectively Date: Thu, 19 Mar 2020 10:26:18 +0100 Message-Id: <20200319092627.51487-8-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:rNWNRgLphq1+tfycTpE6pfTbHrdBb7OgawwDi5sc66TjRBIsEHh cQOxF7RlCXjGUNa1UxxofphRkVUc7NicCDMcNGtDZGLZKmjLfz96f6tqsLqN9XvZ4Bh21JQ ZwGv5D0i4xr1/d1DeQeZjHVbags0OhRB/HBwNACdwVWmC3ECEWLaSO4bWME8Bub9JxA+46q 72oV1py5fEJm/dbisLVKA== X-UI-Out-Filterresults: notjunk:1;V03:K0:KOVr46hHLfw=:Q5ocxgyiKCGl33lpHGkJRF NE+awer5gjCNnPgr7JDRx5l14a5xYkSTadwA5/7yySF0/msUvbxhIIVQ6oPEMoq3npEKnyLuQ g+0PteqzOlej7meneDJXIMG9HitxmTnxQ4yx39WknyWPrA9GpHc67y8h/G2jFg0LvpRCz2BIe EZ2aqWKFOI+85OCDs6zO3VeaixQRNzQ8vn291sjvBmkAFPV/eHIV5egYO0E3hz8MuTffptrdf xoVHASTUxMEPH7TJJ4puyX4WlONP1APxrLR+3+ccwnb9sVviLDl8IImpHnK5r7li5DpX7coRc 6U+ey3vdkrpjUUPNF1SwdyiKoy1dowSA7X2W9WkFYdfjZyDjZixnQLeq7c1tEqgPorTj376gK 0p3UkE/A2TZBydWAu87gYY1kqnoQr5/JRBCzSw0DBpAdqyxWQO938PJw65u+MXL+XUd7/iXKM 3qClhrVVQD9SIoqQqFDKKMexoEkdiyDZrnMlB+nYzJqBZj+neeEOVlXgqk84S532x6Be7CiNT 3xCTlBudkPl1mEKtaVNYyRhgJHuP41XcUt92KOVUTPusFZnABCQZxJZQypAPzmKUG72k0mgvJ k56DwvF6culRd0G5oZ0klXLeozQwAUT1cRkAqlWlQUQIhz6mZoAh+Ti3ytdK9Rz0Wn7J+u7gR OiATUHd0gmpleiaCAoTpuKkDZPWfjXQYslifHV01DR0M7yHzRL5RuUgCRCnyirpJRNVztZgA5 TIchcgx1KIoISAkpzc8G6ERMzXIhCwsV8oEvx/fNRqB/ufSCur2ZbxJLhmrahnMF/TiTFUWYe IhyO1hhE0y7ibzGy0+8Uk2YKP4WrGZEo3+u42g+KSSWZZ6yvxY8M2lPUZjgwSuA2ZFrfNTe X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , Tobias Koch Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Tobias Koch Analogous to what commit 5dfa88f7 did for setrlimit, this commit selectively ignores limits for memory-related resources in prlimit64 calls. This is to prevent too restrictive limits from causing QEMU itself to malfunction. Signed-off-by: Tobias Koch Reviewed-by: Laurent Vivier Message-Id: <20200305202400.27574-1-tobias.koch@nonterra.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 811495c3a0bc..be676c3a4fb4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11904,7 +11904,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, struct target_rlimit64 *target_rnew, *target_rold; struct host_rlimit64 rnew, rold, *rnewp = 0; int resource = target_to_host_resource(arg2); - if (arg3) { + + if (arg3 && (resource != RLIMIT_AS && + resource != RLIMIT_DATA && + resource != RLIMIT_STACK)) { if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) { return -TARGET_EFAULT; } From patchwork Thu Mar 19 09:26:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 361C914B4 for ; Thu, 19 Mar 2020 09:27:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15C8E20754 for ; Thu, 19 Mar 2020 09:27:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15C8E20754 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErSi-0007EH-59 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:27:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40910) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRw-0005OR-UE for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRv-0004De-Lh for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:42449) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRv-0004DF-CS for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:47 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mae7u-1jppp83Dcw-00c6Sh; Thu, 19 Mar 2020 10:26:36 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 08/16] linux-user: fix socket() strace Date: Thu, 19 Mar 2020 10:26:19 +0100 Message-Id: <20200319092627.51487-9-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:T0Pw2XAbqF+FRnv5/5E+PLfpIAGQ/mjGE631hQ6KfqEOPaXO2Bo mzgHfPnLrtAYJEFW1X4vch5ewYklfLAgjDId7u6k/5MZia3Dj+AcGQyMk5hZIXYFyTaLigz BwajaeeB6AmD6kr27Ru3w6USZ82uCQ2dewjPiO+UHIbFZK6+3sFbNqVHqZjVl+k0pSqPgwH 7QFDVq0F8HoU+YpT5+dew== X-UI-Out-Filterresults: notjunk:1;V03:K0:CyOx+EHhtSU=:sr4B/5yQ6VXdbApVpeyTTM 9O26ZtUXxUr+T9uQWC+wUH3GRmFzjoraHWFuzYzCjeUayOo0MGa3/owd6S9NNC7fyaW4eOvoW cmSZVGhRztE4Saq2P76DzZoyvvUo17b8YefyB3ch6Qwvtvyjvvkk5YopxIcP5mSmr7Zjv2Oqe H12c/v3VF3czFtL/q5wmFVfiW0YaydcSL1vICiwXz+eFUwUVNME0km69vJH70VjCZWWnuz6/e jgbHbzeP2FD8uvRnnqFTR4/LV+hggQNFh6PeHiyF+ejxGB8pTuqh2uZoRY8kwBGmiCBFImlp4 KXn+UgU46kwFUwAIu70V+IbHadcVN1Oxl4wyMywEo/6cx/X9WxJPoeKMykthQFjLorp45sVbK E6sj233ruPcjL5PKa5QphuAR1VuKvAd9nX6oNG1fnNfGFLm1T5bfqktUP7q/XgHj9/pQKoOJ1 +6VQ6MU8p2jEhbwEXPq6eVNx/rdWf0FeJOYjdHhsLb+yRu77tmLci7vBidZmuliDVKME3YbmY Nq9m0W+NOH6HJ9UMmQsBzcH4kYIU7HEmP58pNHKG46YdMz3bZSBrBt9RfM/v8jgGyi/UDnyfp WDagEgAvesaFHvHBJN5HNeJ/jSvS+HkMnB/qe5Z+tOsWK3fz2EKswB7dFywVNQ1qO9wVfyPLI f2gFIgwmkCTnBeX8OgimgbIsreN6+mARU+j2dY191xhoua3MEir8HYLYNM1+9pFfLHSkwLCQY Qwvp4Ik3llYqWHxE8KjMMNIy9vErkG3KJ7k+92e9fso4IeMEXF4aJRcA4R/PnFBnppgzwCZzC wLn5TrjZocGOVu1a6/QsHNHhwH1JL2Z/ixBeXvEznHxANdo78eGfsZC+lS9RD2OCZljRegL X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" print_socket_type() doesn't manage flags and the correct type cannot be displayed Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200312165530.53450-1-laurent@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 4f7130b2ff63..69232f7e27b8 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -444,7 +444,7 @@ print_socket_domain(int domain) static void print_socket_type(int type) { - switch (type) { + switch (type & TARGET_SOCK_TYPE_MASK) { case TARGET_SOCK_DGRAM: qemu_log("SOCK_DGRAM"); break; @@ -464,6 +464,12 @@ print_socket_type(int type) qemu_log("SOCK_PACKET"); break; } + if (type & TARGET_SOCK_CLOEXEC) { + qemu_log("|SOCK_CLOEXEC"); + } + if (type & TARGET_SOCK_NONBLOCK) { + qemu_log("|SOCK_NONBLOCK"); + } } static void From patchwork Thu Mar 19 09:26:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 489E01864 for ; Thu, 19 Mar 2020 09:30:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 279FB20663 for ; Thu, 19 Mar 2020 09:30:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 279FB20663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErVf-0005LK-94 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:30:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40873) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRv-0005MP-MG for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRu-0004Cx-GW for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:47 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:35299) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRu-0004Cd-7J for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:46 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MF2YC-1j3nlt19fk-00FR61; Thu, 19 Mar 2020 10:26:37 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 09/16] linux-user: Update TASK_UNMAPPED_BASE for aarch64 Date: Thu, 19 Mar 2020 10:26:20 +0100 Message-Id: <20200319092627.51487-10-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:IGmL+8UbZ90+Uaal3vT715lrRDQg8cicjsPVKzzM+5RAfBrIlwk ZFA6FnWqFJr3XFs87rlYYnQkFx6lWyIKJU4sN7AO0ON/k3qYdi1tn0qnBhAbg6xHkqZwvsx U5nxJVB7nioyX164RSdLY49JLCR7vqwYlhQugYo7yr0xInmk/i1MS+TT8q2QIf3NL7dVCi/ 56CzJJoysDgp4lTxisamQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:IyHZQ8bPvPg=:peOn06G944QaknQMFfiKd1 tiF3R9njNTSBXuz8TW1JHRIKR/4y0WLQLoXsnSf9Uu5lNhJICXIqslbQbID9X7ozlfRu7Ayjh cmj6ihS7gkv8slj7xhkGs1BuskMA6YJo2x/rx9nWleXBpzq3DcrwKfZHGLj7dCbReSZTBKoha zaQ/9YVhppNodjTiPXBvTShS1YrZEpUIAGnSU0DSccG0jOgz1O9xigByMiF1cFefAp1nRCTre lZ0iTJK+Px7J7UAyF7XfawcFEOrvkLk4awkBS/x82HQcVZyLL6PkFHe85OLOBB+ud1SxsflCp 6EXMzImdtAu++kUau2Y57SO6QD63Qtox6KovvtyffYk8aPXABRT4zVckzW4S0EQd8St18hwg7 hkzY3OTyfeIwTvB2bkGVSQhYxirDZVmkHcbraI/KOswY4QRzUDSMWvkeSMad2DDehxKr+tiBi IFpcmFn+Gr4dJL+LpbxyxHQdTQlRfOQuCxOzjPywLG5iRlOD//yNmU79yrpAc6KjCet/EWBan 47eh2B4mNkI223OksViW1T4HX1lPnELsf3c5KkTAfnCVvCsygePc3B5dTUmI/9yL1JAhMQpet nodNWLwzVYzUqNdG2NlbojF/uDTyJDtBc22mVZSEoDhHQTG1cXv7gXFAz1NOFv7V9kY/Bryt0 umlToiwzt2XajxvLkEjzvq1P3DNRYSzNMC7XRQdyB1OhCnbiv0DuulLNZidsVQNdIFMvGtEP8 2Sg7Thw7vykA61UVQ2DAbWBb42smcztja1jTAjgqAC22hCIRnOgruTyf0pdmo00CtkZ2vQ8Vl uCLXBWEAITKYDHJaQVSxdVY+AvZHGm1Cae2ZKE1jvV1wkFBboB3OM/ghOOmtCvM0JfKWkMW X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , Lirong Yuan Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Lirong Yuan This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms: https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_platform.h Signed-off-by: Lirong Yuan Reviewed-by: Laurent Vivier Message-Id: <20200313002813.3857-1-yuanzi@google.com> Signed-off-by: Laurent Vivier --- linux-user/mmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 8685f02e7e90..e37803379747 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -184,7 +184,11 @@ static int mmap_frag(abi_ulong real_start, } #if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64 +#ifdef TARGET_AARCH64 +# define TASK_UNMAPPED_BASE 0x5500000000 +#else # define TASK_UNMAPPED_BASE (1ul << 38) +#endif #else # define TASK_UNMAPPED_BASE 0x40000000 #endif From patchwork Thu Mar 19 09:26:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446931 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8F08913 for ; Thu, 19 Mar 2020 09:30:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B88DF20663 for ; Thu, 19 Mar 2020 09:30:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B88DF20663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErVt-0005tG-Po for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:30:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40981) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErS0-0005VC-6b for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRx-0004FQ-Cm for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:52 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:35973) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRx-0004ER-2T for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:49 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M91Tq-1jAzpj40HO-0063xX; Thu, 19 Mar 2020 10:26:38 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 10/16] linux-user: Protect more syscalls Date: Thu, 19 Mar 2020 10:26:21 +0100 Message-Id: <20200319092627.51487-11-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:JWO/hTcjNc79nqn5uCye3/2GkvCs3ofTGo2CJTv6DfNKsyp7c3q atkWsQz2LW0udhV1efV9xxuB6JQlLsBIk5yOBKxU6Zqs5/hL1o0+OFyKRUDRwx7f0aTjtop uftAx6EQPbaCWXDiqnQsSUdjBWB5TChfJrdIxPnu+5qQN25TnUpl/xMXQN/fahMJCKcLeys Erf6Cn0hDDim95lfKJVlA== X-UI-Out-Filterresults: notjunk:1;V03:K0:izPB/Mrth70=:js0t43xeWKvxWDNezEoAIG HXjQgmhY5JA+DWl3bpC3EfDq70+5fGhTi4Kv9bZwWS8QtylOfZh/SIaV+oh5Q2Ji4Q4qnRT3m T64MJDb3Ja4R5kQISj1So+qxrXZLcNDNpcWotggOpJWe4w1mmCSaOjzwCtF99HMnlkR2qAEbD VQa+F8f1ipBMyoV7hKm1vyFGMuOK0+DFWAPfxkoAfHtXYX5JxCZsEICnerDkr8Y8eOuW/3yjb 9tpOMnNxbsHeHJwCo/lCtdsqG+x1O35DlPEvpaAUJ4J/s25lQEKww+ECq+O5zs4DZYWB+bhGD pTehX8hto6Iynh5G7EUPVd4WH+hcKKhk+G2sbzLDLsDETPYuHHzUIAj5Vo3Oh9oOJTzvkSva5 C6qT8sZC74BybrgLlmespWpBNUnNfaQVp5gQkT9XiiZv65llPrlOycj+Rc6vYzueWreHFUHDc pRS0KliLmxUZXQKk8XHGyAN0g+OX5TpvJxQRhNzLTDH6uR8XPf1AX8SJe9jW5y1mrAlp8pc9z BnSGOV9KKYEaYm302fNaVRf647AxEEhgIs0sf5JKCCzP7h53RR3ckBASQ/udDY1rRtYoZkb5t c2LboNhEfewdYPNNrq2iF8FHXq1r+zx/UVnP8yaByF4cI4UwJS3FxZCFpOvdrCxD2xLKMAyPP dCcEqWiv1Kl9Zjk/J0ne42RJaXVfT7OsoGHUeW0MNPA7/o7F0l3XJROPOQmjsb9BDJIEbU5ZN qO+1VZ5AZGKKzYy032rE49UQognznSGlUXBG7wjAg40x/k2p++hdF9hYOojCd7VBIU9q2cPU1 7+n0k3nS7zRUuGSDS2JHzqN8z9AW6TzBjg/qz9d8xrHGdFcddbt8BnL5AOp1i/V1KpFhCvX X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis New y2038 safe 32-bit architectures (like RISC-V) don't support old syscalls with a 32-bit time_t. The kernel defines new *_time64 versions of these syscalls. Add some more #ifdefs to syscall.c in linux-user to allow us to compile without these old syscalls. Signed-off-by: Alistair Francis Reviewed-by: Laurent Vivier Message-Id: <9ffc3cc6226756895157f16622be5f6edfa2aee6.1584051142.git.alistair.francis@wdc.com> [lv: guard copy_to_user_timezone() with TARGET_NR_gettimeofday] Signed-off-by: Laurent Vivier --- linux-user/strace.c | 2 ++ linux-user/syscall.c | 70 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 69232f7e27b8..0d9095c674f4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -781,6 +781,7 @@ print_syscall_ret_newselect(const struct syscallname *name, abi_long ret) #define TARGET_TIME_OOP 3 /* leap second in progress */ #define TARGET_TIME_WAIT 4 /* leap second has occurred */ #define TARGET_TIME_ERROR 5 /* clock not synchronized */ +#ifdef TARGET_NR_adjtimex static void print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret) { @@ -819,6 +820,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret) qemu_log("\n"); } +#endif UNUSED static struct flags access_flags[] = { FLAG_GENERIC(F_OK), diff --git a/linux-user/syscall.c b/linux-user/syscall.c index be676c3a4fb4..ea1c84dc5de5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -742,21 +742,30 @@ safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count) safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count) safe_syscall4(int, openat, int, dirfd, const char *, pathname, \ int, flags, mode_t, mode) +#if defined(TARGET_NR_wait4) || defined(TARGET_NR_waitpid) safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \ struct rusage *, rusage) +#endif safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \ int, options, struct rusage *, rusage) safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp) +#if defined(TARGET_NR_select) || defined(TARGET_NR__newselect) || \ + defined(TARGET_NR_pselect6) safe_syscall6(int, pselect6, int, nfds, fd_set *, readfds, fd_set *, writefds, \ fd_set *, exceptfds, struct timespec *, timeout, void *, sig) +#endif +#if defined(TARGET_NR_ppoll) || defined(TARGET_NR_poll) safe_syscall5(int, ppoll, struct pollfd *, ufds, unsigned int, nfds, struct timespec *, tsp, const sigset_t *, sigmask, size_t, sigsetsize) +#endif safe_syscall6(int, epoll_pwait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout, const sigset_t *, sigmask, size_t, sigsetsize) +#ifdef TARGET_NR_futex safe_syscall6(int,futex,int *,uaddr,int,op,int,val, \ const struct timespec *,timeout,int *,uaddr2,int,val3) +#endif safe_syscall2(int, rt_sigsuspend, sigset_t *, newset, size_t, sigsetsize) safe_syscall2(int, kill, pid_t, pid, int, sig) safe_syscall2(int, tkill, int, tid, int, sig) @@ -776,12 +785,16 @@ safe_syscall6(ssize_t, recvfrom, int, fd, void *, buf, size_t, len, safe_syscall3(ssize_t, sendmsg, int, fd, const struct msghdr *, msg, int, flags) safe_syscall3(ssize_t, recvmsg, int, fd, struct msghdr *, msg, int, flags) safe_syscall2(int, flock, int, fd, int, operation) +#ifdef TARGET_NR_rt_sigtimedwait safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo, const struct timespec *, uts, size_t, sigsetsize) +#endif safe_syscall4(int, accept4, int, fd, struct sockaddr *, addr, socklen_t *, len, int, flags) +#if defined(TARGET_NR_nanosleep) safe_syscall2(int, nanosleep, const struct timespec *, req, struct timespec *, rem) +#endif #ifdef TARGET_NR_clock_nanosleep safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags, const struct timespec *, req, struct timespec *, rem) @@ -802,9 +815,11 @@ safe_syscall5(int, msgrcv, int, msgid, void *, msgp, size_t, sz, safe_syscall4(int, semtimedop, int, semid, struct sembuf *, tsops, unsigned, nsops, const struct timespec *, timeout) #endif -#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open) +#ifdef TARGET_NR_mq_timedsend safe_syscall5(int, mq_timedsend, int, mqdes, const char *, msg_ptr, size_t, len, unsigned, prio, const struct timespec *, timeout) +#endif +#ifdef TARGET_NR_mq_timedreceive safe_syscall5(int, mq_timedreceive, int, mqdes, char *, msg_ptr, size_t, len, unsigned *, prio, const struct timespec *, timeout) #endif @@ -946,6 +961,8 @@ abi_long do_brk(abi_ulong new_brk) return target_brk; } +#if defined(TARGET_NR_select) || defined(TARGET_NR__newselect) || \ + defined(TARGET_NR_pselect6) static inline abi_long copy_from_user_fdset(fd_set *fds, abi_ulong target_fds_addr, int n) @@ -1021,6 +1038,7 @@ static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr, return 0; } +#endif #if defined(__alpha__) #define HOST_HZ 1024 @@ -1067,6 +1085,7 @@ static inline abi_long host_to_target_rusage(abi_ulong target_addr, return 0; } +#ifdef TARGET_NR_setrlimit static inline rlim_t target_to_host_rlim(abi_ulong target_rlim) { abi_ulong target_rlim_swap; @@ -1082,7 +1101,9 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim) return result; } +#endif +#if defined(TARGET_NR_getrlimit) || defined(TARGET_NR_ugetrlimit) static inline abi_ulong host_to_target_rlim(rlim_t rlim) { abi_ulong target_rlim_swap; @@ -1096,6 +1117,7 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim) return result; } +#endif static inline int target_to_host_resource(int code) { @@ -1186,6 +1208,12 @@ static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr, return 0; } +#if defined(TARGET_NR_futex) || \ + defined(TARGET_NR_rt_sigtimedwait) || \ + defined(TARGET_NR_pselect6) || defined(TARGET_NR_pselect6) || \ + defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \ + defined(TARGET_NR_utimensat) || defined(TARGET_NR_mq_timedsend) || \ + defined(TARGET_NR_mq_timedreceive) static inline abi_long target_to_host_timespec(struct timespec *host_ts, abi_ulong target_addr) { @@ -1199,6 +1227,7 @@ static inline abi_long target_to_host_timespec(struct timespec *host_ts, unlock_user_struct(target_ts, target_addr, 0); return 0; } +#endif static inline abi_long host_to_target_timespec(abi_ulong target_addr, struct timespec *host_ts) @@ -1228,6 +1257,7 @@ static inline abi_long host_to_target_timespec64(abi_ulong target_addr, return 0; } +#if defined(TARGET_NR_gettimeofday) static inline abi_long copy_to_user_timezone(abi_ulong target_tz_addr, struct timezone *tz) { @@ -1244,7 +1274,9 @@ static inline abi_long copy_to_user_timezone(abi_ulong target_tz_addr, return 0; } +#endif +#if defined(TARGET_NR_settimeofday) static inline abi_long copy_from_user_timezone(struct timezone *tz, abi_ulong target_tz_addr) { @@ -1261,6 +1293,7 @@ static inline abi_long copy_from_user_timezone(struct timezone *tz, return 0; } +#endif #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open) #include @@ -6582,6 +6615,8 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1, } #endif +#if defined(TARGET_NR_timer_settime) || \ + (defined(TARGET_NR_timerfd_settime) && defined(CONFIG_TIMERFD)) static inline abi_long target_to_host_itimerspec(struct itimerspec *host_itspec, abi_ulong target_addr) { @@ -6601,7 +6636,11 @@ static inline abi_long target_to_host_itimerspec(struct itimerspec *host_itspec, unlock_user_struct(target_itspec, target_addr, 1); return 0; } +#endif +#if ((defined(TARGET_NR_timerfd_gettime) || \ + defined(TARGET_NR_timerfd_settime)) && defined(CONFIG_TIMERFD)) || \ + defined(TARGET_NR_timer_gettime) || defined(TARGET_NR_timer_settime) static inline abi_long host_to_target_itimerspec(abi_ulong target_addr, struct itimerspec *host_its) { @@ -6620,7 +6659,10 @@ static inline abi_long host_to_target_itimerspec(abi_ulong target_addr, unlock_user_struct(target_itspec, target_addr, 0); return 0; } +#endif +#if defined(TARGET_NR_adjtimex) || \ + (defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)) static inline abi_long target_to_host_timex(struct timex *host_tx, abi_long target_addr) { @@ -6690,7 +6732,7 @@ static inline abi_long host_to_target_timex(abi_long target_addr, unlock_user_struct(target_tx, target_addr, 1); return 0; } - +#endif static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp, abi_ulong target_addr) @@ -6857,6 +6899,7 @@ static inline abi_long host_to_target_statx(struct target_statx *host_stx, futexes locally would make futexes shared between multiple processes tricky. However they're probably useless because guest atomic operations won't work either. */ +#if defined(TARGET_NR_futex) static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, target_ulong uaddr2, int val3) { @@ -6903,6 +6946,7 @@ static int do_futex(target_ulong uaddr, int op, int val, target_ulong timeout, return -TARGET_ENOSYS; } } +#endif #if defined(TARGET_NR_name_to_handle_at) && defined(CONFIG_OPEN_BY_HANDLE) static abi_long do_name_to_handle_at(abi_long dirfd, abi_long pathname, abi_long handle, abi_long mount_id, @@ -8521,6 +8565,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#ifdef TARGET_NR_rt_sigtimedwait case TARGET_NR_rt_sigtimedwait: { sigset_t set; @@ -8557,6 +8602,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#endif case TARGET_NR_rt_sigqueueinfo: { siginfo_t uinfo; @@ -8656,6 +8702,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#if defined(TARGET_NR_gettimeofday) case TARGET_NR_gettimeofday: { struct timeval tv; @@ -8672,6 +8719,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#endif +#if defined(TARGET_NR_settimeofday) case TARGET_NR_settimeofday: { struct timeval tv, *ptv = NULL; @@ -8693,6 +8742,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return get_errno(settimeofday(ptv, ptz)); } +#endif #if defined(TARGET_NR_select) case TARGET_NR_select: #if defined(TARGET_WANT_NI_OLD_SELECT) @@ -9164,6 +9214,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_sendmmsg case TARGET_NR_sendmmsg: return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 1); +#endif +#ifdef TARGET_NR_recvmmsg case TARGET_NR_recvmmsg: return do_sendrecvmmsg(arg1, arg2, arg3, arg4, 0); #endif @@ -9338,6 +9390,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5, arg6, arg7, arg8, 0); #endif +#if defined(TARGET_NR_wait4) case TARGET_NR_wait4: { int status; @@ -9365,6 +9418,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#endif #ifdef TARGET_NR_swapoff case TARGET_NR_swapoff: if (!(p = lock_user_string(arg1))) @@ -9509,6 +9563,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return do_vm86(cpu_env, arg1, arg2); #endif #endif +#if defined(TARGET_NR_adjtimex) case TARGET_NR_adjtimex: { struct timex host_buf; @@ -9524,6 +9579,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#endif #if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME) case TARGET_NR_clock_adjtime: { @@ -10040,6 +10096,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return get_errno(sched_get_priority_max(arg1)); case TARGET_NR_sched_get_priority_min: return get_errno(sched_get_priority_min(arg1)); +#ifdef TARGET_NR_sched_rr_get_interval case TARGET_NR_sched_rr_get_interval: { struct timespec ts; @@ -10049,6 +10106,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#endif +#if defined(TARGET_NR_nanosleep) case TARGET_NR_nanosleep: { struct timespec req, rem; @@ -10059,6 +10118,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } } return ret; +#endif case TARGET_NR_prctl: switch (arg1) { case PR_GET_PDEATHSIG: @@ -11529,8 +11589,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } return ret; #endif +#ifdef TARGET_NR_futex case TARGET_NR_futex: return do_futex(arg1, arg2, arg3, arg4, arg5, arg6); +#endif #if defined(TARGET_NR_inotify_init) && defined(__NR_inotify_init) case TARGET_NR_inotify_init: ret = get_errno(sys_inotify_init()); @@ -11595,6 +11657,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, unlock_user (p, arg1, 0); return ret; +#ifdef TARGET_NR_mq_timedsend case TARGET_NR_mq_timedsend: { struct timespec ts; @@ -11610,7 +11673,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, unlock_user (p, arg2, arg3); } return ret; +#endif +#ifdef TARGET_NR_mq_timedreceive case TARGET_NR_mq_timedreceive: { struct timespec ts; @@ -11631,6 +11696,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, put_user_u32(prio, arg4); } return ret; +#endif /* Not implemented for now... */ /* case TARGET_NR_mq_notify: */ From patchwork Thu Mar 19 09:26:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26F641667 for ; Thu, 19 Mar 2020 09:30:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 079E020663 for ; Thu, 19 Mar 2020 09:30:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 079E020663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErVm-0005bE-2l for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:30:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40949) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRy-0005Qu-D5 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRx-0004F3-29 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:50 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:33917) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRw-0004E8-P7 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mc1hn-1jqfIn2n7f-00dTuI; Thu, 19 Mar 2020 10:26:38 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 11/16] linux-user/syscall: Add support for clock_gettime64/clock_settime64 Date: Thu, 19 Mar 2020 10:26:22 +0100 Message-Id: <20200319092627.51487-12-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:L9uGFhJuOpdqZ11JjA5qmhOkxad9EpMTdmTYCQSsFM3t3oRux9s k+BgrnC5/eJteZAE9/PDuRyaqem/D1lL6qPWSFXmPDBAu5llwvv0sq4IzY4Dq7YSO3EA9o9 oT3PHJr3rHsb7Z0yGknnN3Mu6leuCRKLCUkTWqUHShJeFAxVY41nx0P0iGY0D4BrdMhddKJ HC0jVu6OrwIa+SziKXy2g== X-UI-Out-Filterresults: notjunk:1;V03:K0:hdwfzrX7RyI=:tEUyfOLVlQEw+D9J8JjgEQ ROJL9gJcpmjkuU1LkdJsQN80MJWfEWKfUMLksAwvUoWUPDBDToTDfMTOEAYYB0vhypynlBavk /FRVCQWsn7ILmSBl3MkyZ9uv6aCJwVIOXCxZRj5fNirNbETJmJytb6LMt+WOaVGYMyqT0lMjB cuLWKC9Fl0TlfKBRnLbT+ggOY5XJGDvqhaD0KOSkmQ7r9o/qRIWv+ZwuxKswlbSBmTXpF6BqS CqeUqJDax8M7kM7ieYop32weMJYxNuZ8QXF8yP67DQt1WHmGIDX5XC1gHKDQ2C1zOuc0FQC1Z JbWDxJ8b2rnOXSfvu5ttEh7H2hziA/sBMmela003kY38Mhvx15BeT9aBB0m2SWM12NYhTmDJ9 hC6cdYF0TelsdAlQev0L2UAV4jRHA35lhgflQToVE7QiKOeu49RsP13Bqql9GopjtOzPQQmzL xob2bAqQ3ew//DYdioNDFiaynQ26t/14RtPqpSxsy4ouVjy23ZqU1mrhhYhXHt1NSD9BlZwqw Lbw7WCxzJyNTBpBgQTIuzp4YzA5G7Cf9iisvpysgb+ZAA3kT1oNoDsPkad272LW5SpsjrmSkD 05cmHoYs9FkUOJ5Wb5zRAs3MLXSpiAfJbcULLJg+oFCtIWWIlLBE9hkkDSI+4A2K88K+UBAfW +uqlRu5EAizIal94cWkdjR/UFdpnm3a1OwIpjp+0QWN+Ea/XpFnDXSNpW4eBo6JN+vWl7LbB9 mkEa/T5gIeOundFokfmYEwBcy2Wx1BdVPLbn0dJiAtNoPtHmoUlOFljChYz74hRc/+XI1SIaF 2Au8ADBgXexxtlZuCHQRZjmYRdhShWOaBV8UXSV6sKhVdIrfr5UfTW+33d1U8zIXYrVrPwk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.135 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis Add support for the clock_gettime64/clock_settime64 syscalls. If your host is 64-bit or is 32-bit with the *_time64 syscall then the timespec will correctly be a 64-bit time_t. Otherwise the host will return a 32-bit time_t which will be rounded to 64-bits. This will be incorrect after y2038. Signed-off-by: Alistair Francis Reviewed-by: Laurent Vivier Message-Id: <4a7fd05532400d10aa0f684c9043e2ac7b34d91c.1584051142.git.alistair.francis@wdc.com> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ea1c84dc5de5..661404687080 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1229,6 +1229,22 @@ static inline abi_long target_to_host_timespec(struct timespec *host_ts, } #endif +#if defined(TARGET_NR_clock_settime64) +static inline abi_long target_to_host_timespec64(struct timespec *host_ts, + abi_ulong target_addr) +{ + struct target__kernel_timespec *target_ts; + + if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1)) { + return -TARGET_EFAULT; + } + __get_user(host_ts->tv_sec, &target_ts->tv_sec); + __get_user(host_ts->tv_nsec, &target_ts->tv_nsec); + unlock_user_struct(target_ts, target_addr, 0); + return 0; +} +#endif + static inline abi_long host_to_target_timespec(abi_ulong target_addr, struct timespec *host_ts) { @@ -11493,6 +11509,18 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; } #endif +#ifdef TARGET_NR_clock_settime64 + case TARGET_NR_clock_settime64: + { + struct timespec ts; + + ret = target_to_host_timespec64(&ts, arg2); + if (!is_error(ret)) { + ret = get_errno(clock_settime(arg1, &ts)); + } + return ret; + } +#endif #ifdef TARGET_NR_clock_gettime case TARGET_NR_clock_gettime: { @@ -11504,6 +11532,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; } #endif +#ifdef TARGET_NR_clock_gettime64 + case TARGET_NR_clock_gettime64: + { + struct timespec ts; + ret = get_errno(clock_gettime(arg1, &ts)); + if (!is_error(ret)) { + ret = host_to_target_timespec64(arg2, &ts); + } + return ret; + } +#endif #ifdef TARGET_NR_clock_getres case TARGET_NR_clock_getres: { From patchwork Thu Mar 19 09:26:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446941 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 140F414B4 for ; Thu, 19 Mar 2020 09:34:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D606520663 for ; Thu, 19 Mar 2020 09:34:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D606520663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErZ2-0002OK-0D for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:34:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRx-0005Om-2T for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRs-0004CV-Ud for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:42001) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRs-0004By-Gr for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:44 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M4KFF-1jEaSs0lwv-000Ing; Thu, 19 Mar 2020 10:26:39 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 12/16] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel Date: Thu, 19 Mar 2020 10:26:23 +0100 Message-Id: <20200319092627.51487-13-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:prFaPj4GibEzCqTvGN0Onu/j0EzjXcb1r3CWbVFM+LmOwVkNgDB Z8VzySuqnzIdgmcYAeIZDGDH0Tk3ffwKqWthOfGsoJhcS2UyiQTqlOFSca0FN5F7DENYtsA aenNE3HGJL9LfFZD/Eldkv8jEBtgsvuQvrbAXOHFAWvAw+agOHd+vxioEoz9sJ/e5VaEg7v b4r6trcl4OG0WhUhnBAEw== X-UI-Out-Filterresults: notjunk:1;V03:K0:RHqPFoITFyI=:ttlThVhvjxiUCcmcM3AVH2 0jKnpGwqXgwQ46qgIsjIl95Huz5AMIYp7eyHvB7zNzGY0IT31E0jnJLOK2fG3l8M4H0hAuXVc YSO93RzfpApHxjstciGo4y58CU1tntC478IABGgW50Fjh9WMAujl9+ePH+YkPV1ZGNEdKCLqY VYUpHMFCseLGSDxyASlt99aAwyVduFBQpTvOlTN17Px2T8aiiRiOOTv53HdAkneX6KOPQoWn5 13K32nL0a6aPpJOUn634+xapvNd5Bf7fygqtYCDzuXVqArE+D/MX6VvyS/LDixh9QzrQTf051 Ys0RtwjS7+wiVXnfh9Zcxr6VoS/tjt9+mTv13FpDO18lLlBaNic184O1r2CuXByAd7zJcA0yW ndHfpiRpriRDzXcie7HiRk9bbMxHEy8si3d/zrfFUIna8QwizCUZhgZN6jLtGekIp+gU1+Rbp /+ObihOfAdNB853JKfzTYEF6h6aYcuKPXtd1PKCiuWlmiwV49pha+MRcOQFzK/Wrlc7tLnAod zxoqQKJeDbSvpZwTDtyk+RtWfTKXCza2ZsbRTQ+n5IY4EIQW2Y0AwmNc3iPsMMVZP3pmdu+3f 5GcojZMM35gUw3ZkL6rU00rNq8ltvT0wXl0UfVhTJ6+hjYyHYoYuLqxDtPkZKHYH1ndJZy0J0 lK6261OtpY7lC6OBhh4krsrjduUWVXnKjCI1CJP24EOoIBEgz3vCwZcbDNmFyyFuxMz8jF6zF DKRWdibjv1wQi7B0S7LGJ+OfjoLTEcw7tg7lTLMl89PMTummWvhtu2OO6EOGVXxUg3PLqgE8C 4Uu5atUsEWn4fJG/j7Ks9ExkYv2h/Yx/BPtFXEK6Gbu/dV11nyFop1dyAdaJ/Ut3kRef6VR X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis Signed-off-by: Alistair Francis Reviewed-by: Laurent Vivier Message-Id: <8e512fa2dc885aafc4d9c4013ee033442827a4a0.1584051142.git.alistair.francis@wdc.com> [lv: guard sys_futex with TARGET_NR_exit] Signed-off-by: Laurent Vivier --- linux-user/riscv/syscall32_nr.h | 295 +++++++++++++++++++++++++++++++ linux-user/riscv/syscall64_nr.h | 301 ++++++++++++++++++++++++++++++++ linux-user/riscv/syscall_nr.h | 294 +------------------------------ linux-user/syscall.c | 2 +- 4 files changed, 599 insertions(+), 293 deletions(-) create mode 100644 linux-user/riscv/syscall32_nr.h create mode 100644 linux-user/riscv/syscall64_nr.h diff --git a/linux-user/riscv/syscall32_nr.h b/linux-user/riscv/syscall32_nr.h new file mode 100644 index 000000000000..4fef73e954da --- /dev/null +++ b/linux-user/riscv/syscall32_nr.h @@ -0,0 +1,295 @@ +/* + * This file contains the system call numbers. + */ +#ifndef LINUX_USER_RISCV_SYSCALL32_NR_H +#define LINUX_USER_RISCV_SYSCALL32_NR_H + +#define TARGET_NR_io_setup 0 +#define TARGET_NR_io_destroy 1 +#define TARGET_NR_io_submit 2 +#define TARGET_NR_io_cancel 3 +#define TARGET_NR_setxattr 5 +#define TARGET_NR_lsetxattr 6 +#define TARGET_NR_fsetxattr 7 +#define TARGET_NR_getxattr 8 +#define TARGET_NR_lgetxattr 9 +#define TARGET_NR_fgetxattr 10 +#define TARGET_NR_listxattr 11 +#define TARGET_NR_llistxattr 12 +#define TARGET_NR_flistxattr 13 +#define TARGET_NR_removexattr 14 +#define TARGET_NR_lremovexattr 15 +#define TARGET_NR_fremovexattr 16 +#define TARGET_NR_getcwd 17 +#define TARGET_NR_lookup_dcookie 18 +#define TARGET_NR_eventfd2 19 +#define TARGET_NR_epoll_create1 20 +#define TARGET_NR_epoll_ctl 21 +#define TARGET_NR_epoll_pwait 22 +#define TARGET_NR_dup 23 +#define TARGET_NR_dup3 24 +#define TARGET_NR_fcntl64 25 +#define TARGET_NR_inotify_init1 26 +#define TARGET_NR_inotify_add_watch 27 +#define TARGET_NR_inotify_rm_watch 28 +#define TARGET_NR_ioctl 29 +#define TARGET_NR_ioprio_set 30 +#define TARGET_NR_ioprio_get 31 +#define TARGET_NR_flock 32 +#define TARGET_NR_mknodat 33 +#define TARGET_NR_mkdirat 34 +#define TARGET_NR_unlinkat 35 +#define TARGET_NR_symlinkat 36 +#define TARGET_NR_linkat 37 +#define TARGET_NR_umount2 39 +#define TARGET_NR_mount 40 +#define TARGET_NR_pivot_root 41 +#define TARGET_NR_nfsservctl 42 +#define TARGET_NR_statfs64 43 +#define TARGET_NR_fstatfs64 44 +#define TARGET_NR_truncate64 45 +#define TARGET_NR_ftruncate64 46 +#define TARGET_NR_fallocate 47 +#define TARGET_NR_faccessat 48 +#define TARGET_NR_chdir 49 +#define TARGET_NR_fchdir 50 +#define TARGET_NR_chroot 51 +#define TARGET_NR_fchmod 52 +#define TARGET_NR_fchmodat 53 +#define TARGET_NR_fchownat 54 +#define TARGET_NR_fchown 55 +#define TARGET_NR_openat 56 +#define TARGET_NR_close 57 +#define TARGET_NR_vhangup 58 +#define TARGET_NR_pipe2 59 +#define TARGET_NR_quotactl 60 +#define TARGET_NR_getdents64 61 +#define TARGET_NR_llseek 62 +#define TARGET_NR_read 63 +#define TARGET_NR_write 64 +#define TARGET_NR_readv 65 +#define TARGET_NR_writev 66 +#define TARGET_NR_pread64 67 +#define TARGET_NR_pwrite64 68 +#define TARGET_NR_preadv 69 +#define TARGET_NR_pwritev 70 +#define TARGET_NR_sendfile64 71 +#define TARGET_NR_signalfd4 74 +#define TARGET_NR_vmsplice 75 +#define TARGET_NR_splice 76 +#define TARGET_NR_tee 77 +#define TARGET_NR_readlinkat 78 +#define TARGET_NR_fstatat64 79 +#define TARGET_NR_fstat64 80 +#define TARGET_NR_sync 81 +#define TARGET_NR_fsync 82 +#define TARGET_NR_fdatasync 83 +#define TARGET_NR_sync_file_range 84 +#define TARGET_NR_timerfd_create 85 +#define TARGET_NR_acct 89 +#define TARGET_NR_capget 90 +#define TARGET_NR_capset 91 +#define TARGET_NR_personality 92 +#define TARGET_NR_exit 93 +#define TARGET_NR_exit_group 94 +#define TARGET_NR_waitid 95 +#define TARGET_NR_set_tid_address 96 +#define TARGET_NR_unshare 97 +#define TARGET_NR_set_robust_list 99 +#define TARGET_NR_get_robust_list 100 +#define TARGET_NR_getitimer 102 +#define TARGET_NR_setitimer 103 +#define TARGET_NR_kexec_load 104 +#define TARGET_NR_init_module 105 +#define TARGET_NR_delete_module 106 +#define TARGET_NR_timer_create 107 +#define TARGET_NR_timer_getoverrun 109 +#define TARGET_NR_timer_delete 111 +#define TARGET_NR_syslog 116 +#define TARGET_NR_ptrace 117 +#define TARGET_NR_sched_setparam 118 +#define TARGET_NR_sched_setscheduler 119 +#define TARGET_NR_sched_getscheduler 120 +#define TARGET_NR_sched_getparam 121 +#define TARGET_NR_sched_setaffinity 122 +#define TARGET_NR_sched_getaffinity 123 +#define TARGET_NR_sched_yield 124 +#define TARGET_NR_sched_get_priority_max 125 +#define TARGET_NR_sched_get_priority_min 126 +#define TARGET_NR_restart_syscall 128 +#define TARGET_NR_kill 129 +#define TARGET_NR_tkill 130 +#define TARGET_NR_tgkill 131 +#define TARGET_NR_sigaltstack 132 +#define TARGET_NR_rt_sigsuspend 133 +#define TARGET_NR_rt_sigaction 134 +#define TARGET_NR_rt_sigprocmask 135 +#define TARGET_NR_rt_sigpending 136 +#define TARGET_NR_rt_sigqueueinfo 138 +#define TARGET_NR_rt_sigreturn 139 +#define TARGET_NR_setpriority 140 +#define TARGET_NR_getpriority 141 +#define TARGET_NR_reboot 142 +#define TARGET_NR_setregid 143 +#define TARGET_NR_setgid 144 +#define TARGET_NR_setreuid 145 +#define TARGET_NR_setuid 146 +#define TARGET_NR_setresuid 147 +#define TARGET_NR_getresuid 148 +#define TARGET_NR_setresgid 149 +#define TARGET_NR_getresgid 150 +#define TARGET_NR_setfsuid 151 +#define TARGET_NR_setfsgid 152 +#define TARGET_NR_times 153 +#define TARGET_NR_setpgid 154 +#define TARGET_NR_getpgid 155 +#define TARGET_NR_getsid 156 +#define TARGET_NR_setsid 157 +#define TARGET_NR_getgroups 158 +#define TARGET_NR_setgroups 159 +#define TARGET_NR_uname 160 +#define TARGET_NR_sethostname 161 +#define TARGET_NR_setdomainname 162 +#define TARGET_NR_getrlimit 163 +#define TARGET_NR_setrlimit 164 +#define TARGET_NR_getrusage 165 +#define TARGET_NR_umask 166 +#define TARGET_NR_prctl 167 +#define TARGET_NR_getcpu 168 +#define TARGET_NR_getpid 172 +#define TARGET_NR_getppid 173 +#define TARGET_NR_getuid 174 +#define TARGET_NR_geteuid 175 +#define TARGET_NR_getgid 176 +#define TARGET_NR_getegid 177 +#define TARGET_NR_gettid 178 +#define TARGET_NR_sysinfo 179 +#define TARGET_NR_mq_open 180 +#define TARGET_NR_mq_unlink 181 +#define TARGET_NR_mq_notify 184 +#define TARGET_NR_mq_getsetattr 185 +#define TARGET_NR_msgget 186 +#define TARGET_NR_msgctl 187 +#define TARGET_NR_msgrcv 188 +#define TARGET_NR_msgsnd 189 +#define TARGET_NR_semget 190 +#define TARGET_NR_semctl 191 +#define TARGET_NR_semop 193 +#define TARGET_NR_shmget 194 +#define TARGET_NR_shmctl 195 +#define TARGET_NR_shmat 196 +#define TARGET_NR_shmdt 197 +#define TARGET_NR_socket 198 +#define TARGET_NR_socketpair 199 +#define TARGET_NR_bind 200 +#define TARGET_NR_listen 201 +#define TARGET_NR_accept 202 +#define TARGET_NR_connect 203 +#define TARGET_NR_getsockname 204 +#define TARGET_NR_getpeername 205 +#define TARGET_NR_sendto 206 +#define TARGET_NR_recvfrom 207 +#define TARGET_NR_setsockopt 208 +#define TARGET_NR_getsockopt 209 +#define TARGET_NR_shutdown 210 +#define TARGET_NR_sendmsg 211 +#define TARGET_NR_recvmsg 212 +#define TARGET_NR_readahead 213 +#define TARGET_NR_brk 214 +#define TARGET_NR_munmap 215 +#define TARGET_NR_mremap 216 +#define TARGET_NR_add_key 217 +#define TARGET_NR_request_key 218 +#define TARGET_NR_keyctl 219 +#define TARGET_NR_clone 220 +#define TARGET_NR_execve 221 +#define TARGET_NR_mmap2 222 +#define TARGET_NR_fadvise64_64 223 +#define TARGET_NR_swapon 224 +#define TARGET_NR_swapoff 225 +#define TARGET_NR_mprotect 226 +#define TARGET_NR_msync 227 +#define TARGET_NR_mlock 228 +#define TARGET_NR_munlock 229 +#define TARGET_NR_mlockall 230 +#define TARGET_NR_munlockall 231 +#define TARGET_NR_mincore 232 +#define TARGET_NR_madvise 233 +#define TARGET_NR_remap_file_pages 234 +#define TARGET_NR_mbind 235 +#define TARGET_NR_get_mempolicy 236 +#define TARGET_NR_set_mempolicy 237 +#define TARGET_NR_migrate_pages 238 +#define TARGET_NR_move_pages 239 +#define TARGET_NR_rt_tgsigqueueinfo 240 +#define TARGET_NR_perf_event_open 241 +#define TARGET_NR_accept4 242 +#define TARGET_NR_arch_specific_syscall 244 +#define TARGET_NR_riscv_flush_icache (TARGET_NR_arch_specific_syscall + 15) +#define TARGET_NR_prlimit64 261 +#define TARGET_NR_fanotify_init 262 +#define TARGET_NR_fanotify_mark 263 +#define TARGET_NR_name_to_handle_at 264 +#define TARGET_NR_open_by_handle_at 265 +#define TARGET_NR_syncfs 267 +#define TARGET_NR_setns 268 +#define TARGET_NR_sendmmsg 269 +#define TARGET_NR_process_vm_readv 270 +#define TARGET_NR_process_vm_writev 271 +#define TARGET_NR_kcmp 272 +#define TARGET_NR_finit_module 273 +#define TARGET_NR_sched_setattr 274 +#define TARGET_NR_sched_getattr 275 +#define TARGET_NR_renameat2 276 +#define TARGET_NR_seccomp 277 +#define TARGET_NR_getrandom 278 +#define TARGET_NR_memfd_create 279 +#define TARGET_NR_bpf 280 +#define TARGET_NR_execveat 281 +#define TARGET_NR_userfaultfd 282 +#define TARGET_NR_membarrier 283 +#define TARGET_NR_mlock2 284 +#define TARGET_NR_copy_file_range 285 +#define TARGET_NR_preadv2 286 +#define TARGET_NR_pwritev2 287 +#define TARGET_NR_pkey_mprotect 288 +#define TARGET_NR_pkey_alloc 289 +#define TARGET_NR_pkey_free 290 +#define TARGET_NR_statx 291 +#define TARGET_NR_rseq 293 +#define TARGET_NR_kexec_file_load 294 +#define TARGET_NR_clock_gettime64 403 +#define TARGET_NR_clock_settime64 404 +#define TARGET_NR_clock_adjtime64 405 +#define TARGET_NR_clock_getres_time64 406 +#define TARGET_NR_clock_nanosleep_time64 407 +#define TARGET_NR_timer_gettime64 408 +#define TARGET_NR_timer_settime64 409 +#define TARGET_NR_timerfd_gettime64 410 +#define TARGET_NR_timerfd_settime64 411 +#define TARGET_NR_utimensat_time64 412 +#define TARGET_NR_pselect6_time64 413 +#define TARGET_NR_ppoll_time64 414 +#define TARGET_NR_io_pgetevents_time64 416 +#define TARGET_NR_recvmmsg_time64 417 +#define TARGET_NR_mq_timedsend_time64 418 +#define TARGET_NR_mq_timedreceive_time64 419 +#define TARGET_NR_semtimedop_time64 420 +#define TARGET_NR_rt_sigtimedwait_time64 421 +#define TARGET_NR_futex_time64 422 +#define TARGET_NR_sched_rr_get_interval_time64 423 +#define TARGET_NR_pidfd_send_signal 424 +#define TARGET_NR_io_uring_setup 425 +#define TARGET_NR_io_uring_enter 426 +#define TARGET_NR_io_uring_register 427 +#define TARGET_NR_open_tree 428 +#define TARGET_NR_move_mount 429 +#define TARGET_NR_fsopen 430 +#define TARGET_NR_fsconfig 431 +#define TARGET_NR_fsmount 432 +#define TARGET_NR_fspick 433 +#define TARGET_NR_pidfd_open 434 +#define TARGET_NR_clone3 435 +#define TARGET_NR_syscalls 436 + +#endif /* LINUX_USER_RISCV_SYSCALL32_NR_H */ diff --git a/linux-user/riscv/syscall64_nr.h b/linux-user/riscv/syscall64_nr.h new file mode 100644 index 000000000000..cc82f3244f55 --- /dev/null +++ b/linux-user/riscv/syscall64_nr.h @@ -0,0 +1,301 @@ +/* + * This file contains the system call numbers. + */ +#ifndef LINUX_USER_RISCV_SYSCALL64_NR_H +#define LINUX_USER_RISCV_SYSCALL64_NR_H + +#define TARGET_NR_io_setup 0 +#define TARGET_NR_io_destroy 1 +#define TARGET_NR_io_submit 2 +#define TARGET_NR_io_cancel 3 +#define TARGET_NR_io_getevents 4 +#define TARGET_NR_setxattr 5 +#define TARGET_NR_lsetxattr 6 +#define TARGET_NR_fsetxattr 7 +#define TARGET_NR_getxattr 8 +#define TARGET_NR_lgetxattr 9 +#define TARGET_NR_fgetxattr 10 +#define TARGET_NR_listxattr 11 +#define TARGET_NR_llistxattr 12 +#define TARGET_NR_flistxattr 13 +#define TARGET_NR_removexattr 14 +#define TARGET_NR_lremovexattr 15 +#define TARGET_NR_fremovexattr 16 +#define TARGET_NR_getcwd 17 +#define TARGET_NR_lookup_dcookie 18 +#define TARGET_NR_eventfd2 19 +#define TARGET_NR_epoll_create1 20 +#define TARGET_NR_epoll_ctl 21 +#define TARGET_NR_epoll_pwait 22 +#define TARGET_NR_dup 23 +#define TARGET_NR_dup3 24 +#define TARGET_NR_fcntl 25 +#define TARGET_NR_inotify_init1 26 +#define TARGET_NR_inotify_add_watch 27 +#define TARGET_NR_inotify_rm_watch 28 +#define TARGET_NR_ioctl 29 +#define TARGET_NR_ioprio_set 30 +#define TARGET_NR_ioprio_get 31 +#define TARGET_NR_flock 32 +#define TARGET_NR_mknodat 33 +#define TARGET_NR_mkdirat 34 +#define TARGET_NR_unlinkat 35 +#define TARGET_NR_symlinkat 36 +#define TARGET_NR_linkat 37 +#define TARGET_NR_umount2 39 +#define TARGET_NR_mount 40 +#define TARGET_NR_pivot_root 41 +#define TARGET_NR_nfsservctl 42 +#define TARGET_NR_statfs 43 +#define TARGET_NR_fstatfs 44 +#define TARGET_NR_truncate 45 +#define TARGET_NR_ftruncate 46 +#define TARGET_NR_fallocate 47 +#define TARGET_NR_faccessat 48 +#define TARGET_NR_chdir 49 +#define TARGET_NR_fchdir 50 +#define TARGET_NR_chroot 51 +#define TARGET_NR_fchmod 52 +#define TARGET_NR_fchmodat 53 +#define TARGET_NR_fchownat 54 +#define TARGET_NR_fchown 55 +#define TARGET_NR_openat 56 +#define TARGET_NR_close 57 +#define TARGET_NR_vhangup 58 +#define TARGET_NR_pipe2 59 +#define TARGET_NR_quotactl 60 +#define TARGET_NR_getdents64 61 +#define TARGET_NR_lseek 62 +#define TARGET_NR_read 63 +#define TARGET_NR_write 64 +#define TARGET_NR_readv 65 +#define TARGET_NR_writev 66 +#define TARGET_NR_pread64 67 +#define TARGET_NR_pwrite64 68 +#define TARGET_NR_preadv 69 +#define TARGET_NR_pwritev 70 +#define TARGET_NR_sendfile 71 +#define TARGET_NR_pselect6 72 +#define TARGET_NR_ppoll 73 +#define TARGET_NR_signalfd4 74 +#define TARGET_NR_vmsplice 75 +#define TARGET_NR_splice 76 +#define TARGET_NR_tee 77 +#define TARGET_NR_readlinkat 78 +#define TARGET_NR_newfstatat 79 +#define TARGET_NR_fstat 80 +#define TARGET_NR_sync 81 +#define TARGET_NR_fsync 82 +#define TARGET_NR_fdatasync 83 +#define TARGET_NR_sync_file_range 84 +#define TARGET_NR_timerfd_create 85 +#define TARGET_NR_timerfd_settime 86 +#define TARGET_NR_timerfd_gettime 87 +#define TARGET_NR_utimensat 88 +#define TARGET_NR_acct 89 +#define TARGET_NR_capget 90 +#define TARGET_NR_capset 91 +#define TARGET_NR_personality 92 +#define TARGET_NR_exit 93 +#define TARGET_NR_exit_group 94 +#define TARGET_NR_waitid 95 +#define TARGET_NR_set_tid_address 96 +#define TARGET_NR_unshare 97 +#define TARGET_NR_futex 98 +#define TARGET_NR_set_robust_list 99 +#define TARGET_NR_get_robust_list 100 +#define TARGET_NR_nanosleep 101 +#define TARGET_NR_getitimer 102 +#define TARGET_NR_setitimer 103 +#define TARGET_NR_kexec_load 104 +#define TARGET_NR_init_module 105 +#define TARGET_NR_delete_module 106 +#define TARGET_NR_timer_create 107 +#define TARGET_NR_timer_gettime 108 +#define TARGET_NR_timer_getoverrun 109 +#define TARGET_NR_timer_settime 110 +#define TARGET_NR_timer_delete 111 +#define TARGET_NR_clock_settime 112 +#define TARGET_NR_clock_gettime 113 +#define TARGET_NR_clock_getres 114 +#define TARGET_NR_clock_nanosleep 115 +#define TARGET_NR_syslog 116 +#define TARGET_NR_ptrace 117 +#define TARGET_NR_sched_setparam 118 +#define TARGET_NR_sched_setscheduler 119 +#define TARGET_NR_sched_getscheduler 120 +#define TARGET_NR_sched_getparam 121 +#define TARGET_NR_sched_setaffinity 122 +#define TARGET_NR_sched_getaffinity 123 +#define TARGET_NR_sched_yield 124 +#define TARGET_NR_sched_get_priority_max 125 +#define TARGET_NR_sched_get_priority_min 126 +#define TARGET_NR_sched_rr_get_interval 127 +#define TARGET_NR_restart_syscall 128 +#define TARGET_NR_kill 129 +#define TARGET_NR_tkill 130 +#define TARGET_NR_tgkill 131 +#define TARGET_NR_sigaltstack 132 +#define TARGET_NR_rt_sigsuspend 133 +#define TARGET_NR_rt_sigaction 134 +#define TARGET_NR_rt_sigprocmask 135 +#define TARGET_NR_rt_sigpending 136 +#define TARGET_NR_rt_sigtimedwait 137 +#define TARGET_NR_rt_sigqueueinfo 138 +#define TARGET_NR_rt_sigreturn 139 +#define TARGET_NR_setpriority 140 +#define TARGET_NR_getpriority 141 +#define TARGET_NR_reboot 142 +#define TARGET_NR_setregid 143 +#define TARGET_NR_setgid 144 +#define TARGET_NR_setreuid 145 +#define TARGET_NR_setuid 146 +#define TARGET_NR_setresuid 147 +#define TARGET_NR_getresuid 148 +#define TARGET_NR_setresgid 149 +#define TARGET_NR_getresgid 150 +#define TARGET_NR_setfsuid 151 +#define TARGET_NR_setfsgid 152 +#define TARGET_NR_times 153 +#define TARGET_NR_setpgid 154 +#define TARGET_NR_getpgid 155 +#define TARGET_NR_getsid 156 +#define TARGET_NR_setsid 157 +#define TARGET_NR_getgroups 158 +#define TARGET_NR_setgroups 159 +#define TARGET_NR_uname 160 +#define TARGET_NR_sethostname 161 +#define TARGET_NR_setdomainname 162 +#define TARGET_NR_getrlimit 163 +#define TARGET_NR_setrlimit 164 +#define TARGET_NR_getrusage 165 +#define TARGET_NR_umask 166 +#define TARGET_NR_prctl 167 +#define TARGET_NR_getcpu 168 +#define TARGET_NR_gettimeofday 169 +#define TARGET_NR_settimeofday 170 +#define TARGET_NR_adjtimex 171 +#define TARGET_NR_getpid 172 +#define TARGET_NR_getppid 173 +#define TARGET_NR_getuid 174 +#define TARGET_NR_geteuid 175 +#define TARGET_NR_getgid 176 +#define TARGET_NR_getegid 177 +#define TARGET_NR_gettid 178 +#define TARGET_NR_sysinfo 179 +#define TARGET_NR_mq_open 180 +#define TARGET_NR_mq_unlink 181 +#define TARGET_NR_mq_timedsend 182 +#define TARGET_NR_mq_timedreceive 183 +#define TARGET_NR_mq_notify 184 +#define TARGET_NR_mq_getsetattr 185 +#define TARGET_NR_msgget 186 +#define TARGET_NR_msgctl 187 +#define TARGET_NR_msgrcv 188 +#define TARGET_NR_msgsnd 189 +#define TARGET_NR_semget 190 +#define TARGET_NR_semctl 191 +#define TARGET_NR_semtimedop 192 +#define TARGET_NR_semop 193 +#define TARGET_NR_shmget 194 +#define TARGET_NR_shmctl 195 +#define TARGET_NR_shmat 196 +#define TARGET_NR_shmdt 197 +#define TARGET_NR_socket 198 +#define TARGET_NR_socketpair 199 +#define TARGET_NR_bind 200 +#define TARGET_NR_listen 201 +#define TARGET_NR_accept 202 +#define TARGET_NR_connect 203 +#define TARGET_NR_getsockname 204 +#define TARGET_NR_getpeername 205 +#define TARGET_NR_sendto 206 +#define TARGET_NR_recvfrom 207 +#define TARGET_NR_setsockopt 208 +#define TARGET_NR_getsockopt 209 +#define TARGET_NR_shutdown 210 +#define TARGET_NR_sendmsg 211 +#define TARGET_NR_recvmsg 212 +#define TARGET_NR_readahead 213 +#define TARGET_NR_brk 214 +#define TARGET_NR_munmap 215 +#define TARGET_NR_mremap 216 +#define TARGET_NR_add_key 217 +#define TARGET_NR_request_key 218 +#define TARGET_NR_keyctl 219 +#define TARGET_NR_clone 220 +#define TARGET_NR_execve 221 +#define TARGET_NR_mmap 222 +#define TARGET_NR_fadvise64 223 +#define TARGET_NR_swapon 224 +#define TARGET_NR_swapoff 225 +#define TARGET_NR_mprotect 226 +#define TARGET_NR_msync 227 +#define TARGET_NR_mlock 228 +#define TARGET_NR_munlock 229 +#define TARGET_NR_mlockall 230 +#define TARGET_NR_munlockall 231 +#define TARGET_NR_mincore 232 +#define TARGET_NR_madvise 233 +#define TARGET_NR_remap_file_pages 234 +#define TARGET_NR_mbind 235 +#define TARGET_NR_get_mempolicy 236 +#define TARGET_NR_set_mempolicy 237 +#define TARGET_NR_migrate_pages 238 +#define TARGET_NR_move_pages 239 +#define TARGET_NR_rt_tgsigqueueinfo 240 +#define TARGET_NR_perf_event_open 241 +#define TARGET_NR_accept4 242 +#define TARGET_NR_recvmmsg 243 +#define TARGET_NR_arch_specific_syscall 244 +#define TARGET_NR_riscv_flush_icache (TARGET_NR_arch_specific_syscall + 15) +#define TARGET_NR_wait4 260 +#define TARGET_NR_prlimit64 261 +#define TARGET_NR_fanotify_init 262 +#define TARGET_NR_fanotify_mark 263 +#define TARGET_NR_name_to_handle_at 264 +#define TARGET_NR_open_by_handle_at 265 +#define TARGET_NR_clock_adjtime 266 +#define TARGET_NR_syncfs 267 +#define TARGET_NR_setns 268 +#define TARGET_NR_sendmmsg 269 +#define TARGET_NR_process_vm_readv 270 +#define TARGET_NR_process_vm_writev 271 +#define TARGET_NR_kcmp 272 +#define TARGET_NR_finit_module 273 +#define TARGET_NR_sched_setattr 274 +#define TARGET_NR_sched_getattr 275 +#define TARGET_NR_renameat2 276 +#define TARGET_NR_seccomp 277 +#define TARGET_NR_getrandom 278 +#define TARGET_NR_memfd_create 279 +#define TARGET_NR_bpf 280 +#define TARGET_NR_execveat 281 +#define TARGET_NR_userfaultfd 282 +#define TARGET_NR_membarrier 283 +#define TARGET_NR_mlock2 284 +#define TARGET_NR_copy_file_range 285 +#define TARGET_NR_preadv2 286 +#define TARGET_NR_pwritev2 287 +#define TARGET_NR_pkey_mprotect 288 +#define TARGET_NR_pkey_alloc 289 +#define TARGET_NR_pkey_free 290 +#define TARGET_NR_statx 291 +#define TARGET_NR_io_pgetevents 292 +#define TARGET_NR_rseq 293 +#define TARGET_NR_kexec_file_load 294 +#define TARGET_NR_pidfd_send_signal 424 +#define TARGET_NR_io_uring_setup 425 +#define TARGET_NR_io_uring_enter 426 +#define TARGET_NR_io_uring_register 427 +#define TARGET_NR_open_tree 428 +#define TARGET_NR_move_mount 429 +#define TARGET_NR_fsopen 430 +#define TARGET_NR_fsconfig 431 +#define TARGET_NR_fsmount 432 +#define TARGET_NR_fspick 433 +#define TARGET_NR_pidfd_open 434 +#define TARGET_NR_clone3 435 +#define TARGET_NR_syscalls 436 + +#endif /* LINUX_USER_RISCV_SYSCALL64_NR_H */ diff --git a/linux-user/riscv/syscall_nr.h b/linux-user/riscv/syscall_nr.h index 5c8728220994..0a5a2f2fb161 100644 --- a/linux-user/riscv/syscall_nr.h +++ b/linux-user/riscv/syscall_nr.h @@ -6,300 +6,10 @@ #ifndef LINUX_USER_RISCV_SYSCALL_NR_H #define LINUX_USER_RISCV_SYSCALL_NR_H -#define TARGET_NR_io_setup 0 -#define TARGET_NR_io_destroy 1 -#define TARGET_NR_io_submit 2 -#define TARGET_NR_io_cancel 3 -#define TARGET_NR_io_getevents 4 -#define TARGET_NR_setxattr 5 -#define TARGET_NR_lsetxattr 6 -#define TARGET_NR_fsetxattr 7 -#define TARGET_NR_getxattr 8 -#define TARGET_NR_lgetxattr 9 -#define TARGET_NR_fgetxattr 10 -#define TARGET_NR_listxattr 11 -#define TARGET_NR_llistxattr 12 -#define TARGET_NR_flistxattr 13 -#define TARGET_NR_removexattr 14 -#define TARGET_NR_lremovexattr 15 -#define TARGET_NR_fremovexattr 16 -#define TARGET_NR_getcwd 17 -#define TARGET_NR_lookup_dcookie 18 -#define TARGET_NR_eventfd2 19 -#define TARGET_NR_epoll_create1 20 -#define TARGET_NR_epoll_ctl 21 -#define TARGET_NR_epoll_pwait 22 -#define TARGET_NR_dup 23 -#define TARGET_NR_dup3 24 #ifdef TARGET_RISCV32 -#define TARGET_NR_fcntl64 25 +# include "syscall32_nr.h" #else -#define TARGET_NR_fcntl 25 +# include "syscall64_nr.h" #endif -#define TARGET_NR_inotify_init1 26 -#define TARGET_NR_inotify_add_watch 27 -#define TARGET_NR_inotify_rm_watch 28 -#define TARGET_NR_ioctl 29 -#define TARGET_NR_ioprio_set 30 -#define TARGET_NR_ioprio_get 31 -#define TARGET_NR_flock 32 -#define TARGET_NR_mknodat 33 -#define TARGET_NR_mkdirat 34 -#define TARGET_NR_unlinkat 35 -#define TARGET_NR_symlinkat 36 -#define TARGET_NR_linkat 37 -#define TARGET_NR_renameat 38 -#define TARGET_NR_umount2 39 -#define TARGET_NR_mount 40 -#define TARGET_NR_pivot_root 41 -#define TARGET_NR_nfsservctl 42 -#define TARGET_NR_statfs 43 -#define TARGET_NR_fstatfs 44 -#define TARGET_NR_truncate 45 -#define TARGET_NR_ftruncate 46 -#define TARGET_NR_fallocate 47 -#define TARGET_NR_faccessat 48 -#define TARGET_NR_chdir 49 -#define TARGET_NR_fchdir 50 -#define TARGET_NR_chroot 51 -#define TARGET_NR_fchmod 52 -#define TARGET_NR_fchmodat 53 -#define TARGET_NR_fchownat 54 -#define TARGET_NR_fchown 55 -#define TARGET_NR_openat 56 -#define TARGET_NR_close 57 -#define TARGET_NR_vhangup 58 -#define TARGET_NR_pipe2 59 -#define TARGET_NR_quotactl 60 -#define TARGET_NR_getdents64 61 -#ifdef TARGET_RISCV32 -#define TARGET_NR__llseek 62 -#else -#define TARGET_NR_lseek 62 -#endif -#define TARGET_NR_read 63 -#define TARGET_NR_write 64 -#define TARGET_NR_readv 65 -#define TARGET_NR_writev 66 -#define TARGET_NR_pread64 67 -#define TARGET_NR_pwrite64 68 -#define TARGET_NR_preadv 69 -#define TARGET_NR_pwritev 70 -#define TARGET_NR_sendfile 71 -#define TARGET_NR_pselect6 72 -#define TARGET_NR_ppoll 73 -#define TARGET_NR_signalfd4 74 -#define TARGET_NR_vmsplice 75 -#define TARGET_NR_splice 76 -#define TARGET_NR_tee 77 -#define TARGET_NR_readlinkat 78 -#define TARGET_NR_newfstatat 79 -#define TARGET_NR_fstat 80 -#define TARGET_NR_sync 81 -#define TARGET_NR_fsync 82 -#define TARGET_NR_fdatasync 83 -#define TARGET_NR_sync_file_range 84 -#define TARGET_NR_timerfd_create 85 -#define TARGET_NR_timerfd_settime 86 -#define TARGET_NR_timerfd_gettime 87 -#define TARGET_NR_utimensat 88 -#define TARGET_NR_acct 89 -#define TARGET_NR_capget 90 -#define TARGET_NR_capset 91 -#define TARGET_NR_personality 92 -#define TARGET_NR_exit 93 -#define TARGET_NR_exit_group 94 -#define TARGET_NR_waitid 95 -#define TARGET_NR_set_tid_address 96 -#define TARGET_NR_unshare 97 -#define TARGET_NR_futex 98 -#define TARGET_NR_set_robust_list 99 -#define TARGET_NR_get_robust_list 100 -#define TARGET_NR_nanosleep 101 -#define TARGET_NR_getitimer 102 -#define TARGET_NR_setitimer 103 -#define TARGET_NR_kexec_load 104 -#define TARGET_NR_init_module 105 -#define TARGET_NR_delete_module 106 -#define TARGET_NR_timer_create 107 -#define TARGET_NR_timer_gettime 108 -#define TARGET_NR_timer_getoverrun 109 -#define TARGET_NR_timer_settime 110 -#define TARGET_NR_timer_delete 111 -#define TARGET_NR_clock_settime 112 -#define TARGET_NR_clock_gettime 113 -#define TARGET_NR_clock_getres 114 -#define TARGET_NR_clock_nanosleep 115 -#define TARGET_NR_syslog 116 -#define TARGET_NR_ptrace 117 -#define TARGET_NR_sched_setparam 118 -#define TARGET_NR_sched_setscheduler 119 -#define TARGET_NR_sched_getscheduler 120 -#define TARGET_NR_sched_getparam 121 -#define TARGET_NR_sched_setaffinity 122 -#define TARGET_NR_sched_getaffinity 123 -#define TARGET_NR_sched_yield 124 -#define TARGET_NR_sched_get_priority_max 125 -#define TARGET_NR_sched_get_priority_min 126 -#define TARGET_NR_sched_rr_get_interval 127 -#define TARGET_NR_restart_syscall 128 -#define TARGET_NR_kill 129 -#define TARGET_NR_tkill 130 -#define TARGET_NR_tgkill 131 -#define TARGET_NR_sigaltstack 132 -#define TARGET_NR_rt_sigsuspend 133 -#define TARGET_NR_rt_sigaction 134 -#define TARGET_NR_rt_sigprocmask 135 -#define TARGET_NR_rt_sigpending 136 -#define TARGET_NR_rt_sigtimedwait 137 -#define TARGET_NR_rt_sigqueueinfo 138 -#define TARGET_NR_rt_sigreturn 139 -#define TARGET_NR_setpriority 140 -#define TARGET_NR_getpriority 141 -#define TARGET_NR_reboot 142 -#define TARGET_NR_setregid 143 -#define TARGET_NR_setgid 144 -#define TARGET_NR_setreuid 145 -#define TARGET_NR_setuid 146 -#define TARGET_NR_setresuid 147 -#define TARGET_NR_getresuid 148 -#define TARGET_NR_setresgid 149 -#define TARGET_NR_getresgid 150 -#define TARGET_NR_setfsuid 151 -#define TARGET_NR_setfsgid 152 -#define TARGET_NR_times 153 -#define TARGET_NR_setpgid 154 -#define TARGET_NR_getpgid 155 -#define TARGET_NR_getsid 156 -#define TARGET_NR_setsid 157 -#define TARGET_NR_getgroups 158 -#define TARGET_NR_setgroups 159 -#define TARGET_NR_uname 160 -#define TARGET_NR_sethostname 161 -#define TARGET_NR_setdomainname 162 -#define TARGET_NR_getrlimit 163 -#define TARGET_NR_setrlimit 164 -#define TARGET_NR_getrusage 165 -#define TARGET_NR_umask 166 -#define TARGET_NR_prctl 167 -#define TARGET_NR_getcpu 168 -#define TARGET_NR_gettimeofday 169 -#define TARGET_NR_settimeofday 170 -#define TARGET_NR_adjtimex 171 -#define TARGET_NR_getpid 172 -#define TARGET_NR_getppid 173 -#define TARGET_NR_getuid 174 -#define TARGET_NR_geteuid 175 -#define TARGET_NR_getgid 176 -#define TARGET_NR_getegid 177 -#define TARGET_NR_gettid 178 -#define TARGET_NR_sysinfo 179 -#define TARGET_NR_mq_open 180 -#define TARGET_NR_mq_unlink 181 -#define TARGET_NR_mq_timedsend 182 -#define TARGET_NR_mq_timedreceive 183 -#define TARGET_NR_mq_notify 184 -#define TARGET_NR_mq_getsetattr 185 -#define TARGET_NR_msgget 186 -#define TARGET_NR_msgctl 187 -#define TARGET_NR_msgrcv 188 -#define TARGET_NR_msgsnd 189 -#define TARGET_NR_semget 190 -#define TARGET_NR_semctl 191 -#define TARGET_NR_semtimedop 192 -#define TARGET_NR_semop 193 -#define TARGET_NR_shmget 194 -#define TARGET_NR_shmctl 195 -#define TARGET_NR_shmat 196 -#define TARGET_NR_shmdt 197 -#define TARGET_NR_socket 198 -#define TARGET_NR_socketpair 199 -#define TARGET_NR_bind 200 -#define TARGET_NR_listen 201 -#define TARGET_NR_accept 202 -#define TARGET_NR_connect 203 -#define TARGET_NR_getsockname 204 -#define TARGET_NR_getpeername 205 -#define TARGET_NR_sendto 206 -#define TARGET_NR_recvfrom 207 -#define TARGET_NR_setsockopt 208 -#define TARGET_NR_getsockopt 209 -#define TARGET_NR_shutdown 210 -#define TARGET_NR_sendmsg 211 -#define TARGET_NR_recvmsg 212 -#define TARGET_NR_readahead 213 -#define TARGET_NR_brk 214 -#define TARGET_NR_munmap 215 -#define TARGET_NR_mremap 216 -#define TARGET_NR_add_key 217 -#define TARGET_NR_request_key 218 -#define TARGET_NR_keyctl 219 -#define TARGET_NR_clone 220 -#define TARGET_NR_execve 221 -#ifdef TARGET_RISCV32 -#define TARGET_NR_mmap2 222 -#define TARGET_NR_fadvise64_64 223 -#else -#define TARGET_NR_mmap 222 -#define TARGET_NR_fadvise64 223 -#endif -#define TARGET_NR_swapon 224 -#define TARGET_NR_swapoff 225 -#define TARGET_NR_mprotect 226 -#define TARGET_NR_msync 227 -#define TARGET_NR_mlock 228 -#define TARGET_NR_munlock 229 -#define TARGET_NR_mlockall 230 -#define TARGET_NR_munlockall 231 -#define TARGET_NR_mincore 232 -#define TARGET_NR_madvise 233 -#define TARGET_NR_remap_file_pages 234 -#define TARGET_NR_mbind 235 -#define TARGET_NR_get_mempolicy 236 -#define TARGET_NR_set_mempolicy 237 -#define TARGET_NR_migrate_pages 238 -#define TARGET_NR_move_pages 239 -#define TARGET_NR_rt_tgsigqueueinfo 240 -#define TARGET_NR_perf_event_open 241 -#define TARGET_NR_accept4 242 -#define TARGET_NR_recvmmsg 243 -#define TARGET_NR_arch_specific_syscall 244 -#define TARGET_NR_wait4 260 -#define TARGET_NR_prlimit64 261 -#define TARGET_NR_fanotify_init 262 -#define TARGET_NR_fanotify_mark 263 -#define TARGET_NR_name_to_handle_at 264 -#define TARGET_NR_open_by_handle_at 265 -#define TARGET_NR_clock_adjtime 266 -#define TARGET_NR_syncfs 267 -#define TARGET_NR_setns 268 -#define TARGET_NR_sendmmsg 269 -#define TARGET_NR_process_vm_readv 270 -#define TARGET_NR_process_vm_writev 271 -#define TARGET_NR_kcmp 272 -#define TARGET_NR_finit_module 273 -#define TARGET_NR_sched_setattr 274 -#define TARGET_NR_sched_getattr 275 -#define TARGET_NR_renameat2 276 -#define TARGET_NR_seccomp 277 -#define TARGET_NR_getrandom 278 -#define TARGET_NR_memfd_create 279 -#define TARGET_NR_bpf 280 -#define TARGET_NR_execveat 281 -#define TARGET_NR_userfaultfd 282 -#define TARGET_NR_membarrier 283 -#define TARGET_NR_mlock2 284 -#define TARGET_NR_copy_file_range 285 -#define TARGET_NR_preadv2 286 -#define TARGET_NR_pwritev2 287 -#define TARGET_NR_pkey_mprotect 288 -#define TARGET_NR_pkey_alloc 289 -#define TARGET_NR_pkey_free 290 -#define TARGET_NR_statx 291 -#define TARGET_NR_io_pgetevents 292 -#define TARGET_NR_rseq 293 -#define TARGET_NR_kexec_file_load 294 - -#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1) #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 661404687080..03ecfd1298c2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -295,7 +295,7 @@ _syscall1(int,exit_group,int,error_code) #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address) _syscall1(int,set_tid_address,int *,tidptr) #endif -#if defined(TARGET_NR_futex) && defined(__NR_futex) +#if (defined(TARGET_NR_futex) || defined(TARGET_NR_exit)) && defined(__NR_futex) _syscall6(int,sys_futex,int *,uaddr,int,op,int,val, const struct timespec *,timeout,int *,uaddr2,int,val3) #endif From patchwork Thu Mar 19 09:26:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69E27913 for ; Thu, 19 Mar 2020 09:32:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A60220663 for ; Thu, 19 Mar 2020 09:32:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A60220663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErXZ-00005N-Ct for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:32:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40950) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRy-0005Qy-Ch for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRw-0004Eo-Nm for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:50 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:45001) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jErRw-0004Do-Em for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:48 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1McZfZ-1jrDXZ1i3h-00cvwS; Thu, 19 Mar 2020 10:26:40 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 13/16] scripts: add a script to generate syscall_nr.h Date: Thu, 19 Mar 2020 10:26:24 +0100 Message-Id: <20200319092627.51487-14-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Rp7DTZxyicnOGYcM/nv6nXaG3JxPR13mUSyaTMRB0KqTStKZjst rAdaw50n4C4gnX632iKNa8VqNMasvE+1BNtmrXhVOWLnDfWMPVx5ivHFi6ugngF0+Z1RxQC beaYNEep0IHLeeqGGwpckgpATttv7YfXAMa7O5SkBf/rBvwnSULU6Lco44KYw0G7JdfHqYr AR09bd880ekqaH2OpBp4w== X-UI-Out-Filterresults: notjunk:1;V03:K0:zDboJhKwmc4=:EMsJ2EWn2hHr0tAkcg7pTk WYTBa5FbfXMol5wzoPgUqaCbzCyey9dNe+6m1OOcaJdXp7uXeeoijRyRxN4HWZFYJ6TBfW8ca PX81dd+xnaqHdEL4JAVh4eSAevhXHn/CLExHT4pbm95apUc6QAZVsySb4KeCn/9AwiQA/4yD2 V9GX25nw0JdeDZ3GLNCTBSVZ+LGHiY0M5rIe/PFIwqpjJROKfxhvtTqawNjpefgmTWHvyll/x VuOMNvnI7rkGqyFb0UdF9oSePI1BDM3/chzUGpvItGeCB2pYE7/ymsYn3JrVvFNN98lUvHZTb Tgopw4UcmaGtFMgR2Uz5o8zR0+0nH5EAY+il1QjuZ9ZkE72FsNpsn9+9CU3BoqBA8KhVN0hjJ ide+yR4Uzc+Vt6t8Y3jIjlLuKLwIuK5X4hOy/SUP+2YBQb+Bgjmfi+gv8zoh9TrHxcgMaUt+L HfrPVk/zpW7jKBJdnfHv3q4MN9bRKJ+P7bSTOiJD8XNjuNZ6ST8ms04ZL/6/X3268Gy/ORWsb wx5oplgh4h7fwAa0w9XS5N7+Mu5KcwkPjg3suEfAE/1ILnL3cpu7uoiHBeqK9MraLNOG0bEDU aoxUcVNvnZcIkrJ2rs8j7gyQyxS6J+iXfHzsxwcoqwtrqAXsRC5yple+AEFOIY0nMkR79Pdax IyHDWhTMkCr2Fau3ngjITfRLqFNedhM/j6er8ftwtmxnXMTje+My6HOo9DFfQNBKFqDNkDREH 69Xx6eUZnISJA1EPuh3jMl4VAuyyZ6wTYzkRVlYIJqiBPzVJ0BDJrrqsKYMEbStWAi+ndnMMp p7c+CiPg3sNw6t4qiso9/97Vol5NwpTbJuAC4ycA3JMiIoI1pfVLOfo6891FPR5GWcS+77N X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Taylor Simpson , Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This script is needed for targets based on asm-generic syscall numbers generation Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Reviewed-by: Taylor Simpson Reviewed-by: Richard Henderson Message-Id: <20200316085620.309769-2-laurent@vivier.eu> [lv: added file in MAINTAINERS] --- MAINTAINERS | 1 + scripts/gensyscalls.sh | 102 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100755 scripts/gensyscalls.sh diff --git a/MAINTAINERS b/MAINTAINERS index 36d0c6887a99..fa4abbc863c2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2448,6 +2448,7 @@ S: Maintained F: linux-user/ F: default-configs/*-linux-user.mak F: scripts/qemu-binfmt-conf.sh +F: scripts/gensyscalls.sh Tiny Code Generator (TCG) ------------------------- diff --git a/scripts/gensyscalls.sh b/scripts/gensyscalls.sh new file mode 100755 index 000000000000..b7b8456f6312 --- /dev/null +++ b/scripts/gensyscalls.sh @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Update syscall_nr.h files from linux headers asm-generic/unistd.h +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +linux="$1" +output="$2" + +TMP=$(mktemp -d) + +if [ "$linux" = "" ] ; then + echo "Needs path to linux source tree" 1>&2 + exit 1 +fi + +if [ "$output" = "" ] ; then + output="$PWD" +fi + +upper() +{ + echo "$1" | tr "[:lower:]" "[:upper:]" | tr "[:punct:]" "_" +} + +qemu_arch() +{ + case "$1" in + arm64) + echo "aarch64" + ;; + *) + echo "$1" + ;; + esac +} + +read_includes() +{ + arch=$1 + bits=$2 + + cpp -P -nostdinc -fdirectives-only \ + -D_UAPI_ASM_$(upper ${arch})_BITSPERLONG_H \ + -D__BITS_PER_LONG=${bits} \ + -I${linux}/arch/${arch}/include/uapi/ \ + -I${linux}/include/uapi \ + -I${TMP} \ + "${linux}/arch/${arch}/include/uapi/asm/unistd.h" +} + +filter_defines() +{ + grep -e "#define __NR_" -e "#define __NR3264" +} + +rename_defines() +{ + sed "s/ __NR_/ TARGET_NR_/g;s/(__NR_/(TARGET_NR_/g" +} + +evaluate_values() +{ + sed "s/#define TARGET_NR_/QEMU TARGET_NR_/" | \ + cpp -P -nostdinc | \ + sed "s/^QEMU /#define /" +} + +generate_syscall_nr() +{ + arch=$1 + bits=$2 + file="$3" + guard="$(upper LINUX_USER_$(qemu_arch $arch)_$(basename "$file"))" + + (echo "/*" + echo " * This file contains the system call numbers." + echo " * Do not modify." + echo " * This file is generated by scripts/gensyscalls.sh" + echo " */" + echo "#ifndef ${guard}" + echo "#define ${guard}" + echo + read_includes $arch $bits | filter_defines | rename_defines | \ + evaluate_values | sort -n -k 3 + echo + echo "#endif /* ${guard} */" + echo) > "$file" +} + +mkdir "$TMP/asm" +> "$TMP/asm/bitsperlong.h" + +generate_syscall_nr arm64 64 "$output/linux-user/aarch64/syscall_nr.h" +generate_syscall_nr nios2 32 "$output/linux-user/nios2/syscall_nr.h" +generate_syscall_nr openrisc 32 "$output/linux-user/openrisc/syscall_nr.h" + +generate_syscall_nr riscv 32 "$output/linux-user/riscv/syscall32_nr.h" +generate_syscall_nr riscv 64 "$output/linux-user/riscv/syscall64_nr.h" +rm -fr "$TMP" From patchwork Thu Mar 19 09:26:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446943 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44DD0913 for ; Thu, 19 Mar 2020 09:34:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 253B820663 for ; Thu, 19 Mar 2020 09:34:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 253B820663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErZX-000356-At for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:34:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41021) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErS3-0005gv-RG for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErS2-0004I8-3K for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:55 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:35407) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErS1-0004Hk-Pg for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:54 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MvsyF-1jWwZ549Rv-00sxQE; Thu, 19 Mar 2020 10:26:41 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 14/16] linux-user, aarch64: sync syscall numbers with kernel v5.5 Date: Thu, 19 Mar 2020 10:26:25 +0100 Message-Id: <20200319092627.51487-15-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:pKVz0hOBLF6d86o4ssCAVZJtFrwan9b8gvfcqm0zwcQTEuHod4U oRuU9QZpch7OZoYauzBEEohwB9j0n9KNzme5RdiAgQlEH6OK+o3CsylbC8vIqlEo9RmBCqw AybsCFR1sIuzj7JSEtbzvc+RWlSIAh/lar57WKHFl7ph0S25Ow2LQTWivjGg+9FspTEBD+E 3iljcU8fCSUOUvtwDrkiQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:JYcIldveUtM=:0tW1ixZhLcTq61BTAJ6fGa REt0JEDgT3kXIgJOsVCUu3CQa0fHAZwCvThChunvGn7Apf8Cr6MaBYawR0pYsOJdwJ5EE9zUs bmwjAwro78NuoTqyxlwBAC3DAE/AciBtRNtqBs3Iz0YtRa7a+zwcM2KB7YhcYGaOiXcCHcozI JGuIUCbuzI68bpr4nSySgjgctV1LdPufRKsPrXj/Y/3HFAxFBvzIupwgjRJUeW2J3okL7fNST LxDP4eaEAPKHqXcGFva9o7MWIembBGcTQTSlYxH56WHm6aYAvuDs8J4DB9UaviTbIYG3j06e1 OXSGffbi5hwTwOJMUgo+zyUqOqaZUk5Ji4yVRXoZ4QK6rVB7tTlGsoqrVK4YvrZqqxWV+zBok xblapAk5TymXbZ9TThyyhTwOl7/gLJTdmbBbiyyA6lppPun54eI9ppvFYyuYb85x1KX/ypad5 84qXdr1eB385+v00YWoFR9CDS6C1l8bIDeY+buUcvpkwGT9Es7IljWo5KtGAkBrcyaxEgVCC5 0lEPpmhSwBQrZ3MDmukZGDShcVllBBPEFFmFdJi1+c76EX4knhJKqsaiNu/k/VuO3VqusAGiz hRQ4fsJBPW3OmNMzXdEbPnEEpr3CdTZK79NF19jSrBbsCsJsEVDTYTTJnKSUK20u+EDauIle8 Pn3fT960U9Q8Usm+yB0C8diuHu8uIOsTZV/vGkK0MgUdSjhpodHoeKSHqmDsMPAGiWF33WudA URYRNvjS/eh99+W4+Nw+dhuIzA/9n5btRIQoTo+QH+Hu6cB0Z7dx73US11zJHmm3eOAffHtZT aMDq08R5z+6G++nXgpEebjEPPUKefWPIO3dS9QRg2gT2yLWqW+KYWeOx5LoWIkjs6zwbxgc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use helper script scripts/gensyscalls.sh to generate the file. This change TARGET_NR_fstatat64 by TARGET_NR_newfstatat that is correct because definitions from linux are: arch/arm64/include/uapi/asm/unistd.h #define __ARCH_WANT_NEW_STAT include/uapi/asm-generic/unistd.h #if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) #define __NR3264_fstatat 79 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat) #define __NR3264_fstat 80 __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat) #endif ... #if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT) ... #if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) #define __NR_newfstatat __NR3264_fstatat #define __NR_fstat __NR3264_fstat #endif ... Add syscalls 286 (preadv2) to 435 (clone3). Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Message-Id: <20200316085620.309769-3-laurent@vivier.eu> --- linux-user/aarch64/syscall_nr.h | 34 ++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/linux-user/aarch64/syscall_nr.h b/linux-user/aarch64/syscall_nr.h index f00ffd7fb82f..85de000b2490 100644 --- a/linux-user/aarch64/syscall_nr.h +++ b/linux-user/aarch64/syscall_nr.h @@ -1,7 +1,8 @@ /* * This file contains the system call numbers. + * Do not modify. + * This file is generated by scripts/gensyscalls.sh */ - #ifndef LINUX_USER_AARCH64_SYSCALL_NR_H #define LINUX_USER_AARCH64_SYSCALL_NR_H @@ -84,7 +85,7 @@ #define TARGET_NR_splice 76 #define TARGET_NR_tee 77 #define TARGET_NR_readlinkat 78 -#define TARGET_NR_fstatat64 79 +#define TARGET_NR_newfstatat 79 #define TARGET_NR_fstat 80 #define TARGET_NR_sync 81 #define TARGET_NR_fsync 82 @@ -254,8 +255,8 @@ #define TARGET_NR_prlimit64 261 #define TARGET_NR_fanotify_init 262 #define TARGET_NR_fanotify_mark 263 -#define TARGET_NR_name_to_handle_at 264 -#define TARGET_NR_open_by_handle_at 265 +#define TARGET_NR_name_to_handle_at 264 +#define TARGET_NR_open_by_handle_at 265 #define TARGET_NR_clock_adjtime 266 #define TARGET_NR_syncfs 267 #define TARGET_NR_setns 268 @@ -276,5 +277,28 @@ #define TARGET_NR_membarrier 283 #define TARGET_NR_mlock2 284 #define TARGET_NR_copy_file_range 285 +#define TARGET_NR_preadv2 286 +#define TARGET_NR_pwritev2 287 +#define TARGET_NR_pkey_mprotect 288 +#define TARGET_NR_pkey_alloc 289 +#define TARGET_NR_pkey_free 290 +#define TARGET_NR_statx 291 +#define TARGET_NR_io_pgetevents 292 +#define TARGET_NR_rseq 293 +#define TARGET_NR_kexec_file_load 294 +#define TARGET_NR_pidfd_send_signal 424 +#define TARGET_NR_io_uring_setup 425 +#define TARGET_NR_io_uring_enter 426 +#define TARGET_NR_io_uring_register 427 +#define TARGET_NR_open_tree 428 +#define TARGET_NR_move_mount 429 +#define TARGET_NR_fsopen 430 +#define TARGET_NR_fsconfig 431 +#define TARGET_NR_fsmount 432 +#define TARGET_NR_fspick 433 +#define TARGET_NR_pidfd_open 434 +#define TARGET_NR_clone3 435 +#define TARGET_NR_syscalls 436 + +#endif /* LINUX_USER_AARCH64_SYSCALL_NR_H */ -#endif From patchwork Thu Mar 19 09:26:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446935 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 099F2913 for ; Thu, 19 Mar 2020 09:32:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD79620663 for ; Thu, 19 Mar 2020 09:32:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD79620663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErXU-0008O1-VO for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:32:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41041) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErS7-0005uA-AJ for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:27:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErS3-0004Iz-Q0 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:59 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:47767) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErS2-0004IC-U6 for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:55 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1My6xz-1jUiZa2CJb-00zWzm; Thu, 19 Mar 2020 10:26:42 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 15/16] linux-user, nios2: sync syscall numbers with kernel v5.5 Date: Thu, 19 Mar 2020 10:26:26 +0100 Message-Id: <20200319092627.51487-16-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:cR8V1I5Jq81SUTF1uOmdSuHljvx3MH/J0yxMC/Sfbm2cx87Ioob Yap2EWvGY6ODI086MlEAUVF+L9QPt3uKro0NcHI6OtqZJWk8mzieb+nHXLst/QnPI/r1UBg u95jSKDhV0AePKXpW6w4CCy6nUhN7rXrP/WHEAHoixCqfezb1Iub6LVyXCJKrnNp4YU8oWn +HYx/sPXphV6oWcpkieCA== X-UI-Out-Filterresults: notjunk:1;V03:K0:MFLh5HLropo=:l/u9SZv1+UdE6Q7Fu0nF3T Ntrnucy+Neds/SNw2tgahIipM8We88EPniAupBIp9vP4BgAm5IP0NDRYzSeK7l+f4cs9eO0ZI QrnTz4DDT77yYgYPSsRUVQGmQ7wbSBviOvkvapb4bCDPdjwdDG8x48yv3rZnGYeCwjNIB4COh VT0V0wdEjZkjbvWtTVhSGPEYonrq3RtsRV4XSFdI004NsYkvGJkAn98yRWGz4semQcFdv+1rV xYqfEmYT6r5D3sQ8dj5LIkMjAWyT2j80N656Ot2FtBXYX2fX+lrj4+otPQvJ5iAk6D6nDteuA ISc1FzM8GTTyg7aL/AjH6b9NHwHiL4KFqJphsa+RQAkzSAhb4pNLyKqxQMC2o1eGC0VgXH/dd etb7j5Bu4u1Cv2ESG/n+EGyBoBc+z5SQiHLPQtYBvwwLdKNZmp4Z3q0gYQJsc31FiUrgcaqiE wRgg+rWVy3q/WjCPMz9sL3btpeSzXSt9WiRJReHc2ihOEzJBiocgRiuW4IPGBgQ6i/PcCaiQ4 jKKgFtqQuTudKuk+QZFeFpcnF/ESnywK//suQATZuBAL9GUF/ugfMBupYQv8ffuuMKzDy/4RV MHdMrfqjsY4oD9KL8PGIvm9+pUqwBUtIipizfTRDpFb9Uni3ZiNmsFn3Nj6gpRKYfpekwG9RD 1XfJWdyLAgcAfsOdVlk2Bi7enLPSBia+zIrGgGQpS8V3mUHC4EV8eLeIeS+e79AsLzPCYy6CP R5AZLz+dHUo2OY7VY56bd8sQXwYn0ngMdh+CuAxA2az2th3dUUt38SL3AaQxDM/KO2/r2bLX3 dfgkL7nAGH3ECcaOpeXw/WqBOY0LS08hKWxkLRhLWqcM6JAyoisDIAhETTLh/jtt4CWX6v3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use helper script scripts/gensyscalls.sh to generate the file. This adds TARGET_NR_llseek that was missing and remove syscalls 1024 to 1079. Add new syscalls from 288 (pkey_mprotect) to 434 (pidfd_open) Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Message-Id: <20200316085620.309769-4-laurent@vivier.eu> --- linux-user/nios2/syscall_nr.h | 650 +++++++++++++++++----------------- 1 file changed, 320 insertions(+), 330 deletions(-) diff --git a/linux-user/nios2/syscall_nr.h b/linux-user/nios2/syscall_nr.h index 8fb87864ca0b..32d485dc9ae8 100644 --- a/linux-user/nios2/syscall_nr.h +++ b/linux-user/nios2/syscall_nr.h @@ -1,334 +1,324 @@ +/* + * This file contains the system call numbers. + * Do not modify. + * This file is generated by scripts/gensyscalls.sh + */ #ifndef LINUX_USER_NIOS2_SYSCALL_NR_H #define LINUX_USER_NIOS2_SYSCALL_NR_H -#define TARGET_NR_io_setup 0 -#define TARGET_NR_io_destroy 1 -#define TARGET_NR_io_submit 2 -#define TARGET_NR_io_cancel 3 -#define TARGET_NR_io_getevents 4 -#define TARGET_NR_setxattr 5 -#define TARGET_NR_lsetxattr 6 -#define TARGET_NR_fsetxattr 7 -#define TARGET_NR_getxattr 8 -#define TARGET_NR_lgetxattr 9 -#define TARGET_NR_fgetxattr 10 -#define TARGET_NR_listxattr 11 -#define TARGET_NR_llistxattr 12 -#define TARGET_NR_flistxattr 13 -#define TARGET_NR_removexattr 14 -#define TARGET_NR_lremovexattr 15 -#define TARGET_NR_fremovexattr 16 -#define TARGET_NR_getcwd 17 -#define TARGET_NR_lookup_dcookie 18 -#define TARGET_NR_eventfd2 19 -#define TARGET_NR_epoll_create1 20 -#define TARGET_NR_epoll_ctl 21 -#define TARGET_NR_epoll_pwait 22 -#define TARGET_NR_dup 23 -#define TARGET_NR_dup3 24 -#define TARGET_NR_fcntl64 25 -#define TARGET_NR_inotify_init1 26 -#define TARGET_NR_inotify_add_watch 27 -#define TARGET_NR_inotify_rm_watch 28 -#define TARGET_NR_ioctl 29 -#define TARGET_NR_ioprio_set 30 -#define TARGET_NR_ioprio_get 31 -#define TARGET_NR_flock 32 -#define TARGET_NR_mknodat 33 -#define TARGET_NR_mkdirat 34 -#define TARGET_NR_unlinkat 35 -#define TARGET_NR_symlinkat 36 -#define TARGET_NR_linkat 37 -#define TARGET_NR_renameat 38 -#define TARGET_NR_umount2 39 -#define TARGET_NR_mount 40 -#define TARGET_NR_pivot_root 41 -#define TARGET_NR_nfsservctl 42 -#define TARGET_NR_statfs64 43 -#define TARGET_NR_fstatfs64 44 -#define TARGET_NR_truncate64 45 -#define TARGET_NR_ftruncate64 46 -#define TARGET_NR_fallocate 47 -#define TARGET_NR_faccessat 48 -#define TARGET_NR_chdir 49 -#define TARGET_NR_fchdir 50 -#define TARGET_NR_chroot 51 -#define TARGET_NR_fchmod 52 -#define TARGET_NR_fchmodat 53 -#define TARGET_NR_fchownat 54 -#define TARGET_NR_fchown 55 -#define TARGET_NR_openat 56 -#define TARGET_NR_close 57 -#define TARGET_NR_vhangup 58 -#define TARGET_NR_pipe2 59 -#define TARGET_NR_quotactl 60 -#define TARGET_NR_getdents64 61 -#define TARGET_NR_read 63 -#define TARGET_NR_write 64 -#define TARGET_NR_readv 65 -#define TARGET_NR_writev 66 -#define TARGET_NR_pread64 67 -#define TARGET_NR_pwrite64 68 -#define TARGET_NR_preadv 69 -#define TARGET_NR_pwritev 70 -#define TARGET_NR_sendfile64 71 -#define TARGET_NR_pselect6 72 -#define TARGET_NR_ppoll 73 -#define TARGET_NR_signalfd4 74 -#define TARGET_NR_vmsplice 75 -#define TARGET_NR_splice 76 -#define TARGET_NR_tee 77 -#define TARGET_NR_readlinkat 78 -#define TARGET_NR_fstatat64 79 -#define TARGET_NR_fstat64 80 -#define TARGET_NR_sync 81 -#define TARGET_NR_fsync 82 -#define TARGET_NR_fdatasync 83 -#define TARGET_NR_sync_file_range 84 -#define TARGET_NR_timerfd_create 85 -#define TARGET_NR_timerfd_settime 86 -#define TARGET_NR_timerfd_gettime 87 -#define TARGET_NR_utimensat 88 -#define TARGET_NR_acct 89 -#define TARGET_NR_capget 90 -#define TARGET_NR_capset 91 -#define TARGET_NR_personality 92 -#define TARGET_NR_exit 93 -#define TARGET_NR_exit_group 94 -#define TARGET_NR_waitid 95 -#define TARGET_NR_set_tid_address 96 -#define TARGET_NR_unshare 97 -#define TARGET_NR_futex 98 -#define TARGET_NR_set_robust_list 99 -#define TARGET_NR_get_robust_list 100 -#define TARGET_NR_nanosleep 101 -#define TARGET_NR_getitimer 102 -#define TARGET_NR_setitimer 103 -#define TARGET_NR_kexec_load 104 -#define TARGET_NR_init_module 105 -#define TARGET_NR_delete_module 106 -#define TARGET_NR_timer_create 107 -#define TARGET_NR_timer_gettime 108 -#define TARGET_NR_timer_getoverrun 109 -#define TARGET_NR_timer_settime 110 -#define TARGET_NR_timer_delete 111 -#define TARGET_NR_clock_settime 112 -#define TARGET_NR_clock_gettime 113 -#define TARGET_NR_clock_getres 114 -#define TARGET_NR_clock_nanosleep 115 -#define TARGET_NR_syslog 116 -#define TARGET_NR_ptrace 117 -#define TARGET_NR_sched_setparam 118 -#define TARGET_NR_sched_setscheduler 119 -#define TARGET_NR_sched_getscheduler 120 -#define TARGET_NR_sched_getparam 121 -#define TARGET_NR_sched_setaffinity 122 -#define TARGET_NR_sched_getaffinity 123 -#define TARGET_NR_sched_yield 124 -#define TARGET_NR_sched_get_priority_max 125 -#define TARGET_NR_sched_get_priority_min 126 -#define TARGET_NR_sched_rr_get_interval 127 -#define TARGET_NR_restart_syscall 128 -#define TARGET_NR_kill 129 -#define TARGET_NR_tkill 130 -#define TARGET_NR_tgkill 131 -#define TARGET_NR_sigaltstack 132 -#define TARGET_NR_rt_sigsuspend 133 -#define TARGET_NR_rt_sigaction 134 -#define TARGET_NR_rt_sigprocmask 135 -#define TARGET_NR_rt_sigpending 136 -#define TARGET_NR_rt_sigtimedwait 137 -#define TARGET_NR_rt_sigqueueinfo 138 -#define TARGET_NR_rt_sigreturn 139 -#define TARGET_NR_setpriority 140 -#define TARGET_NR_getpriority 141 -#define TARGET_NR_reboot 142 -#define TARGET_NR_setregid 143 -#define TARGET_NR_setgid 144 -#define TARGET_NR_setreuid 145 -#define TARGET_NR_setuid 146 -#define TARGET_NR_setresuid 147 -#define TARGET_NR_getresuid 148 -#define TARGET_NR_setresgid 149 -#define TARGET_NR_getresgid 150 -#define TARGET_NR_setfsuid 151 -#define TARGET_NR_setfsgid 152 -#define TARGET_NR_times 153 -#define TARGET_NR_setpgid 154 -#define TARGET_NR_getpgid 155 -#define TARGET_NR_getsid 156 -#define TARGET_NR_setsid 157 -#define TARGET_NR_getgroups 158 -#define TARGET_NR_setgroups 159 -#define TARGET_NR_uname 160 -#define TARGET_NR_sethostname 161 -#define TARGET_NR_setdomainname 162 -#define TARGET_NR_getrlimit 163 -#define TARGET_NR_setrlimit 164 -#define TARGET_NR_getrusage 165 -#define TARGET_NR_umask 166 -#define TARGET_NR_prctl 167 -#define TARGET_NR_getcpu 168 -#define TARGET_NR_gettimeofday 169 -#define TARGET_NR_settimeofday 170 -#define TARGET_NR_adjtimex 171 -#define TARGET_NR_getpid 172 -#define TARGET_NR_getppid 173 -#define TARGET_NR_getuid 174 -#define TARGET_NR_geteuid 175 -#define TARGET_NR_getgid 176 -#define TARGET_NR_getegid 177 -#define TARGET_NR_gettid 178 -#define TARGET_NR_sysinfo 179 -#define TARGET_NR_mq_open 180 -#define TARGET_NR_mq_unlink 181 -#define TARGET_NR_mq_timedsend 182 -#define TARGET_NR_mq_timedreceive 183 -#define TARGET_NR_mq_notify 184 -#define TARGET_NR_mq_getsetattr 185 -#define TARGET_NR_msgget 186 -#define TARGET_NR_msgctl 187 -#define TARGET_NR_msgrcv 188 -#define TARGET_NR_msgsnd 189 -#define TARGET_NR_semget 190 -#define TARGET_NR_semctl 191 -#define TARGET_NR_semtimedop 192 -#define TARGET_NR_semop 193 -#define TARGET_NR_shmget 194 -#define TARGET_NR_shmctl 195 -#define TARGET_NR_shmat 196 -#define TARGET_NR_shmdt 197 -#define TARGET_NR_socket 198 -#define TARGET_NR_socketpair 199 -#define TARGET_NR_bind 200 -#define TARGET_NR_listen 201 -#define TARGET_NR_accept 202 -#define TARGET_NR_connect 203 -#define TARGET_NR_getsockname 204 -#define TARGET_NR_getpeername 205 -#define TARGET_NR_sendto 206 -#define TARGET_NR_recvfrom 207 -#define TARGET_NR_setsockopt 208 -#define TARGET_NR_getsockopt 209 -#define TARGET_NR_shutdown 210 -#define TARGET_NR_sendmsg 211 -#define TARGET_NR_recvmsg 212 -#define TARGET_NR_readahead 213 -#define TARGET_NR_brk 214 -#define TARGET_NR_munmap 215 -#define TARGET_NR_mremap 216 -#define TARGET_NR_add_key 217 -#define TARGET_NR_request_key 218 -#define TARGET_NR_keyctl 219 -#define TARGET_NR_clone 220 -#define TARGET_NR_execve 221 -#define TARGET_NR_mmap2 222 -#define TARGET_NR_fadvise64_64 223 -#define TARGET_NR_swapon 224 -#define TARGET_NR_swapoff 225 -#define TARGET_NR_mprotect 226 -#define TARGET_NR_msync 227 -#define TARGET_NR_mlock 228 -#define TARGET_NR_munlock 229 -#define TARGET_NR_mlockall 230 -#define TARGET_NR_munlockall 231 -#define TARGET_NR_mincore 232 -#define TARGET_NR_madvise 233 -#define TARGET_NR_remap_file_pages 234 -#define TARGET_NR_mbind 235 -#define TARGET_NR_get_mempolicy 236 -#define TARGET_NR_set_mempolicy 237 -#define TARGET_NR_migrate_pages 238 -#define TARGET_NR_move_pages 239 -#define TARGET_NR_rt_tgsigqueueinfo 240 -#define TARGET_NR_perf_event_open 241 -#define TARGET_NR_accept4 242 -#define TARGET_NR_recvmmsg 243 -#define TARGET_NR_cacheflush 244 -#define TARGET_NR_arch_specific_syscall 244 -#define TARGET_NR_wait4 260 -#define TARGET_NR_prlimit64 261 -#define TARGET_NR_fanotify_init 262 -#define TARGET_NR_fanotify_mark 263 -#define TARGET_NR_name_to_handle_at 264 -#define TARGET_NR_open_by_handle_at 265 -#define TARGET_NR_clock_adjtime 266 -#define TARGET_NR_syncfs 267 -#define TARGET_NR_setns 268 -#define TARGET_NR_sendmmsg 269 -#define TARGET_NR_process_vm_readv 270 -#define TARGET_NR_process_vm_writev 271 -#define TARGET_NR_kcmp 272 -#define TARGET_NR_finit_module 273 -#define TARGET_NR_sched_setattr 274 -#define TARGET_NR_sched_getattr 275 -#define TARGET_NR_renameat2 276 -#define TARGET_NR_seccomp 277 -#define TARGET_NR_getrandom 278 -#define TARGET_NR_memfd_create 279 -#define TARGET_NR_bpf 280 -#define TARGET_NR_execveat 281 -#define TARGET_NR_userfaultfd 282 -#define TARGET_NR_membarrier 283 -#define TARGET_NR_mlock2 284 -#define TARGET_NR_copy_file_range 285 -#define TARGET_NR_preadv2 286 -#define TARGET_NR_pwritev2 287 -#define TARGET_NR_open 1024 -#define TARGET_NR_link 1025 -#define TARGET_NR_unlink 1026 -#define TARGET_NR_mknod 1027 -#define TARGET_NR_chmod 1028 -#define TARGET_NR_chown 1029 -#define TARGET_NR_mkdir 1030 -#define TARGET_NR_rmdir 1031 -#define TARGET_NR_lchown 1032 -#define TARGET_NR_access 1033 -#define TARGET_NR_rename 1034 -#define TARGET_NR_readlink 1035 -#define TARGET_NR_symlink 1036 -#define TARGET_NR_utimes 1037 -#define TARGET_NR_3264_stat 1038 -#define TARGET_NR_3264_lstat 1039 -#define TARGET_NR_pipe 1040 -#define TARGET_NR_dup2 1041 -#define TARGET_NR_epoll_create 1042 -#define TARGET_NR_inotify_init 1043 -#define TARGET_NR_eventfd 1044 -#define TARGET_NR_signalfd 1045 -#define TARGET_NR_sendfile 1046 -#define TARGET_NR_ftruncate 1047 -#define TARGET_NR_truncate 1048 -#define TARGET_NR_stat 1049 -#define TARGET_NR_lstat 1050 -#define TARGET_NR_fstat 1051 -#define TARGET_NR_fcntl 1052 -#define TARGET_NR_fadvise64 1053 -#define TARGET_NR_newfstatat 1054 -#define TARGET_NR_fstatfs 1055 -#define TARGET_NR_statfs 1056 -#define TARGET_NR_lseek 1057 -#define TARGET_NR_mmap 1058 -#define TARGET_NR_alarm 1059 -#define TARGET_NR_getpgrp 1060 -#define TARGET_NR_pause 1061 -#define TARGET_NR_time 1062 -#define TARGET_NR_utime 1063 -#define TARGET_NR_creat 1064 -#define TARGET_NR_getdents 1065 -#define TARGET_NR_futimesat 1066 -#define TARGET_NR_select 1067 -#define TARGET_NR_poll 1068 -#define TARGET_NR_epoll_wait 1069 -#define TARGET_NR_ustat 1070 -#define TARGET_NR_vfork 1071 -#define TARGET_NR_oldwait4 1072 -#define TARGET_NR_recv 1073 -#define TARGET_NR_send 1074 -#define TARGET_NR_bdflush 1075 -#define TARGET_NR_umount 1076 -#define TARGET_NR_uselib 1077 -#define TARGET_NR__sysctl 1078 -#define TARGET_NR_fork 1079 +#define TARGET_NR_cacheflush (TARGET_NR_arch_specific_syscall) +#define TARGET_NR_io_setup 0 +#define TARGET_NR_io_destroy 1 +#define TARGET_NR_io_submit 2 +#define TARGET_NR_io_cancel 3 +#define TARGET_NR_io_getevents 4 +#define TARGET_NR_setxattr 5 +#define TARGET_NR_lsetxattr 6 +#define TARGET_NR_fsetxattr 7 +#define TARGET_NR_getxattr 8 +#define TARGET_NR_lgetxattr 9 +#define TARGET_NR_fgetxattr 10 +#define TARGET_NR_listxattr 11 +#define TARGET_NR_llistxattr 12 +#define TARGET_NR_flistxattr 13 +#define TARGET_NR_removexattr 14 +#define TARGET_NR_lremovexattr 15 +#define TARGET_NR_fremovexattr 16 +#define TARGET_NR_getcwd 17 +#define TARGET_NR_lookup_dcookie 18 +#define TARGET_NR_eventfd2 19 +#define TARGET_NR_epoll_create1 20 +#define TARGET_NR_epoll_ctl 21 +#define TARGET_NR_epoll_pwait 22 +#define TARGET_NR_dup 23 +#define TARGET_NR_dup3 24 +#define TARGET_NR_fcntl64 25 +#define TARGET_NR_inotify_init1 26 +#define TARGET_NR_inotify_add_watch 27 +#define TARGET_NR_inotify_rm_watch 28 +#define TARGET_NR_ioctl 29 +#define TARGET_NR_ioprio_set 30 +#define TARGET_NR_ioprio_get 31 +#define TARGET_NR_flock 32 +#define TARGET_NR_mknodat 33 +#define TARGET_NR_mkdirat 34 +#define TARGET_NR_unlinkat 35 +#define TARGET_NR_symlinkat 36 +#define TARGET_NR_linkat 37 +#define TARGET_NR_renameat 38 +#define TARGET_NR_umount2 39 +#define TARGET_NR_mount 40 +#define TARGET_NR_pivot_root 41 +#define TARGET_NR_nfsservctl 42 +#define TARGET_NR_statfs64 43 +#define TARGET_NR_fstatfs64 44 +#define TARGET_NR_truncate64 45 +#define TARGET_NR_ftruncate64 46 +#define TARGET_NR_fallocate 47 +#define TARGET_NR_faccessat 48 +#define TARGET_NR_chdir 49 +#define TARGET_NR_fchdir 50 +#define TARGET_NR_chroot 51 +#define TARGET_NR_fchmod 52 +#define TARGET_NR_fchmodat 53 +#define TARGET_NR_fchownat 54 +#define TARGET_NR_fchown 55 +#define TARGET_NR_openat 56 +#define TARGET_NR_close 57 +#define TARGET_NR_vhangup 58 +#define TARGET_NR_pipe2 59 +#define TARGET_NR_quotactl 60 +#define TARGET_NR_getdents64 61 +#define TARGET_NR_llseek 62 +#define TARGET_NR_read 63 +#define TARGET_NR_write 64 +#define TARGET_NR_readv 65 +#define TARGET_NR_writev 66 +#define TARGET_NR_pread64 67 +#define TARGET_NR_pwrite64 68 +#define TARGET_NR_preadv 69 +#define TARGET_NR_pwritev 70 +#define TARGET_NR_sendfile64 71 +#define TARGET_NR_pselect6 72 +#define TARGET_NR_ppoll 73 +#define TARGET_NR_signalfd4 74 +#define TARGET_NR_vmsplice 75 +#define TARGET_NR_splice 76 +#define TARGET_NR_tee 77 +#define TARGET_NR_readlinkat 78 +#define TARGET_NR_fstatat64 79 +#define TARGET_NR_fstat64 80 +#define TARGET_NR_sync 81 +#define TARGET_NR_fsync 82 +#define TARGET_NR_fdatasync 83 +#define TARGET_NR_sync_file_range 84 +#define TARGET_NR_timerfd_create 85 +#define TARGET_NR_timerfd_settime 86 +#define TARGET_NR_timerfd_gettime 87 +#define TARGET_NR_utimensat 88 +#define TARGET_NR_acct 89 +#define TARGET_NR_capget 90 +#define TARGET_NR_capset 91 +#define TARGET_NR_personality 92 +#define TARGET_NR_exit 93 +#define TARGET_NR_exit_group 94 +#define TARGET_NR_waitid 95 +#define TARGET_NR_set_tid_address 96 +#define TARGET_NR_unshare 97 +#define TARGET_NR_futex 98 +#define TARGET_NR_set_robust_list 99 +#define TARGET_NR_get_robust_list 100 +#define TARGET_NR_nanosleep 101 +#define TARGET_NR_getitimer 102 +#define TARGET_NR_setitimer 103 +#define TARGET_NR_kexec_load 104 +#define TARGET_NR_init_module 105 +#define TARGET_NR_delete_module 106 +#define TARGET_NR_timer_create 107 +#define TARGET_NR_timer_gettime 108 +#define TARGET_NR_timer_getoverrun 109 +#define TARGET_NR_timer_settime 110 +#define TARGET_NR_timer_delete 111 +#define TARGET_NR_clock_settime 112 +#define TARGET_NR_clock_gettime 113 +#define TARGET_NR_clock_getres 114 +#define TARGET_NR_clock_nanosleep 115 +#define TARGET_NR_syslog 116 +#define TARGET_NR_ptrace 117 +#define TARGET_NR_sched_setparam 118 +#define TARGET_NR_sched_setscheduler 119 +#define TARGET_NR_sched_getscheduler 120 +#define TARGET_NR_sched_getparam 121 +#define TARGET_NR_sched_setaffinity 122 +#define TARGET_NR_sched_getaffinity 123 +#define TARGET_NR_sched_yield 124 +#define TARGET_NR_sched_get_priority_max 125 +#define TARGET_NR_sched_get_priority_min 126 +#define TARGET_NR_sched_rr_get_interval 127 +#define TARGET_NR_restart_syscall 128 +#define TARGET_NR_kill 129 +#define TARGET_NR_tkill 130 +#define TARGET_NR_tgkill 131 +#define TARGET_NR_sigaltstack 132 +#define TARGET_NR_rt_sigsuspend 133 +#define TARGET_NR_rt_sigaction 134 +#define TARGET_NR_rt_sigprocmask 135 +#define TARGET_NR_rt_sigpending 136 +#define TARGET_NR_rt_sigtimedwait 137 +#define TARGET_NR_rt_sigqueueinfo 138 +#define TARGET_NR_rt_sigreturn 139 +#define TARGET_NR_setpriority 140 +#define TARGET_NR_getpriority 141 +#define TARGET_NR_reboot 142 +#define TARGET_NR_setregid 143 +#define TARGET_NR_setgid 144 +#define TARGET_NR_setreuid 145 +#define TARGET_NR_setuid 146 +#define TARGET_NR_setresuid 147 +#define TARGET_NR_getresuid 148 +#define TARGET_NR_setresgid 149 +#define TARGET_NR_getresgid 150 +#define TARGET_NR_setfsuid 151 +#define TARGET_NR_setfsgid 152 +#define TARGET_NR_times 153 +#define TARGET_NR_setpgid 154 +#define TARGET_NR_getpgid 155 +#define TARGET_NR_getsid 156 +#define TARGET_NR_setsid 157 +#define TARGET_NR_getgroups 158 +#define TARGET_NR_setgroups 159 +#define TARGET_NR_uname 160 +#define TARGET_NR_sethostname 161 +#define TARGET_NR_setdomainname 162 +#define TARGET_NR_getrlimit 163 +#define TARGET_NR_setrlimit 164 +#define TARGET_NR_getrusage 165 +#define TARGET_NR_umask 166 +#define TARGET_NR_prctl 167 +#define TARGET_NR_getcpu 168 +#define TARGET_NR_gettimeofday 169 +#define TARGET_NR_settimeofday 170 +#define TARGET_NR_adjtimex 171 +#define TARGET_NR_getpid 172 +#define TARGET_NR_getppid 173 +#define TARGET_NR_getuid 174 +#define TARGET_NR_geteuid 175 +#define TARGET_NR_getgid 176 +#define TARGET_NR_getegid 177 +#define TARGET_NR_gettid 178 +#define TARGET_NR_sysinfo 179 +#define TARGET_NR_mq_open 180 +#define TARGET_NR_mq_unlink 181 +#define TARGET_NR_mq_timedsend 182 +#define TARGET_NR_mq_timedreceive 183 +#define TARGET_NR_mq_notify 184 +#define TARGET_NR_mq_getsetattr 185 +#define TARGET_NR_msgget 186 +#define TARGET_NR_msgctl 187 +#define TARGET_NR_msgrcv 188 +#define TARGET_NR_msgsnd 189 +#define TARGET_NR_semget 190 +#define TARGET_NR_semctl 191 +#define TARGET_NR_semtimedop 192 +#define TARGET_NR_semop 193 +#define TARGET_NR_shmget 194 +#define TARGET_NR_shmctl 195 +#define TARGET_NR_shmat 196 +#define TARGET_NR_shmdt 197 +#define TARGET_NR_socket 198 +#define TARGET_NR_socketpair 199 +#define TARGET_NR_bind 200 +#define TARGET_NR_listen 201 +#define TARGET_NR_accept 202 +#define TARGET_NR_connect 203 +#define TARGET_NR_getsockname 204 +#define TARGET_NR_getpeername 205 +#define TARGET_NR_sendto 206 +#define TARGET_NR_recvfrom 207 +#define TARGET_NR_setsockopt 208 +#define TARGET_NR_getsockopt 209 +#define TARGET_NR_shutdown 210 +#define TARGET_NR_sendmsg 211 +#define TARGET_NR_recvmsg 212 +#define TARGET_NR_readahead 213 +#define TARGET_NR_brk 214 +#define TARGET_NR_munmap 215 +#define TARGET_NR_mremap 216 +#define TARGET_NR_add_key 217 +#define TARGET_NR_request_key 218 +#define TARGET_NR_keyctl 219 +#define TARGET_NR_clone 220 +#define TARGET_NR_execve 221 +#define TARGET_NR_mmap2 222 +#define TARGET_NR_fadvise64_64 223 +#define TARGET_NR_swapon 224 +#define TARGET_NR_swapoff 225 +#define TARGET_NR_mprotect 226 +#define TARGET_NR_msync 227 +#define TARGET_NR_mlock 228 +#define TARGET_NR_munlock 229 +#define TARGET_NR_mlockall 230 +#define TARGET_NR_munlockall 231 +#define TARGET_NR_mincore 232 +#define TARGET_NR_madvise 233 +#define TARGET_NR_remap_file_pages 234 +#define TARGET_NR_mbind 235 +#define TARGET_NR_get_mempolicy 236 +#define TARGET_NR_set_mempolicy 237 +#define TARGET_NR_migrate_pages 238 +#define TARGET_NR_move_pages 239 +#define TARGET_NR_rt_tgsigqueueinfo 240 +#define TARGET_NR_perf_event_open 241 +#define TARGET_NR_accept4 242 +#define TARGET_NR_recvmmsg 243 +#define TARGET_NR_arch_specific_syscall 244 +#define TARGET_NR_wait4 260 +#define TARGET_NR_prlimit64 261 +#define TARGET_NR_fanotify_init 262 +#define TARGET_NR_fanotify_mark 263 +#define TARGET_NR_name_to_handle_at 264 +#define TARGET_NR_open_by_handle_at 265 +#define TARGET_NR_clock_adjtime 266 +#define TARGET_NR_syncfs 267 +#define TARGET_NR_setns 268 +#define TARGET_NR_sendmmsg 269 +#define TARGET_NR_process_vm_readv 270 +#define TARGET_NR_process_vm_writev 271 +#define TARGET_NR_kcmp 272 +#define TARGET_NR_finit_module 273 +#define TARGET_NR_sched_setattr 274 +#define TARGET_NR_sched_getattr 275 +#define TARGET_NR_renameat2 276 +#define TARGET_NR_seccomp 277 +#define TARGET_NR_getrandom 278 +#define TARGET_NR_memfd_create 279 +#define TARGET_NR_bpf 280 +#define TARGET_NR_execveat 281 +#define TARGET_NR_userfaultfd 282 +#define TARGET_NR_membarrier 283 +#define TARGET_NR_mlock2 284 +#define TARGET_NR_copy_file_range 285 +#define TARGET_NR_preadv2 286 +#define TARGET_NR_pwritev2 287 +#define TARGET_NR_pkey_mprotect 288 +#define TARGET_NR_pkey_alloc 289 +#define TARGET_NR_pkey_free 290 +#define TARGET_NR_statx 291 +#define TARGET_NR_io_pgetevents 292 +#define TARGET_NR_rseq 293 +#define TARGET_NR_kexec_file_load 294 +#define TARGET_NR_clock_gettime64 403 +#define TARGET_NR_clock_settime64 404 +#define TARGET_NR_clock_adjtime64 405 +#define TARGET_NR_clock_getres_time64 406 +#define TARGET_NR_clock_nanosleep_time64 407 +#define TARGET_NR_timer_gettime64 408 +#define TARGET_NR_timer_settime64 409 +#define TARGET_NR_timerfd_gettime64 410 +#define TARGET_NR_timerfd_settime64 411 +#define TARGET_NR_utimensat_time64 412 +#define TARGET_NR_pselect6_time64 413 +#define TARGET_NR_ppoll_time64 414 +#define TARGET_NR_io_pgetevents_time64 416 +#define TARGET_NR_recvmmsg_time64 417 +#define TARGET_NR_mq_timedsend_time64 418 +#define TARGET_NR_mq_timedreceive_time64 419 +#define TARGET_NR_semtimedop_time64 420 +#define TARGET_NR_rt_sigtimedwait_time64 421 +#define TARGET_NR_futex_time64 422 +#define TARGET_NR_sched_rr_get_interval_time64 423 +#define TARGET_NR_pidfd_send_signal 424 +#define TARGET_NR_io_uring_setup 425 +#define TARGET_NR_io_uring_enter 426 +#define TARGET_NR_io_uring_register 427 +#define TARGET_NR_open_tree 428 +#define TARGET_NR_move_mount 429 +#define TARGET_NR_fsopen 430 +#define TARGET_NR_fsconfig 431 +#define TARGET_NR_fsmount 432 +#define TARGET_NR_fspick 433 +#define TARGET_NR_pidfd_open 434 +#define TARGET_NR_syscalls 436 + +#endif /* LINUX_USER_NIOS2_SYSCALL_NR_H */ -#endif From patchwork Thu Mar 19 09:26:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11446919 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B3B213B1 for ; Thu, 19 Mar 2020 09:29:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A6F220752 for ; Thu, 19 Mar 2020 09:29:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A6F220752 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErUC-0002Ju-6p for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Mar 2020 05:29:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40954) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRy-0005RH-FW for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRv-0004E0-UD for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:50 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:49255) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jErRv-0004DL-KE for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:47 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mbkac-1jqwI82yFC-00dCvP; Thu, 19 Mar 2020 10:26:43 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 16/16] linux-user, openrisc: sync syscall numbers with kernel v5.5 Date: Thu, 19 Mar 2020 10:26:27 +0100 Message-Id: <20200319092627.51487-17-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ow+e9N9X8+UvS0Q2UX7O6n918njvFOExkWRU2V0jADEyW/ph56v uojN/hRMzyna+3KzpjlXqiCu2bOTthfZA/sp5hgzNJG5avdOvwoxqSJ+bFYI+CMjAyjK6km kUhaZr8Nml4CHog23mwd3enUFKFl/0WyuRZ8TcB9jw0pl7d1H7zU8G4wW16OS2lFS9+2f5G QHsaZOJKkhhx42oLQKT+g== X-UI-Out-Filterresults: notjunk:1;V03:K0:lJurAFmQqzc=:HDzvFe17p/vKpl9y6hxMc0 1BBVe2zQiZM38YRbMY5JdAHHvnusZ5iXJg9zv5qJqats/9xoxYCbRhXPqv0Ch6eEOrsTFYXsa 0nFjoSMto8qGIXKwb/6aeOl2IIT+OxJte6LNzsMaNOPsdnE0LBZYJ2gr6Hg/4K/7WoNZ9NHgB VOYPJMMP5F/vOa8aMcCMvG2DL6RhQcxI+99LDUjnWSMAOn6ls5DtDXq0ElwAtha0kSv1Yls04 i6rgcHvqZoNu90FQzWpULwb0SNQoxi47yEiQVRZH/ZsLOo6UYUGF+smWQvP0+6arUo5xEMqFs muyf09BldkZphbd6TSRx1Uvip66SzYXAH4dGf8upQ+OlNPT4TP8mCo5ZBBCml8YsACLpLdTcw je6L+BZcV6Ywi6fl7PnFmLE7tUBD96xLgSbonzSRZFbdhWVHy1oRteOz8BYBPsR0bJjeXxcHC bFOGnOp8MUBwGCK6CX1PKR43pVw6LeZg5ywAmP3ymoetPqgsuIu6B7E8Bytw9rWZ4pV/Zp1AA uxpn8CBxPNU7NaZ7+K8fPouOORPJhMaOZvAxEwlMjorhFVy1XgwD0R0nC/8IhQfmnA1eFvBHL vzk0By1doaZidSYAJwuiYvxiDuFjqpRlDdJTV3gIG5wpP+q6AhoiX2oOJmWSIsyzukS/H0j8n YZNW0ItgX8oi8KAzNbjpVeaRRRnvR772ChKBoUBaNc9Mbto4VA9JwCzOyeWSEgygQNEGTi8BJ 3XYC0/+15GYkT10Mi199beB2H8pLmtGrKXz9oxCIMtTDgRicksuKryDi4YkQoGe9Qv7GNXcCE 9pqJ/2yVPJaH5Mc0CbU0jvVjVubP0KyZY0RFH0jSOzOy5T+Z8xaCCT1xL0g3jIodUhlmzVo X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Riku Voipio , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use helper script scripts/gensyscalls.sh to generate the file. Add TARGET_NR_or1k_atomic Remove useless comments and blank lines. Define diretly the __NR_XXX64 syscalls rather than using the intermediate __NR3264 definition. Remove wrong cut'n'paste (like "#ifdef __ARCH_WANT_SYNC_FILE_RANGE2") Add new syscalls from 286 (preadv) to 434 (pidfd_open). Remove obsolete syscalls 1204 (open) to 1079 (fork). Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Message-Id: <20200316085620.309769-5-laurent@vivier.eu> --- linux-user/openrisc/syscall_nr.h | 309 +++++++------------------------ 1 file changed, 62 insertions(+), 247 deletions(-) diff --git a/linux-user/openrisc/syscall_nr.h b/linux-user/openrisc/syscall_nr.h index 7763dbcfd8b3..340383beb2c6 100644 --- a/linux-user/openrisc/syscall_nr.h +++ b/linux-user/openrisc/syscall_nr.h @@ -1,13 +1,17 @@ +/* + * This file contains the system call numbers. + * Do not modify. + * This file is generated by scripts/gensyscalls.sh + */ #ifndef LINUX_USER_OPENRISC_SYSCALL_NR_H #define LINUX_USER_OPENRISC_SYSCALL_NR_H #define TARGET_NR_io_setup 0 +#define TARGET_NR_or1k_atomic TARGET_NR_arch_specific_syscall #define TARGET_NR_io_destroy 1 #define TARGET_NR_io_submit 2 #define TARGET_NR_io_cancel 3 #define TARGET_NR_io_getevents 4 - -/* fs/xattr.c */ #define TARGET_NR_setxattr 5 #define TARGET_NR_lsetxattr 6 #define TARGET_NR_fsetxattr 7 @@ -20,63 +24,36 @@ #define TARGET_NR_removexattr 14 #define TARGET_NR_lremovexattr 15 #define TARGET_NR_fremovexattr 16 - -/* fs/dcache.c */ #define TARGET_NR_getcwd 17 - -/* fs/cookies.c */ #define TARGET_NR_lookup_dcookie 18 - -/* fs/eventfd.c */ #define TARGET_NR_eventfd2 19 - -/* fs/eventpoll.c */ #define TARGET_NR_epoll_create1 20 #define TARGET_NR_epoll_ctl 21 #define TARGET_NR_epoll_pwait 22 - -/* fs/fcntl.c */ #define TARGET_NR_dup 23 #define TARGET_NR_dup3 24 -#define TARGET_NR_3264_fcntl 25 - -/* fs/inotify_user.c */ +#define TARGET_NR_fcntl64 25 #define TARGET_NR_inotify_init1 26 #define TARGET_NR_inotify_add_watch 27 #define TARGET_NR_inotify_rm_watch 28 - -/* fs/ioctl.c */ #define TARGET_NR_ioctl 29 - -/* fs/ioprio.c */ #define TARGET_NR_ioprio_set 30 #define TARGET_NR_ioprio_get 31 - -/* fs/locks.c */ #define TARGET_NR_flock 32 - -/* fs/namei.c */ #define TARGET_NR_mknodat 33 #define TARGET_NR_mkdirat 34 #define TARGET_NR_unlinkat 35 #define TARGET_NR_symlinkat 36 #define TARGET_NR_linkat 37 #define TARGET_NR_renameat 38 - -/* fs/namespace.c */ #define TARGET_NR_umount2 39 #define TARGET_NR_mount 40 #define TARGET_NR_pivot_root 41 - -/* fs/nfsctl.c */ #define TARGET_NR_nfsservctl 42 - -/* fs/open.c */ -#define TARGET_NR_3264_statfs 43 -#define TARGET_NR_3264_fstatfs 44 -#define TARGET_NR_3264_truncate 45 -#define TARGET_NR_3264_ftruncate 46 - +#define TARGET_NR_statfs64 43 +#define TARGET_NR_fstatfs64 44 +#define TARGET_NR_truncate64 45 +#define TARGET_NR_ftruncate64 46 #define TARGET_NR_fallocate 47 #define TARGET_NR_faccessat 48 #define TARGET_NR_chdir 49 @@ -89,18 +66,10 @@ #define TARGET_NR_openat 56 #define TARGET_NR_close 57 #define TARGET_NR_vhangup 58 - -/* fs/pipe.c */ #define TARGET_NR_pipe2 59 - -/* fs/quota.c */ #define TARGET_NR_quotactl 60 - -/* fs/readdir.c */ #define TARGET_NR_getdents64 61 - -/* fs/read_write.c */ -#define TARGET_NR_3264_lseek 62 +#define TARGET_NR_llseek 62 #define TARGET_NR_read 63 #define TARGET_NR_write 64 #define TARGET_NR_readv 65 @@ -109,85 +78,42 @@ #define TARGET_NR_pwrite64 68 #define TARGET_NR_preadv 69 #define TARGET_NR_pwritev 70 - -/* fs/sendfile.c */ -#define TARGET_NR_3264_sendfile 71 - -/* fs/select.c */ +#define TARGET_NR_sendfile64 71 #define TARGET_NR_pselect6 72 #define TARGET_NR_ppoll 73 - -/* fs/signalfd.c */ #define TARGET_NR_signalfd4 74 - -/* fs/splice.c */ #define TARGET_NR_vmsplice 75 #define TARGET_NR_splice 76 #define TARGET_NR_tee 77 - -/* fs/stat.c */ #define TARGET_NR_readlinkat 78 -#define TARGET_NR_3264_fstatat 79 -#define TARGET_NR_3264_fstat 80 - -/* fs/sync.c */ +#define TARGET_NR_fstatat64 79 +#define TARGET_NR_fstat64 80 #define TARGET_NR_sync 81 #define TARGET_NR_fsync 82 #define TARGET_NR_fdatasync 83 - -#ifdef __ARCH_WANT_SYNC_FILE_RANGE2 -#define TARGET_NR_sync_file_range2 84 -#else #define TARGET_NR_sync_file_range 84 -#endif - -/* fs/timerfd.c */ #define TARGET_NR_timerfd_create 85 #define TARGET_NR_timerfd_settime 86 #define TARGET_NR_timerfd_gettime 87 - -/* fs/utimes.c */ #define TARGET_NR_utimensat 88 - -/* kernel/acct.c */ #define TARGET_NR_acct 89 - -/* kernel/capability.c */ #define TARGET_NR_capget 90 #define TARGET_NR_capset 91 - -/* kernel/exec_domain.c */ #define TARGET_NR_personality 92 - -/* kernel/exit.c */ #define TARGET_NR_exit 93 #define TARGET_NR_exit_group 94 #define TARGET_NR_waitid 95 - -/* kernel/fork.c */ #define TARGET_NR_set_tid_address 96 #define TARGET_NR_unshare 97 - -/* kernel/futex.c */ #define TARGET_NR_futex 98 #define TARGET_NR_set_robust_list 99 #define TARGET_NR_get_robust_list 100 - -/* kernel/hrtimer.c */ #define TARGET_NR_nanosleep 101 - -/* kernel/itimer.c */ #define TARGET_NR_getitimer 102 #define TARGET_NR_setitimer 103 - -/* kernel/kexec.c */ #define TARGET_NR_kexec_load 104 - -/* kernel/module.c */ #define TARGET_NR_init_module 105 #define TARGET_NR_delete_module 106 - -/* kernel/posix-timers.c */ #define TARGET_NR_timer_create 107 #define TARGET_NR_timer_gettime 108 #define TARGET_NR_timer_getoverrun 109 @@ -197,14 +123,8 @@ #define TARGET_NR_clock_gettime 113 #define TARGET_NR_clock_getres 114 #define TARGET_NR_clock_nanosleep 115 - -/* kernel/printk.c */ #define TARGET_NR_syslog 116 - -/* kernel/ptrace.c */ #define TARGET_NR_ptrace 117 - -/* kernel/sched.c */ #define TARGET_NR_sched_setparam 118 #define TARGET_NR_sched_setscheduler 119 #define TARGET_NR_sched_getscheduler 120 @@ -215,8 +135,6 @@ #define TARGET_NR_sched_get_priority_max 125 #define TARGET_NR_sched_get_priority_min 126 #define TARGET_NR_sched_rr_get_interval 127 - -/* kernel/signal.c */ #define TARGET_NR_restart_syscall 128 #define TARGET_NR_kill 129 #define TARGET_NR_tkill 130 @@ -229,8 +147,6 @@ #define TARGET_NR_rt_sigtimedwait 137 #define TARGET_NR_rt_sigqueueinfo 138 #define TARGET_NR_rt_sigreturn 139 - -/* kernel/sys.c */ #define TARGET_NR_setpriority 140 #define TARGET_NR_getpriority 141 #define TARGET_NR_reboot 142 @@ -260,13 +176,9 @@ #define TARGET_NR_umask 166 #define TARGET_NR_prctl 167 #define TARGET_NR_getcpu 168 - -/* kernel/time.c */ #define TARGET_NR_gettimeofday 169 #define TARGET_NR_settimeofday 170 #define TARGET_NR_adjtimex 171 - -/* kernel/timer.c */ #define TARGET_NR_getpid 172 #define TARGET_NR_getppid 173 #define TARGET_NR_getuid 174 @@ -275,34 +187,24 @@ #define TARGET_NR_getegid 177 #define TARGET_NR_gettid 178 #define TARGET_NR_sysinfo 179 - -/* ipc/mqueue.c */ #define TARGET_NR_mq_open 180 #define TARGET_NR_mq_unlink 181 #define TARGET_NR_mq_timedsend 182 #define TARGET_NR_mq_timedreceive 183 #define TARGET_NR_mq_notify 184 #define TARGET_NR_mq_getsetattr 185 - -/* ipc/msg.c */ #define TARGET_NR_msgget 186 #define TARGET_NR_msgctl 187 #define TARGET_NR_msgrcv 188 #define TARGET_NR_msgsnd 189 - -/* ipc/sem.c */ #define TARGET_NR_semget 190 #define TARGET_NR_semctl 191 #define TARGET_NR_semtimedop 192 #define TARGET_NR_semop 193 - -/* ipc/shm.c */ #define TARGET_NR_shmget 194 #define TARGET_NR_shmctl 195 #define TARGET_NR_shmat 196 #define TARGET_NR_shmdt 197 - -/* net/socket.c */ #define TARGET_NR_socket 198 #define TARGET_NR_socketpair 199 #define TARGET_NR_bind 200 @@ -318,30 +220,17 @@ #define TARGET_NR_shutdown 210 #define TARGET_NR_sendmsg 211 #define TARGET_NR_recvmsg 212 - -/* mm/filemap.c */ #define TARGET_NR_readahead 213 - -/* mm/nommu.c, also with MMU */ #define TARGET_NR_brk 214 #define TARGET_NR_munmap 215 #define TARGET_NR_mremap 216 - -/* security/keys/keyctl.c */ #define TARGET_NR_add_key 217 #define TARGET_NR_request_key 218 #define TARGET_NR_keyctl 219 - -/* arch/example/kernel/sys_example.c */ #define TARGET_NR_clone 220 #define TARGET_NR_execve 221 - -#define TARGET_NR_3264_mmap 222 -/* mm/fadvise.c */ -#define TARGET_NR_3264_fadvise64 223 - -/* mm/, CONFIG_MMU only */ -#ifndef __ARCH_NOMMU +#define TARGET_NR_mmap2 222 +#define TARGET_NR_fadvise64_64 223 #define TARGET_NR_swapon 224 #define TARGET_NR_swapoff 225 #define TARGET_NR_mprotect 226 @@ -358,25 +247,17 @@ #define TARGET_NR_set_mempolicy 237 #define TARGET_NR_migrate_pages 238 #define TARGET_NR_move_pages 239 -#endif - #define TARGET_NR_rt_tgsigqueueinfo 240 #define TARGET_NR_perf_event_open 241 #define TARGET_NR_accept4 242 #define TARGET_NR_recvmmsg 243 - -/* - * Architectures may provide up to 16 syscalls of their own - * starting with this value. - */ #define TARGET_NR_arch_specific_syscall 244 - #define TARGET_NR_wait4 260 #define TARGET_NR_prlimit64 261 #define TARGET_NR_fanotify_init 262 #define TARGET_NR_fanotify_mark 263 -#define TARGET_NR_name_to_handle_at 264 -#define TARGET_NR_open_by_handle_at 265 +#define TARGET_NR_name_to_handle_at 264 +#define TARGET_NR_open_by_handle_at 265 #define TARGET_NR_clock_adjtime 266 #define TARGET_NR_syncfs 267 #define TARGET_NR_setns 268 @@ -397,113 +278,47 @@ #define TARGET_NR_membarrier 283 #define TARGET_NR_mlock2 284 #define TARGET_NR_copy_file_range 285 +#define TARGET_NR_preadv2 286 +#define TARGET_NR_pwritev2 287 +#define TARGET_NR_pkey_mprotect 288 +#define TARGET_NR_pkey_alloc 289 +#define TARGET_NR_pkey_free 290 +#define TARGET_NR_statx 291 +#define TARGET_NR_io_pgetevents 292 +#define TARGET_NR_rseq 293 +#define TARGET_NR_kexec_file_load 294 +#define TARGET_NR_clock_gettime64 403 +#define TARGET_NR_clock_settime64 404 +#define TARGET_NR_clock_adjtime64 405 +#define TARGET_NR_clock_getres_time64 406 +#define TARGET_NR_clock_nanosleep_time64 407 +#define TARGET_NR_timer_gettime64 408 +#define TARGET_NR_timer_settime64 409 +#define TARGET_NR_timerfd_gettime64 410 +#define TARGET_NR_timerfd_settime64 411 +#define TARGET_NR_utimensat_time64 412 +#define TARGET_NR_pselect6_time64 413 +#define TARGET_NR_ppoll_time64 414 +#define TARGET_NR_io_pgetevents_time64 416 +#define TARGET_NR_recvmmsg_time64 417 +#define TARGET_NR_mq_timedsend_time64 418 +#define TARGET_NR_mq_timedreceive_time64 419 +#define TARGET_NR_semtimedop_time64 420 +#define TARGET_NR_rt_sigtimedwait_time64 421 +#define TARGET_NR_futex_time64 422 +#define TARGET_NR_sched_rr_get_interval_time64 423 +#define TARGET_NR_pidfd_send_signal 424 +#define TARGET_NR_io_uring_setup 425 +#define TARGET_NR_io_uring_enter 426 +#define TARGET_NR_io_uring_register 427 +#define TARGET_NR_open_tree 428 +#define TARGET_NR_move_mount 429 +#define TARGET_NR_fsopen 430 +#define TARGET_NR_fsconfig 431 +#define TARGET_NR_fsmount 432 +#define TARGET_NR_fspick 433 +#define TARGET_NR_pidfd_open 434 +#define TARGET_NR_syscalls 436 + +#endif /* LINUX_USER_OPENRISC_SYSCALL_NR_H */ -/* - * All syscalls below here should go away really, - * these are provided for both review and as a porting - * help for the C library version. -* - * Last chance: are any of these important enough to - * enable by default? - */ -#define TARGET_NR_open 1024 -#define TARGET_NR_link 1025 -#define TARGET_NR_unlink 1026 -#define TARGET_NR_mknod 1027 -#define TARGET_NR_chmod 1028 -#define TARGET_NR_chown 1029 -#define TARGET_NR_mkdir 1030 -#define TARGET_NR_rmdir 1031 -#define TARGET_NR_lchown 1032 -#define TARGET_NR_access 1033 -#define TARGET_NR_rename 1034 -#define TARGET_NR_readlink 1035 -#define TARGET_NR_symlink 1036 -#define TARGET_NR_utimes 1037 -#define TARGET_NR_3264_stat 1038 -#define TARGET_NR_3264_lstat 1039 - -#define TARGET_NR_pipe 1040 -#define TARGET_NR_dup2 1041 -#define TARGET_NR_epoll_create 1042 -#define TARGET_NR_inotify_init 1043 -#define TARGET_NR_eventfd 1044 -#define TARGET_NR_signalfd 1045 - -#define TARGET_NR_sendfile 1046 -#define TARGET_NR_ftruncate 1047 -#define TARGET_NR_truncate 1048 -#define TARGET_NR_stat 1049 -#define TARGET_NR_lstat 1050 -#define TARGET_NR_fstat 1051 -#define TARGET_NR_fcntl 1052 -#define TARGET_NR_fadvise64 1053 -#define __ARCH_WANT_SYS_FADVISE64 -#define TARGET_NR_newfstatat 1054 -#define __ARCH_WANT_SYS_NEWFSTATAT -#define TARGET_NR_fstatfs 1055 -#define TARGET_NR_statfs 1056 -#define TARGET_NR_lseek 1057 -#define TARGET_NR_mmap 1058 - -#define TARGET_NR_alarm 1059 -#define __ARCH_WANT_SYS_ALARM -#define TARGET_NR_getpgrp 1060 -#define __ARCH_WANT_SYS_GETPGRP -#define TARGET_NR_pause 1061 -#define __ARCH_WANT_SYS_PAUSE -#define TARGET_NR_time 1062 -#define __ARCH_WANT_SYS_TIME -#define __ARCH_WANT_COMPAT_SYS_TIME -#define TARGET_NR_utime 1063 -#define __ARCH_WANT_SYS_UTIME - -#define TARGET_NR_creat 1064 -#define TARGET_NR_getdents 1065 -#define __ARCH_WANT_SYS_GETDENTS -#define TARGET_NR_futimesat 1066 -#define TARGET_NR_poll 1068 -#define TARGET_NR_epoll_wait 1069 -#define TARGET_NR_ustat 1070 -#define TARGET_NR_vfork 1071 -#define TARGET_NR_oldwait4 1072 -#define TARGET_NR_recv 1073 -#define TARGET_NR_send 1074 -#define TARGET_NR_bdflush 1075 -#define TARGET_NR_umount 1076 -#define __ARCH_WANT_SYS_OLDUMOUNT -#define TARGET_NR_uselib 1077 -#define TARGET_NR__sysctl 1078 - -#define TARGET_NR_fork 1079 - - -/* - * 32 bit systems traditionally used different - * syscalls for off_t and loff_t arguments, while - * 64 bit systems only need the off_t version. - * For new 32 bit platforms, there is no need to - * implement the old 32 bit off_t syscalls, so - * they take different names. - * Here we map the numbers so that both versions - * use the same syscall table layout. - */ - -#define TARGET_NR_fcntl64 TARGET_NR_3264_fcntl -#define TARGET_NR_statfs64 TARGET_NR_3264_statfs -#define TARGET_NR_fstatfs64 TARGET_NR_3264_fstatfs -#define TARGET_NR_truncate64 TARGET_NR_3264_truncate -#define TARGET_NR_ftruncate64 TARGET_NR_3264_ftruncate -#define TARGET_NR_llseek TARGET_NR_3264_lseek -#define TARGET_NR_sendfile64 TARGET_NR_3264_sendfile -#define TARGET_NR_fstatat64 TARGET_NR_3264_fstatat -#define TARGET_NR_fstat64 TARGET_NR_3264_fstat -#define TARGET_NR_mmap2 TARGET_NR_3264_mmap -#define TARGET_NR_fadvise64_64 TARGET_NR_3264_fadvise64 - -#ifdef TARGET_NR_3264_stat -#define TARGET_NR_stat64 TARGET_NR_3264_stat -#define TARGET_NR_lstat64 TARGET_NR_3264_lstat -#endif - -#endif