Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp609668rdg; Tue, 10 Oct 2023 23:21:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENFX0MHqwvaAB0ejP3pH4wlSCqpC4Xy84oUQ3ytbL+l2cYdYqDmfdBu5z/boUpsQuuCVai X-Received: by 2002:a17:90b:4a0c:b0:26b:4e40:7be8 with SMTP id kk12-20020a17090b4a0c00b0026b4e407be8mr17774969pjb.12.1697005265044; Tue, 10 Oct 2023 23:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697005265; cv=none; d=google.com; s=arc-20160816; b=njOk8Km5knopA2p3UQW94swAJu0B+i9ajvtXv8ea9W8rFbmsVURAj8Kws2+6q/Lbah OUe21t/YKAqD18S1+QuYmL8y8wVWUiNuCdUJAxhGAEZ96KMiSSEEyLLmI8X9RuArLvQT Iv0DTLvGCrQ9AOOU0zETHQAk6t5v3yYCx3moRkUELDd4g98lSkg8D2Fy1KQalz0xsdSd UxpqriswP3FOxdxHdC/WBK8QCvVTV5cXTef7CJ7bRMW8gnLa5y/EE73bW3APxZjI937O dkIXp/j19DleJMV7hIQeR/iclWPpjoyDvMxE1GXIPEkFD3n45C0qR/9bKM3ZajVQG71D 4orQ== 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=zcqMB30naFRgYdHZVjh4rWtjXZPaceEDVeZe+D6ZGQM=; fh=JyL8+fJr4BsolHUmcm+dYi0xCmNZZ71zno4Ij1nE8wE=; b=zL0y4Jyv38AZs1Gj/Jf9UmPMpoZ/KwSqXmJY2iIas4rRMOH9dkvVii14HYmCXbsi7a 0/araHwHuPlwAjERufmggoGe0BICfIdn3U+tzsR2hXcoGSjZZ8+p6vHsIr7y3JgNmUuy fKzDiz90EEsyic/YfA/Etv9izby+rFodHbLh1WsVEaL9mQ/PB1R0Vx4nvvjE1UtteALY EgYCKquxfcOi2VX6V7YH4pNwpXhKI8lVSlKlCLaKX7Dr9C5T7Su8hPDG0XSiVE9iaKYe 3TS57A4pAPw/EZ6/fxj2iM4kV2zdetyXAh14D+Gv4/z9nLnozWmxWmVkK8Zn8WvOyElB fCoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=oYPInmB2; 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ds6-20020a17090b08c600b00276571c0d34si2488571pjb.6.2023.10.10.23.21.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:21:05 -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=oYPInmB2; 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 036A68065E34; Tue, 10 Oct 2023 23:21:01 -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 S1344645AbjJKGUq (ORCPT + 99 others); Wed, 11 Oct 2023 02:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344777AbjJKGUl (ORCPT ); Wed, 11 Oct 2023 02:20:41 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44114D6B for ; Tue, 10 Oct 2023 23:19:29 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-692779f583fso4599751b3a.0 for ; Tue, 10 Oct 2023 23:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1697005164; x=1697609964; 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=zcqMB30naFRgYdHZVjh4rWtjXZPaceEDVeZe+D6ZGQM=; b=oYPInmB2+tfsY5VSLQcX+ksIVpEbszEojCThY8Thzo7e/kJT1tjvQmQuGKX6bkfQxc YzdllyGRSAA1pX5Xcw5qtIOC/UwlooyuihXTul6XnDIrJlT+HHeSHqyGP66XxK8OH0Ne 6RKkpFZgnsTX5PVaOBIbEz2LY02fkDWv5omF3P5UUtacxgRAuev/+wb8lQXKA3I3riHz 3E8wNsopkvnVyH6sxuDkrPbQlGgiJJM1qk2fpyLFWPohvYlFSknl55CJPEGaxWc7Gx2t ETUTh3zTDWvJA7ifiCpKdDBenNIMi2RH8cNtCmLn3biDF9xFyd22D3/AisXDNeMwxSj4 OEnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697005164; x=1697609964; 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=zcqMB30naFRgYdHZVjh4rWtjXZPaceEDVeZe+D6ZGQM=; b=OURYyeUMdTWvh9rH19f7EwCSIuZYmYKJ9OQ2XT2HCdrloLIy5WXGCArq9m0r3DZ3ut 8NDIo/R7KahcxO1RJ9ptO5H4Aw5VOu0ovvp7cg7MbGtF9cG1yJOp9lK5K5Xfaj0UWGQR 1p/fegCtMOvQ6RINOem272dOiTsWK51ib27OFnPNRTfI2+pXXfAJpv06x3tZ9DvnMjCT AKiucDUxv9PTonU41rSULixDnW7CdzCR1JPuYYOsWYNXdHy8ClikSgbONHUYUQktA4sQ jOuIDJOzJOIdcBlfNqDZxCwFwNznNZ8GLHzfllAp5fmYaRBqT1C4sBJ1hIvKCGYscObV y3xA== X-Gm-Message-State: AOJu0YzI6NPeuUVWXC24p3MXd02T4c4BNld7NpesKf/TrzqIwzx3TR2d V433zBreLCKpQ5yOCy0riHunQ+RxHcyozah2xN6HvQ== X-Received: by 2002:a05:6a20:4305:b0:15e:2d9f:cae0 with SMTP id h5-20020a056a20430500b0015e2d9fcae0mr20933619pzk.10.1697005164547; Tue, 10 Oct 2023 23:19:24 -0700 (PDT) MIME-Version: 1.0 References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-3-apatel@ventanamicro.com> <2023101013-overfeed-online-7f69@gregkh> In-Reply-To: <2023101013-overfeed-online-7f69@gregkh> From: Anup Patel Date: Wed, 11 Oct 2023 11:49:14 +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,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 23:21:01 -0700 (PDT) X-Spam-Level: ** 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/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/co= mmit-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. > > thanks, > > greg k-h Regards, Anup