From patchwork Tue Oct 10 17:04:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 150879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp8559vqb; Tue, 10 Oct 2023 10:07:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPOq5yTx8CpKNbhJUUE7xGfQ+M299pxz8h+D/Hom8qm+RsRfISPAM0CXs5hH/iJmM62Gki X-Received: by 2002:a17:903:11c8:b0:1c7:2697:ec10 with SMTP id q8-20020a17090311c800b001c72697ec10mr21949689plh.56.1696957621436; Tue, 10 Oct 2023 10:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696957621; cv=none; d=google.com; s=arc-20160816; b=u3p98Uas4wx/e518WePM2+pSvk0AsL+F+uSzoK0Kb8Nmz8RYnqggbAffwqxIFYpQjA r/8GuE8aISJUkvI2VIm+w/XaEJ27BGZDYsCqIz9444ZHQpgFKfsU8HeAxJPgiY/sVRSH xX6xCA11e7HRMjeiMuKINUSAsVHdG/kiQ2R8rbypgzP3s3wbAxCQZIVU7/lKB0DHxyP/ G5BdWagP83qzsCtUAqi6cGfl78dxbQ6+f8pbf7g5qwlifaahagcZoWpVKD+NzPaj1lZX wyzkaDwCBbIXxEsSVObUrJhMtDCpXiCmAau0+A+sIpGDo0AsBGQh+Axrcb1e0C4yDZk3 kzVQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B8bTrDTugOefVQ1gZ31VUL3xKHXyC/9v3hCQTi2FF0M=; fh=7GYORjoWw1oF4BCDuq40hd+MOEKRwzNqXwnZ/K2vS9Q=; b=eXEmogNNR2hlbRqI9SsvVTAcxSo8tPHHMOvCcBx8+GmkzQQ86qsIc5xbpjb3sYt0P1 uOTt5Iua8az8K3CAyczjlJTysWIxgp0xiGCL2/9V1g2tdkwUpRVSPIT5bzJ/Rc7ICYDE FyKIyB5+oiWCFaAmlwgkcGEXNwSE2FPmrhrc6gUb4LK50NlSEB1LEfwMkSwSkkO8myxg y1Xb17TB4aYCxMHJmG329stj/67n27ecVhCdMghDXDFvxsYGjKIWTB/ge2Me+kqiLP7B IJkk5PM0zLhk0j8IjFV6xphULgqG27Aeg/DyxiluvDXl/WEKYFc/2Loi2iPEW7WSejV7 Nu0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jU5kqW5+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u1-20020a17090341c100b001bda1941a8esi13049058ple.582.2023.10.10.10.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jU5kqW5+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 3A99A8068956; Tue, 10 Oct 2023 10:06:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232520AbjJJRFX (ORCPT + 20 others); Tue, 10 Oct 2023 13:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230236AbjJJRFW (ORCPT ); Tue, 10 Oct 2023 13:05:22 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA93B93 for ; Tue, 10 Oct 2023 10:05:19 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c724577e1fso46632535ad.0 for ; Tue, 10 Oct 2023 10:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696957519; x=1697562319; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B8bTrDTugOefVQ1gZ31VUL3xKHXyC/9v3hCQTi2FF0M=; b=jU5kqW5+yNfWXyrCBivpJvC6WFn8kuATscsBROojMz/mRH5v2/fAXFwz8y12CccoWJ Jf9kUJVveLhhjTZIhIGmzhi2PIHmqcU0yey+PIzlutgigyxExtvao35qm2vVKBHlj0M5 80OItPZNkpj1AOWEtJNrhHi2/IOld306mc2QXADitvQQij7EcYmrVMsuTKiWy8/IwyRF +jF/FpsrO6boZuWHZ4Hp2HIcoT2fU1RGd8mLrl/mxlF6M7G52GTSCS7MxQtYzWhmSq2r g4rsQxODxOtVoFgX8GNihTrb/BCzJDZqzSMVUarbirZT5uVPB2+gZabqxBaiLqhYtD8J 3ZOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696957519; x=1697562319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B8bTrDTugOefVQ1gZ31VUL3xKHXyC/9v3hCQTi2FF0M=; b=cf/7Fg8jJrcImn0o75EZa6hB4EV/3oBWRosgAocioG765qV6l8kZysGr0fsVyMmKiP nNOZd8t7OxTyiAHRT9lwldqbh31Telldm9n8pmuUFfzCjxgLtI0BrNgoHtUwA2GsZSSu ub5sVDYzJJYpmYos8xFh4YpY3LodDdxZppC9CzQRY/ojDdx4VQy/GfCGIRa8EKR0khaH rWDPrBN+YUJ54WHAq5KHYhfE6gi2ecOG8xqTBFjDLDLCEwCdJfSenJVTMj1b6hL9d74B IAtw4JHDaT+Kdrr4GlQNSakHmwgWTHw24v34hMJLMrMC0ypdtRTMQpouBuST8xeW2rj9 vMwA== X-Gm-Message-State: AOJu0YzBlu9x/Nt8jKpRjBLuPOVeqwnDj3508uZhqgDWy7LeiDmST2X8 zzY6ZdMZKRYoGLTDNOMaLdjdzQ== X-Received: by 2002:a17:902:ea0a:b0:1bb:598a:14e5 with SMTP id s10-20020a170902ea0a00b001bb598a14e5mr24227444plg.43.1696957519183; Tue, 10 Oct 2023 10:05:19 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001b89536974bsm11979868pll.202.2023.10.10.10.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:18 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 1/6] RISC-V: Add defines for SBI debug console extension Date: Tue, 10 Oct 2023 22:34:58 +0530 Message-Id: <20231010170503.657189-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010170503.657189-1-apatel@ventanamicro.com> References: <20231010170503.657189-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:06:02 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779389035177025649 X-GMAIL-MSGID: 1779389035177025649 We add SBI debug console extension related defines/enum to the asm/sbi.h header. Signed-off-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 5b4a1bf5f439..12dfda6bb924 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -30,6 +30,7 @@ enum sbi_ext_id { SBI_EXT_HSM = 0x48534D, SBI_EXT_SRST = 0x53525354, SBI_EXT_PMU = 0x504D55, + SBI_EXT_DBCN = 0x4442434E, /* Experimentals extensions must lie within this range */ SBI_EXT_EXPERIMENTAL_START = 0x08000000, @@ -236,6 +237,12 @@ enum sbi_pmu_ctr_type { /* Flags defined for counter stop function */ #define SBI_PMU_STOP_FLAG_RESET (1 << 0) +enum sbi_ext_dbcn_fid { + SBI_EXT_DBCN_CONSOLE_WRITE = 0, + SBI_EXT_DBCN_CONSOLE_READ = 1, + SBI_EXT_DBCN_CONSOLE_WRITE_BYTE = 2, +}; + #define SBI_SPEC_VERSION_DEFAULT 0x1 #define SBI_SPEC_VERSION_MAJOR_SHIFT 24 #define SBI_SPEC_VERSION_MAJOR_MASK 0x7f From patchwork Tue Oct 10 17:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 150878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp8504vqb; Tue, 10 Oct 2023 10:06:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv9o1HrgdeUhM2XTIpzUI1x29Hjl8sNcW/CNttt976ZW6hgW+kLnPtMhRqbyPyhjXV6fJb X-Received: by 2002:a05:6a00:99c:b0:690:fd48:1aa4 with SMTP id u28-20020a056a00099c00b00690fd481aa4mr24279058pfg.0.1696957616521; Tue, 10 Oct 2023 10:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696957616; cv=none; d=google.com; s=arc-20160816; b=qCrK8OGjspZuN/Lt0rPlraMcU+oa7ovLdmN7hgPIw2pv9KtbeCbo5xfvXp1kCoNjpF OqoVFw94MwHereS5krHmjbSVVtoemF0ZL0om7Lswu/FCCWx4ZixL8qLVVa2ExFYEu17h f208tK5TDUcPxpeGvfsBgNWrH+RxfShVlng/F13ux9vljuF6OlOYSnBr2K3IHxaRPr73 OpCInR3Q9P92UPKQnrXDJoPMWSe4nrVsQnM3G+CeOuRl9Y9hgANMDPAV8xPxjEG6Ogh1 BTOe3krSfCu2J3O8ryBQsWPlrGqwMuhTokw8XDq+gKvu91J+KSl2BlqqsYwi4lbkCCtO UpYA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l3lhlJZP7U6sfVX0rlDY0S8d2x8DhhVnWXy5WEJL0wg=; fh=7GYORjoWw1oF4BCDuq40hd+MOEKRwzNqXwnZ/K2vS9Q=; b=vWfto3/oO8Rr7jpZdTs0pAB6m9Mps+dqHZmq9cL+bA0/0W6SqVKwEeJOqyH3gKipuu JzOaFAmRkS3BAS4LmVpF0twCmxTHX/S47AEYzSocXRQ7j68T5ArGZYwCMooF7P1Bbdbl nK1EWzl2GgPHtnS2e44PNfo2B1sJP6xJa1nnGLgh5QZeduLPAthwQ0OrAylspIEKQpDn CSMDEQoSpWm7vL9JvioWLBVsbbo8zpmw5Ff/z1bOsoDFD333XF0zkIHKyoOqrPQqprZe Jswi8xg/R/D8tiYChhmMvi1BrVkln9TxTPFfnI2qv++Sf9iNFK84oyNVHfd/0LX7SnUV hdcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Q1nvnrQh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id f20-20020a63f114000000b00566016fc08csi12524849pgi.83.2023.10.10.10.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Q1nvnrQh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id AAC73808752C; Tue, 10 Oct 2023 10:05:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233955AbjJJRFf (ORCPT + 20 others); Tue, 10 Oct 2023 13:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233927AbjJJRFc (ORCPT ); Tue, 10 Oct 2023 13:05:32 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4593BDA for ; Tue, 10 Oct 2023 10:05:25 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1c60f1a2652so418585ad.0 for ; Tue, 10 Oct 2023 10:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696957525; x=1697562325; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l3lhlJZP7U6sfVX0rlDY0S8d2x8DhhVnWXy5WEJL0wg=; b=Q1nvnrQhx6Vs8g9wOc7yiACALxYiSSrf2LksIxSwvXbWbC6UNECEQcClYhPtrb2p4D zMhL03nuhtA+w/QwK0+6WWFgwJJTeDB5VQ5Z1DRG78TEEd+dPGo196k6nZVzUAE9igOU RGaJDl9jfGZVKlZ5BJMl2E8ViLpZmMrFKKantddS21R5VNXvSHxuGPHNpa6iW7ICODA+ ZM0YEFQS/+M3tWpHZ1RKnQxpmHF6ICK8mkm3vPzR8aQiFT+ZXnEz7G+q3KZxoaVRlkRi wGS16TLD+YV6fZmrGM+HGbZC1GFivZ90lyTo5977Gdwvr4ESBvxvgf9mgoSHxTujZIp4 0fTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696957525; x=1697562325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l3lhlJZP7U6sfVX0rlDY0S8d2x8DhhVnWXy5WEJL0wg=; b=f0dp0Y+BR2eax41NVVE5wAFWAP6pCGFFYq2SVtLIDQsN2UtRw8v+lRce5R28hdVExz EDJrXW+5hd9xnYTTWj356PYDAX2ixOG8TU5YVp4uV8MZKkngPdtIOgfk96/9X1nTsYWq R6grhXTWdye4MMRLOucjVXuqX5Lh4Gb8t2lRGpO+xm9ANX6ADatfffDZLwrDgDU2rOAP ENIWKlo178utEv1LEsDBuEO0ZAl4LFHyX8fRv37CwaC9ZGpJNHbbOiZ2mLkDyXMtRGJw /DUHvQEA8+H0JgC1fy+VNJQyzeKbAu+1zJvuKeIdoaO97nEWx9BfnKwDohZIYtYOWAlU I+BA== X-Gm-Message-State: AOJu0Yw3hW7eC7qvYc+OjWVsub76APmwQDD3a6xMBnzmASjurk5HUTll HiJ0GeltNKVnFq0jyKZzID/ZHA== X-Received: by 2002:a17:902:d352:b0:1c6:de6:5eb4 with SMTP id l18-20020a170902d35200b001c60de65eb4mr18397397plk.13.1696957524587; Tue, 10 Oct 2023 10:05:24 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001b89536974bsm11979868pll.202.2023.10.10.10.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:24 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0 Date: Tue, 10 Oct 2023 22:34:59 +0530 Message-Id: <20231010170503.657189-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010170503.657189-1-apatel@ventanamicro.com> References: <20231010170503.657189-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:05:41 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779389029567373746 X-GMAIL-MSGID: 1779389029567373746 We will be implementing SBI DBCN extension for KVM RISC-V so let us change the KVM RISC-V SBI specification version to v2.0. Signed-off-by: Anup Patel --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h index cdcf0ff07be7..8d6d4dce8a5e 100644 --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h @@ -11,7 +11,7 @@ #define KVM_SBI_IMPID 3 -#define KVM_SBI_VERSION_MAJOR 1 +#define KVM_SBI_VERSION_MAJOR 2 #define KVM_SBI_VERSION_MINOR 0 enum kvm_riscv_sbi_ext_status { From patchwork Tue Oct 10 17:05:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 150874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp7672vqb; Tue, 10 Oct 2023 10:05:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBSFAHOed6UgbD9Qxqr7Q0dSYgwXSdHjganLaHIDQOwRLs+xb7t/Lrb7tRvOC4dGCQYthz X-Received: by 2002:a17:903:2305:b0:1c6:c3f:9dc3 with SMTP id d5-20020a170903230500b001c60c3f9dc3mr17233478plh.54.1696957556452; Tue, 10 Oct 2023 10:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696957556; cv=none; d=google.com; s=arc-20160816; b=zTycT+xrO3yirDLmaIQWQy830ONyOLzxRWPrk3/h12Sg0sxkA1U/Wj9/VARDPMubMu rE7cgfocjiW8OILumqW7nWrv5Q+PeKgDmnlAWe88pECAA4d9Xbgjq4geEqe14JGFi+9R xtV6WFtp552zgxxAf5WxlT5bQnQq1+rAIyDUC2z2M423Ev2rDd/fg2zu8GFrveZ30DPz KDSyxq3deSZOaClLAeyqZItDkIzi+GBatHt/ugQkQ6yzcy1g/uFFQSQDvI0uklWCvXeo J7dZ6AfaGDjqI8Oeswj9NYLA4Yp6azyrip+1fJmxq6KpjPR/hqtpR1A+G5bqZlKXzKWe 8znQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4smwE6VqfYxKvfF0tqu7jNc/7OXpVUXHc/+OAD0MBRk=; fh=7GYORjoWw1oF4BCDuq40hd+MOEKRwzNqXwnZ/K2vS9Q=; b=jLdg87Mi0d9RQA8eHb3eQKaxPUHhPQZit5jCmvDwFLDLhxaHvlaKPu5tG5AEvtoN3S FBSV1/fwDXHNyKUSeUSyK/FbhA1RHZv97jpDUJkdZy70mHDvjMRFdUauAi3L/qer9bJL 1PO1Z48BSa4FdofV/t2xOFNLJlhr5QbC6WGULgYHG9WorljmLKXkGy+diE+bU+Bc3ZOE wr+tJORZ7kK2ukcQpD2k//sED/xHLmRtpHBzR138g4w5uF7S30WqO1RpsORi3M+1xNsy Cl6uMKgYHv8gtMnUJWqoO8LhBdUTR8eDWn46EukbsjUeYnETpy/56yRlh3rUeWMf3Lq4 +e1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=FhwWGb5X; 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d2-20020a170902cec200b001c61226fe40si13147537plg.392.2023.10.10.10.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:56 -0700 (PDT) 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=FhwWGb5X; 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 830568044776; Tue, 10 Oct 2023 10:05:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234044AbjJJRFi (ORCPT + 20 others); Tue, 10 Oct 2023 13:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233978AbjJJRFd (ORCPT ); Tue, 10 Oct 2023 13:05:33 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D14638E for ; Tue, 10 Oct 2023 10:05:30 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1c9bf22fe05so5061575ad.2 for ; Tue, 10 Oct 2023 10:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696957530; x=1697562330; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4smwE6VqfYxKvfF0tqu7jNc/7OXpVUXHc/+OAD0MBRk=; b=FhwWGb5Xse7nvJyYxyIZeHfhdiov1sPmpAIyzOeoCGEf39LOxkt7wfJ2Z0P8A/m678 rZFtelP2j0l+cFV4L9Fd5cfVSWv91bpzgvCS53XnUBi1zh9W1Xz36U8+NoWS9joAjSbI PIzEhCDhs/CTR2GXh1mg5mra4y83r13ciVymQInsYDZrGiCQZaGGVuYTeY9T7kjMtIJK aeud+i6Sr7MfTROpnE4KzDCOMsNYMbUUKOD2aJVn1Xog8btOol7bejKOotidRPs3u8N9 cT7AmZcOJCLaEJ70+JIuVaq/Iqpb+vIlh89lPryRr+V5veLBho8HplAufaN1fMW6m+Ks 6RwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696957530; x=1697562330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4smwE6VqfYxKvfF0tqu7jNc/7OXpVUXHc/+OAD0MBRk=; b=rb4pnaGoL0sXjsxvP0Hw6SOJU/N/137Pv2g3OrjfHQYI3I31UrCOY5Lif/8oE+ui+q wdm/7IalD4p5Qsvitwtu9ct95QQdbbABdFVfXUMzlUj1nMY+BFLTKIi8epRwwQHUuIC0 8VTdMB4pNmOWqc79QxRAekI5K8ZtDSSCLqiNPF6+Pf4nKLgufKXwu0J/MsseZI/f4QmR wlXCrH0OD8VVH6ybk/ERlp97wIBuBOyhBW43B3poLguRSeF1timjqq/U8i+pcaIhF5XH gw1OCH2WuQzJrVpneqe6T4Nlq6zwa5niCQoKqwZAKIV29+lOks9X+NP6UPSlRWzzg0Eb mpPw== X-Gm-Message-State: AOJu0YwfL1iqKXaslnlcJ0Y8bxagtnT8FbLnfY4Y2thgmsBW4HX3way4 eFHA9Lh8AIgMn4hVQFr3TeANpg== X-Received: by 2002:a17:902:a402:b0:1c7:7e00:809e with SMTP id p2-20020a170902a40200b001c77e00809emr15730697plq.67.1696957529924; Tue, 10 Oct 2023 10:05:29 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001b89536974bsm11979868pll.202.2023.10.10.10.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:29 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 3/6] RISC-V: KVM: Forward SBI DBCN extension to user-space Date: Tue, 10 Oct 2023 22:35:00 +0530 Message-Id: <20231010170503.657189-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010170503.657189-1-apatel@ventanamicro.com> References: <20231010170503.657189-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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]); Tue, 10 Oct 2023 10:05:53 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779388966803118032 X-GMAIL-MSGID: 1779388966803118032 The SBI DBCN extension needs to be emulated in user-space so let us forward console_puts() call to user-space. Signed-off-by: Anup Patel --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_sbi.c | 4 ++++ arch/riscv/kvm/vcpu_sbi_replace.c | 31 +++++++++++++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h index 8d6d4dce8a5e..a85f95eb6e85 100644 --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h @@ -69,6 +69,7 @@ extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi; extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence; extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst; extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_dbcn; extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental; extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor; diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h index 917d8cc2489e..60d3b21dead7 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -156,6 +156,7 @@ enum KVM_RISCV_SBI_EXT_ID { KVM_RISCV_SBI_EXT_PMU, KVM_RISCV_SBI_EXT_EXPERIMENTAL, KVM_RISCV_SBI_EXT_VENDOR, + KVM_RISCV_SBI_EXT_DBCN, KVM_RISCV_SBI_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c index 9cd97091c723..b54fe52c915a 100644 --- a/arch/riscv/kvm/vcpu_sbi.c +++ b/arch/riscv/kvm/vcpu_sbi.c @@ -66,6 +66,10 @@ static const struct kvm_riscv_sbi_extension_entry sbi_ext[] = { .ext_idx = KVM_RISCV_SBI_EXT_PMU, .ext_ptr = &vcpu_sbi_ext_pmu, }, + { + .ext_idx = KVM_RISCV_SBI_EXT_DBCN, + .ext_ptr = &vcpu_sbi_ext_dbcn, + }, { .ext_idx = KVM_RISCV_SBI_EXT_EXPERIMENTAL, .ext_ptr = &vcpu_sbi_ext_experimental, diff --git a/arch/riscv/kvm/vcpu_sbi_replace.c b/arch/riscv/kvm/vcpu_sbi_replace.c index 7c4d5d38a339..347c5856347e 100644 --- a/arch/riscv/kvm/vcpu_sbi_replace.c +++ b/arch/riscv/kvm/vcpu_sbi_replace.c @@ -175,3 +175,34 @@ const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst = { .extid_end = SBI_EXT_SRST, .handler = kvm_sbi_ext_srst_handler, }; + +static int kvm_sbi_ext_dbcn_handler(struct kvm_vcpu *vcpu, + struct kvm_run *run, + struct kvm_vcpu_sbi_return *retdata) +{ + struct kvm_cpu_context *cp = &vcpu->arch.guest_context; + unsigned long funcid = cp->a6; + + switch (funcid) { + case SBI_EXT_DBCN_CONSOLE_WRITE: + case SBI_EXT_DBCN_CONSOLE_READ: + case SBI_EXT_DBCN_CONSOLE_WRITE_BYTE: + /* + * The SBI debug console functions are unconditionally + * forwarded to the userspace. + */ + kvm_riscv_vcpu_sbi_forward(vcpu, run); + retdata->uexit = true; + break; + default: + retdata->err_val = SBI_ERR_NOT_SUPPORTED; + } + + return 0; +} + +const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_dbcn = { + .extid_start = SBI_EXT_DBCN, + .extid_end = SBI_EXT_DBCN, + .handler = kvm_sbi_ext_dbcn_handler, +}; From patchwork Tue Oct 10 17:05:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 150875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp8257vqb; Tue, 10 Oct 2023 10:06:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHoUdOioL01IY9DQghasTH1O722fK8wTotpOJKtgtNlmapQ5r7rXpaKONehgjTNxuo/ILtX X-Received: by 2002:a17:902:e807:b0:1bc:5e36:9ab4 with SMTP id u7-20020a170902e80700b001bc5e369ab4mr23379439plg.21.1696957596553; Tue, 10 Oct 2023 10:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696957596; cv=none; d=google.com; s=arc-20160816; b=JWHmXmM3zwjigJ0MiyZg2jrwgU7Um3kDEz7Hy90Es1rnSUC60S1fqUsQ/LYjKMeG3c BG0Vy+gEzF0bcpDeI+7lzeqdHRjuflibEHSRMpQDUXDtr7rOzNdpqZrrdGGTGFDP9iIt 3+TvrVoFC61G+bEt7hUHkUvn37f+kfnSQt2ignAA+vHa36XRa4cqX+a7y/20JGSKorur NFa/6QULEMmT6VJ5fp4Wk2YqDxodvuJRYXpYBm7RgZo+/pOXzY+sbZy02Kpx34TX5h+F hmKYcpvk63ZtEDdR/krjSV0W6Lyl6Rc1pAvmhyjYsfTF7H/BHDCbIQY4Kv1uBKrSpZF+ BCQA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XoCkBvDoaE+G9yGkJwlCtJkOL/TuRqipkz8zh1jvWHI=; fh=7GYORjoWw1oF4BCDuq40hd+MOEKRwzNqXwnZ/K2vS9Q=; b=zeIkka8pSSPQdRqrwzpR6F8qJeRgr/nsoNLMmlXQOVm/3Vlv74oaNgP1PMu2alT/Mc 7buui+XeyR2j7qLm688cq3OaqGB8EyZal1gG8Oy/BfZKYqWIFRQvX0xvC22GTnWwqDNn 8ut1l8Y3GA4e6oLJwb6GYux50B6Z91nr+aQUOLNFqUvwr74h6UxHhg1WtNDkfrS7tS85 gJYqTqcZiUAsBtkdMhI9Kho3KibziY+hmJP0VxkBkoEu7CTLqyaw5zLj6QPIS2IVl2wb ZqUxLv9sCgZYXrhkA0hEiaR9qTZjoNVm3So0FyJbRt2vfeNVA0QXylAb9UNuEk55cZLf YWFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AA2jQLm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k3-20020a170902c40300b001c7245a7fe8si13511469plk.524.2023.10.10.10.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AA2jQLm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 631F3809AF9C; Tue, 10 Oct 2023 10:06:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234219AbjJJRGA (ORCPT + 20 others); Tue, 10 Oct 2023 13:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234049AbjJJRFj (ORCPT ); Tue, 10 Oct 2023 13:05:39 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A3AF0 for ; Tue, 10 Oct 2023 10:05:36 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c60f1a2652so420805ad.0 for ; Tue, 10 Oct 2023 10:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696957535; x=1697562335; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XoCkBvDoaE+G9yGkJwlCtJkOL/TuRqipkz8zh1jvWHI=; b=AA2jQLm6/yeH/yYoMJAer6K2L8kTm74KVZ2ig382ezZ5hfVEIfthok6IseJqgZoOlh vWfEIhzBiGXl3yYiJcNbH4JvQrrLKeqB6xJgDDKho5pYjvnH2TbGu/Ou7ADp/My5B6bc 1/Ere0xGHWsk9TFKbg03APmOpAdYBrE2L29GhruQ9gyvWfjZ4tl6ipieikZobQb/6P4O UV4bGnn6r7nn7E3xlaEzqJfcK5dGEnbRDxiO4MCqZS5gEPECi7TMkILDhBlm3CVGIMMg KJxmn91UM4Ptg96wP7F6dyOMQDMA1pqTZFpTMYQxhPdyuPN7bLqOcHaOlG9PdDlPCHZp IG/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696957535; x=1697562335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XoCkBvDoaE+G9yGkJwlCtJkOL/TuRqipkz8zh1jvWHI=; b=duGSL78HTrK81Hm8zvFrKikpYdRSVCgfPPxgyP61l5qF4iiS437dqSfyFW+EPU9s5o aY5loioG1k9qczjXz66PENUSmazYuXtYwN38EoAsCWD09/6uhOg1HLrYoYOUlYlJhqwu 9TKUAipn26IQCuuehRe+wIa+kumcPONXRxrHD56nB1QnmKAMwGUS2g8x8BegDq2iNB5Z uQIvDhwKoH8UHBU9sut0/niqrVXyrDgetrfrG4tzCxjj4wxBfh/z6GymaheC5SJRMZ5r 6BK6CAeYeyi/xGAo/GBBYn534MQJKRJf/FzRH9aQmvxlLWSX8BSZrjYTVL4qxLWP3bkw 2YBw== X-Gm-Message-State: AOJu0Yz2di/2SQxIkwTTS+RunpZrO2OQD3SC0jhK6TfSh4rjYlKm+0ie xPEoU1wQ5pyVJzlXNg5hZrydsw== X-Received: by 2002:a17:902:d2ca:b0:1c3:76c4:7242 with SMTP id n10-20020a170902d2ca00b001c376c47242mr26123429plc.22.1696957535339; Tue, 10 Oct 2023 10:05:35 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001b89536974bsm11979868pll.202.2023.10.10.10.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:34 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 4/6] tty/serial: Add RISC-V SBI debug console based earlycon Date: Tue, 10 Oct 2023 22:35:01 +0530 Message-Id: <20231010170503.657189-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010170503.657189-1-apatel@ventanamicro.com> References: <20231010170503.657189-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:06:25 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779389008363504754 X-GMAIL-MSGID: 1779389008363504754 We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 35 ++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index bdc568a4ab66..cec46091a716 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -87,7 +87,7 @@ config SERIAL_EARLYCON_SEMIHOST config SERIAL_EARLYCON_RISCV_SBI bool "Early console using RISC-V SBI" - depends on RISCV_SBI_V01 + depends on RISCV_SBI select SERIAL_CORE select SERIAL_CORE_CONSOLE select SERIAL_EARLYCON diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c index 27afb0b74ea7..b1da34e8d8cd 100644 --- a/drivers/tty/serial/earlycon-riscv-sbi.c +++ b/drivers/tty/serial/earlycon-riscv-sbi.c @@ -10,22 +10,49 @@ #include #include +#ifdef CONFIG_RISCV_SBI_V01 static void sbi_putc(struct uart_port *port, unsigned char c) { sbi_console_putchar(c); } -static void sbi_console_write(struct console *con, - const char *s, unsigned n) +static void sbi_0_1_console_write(struct console *con, + const char *s, unsigned int n) { struct earlycon_device *dev = con->data; uart_console_write(&dev->port, s, n, sbi_putc); } +#endif + +static void sbi_dbcn_console_write(struct console *con, + const char *s, unsigned int n) +{ + phys_addr_t pa = __pa(s); + + sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_WRITE, +#ifdef CONFIG_32BIT + n, pa, (u64)pa >> 32, +#else + n, pa, 0, +#endif + 0, 0, 0); +} static int __init early_sbi_setup(struct earlycon_device *device, const char *opt) { - device->con->write = sbi_console_write; - return 0; + int ret = 0; + + if ((sbi_spec_version >= sbi_mk_version(2, 0)) && + (sbi_probe_extension(SBI_EXT_DBCN) > 0)) + device->con->write = sbi_dbcn_console_write; + else +#ifdef CONFIG_RISCV_SBI_V01 + device->con->write = sbi_0_1_console_write; +#else + ret = -ENODEV; +#endif + + return ret; } EARLYCON_DECLARE(sbi, early_sbi_setup); From patchwork Tue Oct 10 17:05:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 150876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp8283vqb; Tue, 10 Oct 2023 10:06:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFx+d6M97iFWGjdOXEm7JLZlJSzFIwuVlCZLMTA3LWzbQmv4wzM4fPTvJSCuduYKez10bhL X-Received: by 2002:a05:6358:e49c:b0:135:499a:382b with SMTP id by28-20020a056358e49c00b00135499a382bmr20021580rwb.7.1696957598501; Tue, 10 Oct 2023 10:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696957598; cv=none; d=google.com; s=arc-20160816; b=FcUmcRzgXsUcg4qHt3fPquX021Dy9K8/FUqP/FfogyQL0SxO9VwB058ejJEQ0pzJse c5+hy7kM+9mXW+DQIfCRGnqsHRqW34R0VpgSQ4lYATofjFwuLIwRg2QLp20Hk8fV0iCw mK/yicZ3+7jUGeZpE6beJtd/eCmrY+vg2W6KJWLj7bKZf1y3Xg46HRWAaY3Jd5Ecj/ae p97lYt7WdEvJnp4CL5uAhgLLLL1UwaCCCKGhfl4T6+BWF15wUcUKu/t+0JMkMsIjNOt6 kowfWbFec/3gPeMxdhwJHWO6Rc/PUZTXl/74EiOI1bDaFDKio6L2KE0y7i+/S2+qScd1 q2OA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5Qqy4Lq8gbERMmKNa3SsbrCy4B07mso/bpWy+ieX3+w=; fh=OfNDhWBTBAuUy+hoy8Y3XMW7PkzxeKRBsc+xFswuT9E=; b=ZbKEQf0N+gZhiBLoa2f2ARLjZLsh0s/072IEWf+sFT2gKceMypsobZgBAertGDK0eV xqHxCk2ZsbcRyhKEhq/GlINjyAswSxII4UloChBt14nkOElMF1vfNdxLpjQsUgIW923J zC1vQVmldh+pUadticN5g8pP4L7Amba4US7VzIO/A2s3d7NRsWOJZOLUWs9xeE4lU8n/ +TSlYnBR0eHT4Z/j+qgFdXNj3vSANCGO4uvA09fbbUNxUyygLK54MNV+k6Mu2tLefNnV 3bthQOFwFbvpxoDVOXo6XjNMZU4aQ7EpknC1erb8vs6S8NrnYUzWUb491aI6Fgn5dt5S NI3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=oxsbFfPK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k185-20020a6384c2000000b00578db71453esi12399047pgd.468.2023.10.10.10.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=oxsbFfPK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id B3054809AFAC; Tue, 10 Oct 2023 10:06:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234134AbjJJRGS (ORCPT + 20 others); Tue, 10 Oct 2023 13:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234047AbjJJRF5 (ORCPT ); Tue, 10 Oct 2023 13:05:57 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1375D125 for ; Tue, 10 Oct 2023 10:05:41 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c9b70b9656so5904905ad.1 for ; Tue, 10 Oct 2023 10:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696957541; x=1697562341; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Qqy4Lq8gbERMmKNa3SsbrCy4B07mso/bpWy+ieX3+w=; b=oxsbFfPKApeST8UXfAEZgouvwcN0yMiLW8HE47kN/PIFXkettHGmJnBeY1oMnHLR8w 1kENylFGJEFUIVCcfqEqA6n8DDOUTUaxXh3m8u0txY6USgdYCbuUKWORgNsT2bLJJqtu RER5TjODAkNwXwEzkkKjYX9sxFR6fgaRVNHRZdv26qiP1OkpR7KTI/RBJWAjOTJ72z0O Pw86hOoCYQol4hJRIxUQgyMrKW3DTioiDABVibaZ+5DlHg23qRSxeXzVsETs7S+ejsdC xqEfLchlgB06beYRu/5LEJPrWZBogDNkhoOy4Mcb4hAYA3oCYsaj7Jl/S1/p10QJ4r84 O1Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696957541; x=1697562341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Qqy4Lq8gbERMmKNa3SsbrCy4B07mso/bpWy+ieX3+w=; b=ZfCZsePwappuqCCDjCh87ojdGw9jxXYCkqoQkfbLcJmq9SJfS41Y+ZfzNU+WXP5dor 9jIURIWTCjEykgPssuqToeBg1VmDu3LNoYv0bGNBONTQ3+ywRXRwguZCl+qTvYWLbwgo suwM8IEcx3SCnnU9RGMmdcO81rwzP13/bSvu6rQfVvnRH1F2cj89mjymiQq++MbJzYKD q5kbmPED3G2WtC+saTFtkS04vZxpyqNTAv7VzUv9omgPWttFLgbAcciLmbbPfXTC+vO+ EaaoRpqMZEfLIinlGiKIMwIXLJfex4O13/nT239gA+x3nUrI7K1LCtwFl4oNIAcpFjAq 4VEQ== X-Gm-Message-State: AOJu0YwwExvK1bvpTjBLCIpO16QUSYZYFAcHAugq/e19Dp02F7dzysKj f4ioCUbfW1EdK2WPHI5L/bYHdg== X-Received: by 2002:a17:902:da89:b0:1c7:3aad:305e with SMTP id j9-20020a170902da8900b001c73aad305emr19217128plx.27.1696957541145; Tue, 10 Oct 2023 10:05:41 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001b89536974bsm11979868pll.202.2023.10.10.10.05.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:40 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Atish Patra , Anup Patel Subject: [PATCH 5/6] tty: Add SBI debug console support to HVC SBI driver Date: Tue, 10 Oct 2023 22:35:02 +0530 Message-Id: <20231010170503.657189-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010170503.657189-1-apatel@ventanamicro.com> References: <20231010170503.657189-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:06:31 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779389011023337020 X-GMAIL-MSGID: 1779389011023337020 From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 80 ++++++++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig index 4f9264d005c0..6e05c5c7bca1 100644 --- a/drivers/tty/hvc/Kconfig +++ b/drivers/tty/hvc/Kconfig @@ -108,7 +108,7 @@ config HVC_DCC_SERIALIZE_SMP config HVC_RISCV_SBI bool "RISC-V SBI console support" - depends on RISCV_SBI_V01 + depends on RISCV_SBI select HVC_DRIVER help This enables support for console output via RISC-V SBI calls, which diff --git a/drivers/tty/hvc/hvc_riscv_sbi.c b/drivers/tty/hvc/hvc_riscv_sbi.c index 31f53fa77e4a..be8b7e351840 100644 --- a/drivers/tty/hvc/hvc_riscv_sbi.c +++ b/drivers/tty/hvc/hvc_riscv_sbi.c @@ -15,6 +15,7 @@ #include "hvc_console.h" +#ifdef CONFIG_RISCV_SBI_V01 static int hvc_sbi_tty_put(uint32_t vtermno, const char *buf, int count) { int i; @@ -39,21 +40,86 @@ static int hvc_sbi_tty_get(uint32_t vtermno, char *buf, int count) return i; } -static const struct hv_ops hvc_sbi_ops = { +static const struct hv_ops hvc_sbi_v01_ops = { .get_chars = hvc_sbi_tty_get, .put_chars = hvc_sbi_tty_put, }; +#endif -static int __init hvc_sbi_init(void) +static int hvc_sbi_dbcn_tty_put(uint32_t vtermno, const char *buf, int count) { - return PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_ops, 16)); + phys_addr_t pa; + struct sbiret ret; + + if (is_vmalloc_addr(buf)) + pa = page_to_phys(vmalloc_to_page(buf)) + offset_in_page(buf); + else + pa = __pa(buf); + + ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_WRITE, +#ifdef CONFIG_32BIT + count, pa, (u64)pa >> 32, +#else + count, pa, 0, +#endif + 0, 0, 0); + + if (ret.error) + return 0; + + return count; } -device_initcall(hvc_sbi_init); -static int __init hvc_sbi_console_init(void) +static int hvc_sbi_dbcn_tty_get(uint32_t vtermno, char *buf, int count) { - hvc_instantiate(0, 0, &hvc_sbi_ops); + phys_addr_t pa; + struct sbiret ret; + + if (is_vmalloc_addr(buf)) + pa = page_to_phys(vmalloc_to_page(buf)) + offset_in_page(buf); + else + pa = __pa(buf); + + ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_READ, +#ifdef CONFIG_32BIT + count, pa, (u64)pa >> 32, +#else + count, pa, 0, +#endif + 0, 0, 0); + + if (ret.error) + return 0; + + return ret.value; +} + +static const struct hv_ops hvc_sbi_dbcn_ops = { + .put_chars = hvc_sbi_dbcn_tty_put, + .get_chars = hvc_sbi_dbcn_tty_get, +}; + +static int __init hvc_sbi_init(void) +{ + int err; + + if ((sbi_spec_version >= sbi_mk_version(2, 0)) && + (sbi_probe_extension(SBI_EXT_DBCN) > 0)) { + err = PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_dbcn_ops, 16)); + if (err) + return err; + hvc_instantiate(0, 0, &hvc_sbi_dbcn_ops); + } else { +#ifdef CONFIG_RISCV_SBI_V01 + err = PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_v01_ops, 16)); + if (err) + return err; + hvc_instantiate(0, 0, &hvc_sbi_v01_ops); +#else + return -ENODEV; +#endif + } return 0; } -console_initcall(hvc_sbi_console_init); +device_initcall(hvc_sbi_init); From patchwork Tue Oct 10 17:05:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 150877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp8379vqb; Tue, 10 Oct 2023 10:06:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMzf8yH4iH4XAtjFQWG+5/8sfV//iYVTh8rEQG3E/w6EhUJ3mwpuDK6yMIVAuIUFsqFvgJ X-Received: by 2002:a17:90b:1b4f:b0:27c:fb63:9c89 with SMTP id nv15-20020a17090b1b4f00b0027cfb639c89mr853976pjb.0.1696957606307; Tue, 10 Oct 2023 10:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696957606; cv=none; d=google.com; s=arc-20160816; b=xiWO+BvCLbEsmIRaNrZaazg6QYJZOroZKOEv9OY8SWrTkXyAKrFJr2xoYPwekZrUkb phR6pW5rXYRUoDgwRy8mSM8yL/nQedQmdLdu+s51pAvcvtO3U72f7C9aRaN1f6SA+XmU tRhzlzjt2rXy8fZEYbgUu/IvKsOC0ypLIO4nlNLLfkP9pBuEYo+7D7G1GlR3LIysSGXT RCmR7K0mzDLEMkKvIsg+JQ3WVjkZnhm3jQ4qBorTKhPMeFaURXrmXve50n1xWPOeMsqC FQ+afADdStY/V12FnEzdvT/upNOs4MuRPxxprU5ULHCDM7uxx5lQyn7CHqQcNfpdBeoO K+Ew== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OF/0DZOVOE1sZojsrN9hmq2DR3MNn3xhzg86O8Xb4xI=; fh=7GYORjoWw1oF4BCDuq40hd+MOEKRwzNqXwnZ/K2vS9Q=; b=aHQWlhOSO8JsIbodTLj/1YdbFr88eAcdJ4apshQ2Hx4L+VvMOoYMrJLJJAErGa/TDs Whi1+zYwYTW4VMjyuqtRgphFltWBCISkwUQKMBj53qJ+pJlfT2wXp5T+qQAixrJQR1eW 2KzZGdBTfW84R21a5aD8z8uz4WOb3DOVAiCNJg01Yan41GpwsKQ4bp0weDSWqozobDqs iHbn/rd6TEV72ifIptLkF6Y7zNwHCqQRb4HuJ/LpWfuur0fhVudDJ1FXC/0Bi25A8z1n /dZk3wlvnpBEEVg2affdcrkDL4dxfF3D8wm5460t+1i2WUIluZvI4SFyVqB4dutTpMVA CBtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=gzuJ05BH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x7-20020a17090a9dc700b0027cf69a6633si958875pjv.95.2023.10.10.10.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=gzuJ05BH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 4DF708082040; Tue, 10 Oct 2023 10:06:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233941AbjJJRG1 (ORCPT + 20 others); Tue, 10 Oct 2023 13:06:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234060AbjJJRGA (ORCPT ); Tue, 10 Oct 2023 13:06:00 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65B8218B for ; Tue, 10 Oct 2023 10:05:47 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1c724577e1fso46637365ad.0 for ; Tue, 10 Oct 2023 10:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696957546; x=1697562346; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OF/0DZOVOE1sZojsrN9hmq2DR3MNn3xhzg86O8Xb4xI=; b=gzuJ05BHsBpfeRoMHWR26s0956U/nteB5pForucJtcHhDFRBXHR0SGK4os/xRl6z2W SA56yVp4pAd/Q2HOzXUk3vEUrX4bVYhS/ugwPAZjDworecKoJGBCR6HmP56lqPm9EbxX AWYNJM/CjI8fJIAhJZI3uAKOtq59Lj0Y8qwbnS9kWsgNvOypdilchNNWEYXFn9WQXHOd FioZ8wfuddJX2ns6sRZSafTolhZCWCsmJ5y6eDqZG0ytBbwEoiJo0OVZAKRMRnBi0NCl tZSJi+TsuvxyQNVF8i5m/GnEgWsk2UR//kOxmU1IaiHvSuY0w05Rc0Jq1WMEm6ecKPbj un6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696957546; x=1697562346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OF/0DZOVOE1sZojsrN9hmq2DR3MNn3xhzg86O8Xb4xI=; b=SDRNML6gAG5mgJtIBDrKUw9LaeP5DM/MlMVwzIbj6H9EjsPptmTfvxI8adIzERoh9q WgbAFHfm5NDhbhnNvjqy/fyL373jJ4xAD1ACEMOhyWZKsAJW9aU9x6lBpUGTuPmy5EtN Iqfz/aaOhvV1Dxy5ZoTXabE/f/aTUIBkjrsTG1HuUZZyCvgmVAGE545YfPv7g3XbPOLu DZDVrI8LpanlI2ITyisyA6h8BRNlLFsuGxNuckTJQz7h+eRgLkUtQEm1oq6ru/cVuXIc kDA+NUBtJXD9Ef0d+vmjQTp8CGSTudHSHKMPhIoJyH8k75rBzEkIW9ipALLtHAE/r0Li ke3A== X-Gm-Message-State: AOJu0YwQPryStSL7zc0j0jhBep3enmguv/4psfcKwJs2asW4rYo/Oo64 Lhfp7oaxxe1H4qlM2bfKSI1oMA== X-Received: by 2002:a17:903:230a:b0:1c7:7e00:8075 with SMTP id d10-20020a170903230a00b001c77e008075mr23570340plh.66.1696957546442; Tue, 10 Oct 2023 10:05:46 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001b89536974bsm11979868pll.202.2023.10.10.10.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:05:45 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 6/6] RISC-V: Enable SBI based earlycon support Date: Tue, 10 Oct 2023 22:35:03 +0530 Message-Id: <20231010170503.657189-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010170503.657189-1-apatel@ventanamicro.com> References: <20231010170503.657189-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:06:43 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779389019040392980 X-GMAIL-MSGID: 1779389019040392980 Let us enable SBI based earlycon support in defconfigs for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel --- arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index ab86ec3b9eab..f82700da0056 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -132,6 +132,7 @@ CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_DW=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_SH_SCI=y +CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIRTIO=y diff --git a/arch/riscv/configs/rv32_defconfig b/arch/riscv/configs/rv32_defconfig index 89b601e253a6..5721af39afd1 100644 --- a/arch/riscv/configs/rv32_defconfig +++ b/arch/riscv/configs/rv32_defconfig @@ -66,6 +66,7 @@ CONFIG_INPUT_MOUSEDEV=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIRTIO=y