From patchwork Wed Apr 28 19:34:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 428619 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp933327jao; Wed, 28 Apr 2021 12:51:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyILvLQgBTwLRSLyRBshvUCFmWWnmmLpiy0ahKQaRtagpUiyqvpfCsyvGJKBuk4xHFOUQ4F X-Received: by 2002:a05:6214:bd4:: with SMTP id ff20mr15185945qvb.1.1619639466485; Wed, 28 Apr 2021 12:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619639466; cv=none; d=google.com; s=arc-20160816; b=SjwkFa646nodXLTW+DGBFVQi4Jc+CkU+CtNfcxsSFhKrLvC9qQGUuWvbqIiWnxZW2Q wfYQO5aKsP9N/5ry5ubIOTl913MzxIw/F10AhPxvoMzTlxAVxogiNC09cw5z+Uqmt5BN Ipy2QoV7BucxxyE6iej33WcdWyF7HR4T7cnRDNBB/Z86N1+vbjvr2emh5KenBzq+gR0M K8HKKrbgUzPTl5QvB5zlc4y5L1KTAZZT8XSDEbzbeDe9Qf2kGjDWQYb3WKxqnMaADGwc e4oe1pL48LlDLneIMwZ7Hh/1mRQo1XKN3yQk3tonrrGTaYNESq2DwJnrDW1qUet6vOmN cbBA== 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 :dkim-signature; bh=Cm5TMYYSdbHhrEfgw+Q+FUKj8miS2gdnBD1hAWEVD3E=; b=gfxiO+jPQfm6DOJoiqMVX6sjDSAehAWlCRSo35KLDCiB5btydCg31uSjjbGRfIzKf9 RVUieQM989+7o7JpWTckf3W+RIH6NaK6yFMbrdaeVd0hMSTXHzbVK20UTDjHagkEnzD+ v3QPyRp/qI4G2468sgEo7JxBd4kx+8/LztzYJ6ymvRIF7sN/AyxqbBoR+PpxtDVawPw/ gpkiHwMXbTcXw7oHDdsYrc3Ku9TYcxeKC+gZPO4GABZDRPRY323NRfxg0HPsZQQiRJjc D7gtJJhepI/JG2K0on5Vo7om1iRMT2/BX8nYDOSzqPOO25fuTchedrgdkbpkIjdiUJdM qjWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="X0KPTs/J"; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s187si477952qka.284.2021.04.28.12.51.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Apr 2021 12:51:06 -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; dkim=fail header.i=@linaro.org header.s=google header.b="X0KPTs/J"; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbqDB-0005es-Vo for patch@linaro.org; Wed, 28 Apr 2021 15:51:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbpx4-0005wb-HD for qemu-devel@nongnu.org; Wed, 28 Apr 2021 15:34:27 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:52737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbpwv-0004fP-87 for qemu-devel@nongnu.org; Wed, 28 Apr 2021 15:34:26 -0400 Received: by mail-pj1-x1034.google.com with SMTP id lr7so15201704pjb.2 for ; Wed, 28 Apr 2021 12:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cm5TMYYSdbHhrEfgw+Q+FUKj8miS2gdnBD1hAWEVD3E=; b=X0KPTs/JjEjv/hdhe+C0sEdi+C4DTA3noNV8I7esXJEmsML3YRfbWScBmz0QigNdKg KmrbIeXkRJm2k+sVk12FXLfD3dkWbD8dmrx7QqyHuZ6Ieq+3IlWJ9RTSMhvwq5J/ME5s AaYYmaaiLovRhL94HHs4KAy+ntM50TE39qd8jFPsDOg+WwreOSGLYIfsL8T9/RewUkNq v6Ahv2PehCFrCGhTYz8zPYUCUDNJ4uOgWixx7xZuo5D4hQy2JpXj/ZAcngjjajsmjJP/ gqIUM4y3cZ2/N6QPbGDcTgT0kLzE80IJSybdk5RLlyOYnost0oTBEgmj7ybaNpe+xMHH JJJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cm5TMYYSdbHhrEfgw+Q+FUKj8miS2gdnBD1hAWEVD3E=; b=UwHniMyTw5sz3NjDCNG9kPco9pDYd9vH03y0X9BUEYZFJ3S6os9KwpwhCyMwM8RrB2 kCkODzhGsSKM5y1EPWaw7aCZYds0wJo1PXCO49/CPDJhL/Dbap5uH4USKOHpuug14x2l M3wxlMkEf2Kpf445ErnSWJTi+jYPcr/qGmdxBI0w6xVbeZZhmNX3VoNXXhyh1TKPUN7C dZhhfcIJQoJ2dmgfK/6LtuZHKvy+hULH3c3LsSo0BH9OGT1kZraQfn98YkhnxKCl0DN8 RzH1iQIA1OrTd8m2TOL/jb3QqGGrUxM0d+jWJw2cB3PcmqKb5b+4tMMpQXPJu+Ay9/FS u19w== X-Gm-Message-State: AOAM531XOme2EIZiHUKyw9j0BiM3baxxlZjVWwnDLsxSQHgGr34FBPG8 i5+P3IWRTdTLno2HR2Nr7jPGAehltOvZEA== X-Received: by 2002:a17:90b:e95:: with SMTP id fv21mr19337108pjb.107.1619638455801; Wed, 28 Apr 2021 12:34:15 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id h21sm403725pfo.211.2021.04.28.12.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 12:34:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 10/15] linux-user/s390x: Set psw.mask properly for the signal handler Date: Wed, 28 Apr 2021 12:34:03 -0700 Message-Id: <20210428193408.233706-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210428193408.233706-1-richard.henderson@linaro.org> References: <20210428193408.233706-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: thuth@redhat.com, qemu-s390x@nongnu.org, cohuck@redhat.com, laurent@vivier.eu, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Note that PSW_ADDR_{64,32} are called PSW_MASK_{EA,BA} in the kernel source. Signed-off-by: Richard Henderson --- linux-user/s390x/signal.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.25.1 Reviewed-by: David Hildenbrand diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index 64a9eab097..17f617c655 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);