Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1435276imu; Wed, 16 Jan 2019 19:55:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN61eV1cfMbY/chXmRkuBiKZELqEbOjhFkU7dYgTa9H4GMChwis0S/ZrB36/WOFIWjsFgyrG X-Received: by 2002:a17:902:5982:: with SMTP id p2mr13236981pli.39.1547697302983; Wed, 16 Jan 2019 19:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547697302; cv=none; d=google.com; s=arc-20160816; b=f8R6c9P2fMXe8r1IqxRIX0iZxZrUr+Dg64vcjdMCgclGzH8iHNOVoY+e5a5F2DDrZx ttjuVx5B6oEN15FhwSJt6dpt2u2a29hly5azBgOQyS7kaEeLVwQ8927sZJYRVulg6zv0 saCAbnBX77MDXLO/GuIVSk0PatzJQrFtXAflPLNKp6rzP42bZDLduAMiI+N9p08MGDoX +IXLTatdRGtKDL/8FbWbC9mMbTq3tRb/KJD8kpHgiQZeCfHaxKAYDTeSqsgz1xsuRyA0 WH2F4KsC/5404hDck9Sa4BNjiILeqrtoqAHNjwK3TyQRwRyMcXgV9oOY24oro21jVNbD pJSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GV4RzWuffBlbpZLmm18twaiIfznOfT9bjCeGSkg+Wqw=; b=HQmRix+9JM5IcYkwHgJGZgaol68iZ7V72NyX71GMEfhEm2/R0uZ+Si5USZQeyqTgxa /inDKqVX126oRs3/+1A4Q9d7MAMrLebpYQT8k4a0WRjyA3sF5UrNqT9HzE7ArOcMyssa vk2F/S62Gp1HtNdy7/h5/q6CcsWTpx5bUQCZcjXA3f9355kFox/x7tgEGOPqNiYVQEM5 rSx4fkmUUofBvk80bEIMi1ZeeXI/RCQvYYlfOBJp+3xGk/cQijmobTAJRUwhnl+CcpLY zLOunLgU5YwQSoVWkDJdnOyG53bedPV9Em338CdSiM0qPYHHJkeHl2stF6ZZWcNY/CAb TjnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r81si518066pfr.164.2019.01.16.19.54.44; Wed, 16 Jan 2019 19:55:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393044AbfAPNQM (ORCPT + 99 others); Wed, 16 Jan 2019 08:16:12 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:56935 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732810AbfAPNQM (ORCPT ); Wed, 16 Jan 2019 08:16:12 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1M9Wqa-1geGri1uc8-005auf; Wed, 16 Jan 2019 14:16:06 +0100 From: Arnd Bergmann To: linux-s390@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, y2038@lists.linaro.org, Dominik Brodowski , Mark Rutland Subject: [PATCH 1/5] s390: open-code s390_personality syscall Date: Wed, 16 Jan 2019 14:15:19 +0100 Message-Id: <20190116131527.2071570-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190116131527.2071570-1-arnd@arndb.de> References: <20190116131527.2071570-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:MP74aNqzY/DIAvcLP1cb/Ch7YTV23eOR8QUFO5fetFd8kirIaOc OTgmwLsmuisTqVz6xPRi8FZN/+mTcmFRlKG7k6gYGMYPpEM2gh01gkr04Ig4rXav0Wjvyvm DOXs9qhDW32vP2S/J2e622fSIDnr7WnOUGkQI1xYg/uTQ7FipXsr+aae4PPSmO5j0eK3yAv 1uo1qtaNwnXbXnSkDruhA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:roQhEKrpGuM=:1w/GKHBSOzwFSBPIJvy5w8 faeWCxzQBncBCm0wuA6cCfUjq4arHSE0iWTOgz1QnIoiV1QPPPoG12cpMTNfawdjs/WuU05k5 a+tCNfYC6cz+N3JrljYKXoWIxqLIEuHRfv8598jGeHsHlLAn6nn8Aqb4IcUx2csXWXy5MvKYY GNo6u+OD6qA+AVQ74mC90ocbwGGDhf/30zANtB6S3S8xYY3xYgriLAORNdogcgiaZlVQd2IxH AVm/79q/6lridx4cIl8twOlqe0XOw31/Q6Tt/3EvY/sgeC9nrx5AjwMTzp0YgBpliBzAxhNKC QbwCG2KkWK67boPAYe/8fBViwEagbh3hGu2PlPUdUQlB0bzziVV2MUW813nHbhXczZqtABQA9 7OGY2QzJFrRi0KP1U8qPz4HspdNLyenYUbCjIMs+pTNpZTUfN6h0bA6gj9r21m9/v65Ibw3Vu RUPH7wuaBznK0dgCxp+Iasf3MbsC1HvodhSITbNElgDiW95dGsoWlBUCoQ0Yy2JaWyTGzJDTq IkE11qMsAyeY+80fiXXSiYJmh5XVp9Jg+pejKkQgFHwA1sRINurGPW2BmdjI+O+/yZdJCINKs nE2kdA32q9//JEHTF7UV/KgGzlBfWRmF/8g6h8nEQ6JY/xvcC+qxWbZyZTZ7KzsAhUthuYbdg 94uHPqaE1bxor1w1jLdyi8kWGcMVM9Pb74HB5SavqHWHpAax26ZaCqucmaT0TAGn8C90zSEBn iOGJX1JEiXDRz52BWxkvYjrs6jSJdNjLmG8eng== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The sys_personality function is not meant to be called from other system calls. We could introduce an intermediate ksys_personality function, but it does almost nothing, so this just moves the implementation into the caller. Signed-off-by: Arnd Bergmann --- arch/s390/kernel/sys_s390.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index 31cefe0c28c0..560bdaf8a74f 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c @@ -79,12 +79,15 @@ SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second, SYSCALL_DEFINE1(s390_personality, unsigned int, personality) { - unsigned int ret; + unsigned int ret = current->personality; if (personality(current->personality) == PER_LINUX32 && personality(personality) == PER_LINUX) personality |= PER_LINUX32; - ret = sys_personality(personality); + + if (personality != 0xffffffff) + set_personality(personality); + if (personality(ret) == PER_LINUX32) ret &= ~PER_LINUX32; -- 2.20.0