From patchwork Wed Jul 12 16:10:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1806873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=IjcaLZ0l; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=fGAuAcLo; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R1N5c3xplz20cD for ; Thu, 13 Jul 2023 02:11:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=uslLkZQR1iBZ08o2pdLT8ymdilmlA7GoaZ9BRZcIs5I=; b=IjcaLZ0lOmqox/ OrESkMQzlXNasFcWQsM+oCZlPrl5T3hhdQ7bbMJeJkumP2frmzjzjzXtHLtsyzVx2exaKYaonAZ1n 8X550vlVAG8sxXuCOdC5ey33kWlTXQZ+RLnGlRKNq85Z6s8GLMIiandR1kyu8E6L022pkhxH6YS/Z DB1Jrne38LeBGpicEo3ueivp7J2UUGcpP1JZb1hq4/4NLW+YdovEF2P7IMZNUzGbYldtQ7Nl3Caqd qRrbUXOQ7eapTsvyv8QcqgL+SxrcSrLjH5JQwz3HjOA/Wvlyi4R+ZFK0qxFa9OQY9cqSIKR84glLG SmkgVtInpOkqJw9K4Bng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJcQq-000TZH-2V; Wed, 12 Jul 2023 16:11:12 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJcQn-000TUj-1r for kvm-riscv@lists.infradead.org; Wed, 12 Jul 2023 16:11:10 +0000 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-51452556acdso4979048a12.2 for ; Wed, 12 Jul 2023 09:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1689178261; x=1691770261; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=P/gyHWRhdmt3W1ZOf5pRL6UNntD92OSXMXDmAzXvrNg=; b=fGAuAcLoInUfc0q3fFxWXNh784K2v5lXc+3MSoA4NM4bybLlq2A877Q95K6HPCvW9i S9PrgoE9ClCRf5R1/0nlUvszFDWskGWmxaLRyn6U+mvK6cGOHNG3QzCcA15MOd4qS2MD OJtKncBfjTZp/dtZdSfB6Y79/SxulIFkSPojn75EDVKeTnitLdCwvm2lEdtuzzfq/gqP WgwieP0Xy0H7L55RHFo3oyH4kuqlxT+6te6xDOc3zCzYjO3yerYeY6DGF8VaQC7y7Sjo udyKf12J7tGNllcGbv7sN3p3I7EUKSbpIMb+L6OF6oOhCDg1p7ZtWEyjTUOrd3JjZGPW EHRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689178261; x=1691770261; 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=P/gyHWRhdmt3W1ZOf5pRL6UNntD92OSXMXDmAzXvrNg=; b=O/sk74ahs1VwXpnYcencvawA5IzWlPihT+W9yD2FZ3sKn69Kz+V9TvD6jOl+6VdRv2 KlfHMCROGz614gwr3IEf3jjAq/qJG/wFNh1G1D7jp8hBN2RVmLl6ITD53cULtXEXO8Y3 oYtKDg6GRGsI/m+elJlQByeHEU9bQ1rbS2ni0VoSdIqqfNA+ayQTfFkl5RHxv1Hw94A9 F2z33IZmXA66o7WgMLvBJgJtf8tKi+/rblpF7B48RhIgTxXfAvg3xPZe/EJMzBCVTwUE VeegjbtdhP3chMarnRAs95rncn4FORXZYgTXIO/RpIbSV4oNXrGJmIjjItNeSeIQ4yO5 taVQ== X-Gm-Message-State: ABy/qLYrQTEoWXfSS7tYxfMc/rTz896b+/W9ix8R4waLJdeza2wdkr8f YgKoWbC6m6aj1IO8Cd32DB+COA== X-Google-Smtp-Source: APBJJlFJQ/muT40Pd9YoRXcgQ+QCoBx9dXiJIoyQqgXxxQpDnA04YVdYrtkec+9jLWPYZIUFBi9Fcg== X-Received: by 2002:a17:903:489:b0:1b8:6cae:4400 with SMTP id jj9-20020a170903048900b001b86cae4400mr15606614plb.37.1689178261471; Wed, 12 Jul 2023 09:11:01 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([171.76.82.173]) by smtp.gmail.com with ESMTPSA id bc2-20020a170902930200b001b9f032bb3dsm3811650plb.3.2023.07.12.09.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 09:11:01 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra Cc: Palmer Dabbelt , Paul Walmsley , Andrew Jones , Heiko Stuebner , Samuel Ortiz , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH 0/7] KVM RISC-V ONE_REG ISA extension improvements Date: Wed, 12 Jul 2023 21:40:40 +0530 Message-Id: <20230712161047.1764756-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230712_091109_618059_954E8837 X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This series improves the ISA extension ONE_REG interface in following ways: 1) Move ONE_REG related code to dedicated source file 2) Allow multiple ISA extensions to be enabled/disabled in one ioctl 3 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:534 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This series improves the ISA extension ONE_REG interface in following ways: 1) Move ONE_REG related code to dedicated source file 2) Allow multiple ISA extensions to be enabled/disabled in one ioctl 3) Add more ISA extensions to the ONE_REG interface The series has following dependencies: 1) PATCH6 depends on https://lore.kernel.org/linux-riscv/20230712084134.1648008-1-sameo@rivosinc.com/ 2) PATCH7 depends on https://lore.kernel.org/linux-riscv/20230711153743.1970625-1-heiko@sntech.de/ The PATCH1 to PATCH5 of this series don't depend on any patches. These patches can also be found in the riscv_kvm_onereg_imp_v1 branch at: https://github.com/avpatel/linux.git Anup Patel (7): RISC-V: KVM: Factor-out ONE_REG related code to its own source file RISC-V: KVM: Extend ONE_REG to enable/disable multiple ISA extensions RISC-V: KVM: Allow Zba and Zbs extensions for Guest/VM RISC-V: KVM: Allow Zicntr, Zicsr, Zifencei, and Zihpm for Guest/VM RISC-V: KVM: Sort ISA extensions alphabetically in ONE_REG interface RISC-V: KVM: Allow Zbc, Zbk* and Zk* extensions for Guest/VM RISC-V: KVM: Allow Zvb* and Zvk* extensions for Guest/VM arch/riscv/include/asm/kvm_host.h | 6 + arch/riscv/include/uapi/asm/kvm.h | 35 ++ arch/riscv/kvm/Makefile | 1 + arch/riscv/kvm/vcpu.c | 529 +---------------------- arch/riscv/kvm/vcpu_onereg.c | 695 ++++++++++++++++++++++++++++++ 5 files changed, 738 insertions(+), 528 deletions(-) create mode 100644 arch/riscv/kvm/vcpu_onereg.c