Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2275959imm; Mon, 28 May 2018 05:13:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1+9XCn3NOVBKALosc9YnOQS9Dj2FlL2zvYVLyVUeEOPiGpnnJHgsEBX1bmobMn6nRkkoc X-Received: by 2002:a65:648a:: with SMTP id e10-v6mr10495082pgv.34.1527509627484; Mon, 28 May 2018 05:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527509627; cv=none; d=google.com; s=arc-20160816; b=UhiuvxaSxj988Pk7p4LPWFOQAIdmBqyPvs5eIJM5bS9AlxU0tEfzo+84Qfo6f8fZN9 E2Lb4DeL0BqYdSL5ZJx7RSI7qHgSECTAgpoRlsnOUsb6e33x5SM6vkBvmOsG5DV/hLbR OugPNZduMbp/6IMzHCM280GrKKm8Fg3/vvjcDqmTOoKgCiWdYkUgQLeUJ8gtRTlKWDDK /eniB8yAfS3H7xoaij7vgNpMyHPRyH6BdlpKU8meSQQg86Uvfw+Buf5wqnJtF2dTQR0R 24IJaKZU9wB+hozhIhcoo4qzASyx/zVhmRVSBrkfGvDJzQb69cBfywCzD9LeVdVRV534 negg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=uthTbPtQtif4d/hCnFGnlVJpveBBdy7WFdnZsTuCINw=; b=RtE+rpQIHBaVe1DuztrAPUu976keAguko/HAMak08S5Gyl5K1hH4zp7hqA9YGMHQ5T 0efERmo64TYyDxuXmgA7t3j0cYjy3Be/0yp3aXckXQsZ2I394y7FcrxNBI4P7fLA1VSn yY/mWTc2c2dQnLGz5mqqbM/dNxjPkhE9GfU/P6odgx6M7mRmdr7Tmpvfw7O/395XhwiJ Ytr06gAUJfAq0M3Ha9HN0ASlQ26meyAbBum5u2JHYBWs9tOU2fn3hf/LV9lDRi8HU5pe xy15Bw3q98Sk05Fg19pu1GJmAtIGWcXbFFuAVip8B8KqazLkzNGQEdURLOUG8Bv1unRg rjVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=byjYvXDR; 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 64-v6si14110906plk.33.2018.05.28.05.13.32; Mon, 28 May 2018 05:13:47 -0700 (PDT) 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=byjYvXDR; 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 S1423020AbeE1LER (ORCPT + 99 others); Mon, 28 May 2018 07:04:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164721AbeE1LEL (ORCPT ); Mon, 28 May 2018 07:04:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32DA72088E; Mon, 28 May 2018 11:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505450; bh=JtntKTJ/8hWDM/8Oyzz53Fjsuj+Tm1uceF8TiXg3w7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=byjYvXDRdrmpUIVnf9RDmJ2T3vtkAN9TJv+eIR7iUwYd22pR9n+lLWtsELW6VWybQ saZ+7XFXD5k56ElWROHVEcH8gcwxb7YgiYdSH0Kck7+pYRMnvZNxmbsC6zwG4jFbao BYguUH4Vd7WG3BhNI0ywQ5R6OcH8bW8wovu1xo/k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Daniel Thompson , Jason Wessel , kgdb-bugreport@lists.sourceforge.net, Sasha Levin Subject: [PATCH 4.14 495/496] kdb: make "mdr" command repeat Date: Mon, 28 May 2018 12:04:40 +0200 Message-Id: <20180528100340.741286876@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Randy Dunlap [ Upstream commit 1e0ce03bf142454f38a5fc050bf4fd698d2d36d8 ] The "mdr" command should repeat (continue) when only Enter/Return is pressed, so make it do so. Signed-off-by: Randy Dunlap Cc: Daniel Thompson Cc: Jason Wessel Cc: kgdb-bugreport@lists.sourceforge.net Signed-off-by: Jason Wessel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/debug/kdb/kdb_main.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -1566,6 +1566,7 @@ static int kdb_md(int argc, const char * int symbolic = 0; int valid = 0; int phys = 0; + int raw = 0; kdbgetintenv("MDCOUNT", &mdcount); kdbgetintenv("RADIX", &radix); @@ -1575,9 +1576,10 @@ static int kdb_md(int argc, const char * repeat = mdcount * 16 / bytesperword; if (strcmp(argv[0], "mdr") == 0) { - if (argc != 2) + if (argc == 2 || (argc == 0 && last_addr != 0)) + valid = raw = 1; + else return KDB_ARGCOUNT; - valid = 1; } else if (isdigit(argv[0][2])) { bytesperword = (int)(argv[0][2] - '0'); if (bytesperword == 0) { @@ -1613,7 +1615,10 @@ static int kdb_md(int argc, const char * radix = last_radix; bytesperword = last_bytesperword; repeat = last_repeat; - mdcount = ((repeat * bytesperword) + 15) / 16; + if (raw) + mdcount = repeat; + else + mdcount = ((repeat * bytesperword) + 15) / 16; } if (argc) { @@ -1630,7 +1635,10 @@ static int kdb_md(int argc, const char * diag = kdbgetularg(argv[nextarg], &val); if (!diag) { mdcount = (int) val; - repeat = mdcount * 16 / bytesperword; + if (raw) + repeat = mdcount; + else + repeat = mdcount * 16 / bytesperword; } } if (argc >= nextarg+1) { @@ -1640,8 +1648,15 @@ static int kdb_md(int argc, const char * } } - if (strcmp(argv[0], "mdr") == 0) - return kdb_mdr(addr, mdcount); + if (strcmp(argv[0], "mdr") == 0) { + int ret; + last_addr = addr; + ret = kdb_mdr(addr, mdcount); + last_addr += mdcount; + last_repeat = mdcount; + last_bytesperword = bytesperword; // to make REPEAT happy + return ret; + } switch (radix) { case 10: