Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2496603imm; Mon, 28 May 2018 09:10:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpQ0IqVs8G4zJmZ1LptfFwTPFJBOlbHSzHGVfwTf8EaRn1wYBJ2qMxupGzCHS8Elf598LhD X-Received: by 2002:a63:7f5c:: with SMTP id p28-v6mr10958232pgn.64.1527523856507; Mon, 28 May 2018 09:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523856; cv=none; d=google.com; s=arc-20160816; b=elkvE+zoZN6CICMCcb/b7+a/RkOclbUIhZT/iqmNUAo1BkHay3E+z6sF85ItN1jW/c fJHRnq6/654BiGNOn+hInWrjFpPBtdcOnPkUlJBbDGbv2r1Ub+3+HFL7EhTRUnaQOJbU A/K7KuAG7+ZjWTv8A8iFCE2dPGvgCi7gTD64HfgNG5jrEw/IoStYytLmg2nCkGC9qBlK Ir2S7yGQzO56TShdrayV40ij/NIN3Z2l9jLbi3aHejVI2ukW+y8lFlb/oT77sHut5UXT usK16skdJSaAs+teBmEUSwQQbdvBMQkRamAP6rmRrTp5O5NSF3fqJddLQ8e0xQHe0rb3 9qnA== 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=M4SxjWgWT/lxfzhVYVnRJnw4jD45aIH9oxeVbNyI0Sw=; b=gBDgOtBQtHa7YreWks/oXh028PKtDNWEesG1e7ftD8KkMMNwHl8Fjs7GNRvNI8KPWx q6vQ5e030vi81WJm/JhDKxTL9yh1gERk5gVNRHVseuk9P/id/6yZHD9Z246ng9fHozKS YDWrERjvtWqbF7VKVMQrAYi8fjuG31JKBfZlJtP8S4OD3ZSs9GCUJdNPuLRs7Xb6yV6O Btez+kpd+0boWYZmYQeW8TdZxiQjitjeogZn5YCk6F3RPf97KU0lNbSBz1MbAA5oAyNK SI1SGErLelvtQ9RzDBh5ZJQ+gOWANvUew3xgvyzNS0vQpkwxQexgAG4fShs785SE9i7q MZzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TQ2qU9iB; 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 w10-v6si3883385pgt.404.2018.05.28.09.10.41; Mon, 28 May 2018 09:10:56 -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=TQ2qU9iB; 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 S965453AbeE1KN7 (ORCPT + 99 others); Mon, 28 May 2018 06:13:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:33794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965423AbeE1KNz (ORCPT ); Mon, 28 May 2018 06:13:55 -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 128ED20843; Mon, 28 May 2018 10:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502434; bh=03cNqeUC7LydJ70pUx/ujHSGJQNjAT+RDO0G0s/KEBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQ2qU9iBAHx6jyb2T3960m5BzE734p88eu6w30bc58LG35sb7TTz/Y0Rk1mixH6vr 0z58YJcBkONDR488cmS3WTDaKT1SZQp5HpyEMEfGbAy7txsZYXOw6HIrAIf1VkD5hZ hDK5HnZevIWdO//QUIsFVfMNvtNwpFx2R/ihCfOs= 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 3.18 185/185] kdb: make "mdr" command repeat Date: Mon, 28 May 2018 12:03:46 +0200 Message-Id: <20180528100117.109880413@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -1524,6 +1524,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); @@ -1533,9 +1534,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) { @@ -1571,7 +1573,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) { @@ -1588,7 +1593,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) { @@ -1598,8 +1606,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: