From patchwork Mon Apr 30 09:09:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 134698 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp3531266lji; Mon, 30 Apr 2018 02:18:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo6l72s9Wx3ZIy33Ovu8tfSolHFZDMmMYrcIuon3wOwNf6nNK+aqqnQvBbMBg5bYPmFfhdU X-Received: by 2002:a0c:ad07:: with SMTP id u7-v6mr10628043qvc.160.1525079915760; Mon, 30 Apr 2018 02:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525079915; cv=none; d=google.com; s=arc-20160816; b=q2J+7zJeu5TQFlGexMIlJLq8vPPEv4zn6miGguo4UEfg0Djw+L0Eck/2Yfs64Y7AR1 3XAZicFFf0y4BU35ZTiWo78+2ts9SLXjQdwDBFzvqSOvW88t7g3WD5wwwrfZ3aK9vRAv xaQxWL//XBiovkQouYig9oGzCsj/rKWiHmyy5rGsg3iqxTb3BxkygYtuSUQloCJi6Snh 7O1IwGH5OomSWl541ujK7Cm6s0JTJ6pAtwoqNm57zZXxIGcSZBxODbKPEyBhmzsAlGu6 Fvd/ekEwI9BJX6zslXCK1sThgyGt2cgk+ZcwEFWtsUeVZW3dkrpN9dmd1SRriCJ6fE2k GJLA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=YSw97K15FyPROPYB6eP2/ZmsZp+c34RzcH/xfwND3tc=; b=CajiYaXm4mipAE48vXf0oTVZX9Mh+um2Gpksrn1UUYNpAflccOUpj95XiBR6QUp3xe vW6NWV28UnKw8GhI6FjXThusHIv4Lq3pE3cp9AB2K8h51u47TPw4/0EULkgTtOICaMHD lTyqcLy1axdoyJGRO4FRD5XpJSCbPCG81vPZYFlxKG7Z8S6qaOj0KRr8vsqGsqnOGUJh dIN/ufm6loSORB0PBpnB6VAQ31IptXkRJp7EX1cewesFwBMmp4cSyKDkF98JdkBqUfPH 1tqZ3bHlYyY5VDn3H+bNcQCRu5Og3HTtd5uEc6kmTZFxgGHtz6xGllBZ0mWbnFF/4fUw 9h5Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 124si1058658qkf.342.2018.04.30.02.18.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 30 Apr 2018 02:18:35 -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; 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 Received: from localhost ([::1]:58549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fD4x9-0003IA-6s for patch@linaro.org; Mon, 30 Apr 2018 05:18:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fD4q5-0006Ji-6b for qemu-devel@nongnu.org; Mon, 30 Apr 2018 05:11:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fD4q2-0006AZ-A4 for qemu-devel@nongnu.org; Mon, 30 Apr 2018 05:11:17 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:48573) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fD4pz-00065d-6R; Mon, 30 Apr 2018 05:11:11 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0Lto5V-1eCTjZ1V5x-011Bxx; Mon, 30 Apr 2018 11:10:48 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 30 Apr 2018 11:09:56 +0200 Message-Id: <20180430091037.13878-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430091037.13878-1-laurent@vivier.eu> References: <20180430091037.13878-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:msuxqVI1PnTRjwTLjeI+Wkn5AxGqWWPfPbOEURDk5x5Gu5BE7JC mcM58Ijcwe9nv09JXxAxKHrwowduwEGPbMczIKMyVMLjdbHniGl4jrPMHNzjOTVYiv3o2C2 Jr31KVyH8Fc/HwI1nm9jm+QpTbibEihlWvHKnSsJDxEPAXebaRD19oR9b1VCg0hAgMev3q+ RlSejs19Y0uVCfbGFXxcQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ekj++4M3/M4=:Taa7beT3SbCM6QmwlVRtjw hesZnkK7KzYAKIfxP4ykQu1ieqM5possVw08Kr21eYCwE6+eWIJoPWe7Z3fgjXkrM+Az384mS 4fxkvzOrR+K/O+I9DHo2C1TEHW8Bj4ZMVqjSUaPIBu8W3pb6Al9JZgFDXbKIGM07syT/xh4fD PDE7cYtCAEGwzZf7/bKcIESEmesrvMChOrLh7+WVqws/6CvK/jM55kVwRZahg+1ptgHvvHDE0 QOSdB/rvsic0CVsIpHKcLp8nniJwN5Ds7S6NOjSYUS23bq6QlP4oXTEs6nqdM6fFZwtHE+QtR At1uslGqiAPTIdPoRpJrXKFTwxn2UBJ53VthTzdY93fyqhHZbcZZI04ZLF3Dp6gAo3Sg4tAey 3RhNy7D1xVlkMsNdTYau7KriYluFrKCRvAdWdNJbP/X7o5vIudwERrxJQ0VTzatWkaTTTo/yx LmsBzPLsH5gPk9iyZk9gJ3CmqBjk4557tyzR4xFkto63f1xxOyimkrpfDxzzs4+7HyRcS8Uwq YGGs+SCJSr/AsMjCR/7YqSmHiTT9T3yIzSOrWSjQDQjpluv5IDah3r4oFlIz5387RugoPaj6V Dsc2g1Iup+qD2ompM0k2K2REb77kS75ely7PkUKfcw8NTJCg6WtM2qnBKx6dJcFn9L9BvVd6U +FI2pVfuuEcwzwKyKsefm77SdSeotxZCOeM/tzybS4h4XZMVS0Cf2DvlhTQQMgEvgKnTmxe3r z9UoQn7X2BVBqYOq X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PULL 01/42] linux-user: set minimum uname for RISC-V 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: qemu-s390x@nongnu.org, Riku Voipio , =?utf-8?q?Ale?= =?utf-8?b?eCBCZW5uw6ll?= , Laurent Vivier , Cornelia Huck Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée As support for RISC-V was only merged into the mainline kernel at 4.15 it is unlikely that glibc will be happy with a reported kernel version of 3.8.0. Indeed when I testing binaries created by the current Debian Sid compiler the tests failed with: FATAL: kernel too old Bump the version to the minimum a RISC-V glibc would expect: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/configure.ac Signed-off-by: Alex Bennée Reviewed-by: Palmer Dabbelt Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180425100218.24785-1-alex.bennee@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/riscv/target_syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.3 diff --git a/linux-user/riscv/target_syscall.h b/linux-user/riscv/target_syscall.h index d4e109a27f..ee81d8bc88 100644 --- a/linux-user/riscv/target_syscall.h +++ b/linux-user/riscv/target_syscall.h @@ -45,7 +45,7 @@ struct target_pt_regs { #else #define UNAME_MACHINE "riscv64" #endif -#define UNAME_MINIMUM_RELEASE "3.8.0" +#define UNAME_MINIMUM_RELEASE "4.15.0" #define TARGET_MINSIGSTKSZ 2048 #define TARGET_MLOCKALL_MCL_CURRENT 1 From patchwork Mon Apr 30 09:09:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 134697 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp3528047lji; Mon, 30 Apr 2018 02:14:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrmGZaM0HNqQ0gGrYZwan2rUPoD5XRD+yuNt+7LtmYOSSnke8E12GpVKkuN/ovQyjoNZE9q X-Received: by 2002:a0c:d88f:: with SMTP id q15-v6mr10462063qvj.83.1525079650630; Mon, 30 Apr 2018 02:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525079650; cv=none; d=google.com; s=arc-20160816; b=oW1fbh6q08d5zsD5NXwws3IulELyv8joKWSW9JqBXyiiLl8NQkpu53mGU1dBkYDDfh zI0THZmf7PKOZmD+eO5TDef313rBFpkoeV8QExB7lpXlBfFUK/A4BhO6ToAi7QAe701b lHuO7mlTnSvgH2ysOCgAPg0n/2pYyp1Nc01Y0OOlL6qfiNSewUtLHwzHl4NHTT6eUZiJ SavLAuIGmhYFV1BvH3cUd/5YO4xeqeXAw4sLZA3Bdk9KpV/1gSlaaRVD9+7XmjIgADwz +IdX0bf7WvloAMMWZDAUTC3igmfMMJWlBxzKBzvkHMuJ7hmds5tigsufUff7/KBMkbDl R4yA== 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:arc-authentication-results; bh=naKBRgLgRvEZKueT5ba2ZxsV2nkBvp6ahOHhJl4ISls=; b=CCSOHLM8nxonxRO2FDZm6UnwSsxxWyQmswId5rVJbzP2WZ61o79nqCGTdS4YX7agOD 4mXUAegL1g8vZg3dzz+fVoZJXLxcZA8CSBgtjwxQ+XnsbsIS0nOlnhrmxh8/iMhN7Mvx pUWyzh8WaH5SY8rol6RaP7je+t/Qk5qoJjsJhSCdlJURPGnuYxJGiDjHNsoEle7T3JWJ Pj+Wnl+ryAEyuiotVJlhgHwnRAmIVTggT88tApxy9V642hIwRbdV+sFhUGQDmBbncAwl pIR9tmp4T8dDM3cUkuH9ssXSziZ0tSbWVIHt4sVMEZQBSJKKOIKr+Xg9sa09eXu2OhGg sVAg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d16si1699017qkb.67.2018.04.30.02.14.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 30 Apr 2018 02:14:10 -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; 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 Received: from localhost ([::1]:58524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fD4ss-0007h5-1H for patch@linaro.org; Mon, 30 Apr 2018 05:14:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fD4q0-0006GZ-Oy for qemu-devel@nongnu.org; Mon, 30 Apr 2018 05:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fD4pz-00066O-7J for qemu-devel@nongnu.org; Mon, 30 Apr 2018 05:11:12 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:38655) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fD4pu-0005wL-F1; Mon, 30 Apr 2018 05:11:06 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LZvn3-1eWKxx4BVV-00liRl; Mon, 30 Apr 2018 11:10:49 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 30 Apr 2018 11:09:57 +0200 Message-Id: <20180430091037.13878-3-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430091037.13878-1-laurent@vivier.eu> References: <20180430091037.13878-1-laurent@vivier.eu> X-Provags-ID: V03:K1:hzraixj2punJDMJGXyURqrGKReIz3eZdAgLmZfZTiglEJEeOSXW cCWwP5i6jtdrj9ZWPcLqqVnxMwIfxryvmCLEsLfAkuwqzZlWCFngdx3gq65sSTUpQYrrlWS vkT0Ychst+9cIZpIHroVXpM81h0pUAkUFcscG+1KL9DNMFCugXzSf9ZYMhkMZoxw6FaIRlI 7JWTtMZJRLQR6bZ2cvRXA== X-UI-Out-Filterresults: notjunk:1; V01:K0:l8Mj40g4GGA=:9TX+n1oinjMeum6Q3nnxGo MsOuukazAsXHwwp3TdWNI61RTTll4QkTE/pTPWbIZQ5JmJP4XyvJdjJuZD+iNo4/j7XgRJfRN A4gAYHjSe7KjYUYsU04Qv4VJGR40Pyo3mU53IL5CHXtHtyHIlD5127DxTtZXI6p91W6ZZAIRv bu+P135ys/GTB7Kh5HaGCOMQs6VgCnWmuzxsE81rPfxJaswZrAmAEdArknz40m8aIlf9j2S04 tesNTzzZdPq6La0kGYt4xwznH0tJ/qa8tQilLhJhUO5Mu9/jkGkcj2KKjeYOCxQNNBlxkvxM+ 6F0x2p0fqnw/C79nDNoseap7ZkRgybDn5MK8tZkfsx9CLQfNNms9YLFZf+vcT4ZdEq8ik18/c 2m66VfjJv9+asIaq9leams8RCiXLo1P2CnwfKHEqqO5Q+ITE60xuBZNp2mwh2zGLz0PzHlrFk X7ulwgnpnXjIlo23exkNhCtsaIDCTgT7/Skd6bWw8LAzmbdr9CeX6/5/W3zDiRw1z+hbur6M1 nfCYSzBvCFo7fYUAy2dLT+OcnjFKCOQfrMdmx2eSVyNRg0XmgnisEtHl0amKeuAWfqHvvE3gZ PgTJgIVgk8AEuiWOHoayrAyfwbhpTJ1jskywIgx9iMIt2hEzTvRGz9kK2Zh3hSLXYhtSPCKCY LdCrVCT+NnEkR3uYmFSiQacP4YAt5wqeacuBgVLbicJ1sTdK/I0P8cvaUHh+rXBbiYIg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PULL 02/42] linux-user: Fix getdents emulation for 64 bit guest on 32 bit host 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: Peter Maydell , qemu-s390x@nongnu.org, Riku Voipio , Laurent Vivier , Cornelia Huck Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Currently we mishandle emulation of the getdents syscall for the case of a 64 bit guest on a 32 bit host -- it defaults into the 'host and guest same size' codepath and generates incorrect structures in the guest buffer. We can't easily handle the 64-on-32 case using the host getdents syscall, because the guest struct dirent is bigger than the host struct dirent, and we might find the host syscall has handed us back more records than we can fit in the guest buffer after conversion. Instead, always emulate 64-on-32 getdents with the host getdents64. This avoids the buffer-overrun problem because a dirent64 struct is always the same size on any host and always larger than any architecture's dirent struct. Reported-by: Henry Wertz Signed-off-by: Peter Maydell Message-Id: <20180419125740.2695-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) -- 2.14.3 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 643b8833de..404be44ad5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -259,10 +259,22 @@ static int gettid(void) { return -ENOSYS; } #endif -#if defined(TARGET_NR_getdents) && defined(__NR_getdents) + +/* For the 64-bit guest on 32-bit host case we must emulate + * getdents using getdents64, because otherwise the host + * might hand us back more dirent records than we can fit + * into the guest buffer after structure format conversion. + * Otherwise we emulate getdents with getdents if the host has it. + */ +#if defined(__NR_getdents) && HOST_LONG_BITS >= TARGET_ABI_BITS +#define EMULATE_GETDENTS_WITH_GETDENTS +#endif + +#if defined(TARGET_NR_getdents) && defined(EMULATE_GETDENTS_WITH_GETDENTS) _syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count); #endif -#if !defined(__NR_getdents) || \ +#if (defined(TARGET_NR_getdents) && \ + !defined(EMULATE_GETDENTS_WITH_GETDENTS)) || \ (defined(TARGET_NR_getdents64) && defined(__NR_getdents64)) _syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count); #endif @@ -10163,7 +10175,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_getdents case TARGET_NR_getdents: -#ifdef __NR_getdents +#ifdef EMULATE_GETDENTS_WITH_GETDENTS #if TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64 { struct target_dirent *target_dirp; From patchwork Mon Apr 30 09:10:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 134699 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp3543749lji; Mon, 30 Apr 2018 02:34:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoy8Inii5CtMXcO2a2MW7YoSD40BPxb2zcv+RctTehbmIkr87fbz0nT1LQ3t72ceAW2lSRM X-Received: by 10.55.171.9 with SMTP id u9mr9588662qke.125.1525080871699; Mon, 30 Apr 2018 02:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525080871; cv=none; d=google.com; s=arc-20160816; b=NoxHKU4EO3aTh1kykSKASGkFVLxQxQdGsmNTDT4SXSJvOvnYhJvdSNbI9/ms9C822Z kHIC0NUyYEacC69IhpARbWsnRZLGLN/WFZhFDZ8uysn+3QLvD2bVtmiHMmy3dcInDGa4 xhmtPIgJ8WJ4nKoatyqYkIK0pVkHyfMYBOAptVdGr1J2wamc6xD2HHdnnHiHoFL4o1gT YwfbcYVkJz5T3ukDi+HC1N/I9L2/5cBjLBWisB2WlcAC7P/QAiz9kRDpnpQsaZ16xpzf X8X5a3kxNDr+448Ph/1uRFQVQyAtPu4ttVhVM4lp680gYLArZ0KuSAv5KnMct/t4YzZQ j/aw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=uE/oKEDtr8SXfM7AsZEbQMp5/Is9ve4ZyOgy6FTuLc8=; b=s5ks6mh8sHGZ40w4YpMK8orPLIf70PgP78+1SSjkgsupOqLdCIJqS4+RRifTM7MXaV b/FuSK6xG5zciM8eHxETF7kvECrAZJuEWcHdvDRgeHWdtjqRIczr9YdJ1WcoHLfoNPmF 2xoXc6hO8ayFOqYRunBr38TM91bFVT83Wb/0VhJFOLn49Vr3zou3iGQrZydgu5KtnANf m4TbABlXZ3ws3G+5QX1PxOUMIdCkZenTVai51RJH6mKOokpAz6dQ38U9R/lbVVO7us9/ 0Z/HGCoJoogfCfjCI+/ifCQc0ewKb8zEmewc/bHPhgeJb0dTIGTDr4AxEj+dfpSnAw6E pttA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h11-v6si6875250qtp.105.2018.04.30.02.34.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 30 Apr 2018 02:34:31 -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; 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 Received: from localhost ([::1]:58657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fD5CZ-0008On-4i for patch@linaro.org; Mon, 30 Apr 2018 05:34:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fD4qR-0006gV-CG for qemu-devel@nongnu.org; Mon, 30 Apr 2018 05:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fD4qM-0006Wi-11 for qemu-devel@nongnu.org; Mon, 30 Apr 2018 05:11:39 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:35707) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fD4qL-0006VR-HN; Mon, 30 Apr 2018 05:11:33 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MWRtC-1esfcy3Ah0-00XdN0; Mon, 30 Apr 2018 11:11:26 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 30 Apr 2018 11:10:37 +0200 Message-Id: <20180430091037.13878-43-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430091037.13878-1-laurent@vivier.eu> References: <20180430091037.13878-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:S7c+THSRYyBmJae4q8/KCe9UMEHypAUjwGgdrK/fH5s1JcN8Jpa sDWhscdYRE2jgG6fxD30ncIpjCDLzEYF9L8MEU90q29lFSFQDPcgfcX+sVi+mpq4s/8/VOY EW9kpSIFw1gwsyjK7L3eFjs+HJdHmKf6sd2vga6Uwt/HeaowfrGPBw/0hGRHnsbWX7Ke8lG ujov6mZo9CNesybflF9Kg== X-UI-Out-Filterresults: notjunk:1; V01:K0:Wk4Pn5Sf3zU=:fYgQ/ZN6MbNxgXgiJifKsh DWrCdVGoDjM7r89jA3xYFFZUop5PNLEFw2SPyAZ4jAs/f8pRDBKhhsv1KlHvw71uFu1Ov26Up ydyIdzrijbeN1DbeoJV6uex5UhE8G4dAEhUo5BPJ4j0+Jr9CNNNSdpAupINJdKjvQ/6AcFSGP 7PyMgRv9+8vWkqTguEnXdG/9UtTgHRYjWyfYsu/rowrIpE+Quw/6NdIUtWcgoA30bE/U2qnof IpGNHEnY80eXTbWG+16seLSHwRBn9tRqKogsPHTZHWXwE+ZpKeGPdVSI5g1mHdng/Nh0CWty9 VfPXjifWrfnHVLvdZLV8hK1jvltQ0+rprOlUnfdmcyNs34hFCCsJkfSij0Q3ae8LSW2SqdDrO jV0tQ+ov8XGpUBIjhijTQWz4+dMPoXbPeJFrQ3ml1fnYwSj7d1tAEBmLniQaXyAjvrXR8T758 LQK6ndHfDHKvuN+R4nyQux7gaArGF6JcpminIdAXDCVeFQ8GCUN1jrtI93zRYWwZ6TkBGi6+l qW4nif6ibtOCqpmmvA79C8WhUlHGIHPqGpcj+X3GdUb5eWipd+BDHDPlb4mqVEol5aPJtn8lI PRxOpimJPNJcnTYqsduvr6kYL2knwEa3i5E1zxqnWQxw1d3nyXjS3+Qb7ocJfEUO43KJy4bE7 /JXco3ckcEDOEgBwQDXQ17Wx/yOSd3YuRrvBmnmYN8D5p0Qx26f0/LNEtTRY3OhMcoEPBB2tF hGUWw+lV34P7mwkx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PULL 42/42] linux-user: Add ARM get_tls syscall support 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: Christophe Lyon , qemu-s390x@nongnu.org, Riku Voipio , Laurent Vivier , Cornelia Huck Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Christophe Lyon Co-Authored-By: Mickaël Guêné Signed-off-by: Christophe Lyon Reviewed-by: Peter Maydell Message-Id: <20180416091845.7315-1-christophe.lyon@st.com> [lv: moved the change to linux-user/arm/cpu_loop.c] Signed-off-by: Laurent Vivier --- linux-user/arm/cpu_loop.c | 3 +++ linux-user/arm/target_syscall.h | 1 + 2 files changed, 4 insertions(+) -- 2.14.3 diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index d911929bf6..26928fbbb2 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -347,6 +347,9 @@ void cpu_loop(CPUARMState *env) case ARM_NR_breakpoint: env->regs[15] -= env->thumb ? 2 : 4; goto excp_debug; + case ARM_NR_get_tls: + env->regs[0] = cpu_get_tls(env); + break; default: gemu_log("qemu: Unsupported ARM syscall: 0x%x\n", n); diff --git a/linux-user/arm/target_syscall.h b/linux-user/arm/target_syscall.h index 94e2a42cb2..afc0772e19 100644 --- a/linux-user/arm/target_syscall.h +++ b/linux-user/arm/target_syscall.h @@ -16,6 +16,7 @@ struct target_pt_regs { #define ARM_NR_breakpoint (ARM_NR_BASE + 1) #define ARM_NR_cacheflush (ARM_NR_BASE + 2) #define ARM_NR_set_tls (ARM_NR_BASE + 5) +#define ARM_NR_get_tls (ARM_NR_BASE + 6) #define ARM_NR_semihosting 0x123456 #define ARM_NR_thumb_semihosting 0xAB