From patchwork Fri Jun 1 07:30:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 137468 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp609335lji; Fri, 1 Jun 2018 00:39:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLi8PXJzCODWZGkgSuAX3W6sXyF74NB8uqvW95VvHId7SJVR8Zig67W9UsckhA7WRXODsYr X-Received: by 2002:a0c:cb13:: with SMTP id o19-v6mr9295243qvk.216.1527838749393; Fri, 01 Jun 2018 00:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527838749; cv=none; d=google.com; s=arc-20160816; b=g3SUsfYMqdkMzrnoukHNu4jGdh7Ao/00cdmsfUZk87g6FOYAYx740YceipNxlj4WpU ilU4h8+edTJr9QRCOFnOZn18h2xYyn6PnlfrNcK8SaTj7Dvw2s/pU0qMGKa7E8+oiMqI Vx+U9ar3jh3McIOf97TalqhpiTzCzgp80AYIHNV8N14CpLNam9tJYISCJMUF7O72FZbd d91Lu9QMUQlDmulsxkfBrqKVQv3hflHX/boAAWU2+IMiDpLNABmk+gdKGo+5lfKEg2Gv AH+xs2i1XeA7RDg8jbb7l66k9/avh7/jHGiYSzzNS3kthYSXCM5BEylH41G44JZU+LCN oAGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=+VLu9ud8UPCypio6yV1SHgwWP7XnngZ6wMGL8Wb+pgk=; b=gJ7ESP46iJTineE3v5oAszQW4SFq8p+Nd7Iaqjht4giGQRpv8Y+JvQVIbwDrZV1YT8 tf6Cszdb7/qHn1A/KhW0b549G1U230wsN3yyOA0b5JpPOSHxFHo9F32VKWwnXP4pu2gk VOfoVHXeZffUFIkaZKqc8D1RUsLKsFkqPCB7vnCsdhktcsc7OoQNlZilQ43/xEQfcLIQ iMiYE8bsSMU8DY8f/dZSa3asF3khJQUgPFT+9UJcv4lp11uOA22uvqg9AiWMnbvbijyn YMcJpkMbqy1ieq17mAz9ba6si08qkiyXg1ZPO1jmgmCz5SzAfVoV49hnJcIrznvL8kbH rk5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ud0Rv9cY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i44-v6si841136qte.148.2018.06.01.00.39.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Jun 2018 00:39:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ud0Rv9cY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOeeS-0002ch-PB for patch@linaro.org; Fri, 01 Jun 2018 03:39:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOeWi-0005Sf-Ek for qemu-devel@nongnu.org; Fri, 01 Jun 2018 03:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOeWe-0000JR-G8 for qemu-devel@nongnu.org; Fri, 01 Jun 2018 03:31:08 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:42873) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOeWe-0000Iw-8S for qemu-devel@nongnu.org; Fri, 01 Jun 2018 03:31:04 -0400 Received: by mail-pg0-x241.google.com with SMTP id p9-v6so10862763pgc.9 for ; Fri, 01 Jun 2018 00:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+VLu9ud8UPCypio6yV1SHgwWP7XnngZ6wMGL8Wb+pgk=; b=Ud0Rv9cYi6IsLu+XwXmjwbarkWjxyOqMVhORg1/DNSymDiA0NVLBLy/KdKGz8o5V9m NCwBMIk5EkF5Z5qI4IN11htsJe9VA+pvIHwx+ye3OxFhIsRPlmNZPuWKC3tgV8f7105a cBO/Fung+3yGKGfEfRZ+bOV3lrdDjUmdNReYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+VLu9ud8UPCypio6yV1SHgwWP7XnngZ6wMGL8Wb+pgk=; b=Ke2PQXZeHrVRrl+LTMCv0efopmYjpo781Qc3MKTcUhZE3wstT8zGkJ4pJN5xWSkmbp +XkYKau8EuLp5dEM7lCyCT5wTUJiAmQGE7hpK1O2BvvSzH5sSpQTOy+2oRwGv8lh1mHx TFzFoUbcTb76MjEqW7i46T45aFBEUO2HpEzsUxbJ6bvC/4fAys021jtOCXsa4bBhBMbn xsjDmzU78ofVFXq6316cTfjBBfW7REIuQlgQ7rhfWwlN8Kj1X+z2AsEKO9zrJMhpyZZM DXYHVDEsyTE9KEXOGEMMKU9FHZSCoFhtrTkdamYxDFz1ekPzEf1mVT+lYsarWNBW+8pe ydUw== X-Gm-Message-State: ALKqPwejsCn0F3zfoAUEQzvblxMgOfUjvXVm1yrjCt1rO3g4RihzDLOR M6aBRHchu5a/Tc2TWO5ya74Y8wkWZvE= X-Received: by 2002:a62:b509:: with SMTP id y9-v6mr7557972pfe.121.1527838262170; Fri, 01 Jun 2018 00:31:02 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id c4-v6sm4431782pgv.86.2018.06.01.00.31.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Jun 2018 00:31:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 1 Jun 2018 00:30:23 -0700 Message-Id: <20180601073050.8054-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180601073050.8054-1-richard.henderson@linaro.org> References: <20180601073050.8054-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH 06/33] linux-user: Split out goto unimplemented to do_unimplemented X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- linux-user/syscall.c | 82 +++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 39 deletions(-) -- 2.17.0 Reviewed-by: Laurent Vivier diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f7b7051c1c..4269ec2c23 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7962,6 +7962,12 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask, return 0; } +static abi_long do_unimplemented(int num) +{ + gemu_log("qemu: Unsupported syscall: %d\n", num); + return -TARGET_ENOSYS; +} + /* This is an internal helper for do_syscall so that it is easier * to have a single return point, so that actions, such as logging * of syscall results, can be performed. @@ -8342,11 +8348,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_break case TARGET_NR_break: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_oldstat case TARGET_NR_oldstat: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_lseek: if (is_hostfd(arg1)) { @@ -8436,14 +8442,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } #endif case TARGET_NR_ptrace: - goto unimplemented; + return do_unimplemented(num); #ifdef TARGET_NR_alarm /* not on alpha */ case TARGET_NR_alarm: return alarm(arg1); #endif #ifdef TARGET_NR_oldfstat case TARGET_NR_oldfstat: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_pause /* not on alpha */ case TARGET_NR_pause: @@ -8522,11 +8528,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_stty case TARGET_NR_stty: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_gtty case TARGET_NR_gtty: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_access case TARGET_NR_access: @@ -8561,7 +8567,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_ftime case TARGET_NR_ftime: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_sync: sync(); @@ -8687,11 +8693,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #ifdef TARGET_NR_prof case TARGET_NR_prof: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_signal case TARGET_NR_signal: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_acct: if (arg1 == 0) { @@ -8715,7 +8721,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_lock case TARGET_NR_lock: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_ioctl: return do_ioctl(arg1, arg2, arg3); @@ -8725,17 +8731,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_mpx case TARGET_NR_mpx: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_setpgid: return get_errno(setpgid(arg1, arg2)); #ifdef TARGET_NR_ulimit case TARGET_NR_ulimit: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_oldolduname case TARGET_NR_oldolduname: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_umask: return get_errno(umask(arg1)); @@ -8747,7 +8753,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #ifdef TARGET_NR_ustat case TARGET_NR_ustat: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_dup2 case TARGET_NR_dup2: @@ -9471,7 +9477,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_oldlstat case TARGET_NR_oldlstat: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_readlink case TARGET_NR_readlink: @@ -9536,7 +9542,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_uselib case TARGET_NR_uselib: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_swapon case TARGET_NR_swapon: @@ -9561,7 +9567,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #ifdef TARGET_NR_readdir case TARGET_NR_readdir: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_mmap case TARGET_NR_mmap: @@ -9699,7 +9705,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return get_errno(setpriority(arg1, arg2, arg3)); #ifdef TARGET_NR_profil case TARGET_NR_profil: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_statfs: if (!(fn = lock_user_string(arg1))) { @@ -9778,7 +9784,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_ioperm case TARGET_NR_ioperm: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_socketcall case TARGET_NR_socketcall: @@ -10062,17 +10068,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #ifdef TARGET_NR_olduname case TARGET_NR_olduname: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_iopl case TARGET_NR_iopl: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_vhangup: return get_errno(vhangup()); #ifdef TARGET_NR_idle case TARGET_NR_idle: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_syscall case TARGET_NR_syscall: @@ -10252,7 +10258,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return do_modify_ldt(cpu_env, arg1, arg2, arg3); #if !defined(TARGET_X86_64) case TARGET_NR_vm86old: - goto unimplemented; + return do_unimplemented(num); case TARGET_NR_vm86: return do_vm86(cpu_env, arg1, arg2); #endif @@ -10297,9 +10303,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_get_kernel_syms case TARGET_NR_get_kernel_syms: #endif - goto unimplemented; + return do_unimplemented(num); case TARGET_NR_quotactl: - goto unimplemented; + return do_unimplemented(num); case TARGET_NR_getpgid: return get_errno(getpgid(arg1)); case TARGET_NR_fchdir: @@ -10309,17 +10315,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return get_errno(fchdir(arg1)); #ifdef TARGET_NR_bdflush /* not on x86_64 */ case TARGET_NR_bdflush: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_sysfs case TARGET_NR_sysfs: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_personality: return get_errno(personality(arg1)); #ifdef TARGET_NR_afs_syscall case TARGET_NR_afs_syscall: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR__llseek /* Not on alpha */ case TARGET_NR__llseek: @@ -10865,11 +10871,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; #ifdef TARGET_NR_query_module case TARGET_NR_query_module: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_nfsservctl case TARGET_NR_nfsservctl: - goto unimplemented; + return do_unimplemented(num); #endif case TARGET_NR_prctl: switch (arg1) { @@ -10949,7 +10955,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #if defined(TARGET_I386) && !defined(TARGET_ABI32) return do_arch_prctl(cpu_env, arg1, arg2); #else - goto unimplemented; + return do_unimplemented(num); #endif #endif #ifdef TARGET_NR_pread64 @@ -11116,16 +11122,16 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_sendfile64 case TARGET_NR_sendfile64: #endif - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_getpmsg case TARGET_NR_getpmsg: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_putpmsg case TARGET_NR_putpmsg: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_vfork case TARGET_NR_vfork: @@ -11694,7 +11700,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif case TARGET_NR_pivot_root: - goto unimplemented; + return do_unimplemented(num); #ifdef TARGET_NR_mincore case TARGET_NR_mincore: { @@ -11869,7 +11875,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_security case TARGET_NR_security: - goto unimplemented; + return do_unimplemented(num); #endif #ifdef TARGET_NR_getpagesize case TARGET_NR_getpagesize: @@ -12884,9 +12890,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif default: - unimplemented: - gemu_log("qemu: Unsupported syscall: %d\n", num); - return -TARGET_ENOSYS; + return do_unimplemented(num); } fail: return ret;