From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Date: Wed, 11 Oct 2023 17:26:06 +0200 Subject: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0 In-Reply-To: References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-3-apatel@ventanamicro.com> <2023101013-overfeed-online-7f69@gregkh> <2023101107-endorse-large-ef50@gregkh> Message-ID: <2023101148-anatomy-mantis-a0f5@gregkh> List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Oct 11, 2023 at 04:32:22PM +0530, Anup Patel wrote: > On Wed, Oct 11, 2023 at 12:57?PM Greg Kroah-Hartman > wrote: > > > > On Wed, Oct 11, 2023 at 11:49:14AM +0530, Anup Patel wrote: > > > On Tue, Oct 10, 2023 at 10:43?PM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Tue, Oct 10, 2023 at 10:34:59PM +0530, Anup Patel wrote: > > > > > 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 > > > > > > > > What does this number mean? Who checks it? Why do you have to keep > > > > incrementing it? > > > > > > This number is the SBI specification version implemented by KVM RISC-V > > > for the Guest kernel. > > > > > > The original sbi_console_putchar() and sbi_console_getchar() are legacy > > > functions (aka SBI v0.1) which were introduced a few years back along > > > with the Linux RISC-V port. > > > > > > The latest SBI v2.0 specification (which is now frozen) introduces a new > > > SBI debug console extension which replaces legacy sbi_console_putchar() > > > and sbi_console_getchar() functions with better alternatives. > > > (Refer, https://github.com/riscv-non-isa/riscv-sbi-doc/releases/download/commit-fe4562532a9cc57e5743b6466946c5e5c98c73ca/riscv-sbi.pdf) > > > > > > This series adds SBI debug console implementation in KVM RISC-V > > > so the SBI specification version advertised by KVM RISC-V must also be > > > upgraded to v2.0. > > > > > > Regarding who checks its, the SBI client drivers in the Linux kernel > > > will check SBI specification version implemented by higher privilege > > > mode (M-mode firmware or HS-mode hypervisor) before probing > > > the SBI extension. For example, the HVC SBI driver (PATCH5) > > > will ensure SBI spec version to be at least v2.0 before probing > > > SBI debug console extension. > > > > Is this api backwards compatible, or did you just break existing > > userspace that only expects version 1.0? > > The legacy sbi_console_putchar() and sbi_console_getchar() > functions have not changed so it does not break existing > user-space. > > The new SBI DBCN functions to be implemented by KVM > user space are: > sbi_debug_console_write() > sbi_debug_console_read() > sbi_debug_console_write_byte() And where exactly is that code for us to review that this is tested? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2F9ACD6E7D for ; Wed, 11 Oct 2023 15:26:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nY0RXmoQvbxzf/0Z4gSj0yTojdltzVQ7SsK6BNP3ou4=; b=JTAtUgJnCOpszA 5eRLyluXroTWTnhlWroREHuOxafrFNBzjmTknPxLUi+YXoVuulZYGGs/TJc64pyE5XfxtW4td816y tNO+erQTUWyfr7WMno7sJUNQVRnqcpM4YSI6TPqRzpt5zPqvdbcc3QKhv8N7w4tYyFRy69u7hZUir xzMsvXTN/Avb1vuuQehXTIvRh4evdPhMtyXirv7/Ixx+edmTrmDWLPgRbpYbY4X9MQo6Kqorqu5f8 vvM84NPgnl9R+mExwqAWtnNPHmBBsIrvYyPsNrZhFjKnUbbXJeaqeeFmaHs5JB61FJAt3hoqpB7EJ 8Wr5vSg2qXzOGw+fRUPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqb6H-00GBO1-1A; Wed, 11 Oct 2023 15:26:17 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqb6D-00GBN4-0F; Wed, 11 Oct 2023 15:26:15 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 595D5CE0E29; Wed, 11 Oct 2023 15:26:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06141C433C9; Wed, 11 Oct 2023 15:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697037969; bh=ffZCdV6S3mfAswlL4iRHUl65ZXH/97XVC+UgVd+j71w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QuMHdz03n1BfB2yvbi90uIfPDcGaOQm/4sxL26h4J46dlTFjur9pQdPbgXE1MWXh/ awQXJQGRuGbvfsBzZS320T2CSWWhpRB35hO0o/kXRPEG0CRnZtbNqsphpUgaRgCFe3 86EcgS2jYsbId1dSXsdUlYVace+g2HNvcvCBqnWY= Date: Wed, 11 Oct 2023 17:26:06 +0200 From: Greg Kroah-Hartman To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Jiri Slaby , 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 Subject: Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0 Message-ID: <2023101148-anatomy-mantis-a0f5@gregkh> References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-3-apatel@ventanamicro.com> <2023101013-overfeed-online-7f69@gregkh> <2023101107-endorse-large-ef50@gregkh> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231011_082613_476345_66BBB883 X-CRM114-Status: GOOD ( 30.33 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org T24gV2VkLCBPY3QgMTEsIDIwMjMgYXQgMDQ6MzI6MjJQTSArMDUzMCwgQW51cCBQYXRlbCB3cm90 ZToKPiBPbiBXZWQsIE9jdCAxMSwgMjAyMyBhdCAxMjo1N+KAr1BNIEdyZWcgS3JvYWgtSGFydG1h bgo+IDxncmVna2hAbGludXhmb3VuZGF0aW9uLm9yZz4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.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C035CD6E7E for ; Wed, 11 Oct 2023 15:26:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234946AbjJKP0P (ORCPT ); Wed, 11 Oct 2023 11:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbjJKP0O (ORCPT ); Wed, 11 Oct 2023 11:26:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044B392; Wed, 11 Oct 2023 08:26:10 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06141C433C9; Wed, 11 Oct 2023 15:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697037969; bh=ffZCdV6S3mfAswlL4iRHUl65ZXH/97XVC+UgVd+j71w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QuMHdz03n1BfB2yvbi90uIfPDcGaOQm/4sxL26h4J46dlTFjur9pQdPbgXE1MWXh/ awQXJQGRuGbvfsBzZS320T2CSWWhpRB35hO0o/kXRPEG0CRnZtbNqsphpUgaRgCFe3 86EcgS2jYsbId1dSXsdUlYVace+g2HNvcvCBqnWY= Date: Wed, 11 Oct 2023 17:26:06 +0200 From: Greg Kroah-Hartman To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Jiri Slaby , 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 Subject: Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0 Message-ID: <2023101148-anatomy-mantis-a0f5@gregkh> References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-3-apatel@ventanamicro.com> <2023101013-overfeed-online-7f69@gregkh> <2023101107-endorse-large-ef50@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Wed, Oct 11, 2023 at 04:32:22PM +0530, Anup Patel wrote: > On Wed, Oct 11, 2023 at 12:57 PM Greg Kroah-Hartman > wrote: > > > > On Wed, Oct 11, 2023 at 11:49:14AM +0530, Anup Patel wrote: > > > On Tue, Oct 10, 2023 at 10:43 PM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Tue, Oct 10, 2023 at 10:34:59PM +0530, Anup Patel wrote: > > > > > 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 > > > > > > > > What does this number mean? Who checks it? Why do you have to keep > > > > incrementing it? > > > > > > This number is the SBI specification version implemented by KVM RISC-V > > > for the Guest kernel. > > > > > > The original sbi_console_putchar() and sbi_console_getchar() are legacy > > > functions (aka SBI v0.1) which were introduced a few years back along > > > with the Linux RISC-V port. > > > > > > The latest SBI v2.0 specification (which is now frozen) introduces a new > > > SBI debug console extension which replaces legacy sbi_console_putchar() > > > and sbi_console_getchar() functions with better alternatives. > > > (Refer, https://github.com/riscv-non-isa/riscv-sbi-doc/releases/download/commit-fe4562532a9cc57e5743b6466946c5e5c98c73ca/riscv-sbi.pdf) > > > > > > This series adds SBI debug console implementation in KVM RISC-V > > > so the SBI specification version advertised by KVM RISC-V must also be > > > upgraded to v2.0. > > > > > > Regarding who checks its, the SBI client drivers in the Linux kernel > > > will check SBI specification version implemented by higher privilege > > > mode (M-mode firmware or HS-mode hypervisor) before probing > > > the SBI extension. For example, the HVC SBI driver (PATCH5) > > > will ensure SBI spec version to be at least v2.0 before probing > > > SBI debug console extension. > > > > Is this api backwards compatible, or did you just break existing > > userspace that only expects version 1.0? > > The legacy sbi_console_putchar() and sbi_console_getchar() > functions have not changed so it does not break existing > user-space. > > The new SBI DBCN functions to be implemented by KVM > user space are: > sbi_debug_console_write() > sbi_debug_console_read() > sbi_debug_console_write_byte() And where exactly is that code for us to review that this is tested? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BFB3CD6E7D for ; Wed, 11 Oct 2023 15:27:08 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=QuMHdz03; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4S5Gpf4zdcz3vXb for ; Thu, 12 Oct 2023 02:27:06 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=QuMHdz03; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2604:1380:40e1:4800::1; helo=sin.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=lists.ozlabs.org) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4S5Gng4fwmz2yTy for ; Thu, 12 Oct 2023 02:26:15 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 595D5CE0E29; Wed, 11 Oct 2023 15:26:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06141C433C9; Wed, 11 Oct 2023 15:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697037969; bh=ffZCdV6S3mfAswlL4iRHUl65ZXH/97XVC+UgVd+j71w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QuMHdz03n1BfB2yvbi90uIfPDcGaOQm/4sxL26h4J46dlTFjur9pQdPbgXE1MWXh/ awQXJQGRuGbvfsBzZS320T2CSWWhpRB35hO0o/kXRPEG0CRnZtbNqsphpUgaRgCFe3 86EcgS2jYsbId1dSXsdUlYVace+g2HNvcvCBqnWY= Date: Wed, 11 Oct 2023 17:26:06 +0200 From: Greg Kroah-Hartman To: Anup Patel Subject: Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0 Message-ID: <2023101148-anatomy-mantis-a0f5@gregkh> References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-3-apatel@ventanamicro.com> <2023101013-overfeed-online-7f69@gregkh> <2023101107-endorse-large-ef50@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-serial@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Atish Patra , linux-kernel@vger.kernel.org, Conor Dooley , Palmer Dabbelt , kvm-riscv@lists.infradead.org, Paul Walmsley , Paolo Bonzini , linux-riscv@lists.infradead.org, Jiri Slaby , Andrew Jones Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Oct 11, 2023 at 04:32:22PM +0530, Anup Patel wrote: > On Wed, Oct 11, 2023 at 12:57 PM Greg Kroah-Hartman > wrote: > > > > On Wed, Oct 11, 2023 at 11:49:14AM +0530, Anup Patel wrote: > > > On Tue, Oct 10, 2023 at 10:43 PM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Tue, Oct 10, 2023 at 10:34:59PM +0530, Anup Patel wrote: > > > > > 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 > > > > > > > > What does this number mean? Who checks it? Why do you have to keep > > > > incrementing it? > > > > > > This number is the SBI specification version implemented by KVM RISC-V > > > for the Guest kernel. > > > > > > The original sbi_console_putchar() and sbi_console_getchar() are legacy > > > functions (aka SBI v0.1) which were introduced a few years back along > > > with the Linux RISC-V port. > > > > > > The latest SBI v2.0 specification (which is now frozen) introduces a new > > > SBI debug console extension which replaces legacy sbi_console_putchar() > > > and sbi_console_getchar() functions with better alternatives. > > > (Refer, https://github.com/riscv-non-isa/riscv-sbi-doc/releases/download/commit-fe4562532a9cc57e5743b6466946c5e5c98c73ca/riscv-sbi.pdf) > > > > > > This series adds SBI debug console implementation in KVM RISC-V > > > so the SBI specification version advertised by KVM RISC-V must also be > > > upgraded to v2.0. > > > > > > Regarding who checks its, the SBI client drivers in the Linux kernel > > > will check SBI specification version implemented by higher privilege > > > mode (M-mode firmware or HS-mode hypervisor) before probing > > > the SBI extension. For example, the HVC SBI driver (PATCH5) > > > will ensure SBI spec version to be at least v2.0 before probing > > > SBI debug console extension. > > > > Is this api backwards compatible, or did you just break existing > > userspace that only expects version 1.0? > > The legacy sbi_console_putchar() and sbi_console_getchar() > functions have not changed so it does not break existing > user-space. > > The new SBI DBCN functions to be implemented by KVM > user space are: > sbi_debug_console_write() > sbi_debug_console_read() > sbi_debug_console_write_byte() And where exactly is that code for us to review that this is tested? thanks, greg k-h