From patchwork Tue May 18 05:31:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 441151 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1798129jac; Mon, 17 May 2021 23:13:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFtdAT0HCzo8uhotHWSRrph41YlEAV+cibB37gxtw9YsdUU5QlMnEq1eW2PRx3NYCofg/9 X-Received: by 2002:a05:6102:10d1:: with SMTP id t17mr4839299vsr.0.1621318399317; Mon, 17 May 2021 23:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621318399; cv=none; d=google.com; s=arc-20160816; b=kKIG+Ygo5INEM5U//dfBRUm8NtfjVmMPcxzEEhPCwVkIa5Gw516MdputXQDhcIh768 ULymVIvWHoQ4ZePNT1O00iuh0ySEBWLUMBJisnu3MdrQ4NkcCQNcU3zFDVfGGHBbKfDZ 9j7pKBPNAS96C3LhaWFJ7Kj3jSwmsiQPddkGs2KIImIGwoWEBcvcMEtSsHdMjBHRcHjY zU9MT00tyrXvo5LcSI5W26ZBgMYnw5rNTKeXi4ZBMma7T9Ay4ZhX68sR+cKThZFsvqDz 243aTtjRGPQbT6I7aEg/P05dtypgBnKGnIGLUMfPHjYXdQI7yjzr9IvevmIRgFfo8Gxh NBnA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Vo6Dl1Qp9eZdyZcBtl1QOozIJdh7pRc5aLtRTUKEkQ0=; b=tBQUKjaSjrrJ9iTe7M5V0P9IrAMYli6WfjErQE5yFgXmmERH22ztTVGMW8KIFxaNnG 0+Vr1WxRKv+YhFROM1O35KlZkvFvgrLYg7k1S/ZUJZipjepIxznutBvq/65XWzTkXFLu GqQ7Xt2g44xaAuEORQ0JU+eVZB7hOs2884l+5flTLN5slPBwJV4EkuHntu4V/+/c0s4R 6eDwCJEs+RzI7VqaieIbIUu1qKS3yHql2MhO0uwyW83ini2YeEgayWlC+acwZLxByrbo BCSkpIz7Q5bDdEZM/lu5J9FJRUgJ4DJxm9wkpPcHzJiL2jvJsMjFxCieh3uYwcm+554f zCgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w20si2864758vsk.264.2021.05.17.23.13.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 23:13:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:33062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lisyk-0003ls-Mx for patch@linaro.org; Tue, 18 May 2021 02:13:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lisKr-0007n3-KK for qemu-devel@nongnu.org; Tue, 18 May 2021 01:32:05 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:50985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lisKn-0007AO-2f for qemu-devel@nongnu.org; Tue, 18 May 2021 01:32:05 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MS1G7-1lt1bF3Cgd-00TWmj; Tue, 18 May 2021 07:31:54 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 42/59] linux-user/s390x: Set psw.mask properly for the signal handler Date: Tue, 18 May 2021 07:31:14 +0200 Message-Id: <20210518053131.87212-43-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210518053131.87212-1-laurent@vivier.eu> References: <20210518053131.87212-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:qa/fa58/7CVeW+epwnsmG7QifkNJtcfhsspWlN1R1wbYIPDIs+a Qs7EOKsmJoryGsQW/MZoDA7usZ6cCnQTcXCIfPZ0D3tktQvOQ8FjmZdKndR9vff9WvOyJ7S L6krUKM00TGuc60ZCnqEibQjQ2gUCHq7/ajjVYI0FMbfkwiVCO7ZuOtDqMhrFll2D9M1nEB IcCK5p5FezP3q6Gbph91g== X-UI-Out-Filterresults: notjunk:1; V03:K0:FZGATEnyljY=:GUkpQOmk1lODYOzcGh/+Tn SjVMLUHVTdk/ZCDhuGyz2J+F9KBfEUXKfV5Dkps+6HQxTGZfTCxjkuAI0pw4NHRA1ZUC0X6GU xs85xbI3m+9OqnvhzpfCDAHfCkwy/iaKZFhqsFxScMGyKOu1mrLdkFsMFhVLyOxErOW/zL8D4 Omsv0zglZXDF0U5jcA4d2afsSdAVwg5WsDOZhDfx9VHX4Tqj4WLOvKBuJ4EPuWJRHebkDk0HH CGI4/WpmtI+oiUS2QP40f8YBkfrEkBVFWRij09f808c/1PZYsOxl0IsbYbh8yrL+uf7b8Cyed X9QzYsGGgjfw6vVavJ8WPuIraYi7Sxo1/f5VZN6blRo/5si8cQVa6s++29ss2ndwNXDUusFmT Z7BrAeq3Dr9AyDN4emi7rc0RiRT4VaBvbQE8onT1NmpgcR4MrRHRaRp2+o67N2H0DzPlkEl2h vOM5zU12hP4aMN3K57OqSfPBDTSxXKmokmRG++xTYiPyMZOCGugzTbcDeu9WBH1rR1AO8NZq0 WWWk29Vg2zbnsFivkhiY9M= Received-SPF: none client-ip=212.227.126.130; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Laurent Vivier , David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Note that PSW_ADDR_{64,32} are called PSW_MASK_{EA,BA} in the kernel source. Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand Message-Id: <20210428193408.233706-11-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/s390x/signal.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.31.1 diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index 64a9eab09770..17f617c65581 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -162,6 +162,9 @@ void setup_frame(int sig, struct target_sigaction *ka, /* Set up registers for signal handler */ env->regs[15] = frame_addr; + /* Force default amode and default user address space control. */ + env->psw.mask = PSW_MASK_64 | PSW_MASK_32 | PSW_ASC_PRIMARY + | (env->psw.mask & ~PSW_MASK_ASC); env->psw.addr = ka->_sa_handler; env->regs[2] = sig; //map_signal(sig); @@ -215,6 +218,9 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, /* Set up registers for signal handler */ env->regs[15] = frame_addr; + /* Force default amode and default user address space control. */ + env->psw.mask = PSW_MASK_64 | PSW_MASK_32 | PSW_ASC_PRIMARY + | (env->psw.mask & ~PSW_MASK_ASC); env->psw.addr = ka->_sa_handler; env->regs[2] = sig; //map_signal(sig);