Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4597187imu; Tue, 29 Jan 2019 04:25:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN7paYa99XprshJvZgivUbdDl5UP1gY556V7HKCybYJCYTm4MLLz8NqEOOU4TBZ6KsS7Gq8C X-Received: by 2002:a17:902:20c6:: with SMTP id v6mr26058773plg.156.1548764752136; Tue, 29 Jan 2019 04:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548764752; cv=none; d=google.com; s=arc-20160816; b=cD4PZmI0lR7q+b9U0knP04UXqmOOfwKR8KlB+NMqVGA9wgM4GXknTfjYLHfs82h11K 28/VOKKOs1y+zK99stXF/eHWcR+XEP2TXkgDbTuF9MZk5KZz1PEQTxgQxrrzoF4j5n8G Cmchf/LhZMYZrN2wv/L8cvdQE4Wi0L3aS2mGbA+V8muuEPPZuSdL8r+6YrfHEHVyJJzI vFYztAwvDoEjpxYJZ+MwonS41LH6APhGmcnacYc44rrmwTQncNQSqpWIcnBrUAZ/7RWH biJmjz+7ZYlTWNGPRCSDDuG1Z4wq8B46ctHxUudr4wnFK2QdvHIAU+NkZD1gqo8TxG+i 0GBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=bq9q9MAS2ftUE5+VyKBqWIT2suFYl6/3N2EiCZ9ezXQ=; b=PTJTQ0hNeyxwJEuCs7+somYPHzoS4NXy5L5qBSnoplQMbl4lu5R2AXNnC48/K6eNRo GAnTWHM+ERE7D0FoGklFcd5oiw8yoENcRjH83hJBey8lfV1TnZCKn27cDVbxDyI6hqnO kjwGJ64ngQL6pdb41ZiGNhunk0nwtUk8ZGIlEje4T6QX7hMU9BMMaTwjuwANR4wTqE+O yDLb4Pn5OqmElOOWQJi1SyCvxCZ1mbxVC9DSfjJzSeA/6ajyv8tWo7eFLD4asXdDWg9c BFqyi15p9ceaGzAIny7SBvz0ZfYYnJLmYABezOTMV6B3TnGjyH3NRJrEzU73GbZdKHQF mEQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qPKG3HcZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si34106389pgk.581.2019.01.29.04.25.36; Tue, 29 Jan 2019 04:25:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=qPKG3HcZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728917AbfA2MZK (ORCPT + 99 others); Tue, 29 Jan 2019 07:25:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:35992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728890AbfA2MZJ (ORCPT ); Tue, 29 Jan 2019 07:25:09 -0500 Received: from localhost.localdomain (unknown [60.186.218.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 633C920870; Tue, 29 Jan 2019 12:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548764709; bh=W5NutnjzmOYCmG0/Pxg45GvbwmpPla6pBxKPgExQ/kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qPKG3HcZ7vIY/Tsv28zWlVpTR3PNWnSO3ZrtzFuQCy2W1uDM66M2evO0OaBSYpaLf exqBpNUPR1o5Tgnb889wV1YFkvPv1uiDhOwfuZrV6ItQhCrtuFxzpXqBqY6GMDFTML LOvYM/ZnRYmMFhx38myZwpnwXHQqKyHSkKZWiol0= From: guoren@kernel.org To: arnd@arndb.de, robh+dt@kernel.org, marc.zyngier@arm.com Cc: linux-kernel@vger.kernel.org, guoren@kernel.org, linux-arch@vger.kernel.org, Guo Ren Subject: [PATCH 07/10] csky: Fixup wrong pt_regs size Date: Tue, 29 Jan 2019 20:24:26 +0800 Message-Id: <1548764669-16656-7-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548764669-16656-1-git-send-email-guoren@kernel.org> References: <1548764669-16656-1-git-send-email-guoren@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren The bug is from commit 2054f4af1957 ("csky: bugfix gdb coredump error.") We change the ELF_NGREG to ELF_NGREG - 2 to fit gdb&gcc define, but forgot modify ptrace regset. Now coredump use ELF_NRGEG to parse GPRs and ptrace use pt_regs_regset, so there are two different reg_sets for userspace. Signed-off-by: Guo Ren --- arch/csky/kernel/ptrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/csky/kernel/ptrace.c b/arch/csky/kernel/ptrace.c index 57f1afe..f2f12ff 100644 --- a/arch/csky/kernel/ptrace.c +++ b/arch/csky/kernel/ptrace.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -159,7 +160,7 @@ static int fpr_set(struct task_struct *target, static const struct user_regset csky_regsets[] = { [REGSET_GPR] = { .core_note_type = NT_PRSTATUS, - .n = ELF_NGREG, + .n = sizeof(struct pt_regs) / sizeof(u32), .size = sizeof(u32), .align = sizeof(u32), .get = &gpr_get, -- 2.7.4