From patchwork Fri Feb 8 14:34:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14699 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0EAAD241D2 for ; Fri, 8 Feb 2013 14:34:59 +0000 (UTC) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by fiordland.canonical.com (Postfix) with ESMTP id A59BAA190A7 for ; Fri, 8 Feb 2013 14:34:58 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id m1so3351261ves.36 for ; Fri, 08 Feb 2013 06:34:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=Jo7fQZ9x0m3Jc54A0Sh8t128ayHhR/2Rhq6LUSE4Qno=; b=Km7Q4Pz598HR3yzlBUCbWsGmqhGKKlqoVpZ1YZE4vOmHSkzkSRv1lpHRhqVruJZFZX Sr4dEXa1ZtKGqyLLs5Dv3y0SSAcjIowZYuosSLxxl8gUkfzoYgMT0mAMi5XIj+ZJByCl FU4jOBtRRfDVAdNyIRw87AJ1VvtFQ5k6lJYJYPciUcP30BF8nuivggfsFj0NQlSGDEGj 55UeguHb3peM1rWY+M7l1FUrNxyI8kaOi37Az2R7rgJuSREmiSAOfh5gyHl+U/i2fNiS eWgw8qAaGnW+UQJyik6YfrXLPzqJL7Y824ZpItdp3Wi7+Im21zMCJ7TRy1VOwOYPkA0b Enqw== X-Received: by 10.52.21.146 with SMTP id v18mr5958185vde.79.1360334098160; Fri, 08 Feb 2013 06:34:58 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp148864vec; Fri, 8 Feb 2013 06:34:57 -0800 (PST) X-Received: by 10.180.81.39 with SMTP id w7mr3018318wix.15.1360334097018; Fri, 08 Feb 2013 06:34:57 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id m6si2066235wjw.66.2013.02.08.06.34.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Feb 2013 06:34:56 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1U3p2U-0000WY-7u; Fri, 08 Feb 2013 14:34:54 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio Subject: [PATCH] linux-user/syscall.c: Don't warn about unimplemented get_robust_list Date: Fri, 8 Feb 2013 14:34:54 +0000 Message-Id: <1360334094-1991-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQl3fH9SUiDh+6+yc5ZR6OuoXdh7a/BZQFnu/QFDxxZ9m006kwpJx5pQL+/8mEWyl8MoDvnm The nature of the kernel ABI for the get_robust_list and set_robust_list syscalls means we cannot implement them in QEMU. Make get_robust_list silently return ENOSYS rather than using the default "print message and then fail ENOSYS" code path, in the same way we already do for set_robust_list, and add a comment documenting why we do this. This silences warnings which were being produced for emulating even trivial programs like 'ls' in x86-64-on-x86-64. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- linux-user/syscall.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9e31ea7..cd0389b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8550,7 +8550,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_set_robust_list case TARGET_NR_set_robust_list: - goto unimplemented_nowarn; + case TARGET_NR_get_robust_list: + /* The ABI for supporting robust futexes has userspace pass + * the kernel a pointer to a linked list which is updated by + * userspace after the syscall; the list is walked by the kernel + * when the thread exits. Since the linked list in QEMU guest + * memory isn't a valid linked list for the host and we have + * no way to reliably intercept the thread-death event, we can't + * support these. Silently return ENOSYS so that guest userspace + * falls back to a non-robust futex implementation (which should + * be OK except in the corner case of the guest crashing while + * holding a mutex that is shared with another process via + * shared memory). + */ + goto unimplemented_nowarn; #endif #if defined(TARGET_NR_utimensat) && defined(__NR_utimensat)