Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp291711rdg; Tue, 10 Oct 2023 10:17:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFt6Imu//QpCCk+nZgN/QwS9Z2bbRHqfQalWsTpNmMWYE/85VOKqOP/I3+oSGm+S5ZtPVGK X-Received: by 2002:a05:6a21:66c4:b0:171:e3b2:7d52 with SMTP id ze4-20020a056a2166c400b00171e3b27d52mr2613079pzb.59.1696958241556; Tue, 10 Oct 2023 10:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696958241; cv=none; d=google.com; s=arc-20160816; b=DpPMwTIljMJVh+4xdkX9fQjwe4rbjZntJplbzb3fV6xdKxucdmxqT6zTe9hNg2BrzM IN1vhRk9+HU7GQuLNmC9CMo2m7CIhM1qySQiY8sFOb9Ob+bxshR0xFxmF6XHCD8/MfQH im0N7mqoSN4dyzlR8SurPXUc0IIp0Uf82tfb+BlnR+W4L0vqmL4Yj2cbUZUNoB+6yU6y SkSC4IkMpH48/Jyl0ck/X9llhvmZbFsq2xaO1qFmcQr/m5A0i2i7FUQTICd7TjFFs33X +RgBPbKI+3Pl1yq+yQP6z3u3tVp1+jaT4m1TPGSB8H9+hVdpeHBkikS18jpyp6NIXlhQ HuNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SzKtiea0KNqVnF94ChCZSeIKOpkPDueWa5JhO03wcVo=; fh=NKFL920pUMQopkg1dKfCPq22lKBlLOlyPGUlM3IaF/I=; b=mdHP4y4/T8Nty36aq/H0Ifhnlc2Qs5jbX00G3QM8IXPWnyhfQBKTkzhjo4oGDnyRPc C7OXV0L6l5WSGZGoIQuMzlxfBlXW5poQZK3xTRgbzg8MjRkaSS2NczLVr1rscDRTqPsN H8kh+RQ0mME3utI3Cc5mo90+bEfWZ96I6dPkYqq8CAIGATOXNt2s1HN0jDNwuy9Yr3ou QyekA2tTtbGsgCwQfR2YqCsdRWsIk21TM8RKGIRY43rUpzgBvYH/f9j7AQJ2bNEV4TyH fmP1dtJNXlORnHp1Zgr8YdkBFQc7co/q4rJPTtbdrKiU1wPKwc5HIyzOemo3CSH94J4Z Vpag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kdZiTe7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h7-20020a056a00230700b0068a3cb58334si10273349pfh.320.2023.10.10.10.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 10:17:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kdZiTe7H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 13C2080736B0; Tue, 10 Oct 2023 10:15:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233927AbjJJRPo (ORCPT + 99 others); Tue, 10 Oct 2023 13:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233824AbjJJRPn (ORCPT ); Tue, 10 Oct 2023 13:15:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 558638E; Tue, 10 Oct 2023 10:15:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F03DC433C7; Tue, 10 Oct 2023 17:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696958140; bh=zjSBxk6UATy9y4pqLcR+ifaY1dYuZQpAMHpPto23JUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kdZiTe7HCo50JWD0c5xwApJlmA9waTfbHKBmCL81h7/HGrq4Cm8fJxyWIYw3pemxr r6Q7kWEFiWquLyBo30s1WMkjWM0VnBmGyDUJnb7X4iGGqYbdWxUnY+UMyQOHkZj8CB MQj4XFDDpT/q2vtHSuAn2tBPx9taEVwTSaFuCWwA= Date: Tue, 10 Oct 2023 19:15:38 +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 3/6] RISC-V: KVM: Forward SBI DBCN extension to user-space Message-ID: <2023101048-attach-drift-d77b@gregkh> References: <20231010170503.657189-1-apatel@ventanamicro.com> <20231010170503.657189-4-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010170503.657189-4-apatel@ventanamicro.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 10:15:55 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 10:35:00PM +0530, Anup Patel wrote: > The SBI DBCN extension needs to be emulated in user-space Why? > so let > us forward console_puts() call to user-space. What could go wrong! Why does userspace have to get involved in a console message? Why is this needed at all? The kernel can not handle userspace consoles as obviously they have to be re-entrant and irq safe. > > 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, You just broke a user/kernel ABI here, why? thanks, greg k-h