From patchwork Mon Nov 2 23:51:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 7538981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CA761BEEA4 for ; Mon, 2 Nov 2015 23:54:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA400205E7 for ; Mon, 2 Nov 2015 23:54:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D57EB2055B for ; Mon, 2 Nov 2015 23:54:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOtw-0004Tv-2F; Mon, 02 Nov 2015 23:52:36 +0000 Received: from mailout1.w2.samsung.com ([211.189.100.11] helo=usmailout1.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtOtr-0004RA-GJ for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2015 23:52:32 +0000 Received: from uscpsbgex3.samsung.com (u124.gpu85.samsung.co.kr [203.254.195.124]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NX700H2EOYW9Q10@mailout1.w2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2015 18:52:08 -0500 (EST) X-AuditID: cbfec37c-f796c6d000006809-6a-5637f728fe51 Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex3.samsung.com (USCPEXMTA) with SMTP id 2B.CE.26633.827F7365; Mon, 2 Nov 2015 18:52:08 -0500 (EST) Received: from sisasmtp.sisa.samsung.com ([105.144.21.116]) by usmmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NX7001A5OYVRY80@usmmp2.samsung.com>; Mon, 02 Nov 2015 18:52:08 -0500 (EST) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.145.28.253) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 2 Nov 2015 15:52:07 -0800 From: Mario Smarduch To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux@arm.linux.org.uk, will.deacon@arm.com, andre.przywara@arm.com, grant.likely@secretlab.ca, robherring2@gmail.com, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms Date: Mon, 02 Nov 2015 15:51:53 -0800 Message-id: <1446508313-24404-1-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.9.1 MIME-version: 1.0 X-Originating-IP: [105.145.28.253] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRmVeSWpSXmKPExsVy+t9hP12N7+ZhBhtaeCxWzPvJaPF+WQ+j xYvX/xgtXp3ZyGYxZ2qhxcdTx9ktNj2+xmpx+zKvxd87/9gsvn/7xmbx8uMJFgdujzXz1jB6 tDT3sHnsnHWX3ePOtT1sHuc3rWH22Lyk3uPnSx2Pz5vkAjiiuGxSUnMyy1KL9O0SuDJmrT7E UjBJuuLBhFOMDYyvRLsYOTgkBEwk/q8W6WLkBDLFJC7cW8/WxcjFISSwjFHi3fRPLBBOE5PE h4kPWCGcC4wSD++/ZwRpYRPQldh/byM7SEJE4BujxO/329hBEswC0RI7LuxkA7GFBcIkZrza xApiswioSizpfckEsppXwE2i+54BxGo5iZPHJoOV8AoISvyYfI8FpIRZQELi+WclkLAQUOe2 m88ZIY5WktixXXsCo8AsJA2zEBoWMDKtYhQrLU4uKE5KT60w1itOzC0uzUvXS87P3cQIiYSa HYz3vtocYhTgYFTi4V2wxDxMiDWxrLgy9xCjBAezkgiv036gEG9KYmVValF+fFFpTmrxIUZp DhYlcV4JSblQIYH0xJLU7NTUgtQimCwTB6dUA6Od/e6qoxrvsi+vD/94bUWBAqvJ2ufiPObX //w/OX1Jj199d8+E2jf9fIbqGi8vSCqemXB/9eZcrcXljC3F15SOxn+xa9mqINY7heGMPu/G 2yVKiw3sjzEnXu2+mnnDq/+GYsvXm6tzqjP+5f5W+Dyn4+njJayThaO7VJLq5+hItEld/9Z8 N0GJpTgj0VCLuag4EQBJmozXgAIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151102_155231_643973_B37187A1 X-CRM114-Status: GOOD ( 12.69 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, kvm@vger.kernel.org, Mario Smarduch Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, this is a re-post from couple weeks ago, please take time to review this simple patch which simplifies DEBUG_LL and prevents kernel crash on virtual platforms. Before this patch DEBUG_LL for 'dummy virtual machine': ( ) Kernel low-level debugging via EmbeddedICE DCC channel ( ) Kernel low-level debug output via semihosting I/O ( ) Kernel low-level debugging via 8250 UART ( ) Kernel low-level debugging via ARM Ltd PL01x Primecell In summary if debug uart is not emulated kernel crashes. And once you pass that hurdle, uart physical/virtual addresses are unknown. DEBUG_LL comes in handy on many occasions and should be somewhat intuitive to use like it is for physical platforms. For virtual platforms user may start daubting the host and get into a bigger mess. After this patch is applied user gets: (X) Kernel low-level debugging on QEMU Virtual Platform ( ) Kernel low-level debugging on Kvmtool Virtual Platform ..... above repeated .... The virtual addresses selected follow arm reference models, high in vmalloc section with high mem enabled and guest running with >= 1GB of memory. The offset is leftover from arm reference models. The patch is against 4.2.0-rc2 commit 43297dda0a51 Original Description -------------------- When booting a VM using QEMU or Kvmtool there are no clear ways to enable low level debugging for these virtual platforms. some menu port choices are not supported by the virtual platforms at all. And there is no help on the location of physical and virtual addresses for the ports. This may lead to wrong debug port and a frozen VM with a blank screen. This patch adds menu selections for QEMU and Kvmtool virtual platforms for low level kernel print debugging. Help section displays port physical and virutal addresses. ARM reference models use the MIDR register to run-time select UART port address (for ARCH_VEXPRESS) based on A9 or A15 part numbers. Looked for a same approach but couldn't find a way to differentiate between virtual platforms, something like a platform register. Acked-by: Christoffer Dall Signed-off-by: Mario Smarduch --- arch/arm/Kconfig.debug | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index a2e16f9..d126bd4 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1155,6 +1155,28 @@ choice This option selects UART0 on VIA/Wondermedia System-on-a-chip devices, including VT8500, WM8505, WM8650 and WM8850. + config DEBUG_VIRT_UART_QEMU + bool "Kernel low-level debugging on QEMU Virtual Platform" + depends on ARCH_VIRT + select DEBUG_UART_PL01X + help + Say Y here if you want the debug print routines to direct + their output to PL011 UART port on QEMU Virtual Platform. + Appropriate address values are: + PHYS VIRT + 0x9000000 0xf8090000 + + config DEBUG_VIRT_UART_KVMTOOL + bool "Kernel low-level debugging on Kvmtool Virtual Platform" + depends on ARCH_VIRT + select DEBUG_UART_8250 + help + Say Y here if you want the debug print routines to direct + their output to 8250 UART port on Kvmtool Virtual + Platform. Appropriate address values are: + PHYS VIRT + 0x3f8 0xf80903f8 + config DEBUG_ICEDCC bool "Kernel low-level debugging via EmbeddedICE DCC channel" help