Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp727595rdg; Wed, 11 Oct 2023 04:03:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHx6ot+3Q0bOBRAFRDaCMxfy6NRGS8IO7+dWgIdVVcRxGjZEPBtfurskTwwjeUhv1BZz1tZ X-Received: by 2002:a05:6a00:2d1e:b0:68f:bb16:d16a with SMTP id fa30-20020a056a002d1e00b0068fbb16d16amr30401290pfb.5.1697022197423; Wed, 11 Oct 2023 04:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697022197; cv=none; d=google.com; s=arc-20160816; b=vuYntjtLmGXcIvfacCbEAVBMKXO+F7485vZdytqJ/IPYK5rv4ruSUi4DhgBFicNi6N FIpGDicoGA2YtfsjCxpILGLYzq4A8nKWwMuP6yPgBMR13qm6D4fRO5LIot3Kpax9zawu dOUqCQXKMc+uHyOLq5mXDdUR1g6ALODXEBinUT7GLd52Mvht7UtB44U2bnI3+bBbK+7M ltuOZZFdrWG7p8fwR/ormg65N0XNDw8KWns0PyIX/alUM6ZxaO7Ye6V0IC9QQ0hQaK4L KEh+eJ34zHzp+Xm2XLPuVxBifN3L8wccDno1ocPKecct1mdurscTfK46VEXAVwbio9is SiYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Xm0CdxGnQbe0GlEx3+GHVomKZQHiVEeERNIEs1qllzo=; fh=JyL8+fJr4BsolHUmcm+dYi0xCmNZZ71zno4Ij1nE8wE=; b=SvmeZ8JCRzStXf/Xt33yQvFWucyYx6CMZuiz9wP7SfvSxVTvkfUCvmfkLMztJAcwCK v2kcOIFLsJXyC3mrKDGbDoHBANa0xdQVrO7lT8FM4ZAFTKpWwCGj1V2wJ0w0VXkKCL35 Y6ktX5b9rLJlr2MgnTwEBk4V+qQsCGTYSgwiu9UzoznbppW8/JGBMZwB2ScgpjLEc9nT iWwLYF97wdbCZLAoGvIoeTOcu5S2GfPM+ZlNewGl/Am/Ts+8t6SNJEpZXaY211vRdAgu lLFUNK3xJ+InGm1EGnW5MZB1K5vfGIEgk264Uiy0easTnYn15tId8Xgu5QanBhuqOII6 gZig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=VZvMO6mf; 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q3-20020a056a00150300b0068bdcfc3454si8842245pfu.135.2023.10.11.04.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:03:17 -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=VZvMO6mf; 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 87E26801F497; Wed, 11 Oct 2023 04:03:14 -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 S1346707AbjJKLDF (ORCPT + 99 others); Wed, 11 Oct 2023 07:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234909AbjJKLCz (ORCPT ); Wed, 11 Oct 2023 07:02:55 -0400 Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CC94128 for ; Wed, 11 Oct 2023 04:02:35 -0700 (PDT) Received: by mail-vs1-xe2c.google.com with SMTP id ada2fe7eead31-452c0d60616so542687137.1 for ; Wed, 11 Oct 2023 04:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1697022154; x=1697626954; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Xm0CdxGnQbe0GlEx3+GHVomKZQHiVEeERNIEs1qllzo=; b=VZvMO6mfkwhG4ZN258/KVtS10RK9KNdvy2Tr1pqJIawr8ZgchnndzYkT7iPrYlCDfy Oejz89MSEUcwBzsWyDDanwyyOj7XGMkjSecwi1EQ3piUgar2tceW/XSQqgh/3agSwSO1 M7T10caA1HtiP+YQw8JuBpVO5eQgsZ/VfGX0p+NXKPiLzE/UZ+YCX8tcmZQ4jDZS+ybU 7a8J/a6Sk4gPRgiTYZGSaBXX0cwnqjCvjqUtmdpMOyTPGIPCFFDlHE0h2UCoJOp1Rlcl bOfOe4UdTBAqPcI/FhXhmxGhFy6oMiPZ8VMemYYGomIonWivw7LGlxJ3TjH4KlbSHnA/ DjNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697022154; x=1697626954; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xm0CdxGnQbe0GlEx3+GHVomKZQHiVEeERNIEs1qllzo=; b=YfQYp7aRxu1F/nYNacTMhU0ocqUped52WqfB9xXVxZEATLZ+W5O7ryFhQXadAvIYfp 412nR8jYcu+aRZNyBJJetchfNU/rFeNTVUoCoajwgxDhay2JRGuIIhoVwCqEtgIMis1M lOHGf8c7TNN6DJHBVJtD1BUNuxbc2omg5miM6FyssDg7iYvTrYjn6j+9oMbh8pW4idgp xQBhhO2BWfoG2l3NC1Ne3RvYCqnIrRHg0v79G2LErQJI2RBTC8BkiPAbWJbZrNFTyNjG 1bVaB9SjlEzSGHKm0LLA4Zb6Cw2GBYSUsa9Ueb9OXeh326/2P9k8OYoTgTW5VMUrTDRj g/1A== X-Gm-Message-State: AOJu0YxFlODdK9OIx1tCmWrRAxSSCWUISqZojXNDhstLfpOYcC7pkRXI DL2GPjogX1bAhYFTJhVNwlB/RGUVd4yF4btNrvK/kw== X-Received: by 2002:a05:6102:27c8:b0:452:79da:94a with SMTP id t8-20020a05610227c800b0045279da094amr8993764vsu.4.1697022154194; Wed, 11 Oct 2023 04:02:34 -0700 (PDT) MIME-Version: 1.0 References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-3-apatel@ventanamicro.com> <2023101013-overfeed-online-7f69@gregkh> <2023101107-endorse-large-ef50@gregkh> In-Reply-To: <2023101107-endorse-large-ef50@gregkh> From: Anup Patel Date: Wed, 11 Oct 2023 16:32:22 +0530 Message-ID: Subject: Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0 To: Greg Kroah-Hartman 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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]); Wed, 11 Oct 2023 04:03:14 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11, 2023 at 12:57=E2=80=AFPM 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=E2=80=AFPM 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/inc= lude/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 ne= w > > 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/downloa= d/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() > > thanks, > > greg k-h Regards, Anup