From patchwork Thu Jul 6 17:38:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1804448 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=m3Y6eyOA; 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=ChscjS7x; 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 4QxkKb4pz5z20ZQ for ; Fri, 7 Jul 2023 03:38:59 +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:References:In-Reply-To: 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: List-Owner; bh=vFrAQT1Bolv/jCa0s8+UIsx/tLERWMfc7GhYyH0hV3w=; b=m3Y6eyOAV4cmJE VUMSHez2waAy7J4/kqKjUcvQdcde5ItAebtCFvphfutdh8JduwrfH0wBNd+NC3LUPE1SFlQBuFQ7D CsKOyw+P4dK3clDHxeSMrTyI4Bd1Ss1gZGw/pPILAZwJ+JJ6T3mC4OrnKwLQ5R2UJltfh8Iu5ZM9p htIdpbA81vsIAvLRYzimSUnF9GIBEfm0w2OqIBMlz1hzboJ6BjpurslKeZCUdmV705mXaMgm4xsQo JaJ0zhWngK6TnSohkjQOz+Al8rTer6q6SpXQz3HtBQS1lGb/cNd3f9w1VtpR2LhYG/aGXcIL7hpbu yM8ylq54qHIEDBL1+ZkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHSwS-002Ivw-12; Thu, 06 Jul 2023 17:38:56 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHSwP-002IvA-1G for kvm-riscv@lists.infradead.org; Thu, 06 Jul 2023 17:38:54 +0000 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-78358268d1bso33846139f.3 for ; Thu, 06 Jul 2023 10:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688665132; x=1691257132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jPQWdMrB3vJlDcEi+yFf+uGq+ry4kW1YJbGepQr4/gM=; b=ChscjS7xi5bWmvQTkCoaq5iCQEbC5OT6Xz3XIIzxZUMAfpHKTvMjKVhf6LQNlPdWj6 TH9OpwTyo5iLGye2nNSnWhH2GrlYlxzlvL2a7csv4BtK6aQQ3U4uLv5wqz7gM/VuTCsF UFA04oojXHHalyFp0TGhjDGUoiS/2IOq/StS/2uOMZ18LxqLyjc+ZtHHDjCorEoJD/k8 pKUbKswxqWsB8FVYwWGMM8q1Zy53vk5lAzdy0I9H49PKwHxHmVt5Pc/TemhIn0zBylD4 1dhOMdpJR5U4vCDN19mwnKJgyXT0YGDzgAVX8ZHytbaJzMcax1LksRojqcD/SlCUr8ZM +N7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688665132; x=1691257132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jPQWdMrB3vJlDcEi+yFf+uGq+ry4kW1YJbGepQr4/gM=; b=azh/KKQObPjAUmYP1VYiwLXBPWB4LufKHX5Ib1tz6n2NB++xMr++BslC+C5MqVieL0 LGHzOE0skRUpBI+UpRSRivdbQlcfXume95qXu29RtZK+LEefeWgC5urPAfDRUnZ2MmYs mRz3lsPbodwtKnGpni/G8MeXhyIxVCnnlvrZoYtODSzCH0OTWNeAYmloCXHmvAjwUJ0X ccICeudaVpcHqVvd6o/+8s0jpLFKqTXwrW3slD4YOLbcj8I3rBmXeuan+Rt7T7UCzwyi 11bw1T0UwMq9owzXBJZDAZZZ5EIOF7CIhZK/Y9F/A2bMkxgLMbV9s7eZ0pO39OMq4NnU c4bg== X-Gm-Message-State: ABy/qLbjmJ8BYqwMhnUs32yx4WZXOjbknB0nO5rRWM8wW9Q3qXDb5bSj duHoHOGXyxTfQiiHRiqT/qgXlA== X-Google-Smtp-Source: APBJJlFfZyjnNopBMKmNevv6TQ/29A1wln9nnX8dJFl55R0cckpdRWcJmQr4+RgdeLoztFzWF3cQKg== X-Received: by 2002:a5d:9e1a:0:b0:783:491a:13fe with SMTP id h26-20020a5d9e1a000000b00783491a13femr2743227ioh.5.1688665132238; Thu, 06 Jul 2023 10:38:52 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id q8-20020a0566380ec800b0042b70c5d242sm633528jas.116.2023.07.06.10.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 10:38:52 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH v3 5/8] riscv: Add zbb extension support Date: Thu, 6 Jul 2023 23:08:01 +0530 Message-Id: <20230706173804.1237348-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230706173804.1237348-1-apatel@ventanamicro.com> References: <20230706173804.1237348-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230706_103853_429418_BEFCB96D X-CRM114-Status: UNSURE ( 9.57 ) 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: The zbb extension allows software to use basic bitmanip instructions. Let us add the zbb extension to the Guest device tree whenever it is supported by the host. Signed-off-by: Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) 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:d2a 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 The zbb extension allows software to use basic bitmanip instructions. Let us add the zbb extension to the Guest device tree whenever it is supported by the host. Signed-off-by: Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index 977e962..17d6757 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -19,6 +19,7 @@ struct isa_ext_info isa_info_arr[] = { {"sstc", KVM_RISCV_ISA_EXT_SSTC}, {"svinval", KVM_RISCV_ISA_EXT_SVINVAL}, {"svpbmt", KVM_RISCV_ISA_EXT_SVPBMT}, + {"zbb", KVM_RISCV_ISA_EXT_ZBB}, {"zicbom", KVM_RISCV_ISA_EXT_ZICBOM}, {"zihintpause", KVM_RISCV_ISA_EXT_ZIHINTPAUSE}, }; diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 56676e3..8448b1a 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -34,6 +34,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-svpbmt", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_SVPBMT], \ "Disable Svpbmt Extension"), \ + OPT_BOOLEAN('\0', "disable-zbb", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZBB], \ + "Disable Zbb Extension"), \ OPT_BOOLEAN('\0', "disable-zicbom", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZICBOM], \ "Disable Zicbom Extension"), \