Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1420323rwl; Fri, 31 Mar 2023 10:50:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bTOzq+NP2LqGZ7rzKDZa5Fw5VnwNbKycgmFG+Vo0zlcWaEprsueTJe0ffKjYY4WHOU9hVj X-Received: by 2002:a17:902:da88:b0:19d:2a3:f019 with SMTP id j8-20020a170902da8800b0019d02a3f019mr7268828plx.1.1680285032487; Fri, 31 Mar 2023 10:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680285032; cv=none; d=google.com; s=arc-20160816; b=QpYymt6ImA9R1GisEPS5YM7N+J3clGZ7JaVla00qM1eZO4vvEG+0V5kuYOt2kSDX7b //i1DSJMYWreo0uiVIHFu9X0D44ro/tMfRQJkHv+AZm9uWJ7194g8fOAnKcn7VZBZXRS 9POnFWjAvuilWIxpykKy+pjl3CylPg+qvOAuJ9TmkGbNZ5ix/UauFKnIcH5nY9A/ObTu z3lM90OH0s2qBG1mQAPYMqYWCHddmFHhbsw78/Aa1eYJV/snAzJhqWY4Ve8NUrOnF1Pw U0Z83Y2PaIgNdtgidR340NzWLZlbBb85cwpw138LN+O4yDhDmdte7wc4+FX1/f+jzmiZ 6FBw== 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=QoHEj/XaVMrYODDwsIv3pUiYWBKTCAt/9DW5FF1yPGU=; b=i6BI3Ota2vPyaQsFTlo3tx56dBOfBlP4ImUgPnsLj7QOXsY/c2PrZnIQGQeTW64EoI jPIARLx0biQ/QeU9amrMmHCmWvst5fOhV4zDmRf9iN8WaG9RlqXkqp3w6EUQa4giGox8 QchKQBE5l84cQ/Dts8xpik535Q5ADkdoDWtFvwQQaUECL4f1sgWLiYFDN0zquKY2d3RN Es7EX51uR9JpmxMFB4XLXdn4zBb3Yp6/qhaKYZ0mYAOZXMfZYJocxwy+HDJ7vXyiQiJY Tr8MaBWe5aIoWlofh7nb33HU020ZLA7NpB21ahrIbf5+HqFgwmCf9RgHL+mi7nCZregv RUsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="lH/bQ9n9"; 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 gj23-20020a17090b109700b0023f3f30482bsi2606211pjb.138.2023.03.31.10.50.19; Fri, 31 Mar 2023 10:50:32 -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="lH/bQ9n9"; 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 S232429AbjCaRqA (ORCPT + 99 others); Fri, 31 Mar 2023 13:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbjCaRp6 (ORCPT ); Fri, 31 Mar 2023 13:45:58 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4DFB2221C for ; Fri, 31 Mar 2023 10:45:57 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id q206so13882594pgq.9 for ; Fri, 31 Mar 2023 10:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680284757; x=1682876757; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QoHEj/XaVMrYODDwsIv3pUiYWBKTCAt/9DW5FF1yPGU=; b=lH/bQ9n9gJdd02yFVctKPMa86VHkqXM8Ocliwa6VG+FvFHiYgR5AAZt11nq31SwgZP O7EgeY84Ar56xdrVYLkB7bIs6ZpHGXA4CQB7i+ZkeNbDoKJioB3FXKIY35z1hKrpT/r0 Ch7QkjOtaqVc8mvf2LgY6cCPM05vXWSPjOGyRfPSdbvbMlI5ZOdbSw3kMwhUmaeJUUQU 4zT7bEn29fjEU7/C7BsieueLxeezVbV/BwgJaW2HdbKD2O+a5EuB92fbQXT2M3oVlyoD x3v9tEhCjru8IQlPGWVhUfnKwwGdmNm+5e9338klW4+cN6L3WPAuAIjpkksZcCAeWVAA B2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680284757; x=1682876757; 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=QoHEj/XaVMrYODDwsIv3pUiYWBKTCAt/9DW5FF1yPGU=; b=jS/9GR/nQBY0G0etE7McAXyxmgg4ge3n83uJNN30u9SZT/g0Lp3IikEhnZzzNxIACh /udft+wKNBngTipCwcWYmhUDkrvHsWf1GG0VZ7gN79R05Es1+66hCrOyCctIXAGVhvqa 2lQ55DmH0K2ij4uCIP68Swvuv/16xSAyU/G4/SuVpTmzSmWMrnv6zQeWv+Udbwl0gj0x 6hmqaX7vM8Sf3g5vOqoChhKwd9epAPaj/7v74pMu4e7UmAntrHbwJP5OOxH9h6gxR1WX otvmv4aSz7c9tZR3byfyl121WA3VMiMTFvsyvMVhX7sCo2II9YV05lNntuD8o5KJV/4m oZ3Q== X-Gm-Message-State: AAQBX9eF0CbVsW55Spm0Uge2yZou2G4NKyJeTxAPEbNDERXh2Fsp6vU7 HUUvZRzZ+DClCRRaFIiFlOeVcQ== X-Received: by 2002:a62:524b:0:b0:62d:e95d:51a0 with SMTP id g72-20020a62524b000000b0062de95d51a0mr2439275pfb.13.1680284756986; Fri, 31 Mar 2023 10:45:56 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id y19-20020a62b513000000b005ae02dc5b94sm2043143pfe.219.2023.03.31.10.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 10:45:56 -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 v4 0/1] RISC-V KVM ONE_REG interface for SBI Date: Fri, 31 Mar 2023 23:15:41 +0530 Message-Id: <20230331174542.2067560-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_v4 branch at: https://github.com/avpatel/linux.git Changes since v3: - Added missing switch case for KVM_REG_RISCV_SBI_EXT in kvm_riscv_vcpu_get_reg(). - Return a bit mask of disabled extensions for GET(KVM_REG_RISCV_SBI_MULTI_DIS). 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 | 4 + arch/riscv/kvm/vcpu_sbi.c | 247 ++++++++++++++++++++++++-- arch/riscv/kvm/vcpu_sbi_base.c | 2 +- 5 files changed, 274 insertions(+), 19 deletions(-) -- 2.34.1