From patchwork Tue Sep 3 19:12:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 19719 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A611B24869 for ; Tue, 3 Sep 2013 19:12:34 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf6873378vcb.0 for ; Tue, 03 Sep 2013 12:12:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=0hHAom9UIcEYMyulPc/7qUwy3qX1MtJ/8/Zy7z7oq8U=; b=DUNVfQoSZIj9jNYGkXoiwS1dqIkmNNL9er9caFVc//r+BisgSZg96o5lK/agx5c94Y oyyjmxoDjeLHddImwfWDkTl4yGVPjDKHunSlGo5tqjnmwOB8iF6a/i6+mmlHJbFx3Yld G5bR3kpAbF6R9ubGHBwsid9GrJIISr8pAlW25pEPQQ8fXIuBU1PZsvu3JefAtsnVEOGX DNWrRN2GTqvq2Yww6CBVAoW6KuqFMISwiMe8ToyV9qz9+/JnaihpP3ni0aTzrZT3+jZE 98KyZpdglN0ADkr7ivvN/+wSathzcf1onHwwptvG0DObsP00evAbmJrGhcgZrdYAn3Lx L7Zw== X-Received: by 10.236.207.103 with SMTP id m67mr9226863yho.1.1378235554444; Tue, 03 Sep 2013 12:12:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.169 with SMTP id d9ls2729514qed.61.gmail; Tue, 03 Sep 2013 12:12:34 -0700 (PDT) X-Received: by 10.52.114.231 with SMTP id jj7mr5992900vdb.2.1378235554337; Tue, 03 Sep 2013 12:12:34 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id gw1si4822421vcb.137.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:12:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so4121107vcb.25 for ; Tue, 03 Sep 2013 12:12:34 -0700 (PDT) X-Gm-Message-State: ALoCoQlQKUWS2MEFKZucFyr/1uq90cdNQSTh25ieGfCSW5OznA/igAGW21lfsuuxyf03he8/GE8Z X-Received: by 10.220.47.10 with SMTP id l10mr1440027vcf.32.1378235554238; Tue, 03 Sep 2013 12:12:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp190462vcz; Tue, 3 Sep 2013 12:12:33 -0700 (PDT) X-Received: by 10.180.37.227 with SMTP id b3mr11812163wik.24.1378235545896; Tue, 03 Sep 2013 12:12:25 -0700 (PDT) Received: from chiark.greenend.org.uk (v6.chiark.greenend.org.uk. [2001:ba8:1e3::]) by mx.google.com with ESMTPS id aw5si7626829wjc.152.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:12:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pmaydell@chiark.greenend.org.uk designates 2001:ba8:1e3:: as permitted sender) client-ip=2001:ba8:1e3::; Received: by chiark.greenend.org.uk (Debian Exim 4.72 #1) with local (return-path pmaydell@chiark.greenend.org.uk) id 1VGw1Y-0005oQ-Jd; Tue, 03 Sep 2013 20:12:24 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Andreas Schwab , Alexander Graf , "Mian M. Hamayun" , kvmarm@lists.cs.columbia.edu, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH v6 15/24] linux-user: Fix up AArch64 syscall handlers Date: Tue, 3 Sep 2013 20:12:15 +0100 Message-Id: <1378235544-22290-16-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1378235544-22290-1-git-send-email-peter.maydell@linaro.org> References: <1378235544-22290-1-git-send-email-peter.maydell@linaro.org> Sender: Peter Maydell X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Alexander Graf Some syscall handlers have special code for ARM enabled that we don't need on AArch64. Exclude AArch64 in those cases. In other places we can share struct definitions with other targets or have to provide our own. With this patch applied, most syscall definitions in linux-user should be sound for AArch64. Signed-off-by: Alexander Graf Signed-off-by: John Rigby Message-id: 1368505980-17151-9-git-send-email-john.rigby@linaro.org Signed-off-by: Peter Maydell --- linux-user/syscall.c | 5 +++-- linux-user/syscall_defs.h | 28 ++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f986548..73046b0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4737,7 +4737,7 @@ static inline abi_long host_to_target_stat64(void *cpu_env, abi_ulong target_addr, struct stat *host_st) { -#ifdef TARGET_ARM +#if defined(TARGET_ARM) && defined(TARGET_ABI32) if (((CPUARMState *)cpu_env)->eabi) { struct target_eabi_stat64 *target_st; @@ -6394,7 +6394,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_mmap case TARGET_NR_mmap: -#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) || \ +#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \ + (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \ defined(TARGET_M68K) || defined(TARGET_CRIS) || defined(TARGET_MICROBLAZE) \ || defined(TARGET_S390X) { diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 086fbff..2ebe356 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1137,7 +1137,8 @@ struct target_winsize { #define TARGET_MAP_UNINITIALIZED 0x4000000 /* for anonymous mmap, memory could be uninitialized */ #endif -#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) \ +#if (defined(TARGET_I386) && defined(TARGET_ABI32)) \ + || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \ || defined(TARGET_CRIS) || defined(TARGET_UNICORE32) struct target_stat { unsigned short st_dev; @@ -1835,6 +1836,28 @@ struct target_stat { abi_long st_blocks; abi_ulong __unused[3]; }; +#elif defined(TARGET_AARCH64) +struct target_stat { + abi_ulong st_dev; + abi_ulong st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + abi_ulong st_rdev; + abi_ulong _pad1; + abi_long st_size; + int st_blksize; + int __pad2; + abi_long st_blocks; + abi_long target_st_atime; + abi_ulong target_st_atime_nsec; + abi_long target_st_mtime; + abi_ulong target_st_mtime_nsec; + abi_long target_st_ctime; + abi_ulong target_st_ctime_nsec; + unsigned int __unused[2]; +}; #elif defined(TARGET_OPENRISC) /* These are the asm-generic versions of the stat and stat64 structures */ @@ -1943,7 +1966,8 @@ struct target_statfs64 { uint32_t f_spare[6]; }; #elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \ - defined(TARGET_SPARC64)) && !defined(TARGET_ABI32) + defined(TARGET_SPARC64) || defined(TARGET_AARCH64)) && \ + !defined(TARGET_ABI32) struct target_statfs { abi_long f_type; abi_long f_bsize;