Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp873649rdh; Thu, 23 Nov 2023 23:12:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8yrvnO4xSXutEb5P5kd9qyc4s1lHaOvQ6PrQMNa8rZ+b/P1VBeEwThJ2+VI9ybpgNSlbi X-Received: by 2002:a05:6830:6b42:b0:6d6:4805:45aa with SMTP id dc2-20020a0568306b4200b006d6480545aamr2071292otb.8.1700809965827; Thu, 23 Nov 2023 23:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700809965; cv=none; d=google.com; s=arc-20160816; b=F1u6bskFQunOqY4Rwif1px+hV+B3xk+d80o+Y1/u148sblTSaBcjCAXGf4ysF88SA3 S11s/yrqE4kFODBVs5c5f5MvxV4RMJTQhVbHJ/aQ7KT8DgYyULsMKN4kanSZ9rVkayOg iJSUaBdlKWFnAX0qU5t7k6+T/wZJsw+DCV9voKKhjjSYQB3hIxh+fguRhlCqvYSsN2Xe ujI3FfGvZmxXKR5ySVauZ/xEeIThUnT7j+qTZle5d2n58lRv2gRSweN4u0qKN3LzeoUa wpEzF2rDVQ0vJhdZbVY8/9dzXx5rzwfTxA+Rert3VRGFpdcQ4M5YROCJOdkYfY6WwkQr QobQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; fh=sCaLDPmI3z3WfJgoG5Ri8nSrNxiyuF4F9Uj24RFqprM=; b=li1dosD39fGQQOaSgn4M52UM84u7coTySdrjNm7e5DiojG8oQ32x9QCnceNn/qTyDt QuDrl1Kx88HRR+KxUfPGVBoPBxkh8jddoD3XO7dGfFfKoTmmUZSCz9dFzAYnFqnqto22 KalM6LEX2QoHp/hophocZbmfZF9ynPiwDYbSFvFDcF1B1KYsj+RO21ByEvQA929fTyyh S71P2c7NJyinlZ+hiJipW+bjH4N6XoY0iapietu+S7h5N+vZbt+PkfNkeFCoT+3NDRSZ CEXJsXa/fomoVarWYfF/taW1CrEsyMycamKmHAb5IX0+a6BTUbe2Ro7vcy1Y1KuEelzR ioEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AYsLJoeK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t21-20020a6564d5000000b005aee0914b6csi2931520pgv.8.2023.11.23.23.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:12:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AYsLJoeK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CC04E80944C7; Thu, 23 Nov 2023 23:10:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbjKXHKV (ORCPT + 99 others); Fri, 24 Nov 2023 02:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjKXHKT (ORCPT ); Fri, 24 Nov 2023 02:10:19 -0500 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4F7D4A for ; Thu, 23 Nov 2023 23:10:25 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6d7f3fc69f4so877494a34.1 for ; Thu, 23 Nov 2023 23:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809824; x=1701414624; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=AYsLJoeKp/VeCaPKIAsqEeGRNi1EXuiCRdE4pVMDxJ6B/TXmQou42eJ+FTRMhNpdnd sFuKbaeEReP4bKRRo6CyvkVoKprhlpDx2zx70YKSZLMqK/pM8YdLoYy7vVPx55si3cwd +BHk+GRqfjWiA/CiWu5xVNTwzv4UofcWvYHv4DLGksU9dgA8m6ZA86W3C2kBPstgYvGq C3HDN5hJhfWEydJcE+A4lEzpyxI8bEjX2zZFta1QC9sLiRa+tfnCdcUmlV9gkqgAPn4V 36L5/VNZt4XjaErD9yP/duGhGFEOksXfIfMZHsHB0ZL+/5LP0yX+iUAuDGXBm8KY1qrI 9eNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809824; x=1701414624; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=UTMOyL/uHt28i+Ie07qBV8QHSksYJa3/nl2clyLMk5J+503sgT/krGjn0i7kmNLPzT rIO8/0kQGvw8sfcFXDemzzkYAvi3QmECqdTx5UuSt2M+duek27TxuoZg1c1QTiQrJ+sO 0AscC+LZeYt1cwojVk7TblFQhaYxhWAcVnkog3K+dppT2Rssc67bIMH6hre8Yu8edg07 NIn7+D6gWRmVBtEicCPCTvGGU6hmFzyjYNr7BKVD2x6XCVU3ptHYbzAy5IOkP9Ze+DYH kA2Kks76RSjgyQR/uH8pT+8hZfT1Q3bjgvdhHc6VZLxQdVXU6g7MEE3DRbOiT5lU+IOz iO0g== X-Gm-Message-State: AOJu0Yz51AnRGI+npCrVr+TPF+/DHGOfFbooW/aGj9jnfg14VCpquPUC BETy9VCL9bRBj6E+QvDiNe2rhw== X-Received: by 2002:a05:6830:603:b0:6d7:f66d:b0ae with SMTP id w3-20020a056830060300b006d7f66db0aemr1910766oti.5.1700809824530; Thu, 23 Nov 2023 23:10:24 -0800 (PST) Received: from localhost.localdomain ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b006c61c098d38sm435532otk.21.2023.11.23.23.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:24 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v5 0/5] RISC-V SBI debug console extension support Date: Fri, 24 Nov 2023 12:39:00 +0530 Message-Id: <20231124070905.1043092-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 23:10:38 -0800 (PST) The SBI v2.0 specification is now frozen. The SBI v2.0 specification defines SBI debug console (DBCN) extension which replaces the legacy SBI v0.1 functions sbi_console_putchar() and sbi_console_getchar(). (Refer v2.0-rc5 at https://github.com/riscv-non-isa/riscv-sbi-doc/releases) This series adds support for SBI debug console (DBCN) extension in Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from the riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v5 branch at: https://github.com/avpatel/linux.git Changes since v4: - Rebased on Linux-6.7-rc2 - Addressed Drew's comments in PATCH2 - Improved sbi_debug_console_write/read() to directly take virtual address of data so that virtual address to physical address conversion can be shared between tty/serial/earlycon-riscv-sbi.c and tty/hvc/hvc_riscv_sbi.c - Addressed Samuel's comments in PATCH3 and PATCH4 Changes since v3: - Rebased on Linux-6.7-rc1 - Dropped PATCH1 to PATCH5 of v3 series since these were merged through KVM RISC-V tree for Linux-6.7 - Used proper error code in PATCH1 - Added new PATCH2 which add common SBI debug console helper functions - Updated PATCH3 and PATCH4 to use SBI debug console helper functions Changes since v2: - Rebased on Linux-6.6-rc5 - Handled page-crossing in PATCH7 of v2 series - Addressed Drew's comment in PATCH3 of v2 series - Added new PATCH5 to make get-reg-list test aware of SBI DBCN extension Changes since v1: - Remove use of #ifdef from PATCH4 and PATCH5 of the v1 series - Improved commit description of PATCH3 in v1 series - Introduced new PATCH3 in this series to allow some SBI extensions (such as SBI DBCN) do to disabled by default so that older KVM user space work fine and newer KVM user space have to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (4): RISC-V: Add stubs for sbi_console_putchar/getchar() RISC-V: Add SBI debug console helper routines tty/serial: Add RISC-V SBI debug console based earlycon RISC-V: Enable SBI based earlycon support Atish Patra (1): tty: Add SBI debug console support to HVC SBI driver arch/riscv/configs/defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 ++++ arch/riscv/kernel/sbi.c | 66 +++++++++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 37 +++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27 ++++++++-- 7 files changed, 133 insertions(+), 12 deletions(-) -- 2.34.1