From patchwork Mon Mar 19 15:30:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 26376 Received: (qmail 42156 invoked by alias); 19 Mar 2018 15:33:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 42144 invoked by uid 89); 19 Mar 2018 15:33:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Mar 2018 15:32:59 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2JFUp9T084166 for ; Mon, 19 Mar 2018 11:32:57 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gtern3gye-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 19 Mar 2018 11:32:56 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Mar 2018 15:32:54 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Mar 2018 15:32:53 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2JFWqdH44105958 for ; Mon, 19 Mar 2018 15:32:52 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F10AF4C044 for ; Mon, 19 Mar 2018 15:26:01 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6BB34C058 for ; Mon, 19 Mar 2018 15:26:01 +0000 (GMT) Received: from oc1027705133.ibm.com (unknown [9.152.212.222]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Mon, 19 Mar 2018 15:26:01 +0000 (GMT) From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 2/3] S390: gdbserver: Don't write guarded storage registers Date: Mon, 19 Mar 2018 16:30:47 +0100 In-Reply-To: <1521473488-27210-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1521473488-27210-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031915-0012-0000-0000-000005C0E1E4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031915-0013-0000-0000-0000193CFB15 Message-Id: <1521473488-27210-3-git-send-email-arnez@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-19_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803190176 X-IsSubscribed: yes On S390, the guarded storage register set is only valid if guarded storage is active. Reading/writing the register set yields errors if this is not the case. Then gdbserver emits warnings like these: Warning: ptrace(regsets_store_inferior_registers): No data available Apart from confusing the user, this can also lead to test case failures due to unexpected output. To suppress this, make the guarded storage regsets read-only for now. gdb/gdbserver/ChangeLog: * linux-s390-low.c (s390_fill_gs): Remove function. (s390_fill_gsbc): Remove function. (s390_regsets): Set fill functions for the guarded storage regsets to NULL. --- gdb/gdbserver/linux-s390-low.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c index 203accdaaa..7de70f3a38 100644 --- a/gdb/gdbserver/linux-s390-low.c +++ b/gdb/gdbserver/linux-s390-low.c @@ -374,16 +374,6 @@ s390_store_vxrs_high (struct regcache *regcache, const void *buf) supply_register (regcache, v16 + i, (const char *) buf + 16 * i); } -static void -s390_fill_gs (struct regcache *regcache, void *buf) -{ - int gsd = find_regno (regcache->tdesc, "gsd"); - int i; - - for (i = 0; i < 3; i++) - collect_register (regcache, gsd + i, (char *) buf + 8 * (i + 1)); -} - static void s390_store_gs (struct regcache *regcache, const void *buf) { @@ -394,16 +384,6 @@ s390_store_gs (struct regcache *regcache, const void *buf) supply_register (regcache, gsd + i, (const char *) buf + 8 * (i + 1)); } -static void -s390_fill_gsbc (struct regcache *regcache, void *buf) -{ - int bc_gsd = find_regno (regcache->tdesc, "bc_gsd"); - int i; - - for (i = 0; i < 3; i++) - collect_register (regcache, bc_gsd + i, (char *) buf + 8 * (i + 1)); -} - static void s390_store_gsbc (struct regcache *regcache, const void *buf) { @@ -432,10 +412,11 @@ static struct regset_info s390_regsets[] = { EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low }, { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0, EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high }, - { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_CB, 0, - EXTENDED_REGS, s390_fill_gs, s390_store_gs }, - { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_GS_BC, 0, - EXTENDED_REGS, s390_fill_gsbc, s390_store_gsbc }, + /* Guarded storage registers are read-only. */ + { PTRACE_GETREGSET, -1, NT_S390_GS_CB, 0, EXTENDED_REGS, + NULL, s390_store_gs }, + { PTRACE_GETREGSET, -1, NT_S390_GS_BC, 0, EXTENDED_REGS, + NULL, s390_store_gsbc }, NULL_REGSET };