From patchwork Tue May 18 05:31:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 441157 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1803743jac; Mon, 17 May 2021 23:22:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcVQA81GkSEsKZ5hlfCEwudFJ7keOjOucgXjGo9Frb2bf+1qxzn3vTgGbs0V62Kg/LDwW0 X-Received: by 2002:a25:109:: with SMTP id 9mr5641673ybb.143.1621318921653; Mon, 17 May 2021 23:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621318921; cv=none; d=google.com; s=arc-20160816; b=W1ykUhC/23bvSt2fruFDjSXHS8pzLk3EndF9WTFN5Z+M9HsUIDfC1d7Pe9X+UNUQ5X f/cugXWpAsp2CeaZFKS6KUguN7oZjLzZKh9DkNJzd7dBUxmG/qtM+Yfsf/5hNt7Pq7xW nRMN+9LohpJcU+h3TKWgeRKXehTJ3Jq+GvIHCQ2fEEMCJnvVHb9mFLli3QpvRGSlhGDG lsUKgZ2BkUBTpwbPS5YAa8LxZ9thHW8zDwZYiNZ0+tWKyGmTD6ti4PR/0YmiKu3wMgNI XGBYTkZ0NyNOWozPVEjQqhmtsTPS3lABPdS6orKygixo5UJVq9XRz5oJsjzWv/R7drb8 D1Eg== 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=o+2L/p0vY4L0OYe+s14M14GRCRFMBNVlNabU7QwqzY4=; b=AVEz8R2VFapmRw1wd/X3motZ8rEj7mo85ZDXmJebjpy7N1T5FXmiBQcqPtT5OrGEs2 fBRCV/XV3uNoVAz0VnidOaNc8B4gSEjgMv3etSgtmOL2k49Fgx4uEqvjESDhMjbFyaID oteBl0CVbP1uZS8HDNMmrHwcq6C9UMC15DYKHZaw2uxZ+w27dahhfkj2s7SN9yYEkEYS mLraoKrdj355KF785/nmxkGSLe9PzC+S8cw1fU6M+GX5wgmEqpclC3h9oe11l1eUTrAJ 2aNPdlLMC9XrGuQkJRw/8KWvIDbtpmU1+4LtGNvurfvT62Mz+TiAKK0GCYOgnPYJXyLB u4OA== 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 q9si19608004ybc.150.2021.05.17.23.22.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 23:22:01 -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]:48154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lit7B-0005nh-4E for patch@linaro.org; Tue, 18 May 2021 02:22:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lisL0-0008MT-7X for qemu-devel@nongnu.org; Tue, 18 May 2021 01:32:14 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:50583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lisKy-0007IR-Dd for qemu-devel@nongnu.org; Tue, 18 May 2021 01:32:13 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MSqbe-1luPBW3iWM-00UMGO; Tue, 18 May 2021 07:32:01 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 54/59] linux-user: Honor TARGET_ARCH_HAS_SA_RESTORER in do_syscall Date: Tue, 18 May 2021 07:31:26 +0200 Message-Id: <20210518053131.87212-55-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:nvqSL6gxEHAc+nguF+PfS0UyMO/WP0J0GgvwFFU6/1X814G5vvX vfFSiIMzqnnYxCu1qqu1H/bZhrqg6+aR8XX/9aaHwr6upFrLGIxK5v3i9p+G0bidwQA+RVL TGDOjIBWlLhxZQ8TchkOELpw7J6FUg6+8HzIdkwCxAv6RS0fqvDwkEEUuOtwHMmHST8+MhX eIWwtbeCGfOvhsu/3NKDg== X-UI-Out-Filterresults: notjunk:1; V03:K0:u6PTpLtkKKE=:qMCVVDO0CYR0WP9BLrYYXR Yr3ARthjuKeIvgInu8dFryAL7O674wyvP9J0VnxQGdIRGuC+ffjigtSgtdfLl/5bvw84OelCH Py1at2lIildOdSfZMJBF/8TQufF7Pa0fFbolK1Vowr2OmoYdYXeuPatlVlqu3GK5SgP6D9CmA 6ZrKQiLPeMEvqHaWSuhTBBio+nuwpDOXp/4FfkdARAec0Sv4QOB99L8ckx94utL6TEVQ+O+gz 2EjePoqc2zbCC0Ainw2YclplLwFG+hNhHMCl+fTA2pcqDFh+kYKdbCuAyorgz65wZaVC3tV3p S2ACR+WxZCtZLZWby9R/93erisdrSVESm614I1kfQCs7DmKW6UgG4qMJhXqdk8tZwG/rQGkL1 M1/bcarlVNCQHSetPEpShgxIyV/Hc0Iy5S47dxScOs01sd90Se3d39OwyC7EU9u7Ci9ZIiDOy u8n9xALw6M4ASfQq3yTsyAMQEZss7hFSvvAgNgyzMvI+CECgbDmJFVnOZ85EMFmKXer6U2jD4 22qV5Jpcbw0CLfh70Yq1PM= Received-SPF: none client-ip=212.227.126.135; 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: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Do not access a field that may not be present. This will become an issue when sharing more code in the next patch. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210422230227.314751-5-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.31.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 15b3af257bef..a2e18b06c6d0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9038,7 +9038,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, act._sa_handler = old_act->_sa_handler; target_siginitset(&act.sa_mask, old_act->sa_mask); act.sa_flags = old_act->sa_flags; +#ifdef TARGET_ARCH_HAS_SA_RESTORER act.sa_restorer = old_act->sa_restorer; +#endif unlock_user_struct(old_act, arg2, 0); pact = &act; } else { @@ -9051,7 +9053,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, old_act->_sa_handler = oact._sa_handler; old_act->sa_mask = oact.sa_mask.sig[0]; old_act->sa_flags = oact.sa_flags; +#ifdef TARGET_ARCH_HAS_SA_RESTORER old_act->sa_restorer = oact.sa_restorer; +#endif unlock_user_struct(old_act, arg3, 1); } #endif