From patchwork Thu Dec 3 17:15:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matheus Castanho X-Patchwork-Id: 41288 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F08D3384B806; Thu, 3 Dec 2020 17:15:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F08D3384B806 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607015735; bh=RvjLavX3leKVa1XnW2/aHi39NBUV4TQFiW2exaLBR+A=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ORdpRNgv+A6AROOLDXsM14KmY6xPoHr6F6/c6geU9Zw0rfo47/aPw8/1kWlfQT2xj BsIb6gU5+i1MNzJbVgvoLJgegVeo80K9kicy7VskK/EloHuI1wVSZqgq6/2NacIlyx BmghdI6NURnI1By3VwmwZqx0O2D1now3vRJ1/SEo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 936BB3857C6C for ; Thu, 3 Dec 2020 17:15:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 936BB3857C6C Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B3HB0aT025133 for ; Thu, 3 Dec 2020 12:15:32 -0500 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 35728pmb5b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 Dec 2020 12:15:32 -0500 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B3HBGPT018023 for ; Thu, 3 Dec 2020 17:15:31 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma01wdc.us.ibm.com with ESMTP id 355vrg2t3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 Dec 2020 17:15:31 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B3HFVqq9110150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 3 Dec 2020 17:15:31 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACA71AC064 for ; Thu, 3 Dec 2020 17:15:30 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39330AC05B for ; Thu, 3 Dec 2020 17:15:30 +0000 (GMT) Received: from localhost (unknown [9.160.113.167]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 3 Dec 2020 17:15:29 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v2 0/2] powerpc: Add support for system call vectored Date: Thu, 3 Dec 2020 14:15:26 -0300 Message-Id: <20201203171528.83180-1-msc@linux.ibm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-12-03_09:2020-12-03, 2020-12-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 impostorscore=0 adultscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012030100 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matheus Castanho via Libc-alpha From: Matheus Castanho Reply-To: Matheus Castanho Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This patchset enables the usage of system call vectored (scv) instruction by system calls for improved performance on POWER9 and later processors. This new version dropped the patch to move brk to a C-based implementation, in favor of Adhemerval's patch [0]. So it should be applied on top of that. Also, it modified the scv check mechanism to remove the thread pointer check as suggested by Florian. Now the dynamic loader always uses sc, static code still checks the thread pointer before accessing the TCB, and shared code (outside the dl) accesses the TCB directly. Please check each patch for more details, specially 1/2 which explains the rationale and details of the runtime mechanism to choose between the old behavior (sc) and the new one (scv 0). Tested on powerpc, powerpc64, and powerpc64le (with and without scv) [0] https://sourceware.org/pipermail/libc-alpha/2020-November/119770.html Tested-by: Lucas A. M. Magalhães --- v2: - Fix typos and comments to match GNU style - Remove the check for the thread pointer on shared code, and always use sc when inside the dynamic loader - Drop the patch implementing brk in C Matheus Castanho (2): powerpc: Runtime selection between sc and scv for syscalls powerpc: Use scv instruction on clone when available sysdeps/powerpc/powerpc32/sysdep.h | 15 ++- sysdeps/powerpc/powerpc64/sysdep.h | 120 +++++++++++++++++- .../unix/sysv/linux/powerpc/powerpc64/clone.S | 36 +++++- .../unix/sysv/linux/powerpc/powerpc64/vfork.S | 6 +- sysdeps/unix/sysv/linux/powerpc/syscall.S | 11 +- sysdeps/unix/sysv/linux/powerpc/sysdep.h | 93 ++++++++++---- 6 files changed, 241 insertions(+), 40 deletions(-) -- 2.26.2