Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15170777rwb; Mon, 28 Nov 2022 08:39:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gN3I7S/fHLkhAnjLp8461bDac3cqVSYgZHC5a8uhBpYQACBM9u/xPmoatLFhG1jJX351x X-Received: by 2002:a05:6402:4020:b0:461:9d22:348d with SMTP id d32-20020a056402402000b004619d22348dmr47319902eda.76.1669653566136; Mon, 28 Nov 2022 08:39:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669653566; cv=none; d=google.com; s=arc-20160816; b=BwJNG+D420wO8Ewr8MpK4HgizEyqyPSRq1EALnz+BBwqrTg2PP3DmoIRsnvrXa6JqI c/pvfcdzM/bnX54w5UYSoqhUXQZgPUEHSkvUcu+dCgU3YWvZxvPMI95uiatMxRDP0Mty ScfSr/TtRrgR6TTY1G0Rsg5Y02q9EotT0U2S8Int+OTx6OKB1EF/DPLZHPreEVBIZHel b71f/y+O12kzW+oAdKD9+Qsne+Ui9inbrCSOW2KnIlZ8/aA/hMs6XKUyYZ9WW8vRibW6 40vVZAe97T+VHUfqiONN0xb/H6WqxDCX9BUKTwokzu53Tp3kmn75xWTU/IYOJiN/u8da dx0g== 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=Jl4oXIilI+U2WdbMINVvxsI3t3kOFF7gSAjgWRgHySc=; b=Lq5QUnz+alWnnbBqlwvfLWMxGYQJoIhmJdjfHZvIpW//LFTMg7d1PJVIcBs7MaCuob S8fvDhwHLdX8xoJLucxcNjJM90zRzHyblE6/ske2kOKKiweB/v5RNIo5VjR0VmGUqQHy Vdcc168Gx2edQt1PFBsxEksMr90p6tuURHbdxC8yXdSpixOm8omgB1OcEJVh9DKXNzJS QCan8eoAg2zjtjVoGJFgcCZYPDmAl7VHoOXtCPH1A2ReT6ziTAgCmS4zVoYUmQaJ8V4X hJ95ZZaQp3FAr6Oe3CZRs8HdwGMPhX7tyHOmfywA3G/iU5BHPGVSbQzYNdSIy9ldjIKn 7aIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=e7h4lRGk; 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 b9-20020a056402084900b004626d7caf42si11630255edz.270.2022.11.28.08.39.04; Mon, 28 Nov 2022 08:39:26 -0800 (PST) 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=e7h4lRGk; 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 S232268AbiK1QOh (ORCPT + 85 others); Mon, 28 Nov 2022 11:14:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231343AbiK1QOg (ORCPT ); Mon, 28 Nov 2022 11:14:36 -0500 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 71F8526E9 for ; Mon, 28 Nov 2022 08:14:35 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id w37so5204798pga.5 for ; Mon, 28 Nov 2022 08:14:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Jl4oXIilI+U2WdbMINVvxsI3t3kOFF7gSAjgWRgHySc=; b=e7h4lRGktftITaQLTFzJ3h3z+b6fKmtXgpcRtyQhPTmm9uRphG0oxaHiHWzgzLtviL eUIhtUYdUK0r+OYubjIc3jg8LG87sY/9qZkb1iajOrwzz4MsCw4n4O5WgbrrH9bE5ZqQ T+rtaLeWg3Hqwd3D9EvQx2fw/hZqf+zpfUIyQulIdVGjrRKXPFXHlvxx0y+yVLwdj2QR XRiUEP4c7u0nG0efttC7ROnQgmzXYNy5eSMIySr3SjKmlejYMgwmgGYiu8fJiVWBoQ/F M0B4dPCBacWkxn+baKI8GzQQdtzCiEFH6t2MteqQmQZCxdCGeCCqUJzI83Lmn7imf+i5 11Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Jl4oXIilI+U2WdbMINVvxsI3t3kOFF7gSAjgWRgHySc=; b=mff87+P/+hIBBCCs4Xgxzb/CWy+pe3oUncrYX4GwBsx9gQ3VujkD79M90JQpx3TZRj sdYT2puJs/6kgS472WVC5Wp7DZ8xsf8iw25TtbUntlo2bmlCh4ImnvL+lbqq63A5x+MP Fk7q9VTwE4xPDS7RCes7y7FAc4EOpDRBxvjAlkikDFKRjdweb9DkaGv5Pn/O9CB1qXu8 qjxnaEb6e3ivYMfc/ZaSDoMtjzMEdnid9exjrR2QjpeCgyaU0Gun24c5klQ1dV3doetK isBOqjOnyNHFlssqeCztCS7kDccGSl9Vil35D1C1mfbf2+XKvf6wGU2To1XA4AprTO4A UtXA== X-Gm-Message-State: ANoB5pnqdjB18EnWzeKXj5MWes6iE+PbTpFZRsOIoPpeRj2X6/r1SzMm /7XZ4ti6nqABL1yDuPRYB7n6GQ== X-Received: by 2002:a63:d18:0:b0:46e:b0e3:ee46 with SMTP id c24-20020a630d18000000b0046eb0e3ee46mr27574846pgl.622.1669652074732; Mon, 28 Nov 2022 08:14:34 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.85.0]) by smtp.gmail.com with ESMTPSA id k145-20020a628497000000b0056246403534sm8210805pfd.88.2022.11.28.08.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 08:14:34 -0800 (PST) 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 0/9] RISC-V KVM ONE_REG interface for SBI Date: Mon, 28 Nov 2022 21:44:15 +0530 Message-Id: <20221128161424.608889-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 does 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_v1 branch at: https://github.com/avpatel/linux.git Anup Patel (9): RISC-V: KVM: Fix reg_val check in kvm_riscv_vcpu_set_reg_config() RISC-V: KVM: Remove redundant includes of asm/kvm_vcpu_timer.h RISC-V: KVM: Remove redundant includes of asm/csr.h RISC-V: KVM: Use switch-case in kvm_riscv_vcpu_set/get_reg() RISC-V: KVM: Move sbi related struct and functions to kvm_vcpu_sbi.h RISC-V: Export sbi_get_mvendorid() and friends RISC-V: KVM: Save mvendorid, marchid, and mimpid when creating VCPU RISC-V: KVM: Add ONE_REG interface for mvendorid, marchid, and mimpid RISC-V: KVM: Add ONE_REG interface to enable/disable SBI extensions arch/riscv/include/asm/kvm_host.h | 16 ++- arch/riscv/include/asm/kvm_vcpu_sbi.h | 14 ++- arch/riscv/include/uapi/asm/kvm.h | 22 ++++ arch/riscv/kernel/sbi.c | 3 + arch/riscv/kvm/vcpu.c | 82 +++++++++++---- arch/riscv/kvm/vcpu_sbi.c | 145 +++++++++++++++++++++++--- arch/riscv/kvm/vcpu_sbi_base.c | 15 ++- arch/riscv/kvm/vcpu_sbi_hsm.c | 1 - arch/riscv/kvm/vcpu_sbi_replace.c | 1 - arch/riscv/kvm/vcpu_sbi_v01.c | 1 - 10 files changed, 244 insertions(+), 56 deletions(-) -- 2.34.1