From patchwork Sun Jun 10 03:00:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138081 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2575626lji; Sat, 9 Jun 2018 20:06:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIv/DPtHAL8thh/cbVuWtYftrHSSjtHVM+dxkG2YqEt6Ytfs1nKXurydpO/Kn6JlHbyWYjt X-Received: by 2002:a0c:f149:: with SMTP id y9-v6mr10675623qvl.111.1528599965689; Sat, 09 Jun 2018 20:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528599965; cv=none; d=google.com; s=arc-20160816; b=g+iMti2otdacsDbUcZBNRikg/WSGw5KB1bRaq5iW4yW2/frWZ7htU27jGdbr1hAdcV kjnOKYcWSNH2Af3JMa46deOkEizpTR7rUzCHj9A5HFxixqInvJBlguNcmErWnlJnn6hL twxPJKwcC0PHXmErQCAMMjKbzmeFDdegz4yC2WXFIs9xdQVxZLZjNN6Iy3TuirZ0z4ll xjtht5bw/M5Z834T0N9HhCpTdSUskQGUblJqXZpwwDdbeJFwMuAzFAtzIGyb4q4NBQEd Zp/vsI6YqU9dO5uhox87W6WNCGBPhBmAm2kf2iJko/Wkf8l5UEQuSf/COTfzUDa9ePw5 W/Cw== 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=bMSA2JgMk6TcdOuFMAf/MvUXNmrYQQtaVYyqyfZQCa4=; b=w8BYw6SfVTfnSMNcgHluHi1fVw1YRpQWh8bAFc89INTMC/I1wBxGOmEYy3vU6uFTtJ pVng3jb3VRtiSHGJK2tMMcvFILJQ1jndCwkMI9WWTIj0jKAzG9OdaWGp+4j9aA6t1YKZ kljD/WWZf8NW5QjrG0hTCbUSsg4dAKjRS/cj8W7ncVLYKFK+ZlUpWz0w97FqXldEQNUO d4Ou4iAipOm+tGb6Nx1qcRT7sOVAxv8f49cPH9JOaQmTiM8NN4FJONAUxT+XEOgz5mZD NAxCB80zRKquk66Yi3fvJ87HDl1nL/pL6AUHrT0Jx0tfrvK19yvdOI1R6sZTz+iC1biH ywlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xw1TwGVd; 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 y81-v6si6840988qkg.368.2018.06.09.20.06.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 09 Jun 2018 20:06:05 -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=Xw1TwGVd; 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]:42188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqg9-0004Q1-3v for patch@linaro.org; Sat, 09 Jun 2018 23:06:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRqct-0001bp-2V for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:02:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRqcr-0003AA-NZ for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:02:43 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:40575) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRqcr-00039t-Fe for qemu-devel@nongnu.org; Sat, 09 Jun 2018 23:02:41 -0400 Received: by mail-pf0-x242.google.com with SMTP id z24-v6so8489912pfe.7 for ; Sat, 09 Jun 2018 20:02:41 -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=bMSA2JgMk6TcdOuFMAf/MvUXNmrYQQtaVYyqyfZQCa4=; b=Xw1TwGVdSWtARBP4Ete1PBOKJ7vYbJN1rXElboVB6nhzrChpu3MDn28jXh6v1ETRH2 ZmV9Bu+dsArGMRJtrBtLyAd4rCZTk4fnycA3Y8VcEmxXIBjhNypozu4Dzk2Y6hc0Eybk zWBjp6phey0rHs4xqicFWHfeD5D35E8or+H/4= 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=bMSA2JgMk6TcdOuFMAf/MvUXNmrYQQtaVYyqyfZQCa4=; b=a+FoPUVs01Mcesg/6r2q4YAW+x21HZyFoFF8s6WgXtibY299PiDV86+xnKlUEvZy3Q KQHDlvOc4mx9rIDWIBN3KaXgKTz4rPofHEn+UeVql+XF4x6aJyqvEQUrEHzPTxj9dTlm z0fxBLeLoouEzux8sVi0EO8PwdGC6sJRdwQEKpaa+g/kjcxPXrIFW5rzpEMsEAI2rzej 0fY1g2VEJ9fgaYiacs8BDHAROB61CP7owMezoDgS4XCTkSRc7ReJgHkUy6NI00RnKjSH ogyEsxmGtwbG4nUZKLgrcC9vLGKuM6TK5vyPbuQM/cnzGfAms5NfGpPCIle+tNQLgKED LVpw== X-Gm-Message-State: APt69E2/2GAUXNtJg3nmXGqGqTHdEDmQP5NtBPc1+7OY5I0bu2KmWcP1 hFeiRjlSkRpbLyN7gkcgn5QNiDgamcE= X-Received: by 2002:a65:5c89:: with SMTP id a9-v6mr10219060pgt.51.1528599760060; Sat, 09 Jun 2018 20:02:40 -0700 (PDT) Received: from cloudburst.twiddle.net (rrcs-173-198-77-219.west.biz.rr.com. [173.198.77.219]) by smtp.gmail.com with ESMTPSA id y17-v6sm31712718pfe.33.2018.06.09.20.02.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Jun 2018 20:02:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 9 Jun 2018 17:00:38 -1000 Message-Id: <20180610030220.3777-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180610030220.3777-1-richard.henderson@linaro.org> References: <20180610030220.3777-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:c00::242 Subject: [Qemu-devel] [PATCH v2 006/108] linux-user: Propagate goto unimplemented to default 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" There is no point in listing a syscall if you want the same effect as not listing it. In one less trivial case, the goto was demonstrably not reachable. Signed-off-by: Richard Henderson --- linux-user/syscall.c | 144 +------------------------------------------ 1 file changed, 1 insertion(+), 143 deletions(-) -- 2.17.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 06205d3d65..5a17803732 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8297,14 +8297,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, ret = get_errno(chmod(p, arg2)); unlock_user(p, arg1, 0); return ret; -#endif -#ifdef TARGET_NR_break - case TARGET_NR_break: - goto unimplemented; -#endif -#ifdef TARGET_NR_oldstat - case TARGET_NR_oldstat: - goto unimplemented; #endif case TARGET_NR_lseek: return get_errno(lseek(arg1, arg2, arg3)); @@ -8390,16 +8382,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return get_errno(stime(&host_time)); } #endif - case TARGET_NR_ptrace: - goto unimplemented; #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; -#endif #ifdef TARGET_NR_pause /* not on alpha */ case TARGET_NR_pause: if (!block_signals()) { @@ -8470,14 +8456,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } return ret; #endif -#ifdef TARGET_NR_stty - case TARGET_NR_stty: - goto unimplemented; -#endif -#ifdef TARGET_NR_gtty - case TARGET_NR_gtty: - goto unimplemented; -#endif #ifdef TARGET_NR_access case TARGET_NR_access: if (!(p = lock_user_string(arg1))) { @@ -8499,10 +8477,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_nice /* not on alpha */ case TARGET_NR_nice: return get_errno(nice(arg1)); -#endif -#ifdef TARGET_NR_ftime - case TARGET_NR_ftime: - goto unimplemented; #endif case TARGET_NR_sync: sync(); @@ -8616,14 +8590,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, ret = host_to_target_clock_t(ret); } return ret; -#ifdef TARGET_NR_prof - case TARGET_NR_prof: - goto unimplemented; -#endif -#ifdef TARGET_NR_signal - case TARGET_NR_signal: - goto unimplemented; -#endif case TARGET_NR_acct: if (arg1 == 0) { ret = get_errno(acct(NULL)); @@ -8642,31 +8608,15 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, ret = get_errno(umount2(p, arg2)); unlock_user(p, arg1, 0); return ret; -#endif -#ifdef TARGET_NR_lock - case TARGET_NR_lock: - goto unimplemented; #endif case TARGET_NR_ioctl: return do_ioctl(arg1, arg2, arg3); #ifdef TARGET_NR_fcntl case TARGET_NR_fcntl: return do_fcntl(arg1, arg2, arg3); -#endif -#ifdef TARGET_NR_mpx - case TARGET_NR_mpx: - goto unimplemented; #endif case TARGET_NR_setpgid: return get_errno(setpgid(arg1, arg2)); -#ifdef TARGET_NR_ulimit - case TARGET_NR_ulimit: - goto unimplemented; -#endif -#ifdef TARGET_NR_oldolduname - case TARGET_NR_oldolduname: - goto unimplemented; -#endif case TARGET_NR_umask: return get_errno(umask(arg1)); case TARGET_NR_chroot: @@ -8675,10 +8625,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, ret = get_errno(chroot(p)); unlock_user(p, arg1, 0); return ret; -#ifdef TARGET_NR_ustat - case TARGET_NR_ustat: - goto unimplemented; -#endif #ifdef TARGET_NR_dup2 case TARGET_NR_dup2: ret = get_errno(dup2(arg1, arg2)); @@ -9386,10 +9332,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } return ret; #endif -#ifdef TARGET_NR_oldlstat - case TARGET_NR_oldlstat: - goto unimplemented; -#endif #ifdef TARGET_NR_readlink case TARGET_NR_readlink: { @@ -9443,10 +9385,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } return ret; #endif -#ifdef TARGET_NR_uselib - case TARGET_NR_uselib: - goto unimplemented; -#endif #ifdef TARGET_NR_swapon case TARGET_NR_swapon: if (!(p = lock_user_string(arg1))) @@ -9468,10 +9406,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, ret = get_errno(reboot(arg1, arg2, arg3, NULL)); } return ret; -#ifdef TARGET_NR_readdir - case TARGET_NR_readdir: - goto unimplemented; -#endif #ifdef TARGET_NR_mmap case TARGET_NR_mmap: #if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \ @@ -9588,10 +9522,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; case TARGET_NR_setpriority: return get_errno(setpriority(arg1, arg2, arg3)); -#ifdef TARGET_NR_profil - case TARGET_NR_profil: - goto unimplemented; -#endif case TARGET_NR_statfs: if (!(p = lock_user_string(arg1))) { return -TARGET_EFAULT; @@ -9659,10 +9589,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, ret = get_errno(fstatfs(arg1, &stfs)); goto convert_statfs64; #endif -#ifdef TARGET_NR_ioperm - case TARGET_NR_ioperm: - goto unimplemented; -#endif #ifdef TARGET_NR_socketcall case TARGET_NR_socketcall: return do_socketcall(arg1, arg2); @@ -9880,20 +9806,8 @@ 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; -#endif -#ifdef TARGET_NR_iopl - case TARGET_NR_iopl: - goto unimplemented; -#endif case TARGET_NR_vhangup: return get_errno(vhangup()); -#ifdef TARGET_NR_idle - case TARGET_NR_idle: - goto unimplemented; -#endif #ifdef TARGET_NR_syscall case TARGET_NR_syscall: return do_syscall(cpu_env, arg1 & 0xffff, arg2, arg3, arg4, arg5, @@ -10069,8 +9983,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, case TARGET_NR_modify_ldt: return do_modify_ldt(cpu_env, arg1, arg2, arg3); #if !defined(TARGET_X86_64) - case TARGET_NR_vm86old: - goto unimplemented; case TARGET_NR_vm86: return do_vm86(cpu_env, arg1, arg2); #endif @@ -10107,35 +10019,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } return ret; #endif -#ifdef TARGET_NR_create_module - case TARGET_NR_create_module: -#endif - case TARGET_NR_init_module: - case TARGET_NR_delete_module: -#ifdef TARGET_NR_get_kernel_syms - case TARGET_NR_get_kernel_syms: -#endif - goto unimplemented; - case TARGET_NR_quotactl: - goto unimplemented; case TARGET_NR_getpgid: return get_errno(getpgid(arg1)); case TARGET_NR_fchdir: return get_errno(fchdir(arg1)); -#ifdef TARGET_NR_bdflush /* not on x86_64 */ - case TARGET_NR_bdflush: - goto unimplemented; -#endif -#ifdef TARGET_NR_sysfs - case TARGET_NR_sysfs: - goto unimplemented; -#endif case TARGET_NR_personality: return get_errno(personality(arg1)); -#ifdef TARGET_NR_afs_syscall - case TARGET_NR_afs_syscall: - goto unimplemented; -#endif #ifdef TARGET_NR__llseek /* Not on alpha */ case TARGET_NR__llseek: { @@ -10648,14 +10537,6 @@ 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; -#endif -#ifdef TARGET_NR_nfsservctl - case TARGET_NR_nfsservctl: - goto unimplemented; -#endif case TARGET_NR_prctl: switch (arg1) { case PR_GET_PDEATHSIG: @@ -10734,7 +10615,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; +#error unreachable #endif #endif #ifdef TARGET_NR_pread64 @@ -10882,21 +10763,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return ret; } #endif -#else - case TARGET_NR_sendfile: -#ifdef TARGET_NR_sendfile64 - case TARGET_NR_sendfile64: -#endif - goto unimplemented; -#endif - -#ifdef TARGET_NR_getpmsg - case TARGET_NR_getpmsg: - goto unimplemented; -#endif -#ifdef TARGET_NR_putpmsg - case TARGET_NR_putpmsg: - goto unimplemented; #endif #ifdef TARGET_NR_vfork case TARGET_NR_vfork: @@ -11439,9 +11305,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, case TARGET_NR_setfsgid32: return get_errno(setfsgid(arg1)); #endif - - case TARGET_NR_pivot_root: - goto unimplemented; #ifdef TARGET_NR_mincore case TARGET_NR_mincore: { @@ -11599,10 +11462,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, /* self-modifying code is handled automatically, so nothing needed */ return 0; #endif -#ifdef TARGET_NR_security - case TARGET_NR_security: - goto unimplemented; -#endif #ifdef TARGET_NR_getpagesize case TARGET_NR_getpagesize: return TARGET_PAGE_SIZE; @@ -12562,7 +12421,6 @@ 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; }