From patchwork Thu Jul 13 16:03:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 9839257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63CA6602A0 for ; Thu, 13 Jul 2017 16:12:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53E8E2871D for ; Thu, 13 Jul 2017 16:12:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4727D2872C; Thu, 13 Jul 2017 16:12:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B29D82871D for ; Thu, 13 Jul 2017 16:12:31 +0000 (UTC) Received: from localhost ([::1]:60985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVgj8-00036O-C3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Jul 2017 12:12:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVgaL-0004US-Pz for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVgaI-0005Wk-Nu for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:03:25 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37490 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVgaI-0005WV-If for qemu-devel@nongnu.org; Thu, 13 Jul 2017 12:03:22 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6DG35fi092712 for ; Thu, 13 Jul 2017 12:03:21 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bp61g00qb-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 13 Jul 2017 12:03:18 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Jul 2017 17:03:15 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 13 Jul 2017 17:03:12 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6DG3CKT13959472; Thu, 13 Jul 2017 16:03:12 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D85E5A4053; Thu, 13 Jul 2017 17:00:29 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C64A5A404D; Thu, 13 Jul 2017 17:00:29 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 13 Jul 2017 17:00:29 +0100 (BST) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id B594620F69C; Thu, 13 Jul 2017 18:03:11 +0200 (CEST) From: Christian Borntraeger To: qemu-devel Date: Thu, 13 Jul 2017 18:03:08 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499961789-127874-1-git-send-email-borntraeger@de.ibm.com> References: <1499961789-127874-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17071316-0040-0000-0000-000003E3EC16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071316-0041-0000-0000-0000207F2F04 Message-Id: <1499961789-127874-7-git-send-email-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-13_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707130251 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 6/7] s390x/arch_dump: also dump guarded storage control block X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Cornelia Huck , Alexander Graf , "Jason J . Herne" , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Write the new note section of type 30b (guarded storage control block). Signed-off-by: Christian Borntraeger Acked-by: Cornelia Huck --- include/elf.h | 1 + target/s390x/arch_dump.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/elf.h b/include/elf.h index 0dbd3e9..cd51434 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1476,6 +1476,7 @@ typedef struct elf64_shdr { #define NT_TASKSTRUCT 4 #define NT_AUXV 6 #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ +#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */ #define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31 */ #define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 (lower half) */ #define NT_S390_PREFIX 0x305 /* s390 prefix register */ diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index 105ae9a..96c9fb9 100644 --- a/target/s390x/arch_dump.c +++ b/target/s390x/arch_dump.c @@ -57,6 +57,12 @@ struct S390xElfVregsHiStruct { typedef struct S390xElfVregsHiStruct S390xElfVregsHi; +struct S390xElfGSCBStruct { + uint64_t gsregs[4]; +} QEMU_PACKED; + +typedef struct S390xElfGSCBStruct S390xElfGSCB; + typedef struct noteStruct { Elf64_Nhdr hdr; char name[8]; @@ -65,6 +71,7 @@ typedef struct noteStruct { S390xElfFpregset fpregset; S390xElfVregsLo vregslo; S390xElfVregsHi vregshi; + S390xElfGSCB gscb; uint32_t prefix; uint64_t timer; uint64_t todcmp; @@ -126,6 +133,16 @@ static void s390x_write_elf64_vregshi(Note *note, S390CPU *cpu, int id) } } +static void s390x_write_elf64_gscb(Note *note, S390CPU *cpu, int id) +{ + int i; + + note->hdr.n_type = cpu_to_be32(NT_S390_GS_CB); + for (i = 0; i < 4; i++) { + note->contents.gscb.gsregs[i] = cpu_to_be64(cpu->env.gscb[i]); + } +} + static void s390x_write_elf64_timer(Note *note, S390CPU *cpu, int id) { note->hdr.n_type = cpu_to_be32(NT_S390_TIMER); @@ -181,6 +198,7 @@ static const NoteFuncDesc note_linux[] = { {sizeof(((Note *)0)->contents.todpreg), s390x_write_elf64_todpreg}, {sizeof(((Note *)0)->contents.vregslo), s390x_write_elf64_vregslo}, {sizeof(((Note *)0)->contents.vregshi), s390x_write_elf64_vregshi}, + {sizeof(((Note *)0)->contents.gscb), s390x_write_elf64_gscb}, { 0, NULL} };