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 04D0AC5B543 for ; Fri, 30 May 2025 19:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tkiGcg9Pp6HB9HenrxwiWzm/IMuLvXwvBc2ohIpTcuU=; b=Og7mx+4OJrk+Z/GggqtjLkIi6a cJEe1waiwqY0iqKpY8w866bbAD95uK915xqmI0nCTd+k+oMkqBokZ/0wfSsEo5tmKlNUqCa3vq5gG 5dJ/PiYVMKdVYnhIU+oRfNDaM5WC+YxMx5IbCPQDGThJnnY7wSAS/z+WC2smzqcXCABLq0cNZ5RLm LpKmZ/bsxxMruhFf3EMUPlpcy/K8ZGSMqHiSryQtmijgS+VEtSzoI/v0e2GE3/5poz0K4wU+qX1zY qYut8zzoOz2oNRalkSIcadGq/MUayl8oyRYJOurcwY2Ehf5dHz94wf7yvoaLSKQCA+UWBstAB1vjJ U4o91Ycg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uL5SM-00000001bvR-3tcC; Fri, 30 May 2025 19:31:54 +0000 Received: from out-171.mta1.migadu.com ([95.215.58.171]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uL5QD-00000001bSI-10Ic; Fri, 30 May 2025 19:29:43 +0000 Message-ID: <0dcd01cd-419f-4225-b22c-cbaf82718235@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1748633376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tkiGcg9Pp6HB9HenrxwiWzm/IMuLvXwvBc2ohIpTcuU=; b=qejIatAl3IVBpVjd5b1sjdObGZ7rJABj1bGentvPoaT9Gk2nMpl/NODNwtlNVuxD7mIwiW xTQUdOt6Gu3DaCC7BjJCdrWEHh521evt/yWAJJhiesYDNH5GuqToxdnr9DVQXVDc4uDjZ3 Hq4CVYV8tCgSZSBhWUbuMlqAshgB7wA= Date: Fri, 30 May 2025 12:29:30 -0700 MIME-Version: 1.0 Subject: Re: [PATCH v3 9/9] RISC-V: KVM: Upgrade the supported SBI version to 3.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Andrew Jones Cc: Anup Patel , Will Deacon , Mark Rutland , Paul Walmsley , Palmer Dabbelt , Mayuresh Chitale , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv References: <20250522-pmu_event_info-v3-0-f7bba7fd9cfe@rivosinc.com> <20250522-pmu_event_info-v3-9-f7bba7fd9cfe@rivosinc.com> <61627296-6f94-45ea-9410-ed0ea2251870@linux.dev> <20250526-224478e15ee50987124a47ac@orel> <20250528-ff9f6120de39c3e4eefc5365@orel> <1169138f-8445-4522-94dd-ad008524c600@linux.dev> <2bac252c-883c-4f8a-9ae1-283660991520@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Atish Patra In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250530_122941_810180_9EF1482A X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/30/25 4:09 AM, Radim Krčmář wrote: > 2025-05-29T11:44:38-07:00, Atish Patra : >> On 5/29/25 3:24 AM, Radim Krčmář wrote: >>> I originally gave up on the idea, but I feel kinda bad for Drew now, so >>> trying again: >> I am sorry if some of my replies came across in the wrong way. That was >> never >> the intention. > I didn't mean to accuse you, my apologies. I agree with Drew's > positions, so to expand on a question that wasn't touched in his mail: > >>> Even if userspace wants SBI for the M-mode interface, security minded >> This is probably a 3rd one ? Why we want M-mode interface in the user >> space ? > It is about turning KVM into an ISA accelerator. > > A guest thinks it is running in S/HS-mode. > The ecall instruction traps to M-mode. RISC-V H extension doesn't > accelerate M-mode, so we have to emulate the trap in software. We don't need to accelerate M-mode. That's the beauty of the RISC-V H extension. The ISA is designed in such a way that the SBI is the interface between the supervisor environment (VS/HS) and the supervisor execution environment (HS/M). > > The ISA doesn't say that M-mode means SBI. We try really hard to have > SBI on all RISC-V, but I think KVM is taking it a bit too far. > > We can discuss how best to describe SBI, so userspace can choose to > accelerate the M-mode in KVM, but I think that the ability to emulate > M-mode in userspace should be provided. I am still trying to understand the advantages of emulating the M-mode in the user space. Can you please elaborate ? I am assuming you are not hinting Nested virtualization which can be achieved with existing ISA provided mechanisms and accelerated by SBI NACL.