From patchwork Fri Aug 22 13:24:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35803 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f200.google.com (mail-yk0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 367E520540 for ; Fri, 22 Aug 2014 13:28:46 +0000 (UTC) Received: by mail-yk0-f200.google.com with SMTP id 9sf34024771ykp.11 for ; Fri, 22 Aug 2014 06:28:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=AsG/jcEMeESJUPJRsdT4838g6plBxnHgeuhg2B1xZ4U=; b=Cn2NtqUPX8hVEkrgFZhbESho6uVm1Sxp8Q3BGESvRQPVjG9dzuCPzpsE/84CrofnC5 OpSd8/EmxuB0b+HcFNUzt4ccYA9JIlPFDQO8Ahp+Ifg/Yx+Qk55pId/b+bjYDjADvRWb A140rZY3NOpWnLdtzzqG2Vq9aO/TCaygaTScei8nJkhu0q82iLM0e/kSPpAqW3gSijTy iciB2FixisAf9YsXdsD5Cd2u+kyCXFecoABTt5bmXwz7VohBfy26zmcsE8f9EBvRY32/ D/5sifRXxb4uvLho7P9AMv/SN8Ihda6CjLSP0U+/Vfh+OkyGyPTzyC1jExafSe6aC9ly VLqA== X-Gm-Message-State: ALoCoQkI/hkF0ibYFNQjoxgeRnQRPVvRTF4UMjUfEkpi5G6Y62hEqkUIPXG/s+MoycTOgrZe3C4R X-Received: by 10.236.105.197 with SMTP id k45mr30332514yhg.19.1408714126048; Fri, 22 Aug 2014 06:28:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.18 with SMTP id z18ls1119365qge.0.gmail; Fri, 22 Aug 2014 06:28:46 -0700 (PDT) X-Received: by 10.52.83.227 with SMTP id t3mr958555vdy.20.1408714125957; Fri, 22 Aug 2014 06:28:45 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id a7si13399377vdb.93.2014.08.22.06.28.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:28:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so12276856vcb.2 for ; Fri, 22 Aug 2014 06:28:45 -0700 (PDT) X-Received: by 10.221.68.66 with SMTP id xx2mr4042622vcb.1.1408714125880; Fri, 22 Aug 2014 06:28:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp16903vcb; Fri, 22 Aug 2014 06:28:45 -0700 (PDT) X-Received: by 10.140.106.5 with SMTP id d5mr7174722qgf.23.1408714124515; Fri, 22 Aug 2014 06:28:44 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h6si42220736qan.116.2014.08.22.06.28.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:28:44 -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; Received: from localhost ([::1]:37091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKotX-0008T5-LN for patch@linaro.org; Fri, 22 Aug 2014 09:28:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKopo-0006Wj-4L for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKoph-0002Ck-6J for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:52 -0400 Received: from afflict.kos.to ([92.243.29.197]:39336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKopg-0002BY-SZ for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:45 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 4D647265B0; Fri, 22 Aug 2014 15:24:43 +0200 (CEST) From: riku.voipio@linaro.org To: Peter Maydell , qemu-devel@nongnu.org Date: Fri, 22 Aug 2014 16:24:36 +0300 Message-Id: <0903c8be9ee7925863c6c50a2096b6e919be861c.1408712881.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Tom Musta Subject: [Qemu-devel] [PULL v3 18/22] linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Tom Musta The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was 2048 previously. Signed-off-by: Tom Musta Signed-off-by: Riku Voipio --- linux-user/aarch64/syscall.h | 1 + linux-user/alpha/syscall.h | 1 + linux-user/arm/syscall.h | 2 ++ linux-user/cris/syscall.h | 1 + linux-user/i386/syscall.h | 1 + linux-user/m68k/syscall.h | 2 ++ linux-user/microblaze/syscall.h | 1 + linux-user/mips/syscall.h | 1 + linux-user/mips64/syscall.h | 1 + linux-user/openrisc/syscall.h | 2 ++ linux-user/ppc/syscall.h | 2 ++ linux-user/s390x/syscall.h | 1 + linux-user/sh4/syscall.h | 2 ++ linux-user/signal.c | 12 +++++++++++- linux-user/sparc/syscall.h | 1 + linux-user/sparc64/syscall.h | 1 + linux-user/unicore32/syscall.h | 2 ++ linux-user/x86_64/syscall.h | 1 + 18 files changed, 34 insertions(+), 1 deletion(-) diff --git a/linux-user/aarch64/syscall.h b/linux-user/aarch64/syscall.h index 18f44a8..d1f4823 100644 --- a/linux-user/aarch64/syscall.h +++ b/linux-user/aarch64/syscall.h @@ -8,3 +8,4 @@ struct target_pt_regs { #define UNAME_MACHINE "aarch64" #define UNAME_MINIMUM_RELEASE "3.8.0" #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/alpha/syscall.h b/linux-user/alpha/syscall.h index ed13d9a..3adedeb 100644 --- a/linux-user/alpha/syscall.h +++ b/linux-user/alpha/syscall.h @@ -252,3 +252,4 @@ struct target_pt_regs { #define TARGET_UAC_NOPRINT 1 #define TARGET_UAC_NOFIX 2 #define TARGET_UAC_SIGBUS 4 +#define TARGET_MINSIGSTKSZ 4096 diff --git a/linux-user/arm/syscall.h b/linux-user/arm/syscall.h index e0d2cc3..cdadb0c 100644 --- a/linux-user/arm/syscall.h +++ b/linux-user/arm/syscall.h @@ -44,3 +44,5 @@ struct target_pt_regs { #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS + +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/cris/syscall.h b/linux-user/cris/syscall.h index f5783c0..a75bcc4 100644 --- a/linux-user/cris/syscall.h +++ b/linux-user/cris/syscall.h @@ -39,5 +39,6 @@ struct target_pt_regs { }; #define TARGET_CLONE_BACKWARDS2 +#define TARGET_MINSIGSTKSZ 2048 #endif diff --git a/linux-user/i386/syscall.h b/linux-user/i386/syscall.h index 9bfc1ad..acf6856 100644 --- a/linux-user/i386/syscall.h +++ b/linux-user/i386/syscall.h @@ -147,3 +147,4 @@ struct target_vm86plus_struct { #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/m68k/syscall.h b/linux-user/m68k/syscall.h index 889eaf7..f8553f8 100644 --- a/linux-user/m68k/syscall.h +++ b/linux-user/m68k/syscall.h @@ -18,4 +18,6 @@ struct target_pt_regs { #define UNAME_MACHINE "m68k" #define UNAME_MINIMUM_RELEASE "2.6.32" +#define TARGET_MINSIGSTKSZ 2048 + void do_m68k_simcall(CPUM68KState *, int); diff --git a/linux-user/microblaze/syscall.h b/linux-user/microblaze/syscall.h index 5b5f6b4..2a5e160 100644 --- a/linux-user/microblaze/syscall.h +++ b/linux-user/microblaze/syscall.h @@ -49,5 +49,6 @@ struct target_pt_regs { }; #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 2048 #endif diff --git a/linux-user/mips/syscall.h b/linux-user/mips/syscall.h index 5bc5696..0b4662c 100644 --- a/linux-user/mips/syscall.h +++ b/linux-user/mips/syscall.h @@ -228,3 +228,4 @@ struct target_pt_regs { #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/mips64/syscall.h b/linux-user/mips64/syscall.h index a7f5a58..39b8bed 100644 --- a/linux-user/mips64/syscall.h +++ b/linux-user/mips64/syscall.h @@ -225,3 +225,4 @@ struct target_pt_regs { #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/openrisc/syscall.h b/linux-user/openrisc/syscall.h index c3b36da..e5e6180 100644 --- a/linux-user/openrisc/syscall.h +++ b/linux-user/openrisc/syscall.h @@ -23,3 +23,5 @@ struct target_pt_regs { #define UNAME_MACHINE "openrisc" #define UNAME_MINIMUM_RELEASE "2.6.32" + +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/ppc/syscall.h b/linux-user/ppc/syscall.h index db92bbe..5311cc6 100644 --- a/linux-user/ppc/syscall.h +++ b/linux-user/ppc/syscall.h @@ -69,3 +69,5 @@ struct target_revectored_struct { #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS + +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/s390x/syscall.h b/linux-user/s390x/syscall.h index aaad512..b11a3b2 100644 --- a/linux-user/s390x/syscall.h +++ b/linux-user/s390x/syscall.h @@ -24,3 +24,4 @@ struct target_pt_regs { #define UNAME_MINIMUM_RELEASE "2.6.32" #define TARGET_CLONE_BACKWARDS2 +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/sh4/syscall.h b/linux-user/sh4/syscall.h index ccd2216..285ecf3 100644 --- a/linux-user/sh4/syscall.h +++ b/linux-user/sh4/syscall.h @@ -11,3 +11,5 @@ struct target_pt_regs { #define UNAME_MACHINE "sh4" #define UNAME_MINIMUM_RELEASE "2.6.32" + +#define TARGET_MINSIGSTKSZ 2048 diff --git a/linux-user/signal.c b/linux-user/signal.c index 1141054..26929c5 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -617,6 +617,15 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp) { struct target_sigaltstack *uss; struct target_sigaltstack ss; + size_t minstacksize = TARGET_MINSIGSTKSZ; + +#if defined(TARGET_PPC64) + /* ELF V2 for PPC64 has a 4K minimum stack size for signal handlers */ + struct image_info *image = ((TaskState *)thread_cpu->opaque)->info; + if (get_ppc64_abi(image) > 1) { + minstacksize = 4096; + } +#endif ret = -TARGET_EFAULT; if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1)) { @@ -642,8 +651,9 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp) ss.ss_sp = 0; } else { ret = -TARGET_ENOMEM; - if (ss.ss_size < MINSIGSTKSZ) + if (ss.ss_size < minstacksize) { goto out; + } } target_sigaltstack_used.ss_sp = ss.ss_sp; diff --git a/linux-user/sparc/syscall.h b/linux-user/sparc/syscall.h index 9549ea0..ae40744 100644 --- a/linux-user/sparc/syscall.h +++ b/linux-user/sparc/syscall.h @@ -15,3 +15,4 @@ struct target_pt_regs { * and copy_thread(). */ #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 4096 diff --git a/linux-user/sparc64/syscall.h b/linux-user/sparc64/syscall.h index 82b1680..816a00f 100644 --- a/linux-user/sparc64/syscall.h +++ b/linux-user/sparc64/syscall.h @@ -16,3 +16,4 @@ struct target_pt_regs { * and copy_thread(). */ #define TARGET_CLONE_BACKWARDS +#define TARGET_MINSIGSTKSZ 4096 diff --git a/linux-user/unicore32/syscall.h b/linux-user/unicore32/syscall.h index f7e5525..3ed6237 100644 --- a/linux-user/unicore32/syscall.h +++ b/linux-user/unicore32/syscall.h @@ -53,4 +53,6 @@ struct target_pt_regs { #define UNAME_MACHINE "UniCore-II" #define UNAME_MINIMUM_RELEASE "2.6.32" +#define TARGET_MINSIGSTKSZ 2048 + #endif /* __UC32_SYSCALL_H__ */ diff --git a/linux-user/x86_64/syscall.h b/linux-user/x86_64/syscall.h index e03b5a0..5828b91 100644 --- a/linux-user/x86_64/syscall.h +++ b/linux-user/x86_64/syscall.h @@ -97,3 +97,4 @@ struct target_msqid64_ds { #define TARGET_ARCH_SET_FS 0x1002 #define TARGET_ARCH_GET_FS 0x1003 #define TARGET_ARCH_GET_GS 0x1004 +#define TARGET_MINSIGSTKSZ 2048