From patchwork Fri Sep 20 07:39:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Hsu X-Patchwork-Id: 1987719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=xVdTeh1H; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=N7Lf+oxg; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X945q4sHgz1y2j for ; Fri, 20 Sep 2024 17:39:27 +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:Cc:To:MIME-Version:Message-Id:Date: Subject: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=d0axyXwugNh26bChIWFd9aNK+nR2iy3gOUknYoSaHjI=; b=xVdTeh1HBubIvT FZf8t+scSOWbuhhPXiczVSF9SXxKavH9Z++TlT1qeqx8mSNLgtA3bNACX6xTazIaZa0+SYlHZRSOS yaKKF7erhef+YlkawQy3vjxBHPfejmIYOZ1JB7V1OpQUCLso9oPS6blvKIVjPPrpPzLkxf9MdgmHn S8iHJLO1BXdsGiH5RzZfrnA2I/s6gZKl9xvxH39Tmf7t7rk9UYTZpz7sy6rpaOfX71UZPwLHipJDb POpLKgWNhhoqCLX7Uk7bplQIlUXE7uTMffRjws9CPde11PwNG0ps8dZ29c223vKtIIzQh/iYAqrfp HZBQcaqwyQgDV6KPvvrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srYEg-0000000Bda4-0cwX; Fri, 20 Sep 2024 07:39:26 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srYEc-0000000BdYM-3LUw for kvm-riscv@lists.infradead.org; Fri, 20 Sep 2024 07:39:24 +0000 Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-2068acc8a4fso17841835ad.1 for ; Fri, 20 Sep 2024 00:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1726817961; x=1727422761; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=Nf3ped5+15OxXfhvvUNIJcQRjiOx4BGk5AuoceNg+i4=; b=N7Lf+oxg7+GTvrE83rD6b2WqTJXnjK2vFKgo5w5eiLuQwFRI/ampWCMXrA2ABggv+c 64G1UFzB49R3cgRA2oLxEE0wYH5O603dH3Yk3SVZBVZ1PXXgGD913A+UHkmY16JzMaaH DQXVNPw+fV04LXVuqIQ4urvnn2tZPYjmJn1aVN79h/OeP9nRxZl6CeRylyXdf7jLN7Bz byOKG0oEh6zs4hmeR3z9ASLTWzxvxErIW5rVxe/+G5HjD/wb5uRvSmyd2YBZRPCpj5Pu n8SbaAi+80XGCN27JBt6jUlQ5HfSE7ClkEs/1BGGwr2B1mciKl5zilw9U2KWBNdiFYGV k9rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726817961; x=1727422761; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nf3ped5+15OxXfhvvUNIJcQRjiOx4BGk5AuoceNg+i4=; b=l/3nUh7pH+OLBQMItMHRmHloV+qUV9GdyX12q6623xvYvHfBVCWbxtpO271mLl2hQA ko84ubenn6lREmd1UkZShE+QPRY3VXbMgpgwkJSONqwXmKofdhxJMmVPll9QGR9MDfcI zj7QE8o/OVWqOgOXU/DC98WcSn7whjvRWAKZcChn0YkS4yQqsIbyt/9v41E/8W88HAeb xIhkeuV1O5GXYaa565yu4zGgiJ8FdHiFkw42PxNeiQmSjW/6YRM8Cl7ZisELvO5d3KYW VRKeaDLFQgvFLC2UHVzXT8ke8SIZkt2hfhSut9pUKKZUGzCAeFTxALKhQrXuwp4VJhQb A3Rw== X-Forwarded-Encrypted: i=1; AJvYcCXjNC7nE2hbPf+uMbo98n/0OEU0vubmg+kQZwc2+iFIY/dkIi8jCc9juh8Vuox0pqw0OG9hzJwdbNk=@lists.infradead.org X-Gm-Message-State: AOJu0YwRdwJZqAXo5tZ0Mo7iRagfK7FA7h4bdjAcZDAIxTJ+om9ni5kJ gydeQNwYcbpIrl2qB+QoY7N38e/kqbmTNSAaoBBJ9L1Y9R9jIMsoKeB36F3Blhw= X-Google-Smtp-Source: AGHT+IGji56j1DV/J1I9lAcA6e9jkM58L8PolAkDBK4wsHtukfvFBHCha1GFixMZFOiVijx3Nngwww== X-Received: by 2002:a17:903:11c4:b0:206:c5ec:1444 with SMTP id d9443c01a7336-208d837462fmr36316815ad.16.1726817960890; Fri, 20 Sep 2024 00:39:20 -0700 (PDT) Received: from [127.0.1.1] (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-207946fcaa4sm89645805ad.212.2024.09.20.00.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2024 00:39:20 -0700 (PDT) From: Max Hsu Subject: [PATCH RFC 0/3] riscv: add Svukte extension Date: Fri, 20 Sep 2024 15:39:02 +0800 Message-Id: <20240920-dev-maxh-svukte-rebase-v1-0-7864a88a62bd@sifive.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJYm7WYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDSyMD3ZTUMt3cxIoM3eKy0uySVN2i1KTE4lTd5FRLs5SkREtjYwtDJaD mgqLUtMwKsMHRSkFuzkqxtbUARSxKLG0AAAA= X-Change-ID: 20240920-dev-maxh-svukte-rebase-ce96dba93381 To: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Max Hsu , Samuel Holland X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1407; i=max.hsu@sifive.com; h=from:subject:message-id; bh=wS0y3XnmRUgkhuicGsT5+NS3O6xPNm1UKgT3dPtkY3g=; b=owEB7QES/pANAwAKAdID/Z0HeUC9AcsmYgBm7SalrbPVcOyg6Y+vrkFjoAudGNjFqNsRSXPO+ jnEQWPDgFOJAbMEAAEKAB0WIQTqXmcbOhS2KZE9X2jSA/2dB3lAvQUCZu0mpQAKCRDSA/2dB3lA vbSwDACoWoQWKUmsoCUtXySuCDJr4EmIadcA2PF5Gfb05zGyIyYvaamuPRF78Hs9yg5wxMS28pH uUGXmVHrnBkbdfS7Tv98hZ5z2M3oliNBA7U2ftPWttl3RadTUTx/6FepAh/ORpls2BawbfFgFS9 Rr9hm99cmywhbgpZUyAz5qKeY3eH92XFaVQk2WxaNypAQemjT5sgLm5h6rgNzHI8K92oDp449h2 v+4/xTDrtGTL9LCyVcAJBRnq9AiRzFW1V7f9dbUZpwEpNX4UMTKZY/N/EwgCYoPUAN98B/LYS5F ClA0u20GecZsZbsRHVI9lyKjnC5R7Ge20io4EzxXCYit3twSQ7h2msP4EXBYqL9K84xQv/OZb9C 2S3dkyfhhnJdkOFPgmDEwTZKHlwPe7cTp5l09WIokK8TwOHP64CwubKuo4z5049KMYYXpn0IVn2 B70xbla3aEDyFfRLMHtJHZ8GgS144ICtRNsLs62i5Pw6kZQahjfIwbYJFhU9bzS/LcYKA= X-Developer-Key: i=max.hsu@sifive.com; a=openpgp; fpr=EA5E671B3A14B629913D5F68D203FD9D077940BD X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240920_003922_854408_560D3F47 X-CRM114-Status: UNSURE ( 7.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) 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: RISC-V privileged spec will be added with Svukte extension [1] Svukte introduce senvcfg.UKTE and hstatus.HUKTE bitfield. which makes user-mode access to supervisor memory raise page faults in constant time, mitigating attacks that attempt to discover the supervis [...] Content analysis details: (-2.1 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:642 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 RISC-V privileged spec will be added with Svukte extension [1] Svukte introduce senvcfg.UKTE and hstatus.HUKTE bitfield. which makes user-mode access to supervisor memory raise page faults in constant time, mitigating attacks that attempt to discover the supervisor software's address-space layout. The following patches add - dt-binding of Svukte ISA string - CSR bit definition, ISA detection, senvcfg.UKTE enablement in kernel - KVM ONE_REG support for Svukte extension This patch series is based on v6.11 Link: https://github.com/riscv/riscv-isa-manual/pull/1564 [1] Signed-off-by: Max Hsu --- Max Hsu (3): dt-bindings: riscv: Add Svukte entry riscv: Add Svukte extension support riscv: KVM: Add Svukte extension support for Guest/VM Documentation/devicetree/bindings/riscv/extensions.yaml | 7 +++++++ arch/riscv/include/asm/csr.h | 2 ++ arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kernel/cpufeature.c | 4 ++++ arch/riscv/kvm/vcpu_onereg.c | 1 + 6 files changed, 16 insertions(+) --- base-commit: 186617d883560848f801732bfecefa0c2f702a0f change-id: 20240920-dev-maxh-svukte-rebase-ce96dba93381 Best regards,