Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1007515rwl; Fri, 31 Mar 2023 05:41:10 -0700 (PDT) X-Google-Smtp-Source: AKy350bhBoScCERfEn/N5HX0RaF0XH4KYIYsMe5jKmoW3RaD1K1+6dUOu4kAsT62Ktd7ZBRUwrX8 X-Received: by 2002:a05:6402:2803:b0:502:e50:3358 with SMTP id h3-20020a056402280300b005020e503358mr6435151ede.3.1680266469610; Fri, 31 Mar 2023 05:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680266469; cv=none; d=google.com; s=arc-20160816; b=CQqy9M1HY0vMaHLzCzwaYYEoceZbxvPrg5Qsk5Y3trnJ1tcTxKYJrUTfS32c1Fp/Dm 8Ps4JJ1y9G+FPsML0QoAlnzLkXCGrgq05OHVsVstXAsNaXZ3viohQjCYbT+9dxLzbsKY sHX5jtCN/V54XZaDVAXIUpleUffgZ573jyixq/3W8nadKv1MN7m2Gfb+CY/m1MozAQ+m nYOh3LfYds46qeWFygCXlFi6TcASCN/xOIm9fr4rmhylWNL11p/6ZnrQe9UGsYikdxQJ rxz/oERK7WlEvdhX1bHAbAswEu14beL48RV+VZGlVn76wpBqApx/SJkKD6x3C84MIlm5 XOVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9WubBxQcFlbrCivsI8ygmIt3wyTH8vV0otzELm2BxuY=; b=gGE8AtaV3K4ukxlJx8L4iwN57qkyAaQDTICqXFU0Wb5qylPS6+jdO9aYstTVVAblvv Z7OsRPr+FYXHi8CM1BeAki78qKjEyJaulNIY3z2sl9F8srYEJNdfEulWym3ASzyT6t6H QfB5xbmWrLIsiLpErZpBK/hXfOl6bSiO3KyAVR3zp8EDewXjNmkGF1qoQwBP8HZln3Kb mtDQpHqBVltuJh2mZHTwd5IGn8kniCtxLnHKE00paSoKA6u6BvXgGu8EJhtTyEvVGs5h uWGyHdCzxrQE+3/prxyIPBv2+2QR1SyztuZ2kuPayVNMUheQbjdd89sH6zVFvUJFLz/G euDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=S8SEwMex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c24-20020aa7d618000000b004be12ce8b1fsi2351466edr.438.2023.03.31.05.40.45; Fri, 31 Mar 2023 05:41:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=S8SEwMex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbjCaMj4 (ORCPT + 99 others); Fri, 31 Mar 2023 08:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232256AbjCaMis (ORCPT ); Fri, 31 Mar 2023 08:38:48 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73DEF1D2F9 for ; Fri, 31 Mar 2023 05:37:09 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id le6so21073174plb.12 for ; Fri, 31 Mar 2023 05:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680266229; x=1682858229; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9WubBxQcFlbrCivsI8ygmIt3wyTH8vV0otzELm2BxuY=; b=S8SEwMexthg418jcoc/l0ZCHyde7NLs7axCIcKNjXn6/pDmhwVH7MN1pRPCb78KzNa FDVWax2ZvK8RuMsbxJ9XKNWUkQDiXGIfqxohzOe3qHDrdZwZTqMl+J89OFKRme09kbun 5ZSa23mTHJibfrCSRY2z0luvXS3fkAqg0B4rjFpGnOUGPnQBReNCO4bYrpRSW0GYmJPK en1NRd3WTFXOB0T0egm20HwRfpWcMnspTvUc0tcufRTjHCDCQ/hFGn2QKMIXn0/a9082 HclH91MlF0fbpypjtJh9lqtcA6+52YstOjrNZ+KXLwD1896ipDTHN6Ixdn3a+V1Ym1ku q0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680266229; x=1682858229; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9WubBxQcFlbrCivsI8ygmIt3wyTH8vV0otzELm2BxuY=; b=YBOJNkIoWQfVk5XmPfVuyoeGBxzgLHE3wV8fEJ6IzNGN6nIfQS9Hd3UT0OJLkTk70B c3DN9hazPhBz293VfEEq7r12bcbQp9YHxDUL9vwwMIfkOK1POM21C0UcW0PfKqRoor0v 5XzOW+vSRsZOtnl63Fp20NY7VMF7enZFmqmwl065z0XhJ4mISU1v5RX7bxgvgQz89nYX 8vGsyv16dEYSDGYx0PKvuOn4MvHBeKLsa5SG9W6OzNPt9KGX5EyvWy7W1BlQtE/V9/m+ jWNcGLU2Tl7NwcmkyrgyFq4YX7/rOuDT2A/xapNvEP+LZF2Bu8go+8mInWmnew41yw/N Z1CQ== X-Gm-Message-State: AO0yUKUqjFUzwfK3m5zS4qJ9WhGJo0p5CSYdVC40vqseh1VmT1Zr5BJy 8F1Q0Z15EijKGEIjBlEeT5ZpKw== X-Received: by 2002:a05:6a20:4c2a:b0:d4:f108:d8d0 with SMTP id fm42-20020a056a204c2a00b000d4f108d8d0mr22359696pzb.36.1680266228643; Fri, 31 Mar 2023 05:37:08 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id c2-20020aa78802000000b005a8a5be96b2sm876470pfo.104.2023.03.31.05.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 05:37:08 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra Cc: Palmer Dabbelt , Paul Walmsley , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v3 0/1] RISC-V KVM ONE_REG interface for SBI Date: Fri, 31 Mar 2023 18:06:54 +0530 Message-Id: <20230331123655.1991260-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series first does few cleanups/fixes (PATCH1 to PATCH5) and adds ONE-REG interface for customizing the SBI interface visible to the Guest/VM. The testing of this series has been done with KVMTOOL changes in riscv_sbi_imp_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_kvm_sbi_imp_v3 branch at: https://github.com/avpatel/linux.git Changes since v2: - Improve ONE_REG interface to allow enabling/disabling multiple SBI extensions in one ioctl(). Changes since v1: - Dropped patches 1 to 8 since these are already merged. - Rebased on Linux-6.3-rc4 Anup Patel (1): RISC-V: KVM: Add ONE_REG interface to enable/disable SBI extensions arch/riscv/include/asm/kvm_vcpu_sbi.h | 8 +- arch/riscv/include/uapi/asm/kvm.h | 32 ++++ arch/riscv/kvm/vcpu.c | 2 + arch/riscv/kvm/vcpu_sbi.c | 245 ++++++++++++++++++++++++-- arch/riscv/kvm/vcpu_sbi_base.c | 2 +- 5 files changed, 270 insertions(+), 19 deletions(-) -- 2.34.1