From patchwork Fri May 20 04:45:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1633678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=AXKUsHC/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=brainfault-org.20210112.gappssmtp.com header.i=@brainfault-org.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=rHGeIWEi; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L4Dgw3bjGz9sG2 for ; Fri, 20 May 2022 14:46:04 +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:Subject:Message-ID:Date:From: MIME-Version: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=xVNBKoXRUcn1k/nMzvnttgFvHUhR3iQY4oxVBYntIPM=; b=AXKUsHC/O3z1CE klRaebNoNLI8CPgqE8IdA01mkhR20Xco9kfREQ8SPX8EGkcLfdNiFDz0b6doZDvgb8ABct35BsU1o PV2Kku/h+6Me/+7NJ34qFzvjC7KJ97bZi1haotHe4YXPu2Uk17xkZmANfok5SJyBx2mCV6IDc/mQi 5IcM+wEmLEMgT6RNasEYju9L+YE9+cpuNxGs6SLN/19OfXu3MyZHy0qOCs/TFFFwyHbGa1zeZTq7O y80ZvB/NJWPgIVz8aTEjsnDkocdw1dBgkksltBCPC81Kaab3Sb2/TcNOg2J62P+VI5sWiqXI48iyC Io4ECCEefds+HWiE7EQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nruWU-00AUOL-SB; Fri, 20 May 2022 04:45:58 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nruWP-00AUMC-Sl for kvm-riscv@lists.infradead.org; Fri, 20 May 2022 04:45:56 +0000 Received: by mail-wr1-x42a.google.com with SMTP id f2so9894870wrc.0 for ; Thu, 19 May 2022 21:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=plxhMmUf+EvrQhTteZUdGqmGsuCJiqfW555AYN0K1E0=; b=rHGeIWEiwBE+lSiR4XwwNpQnDwaCBZYNHDs8N6RWS/7S5MICOMEcgkGeRFHDCI6lxL 44V/nfAUvhDw1LX3+6DWiWH9cGED7wKMjQIfN1bn3XnTRL65I5d3M6ekdZYwdZycu8ex c2FxE8futNYQbMqcJv57mK7n0xOyviklalXZN44ICgvtc0rQRcYHhV1nV4u3RuPd5m6f bnEV4AqGSpOucEwLBVI2QVlWzelZKCzWi3rkl+YTmlumPQ3IRpvrtkaq3DeSlllxPgWh Fn+YDaR7KEUpEtOV0HcsxgMcEo+7aoGYt1yZe/SR8XxUT2mNhzehF2db/feGmSJ7FBW+ IxEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=plxhMmUf+EvrQhTteZUdGqmGsuCJiqfW555AYN0K1E0=; b=nMFK0N9K7YunFmrT5hKRdcm037dzxAUzRvKl8teET2kNLKpCH3avZM5pcSCcV4xzsI mIJGnqhZvywoQahrWphvWdWHe9KwAXBLZFJzgjtosq4MhKcXi6LJTzFo+tltQEk4fFA3 v74ZBv6GXjTyQAOuctk8WLWsEaW9SvRmRrVe4kb7RF6REffUhymTntkp2MZJdmyNneuf 1etH2K9ZztJMN7JDi0kfjsieDDkHYK7kCMPNMNhSf6K7Ti7e2eM76RnjsBTpOUW6oVq0 UZWVEIJR1BYZCc63fPd/y2MuaITJfbCG6SNjGvbiewMQ1HIO1gR0dolbTVGHBXgMcC8y Q0xQ== X-Gm-Message-State: AOAM5322eD3ofFdSw8xBDZvHVErDw6s2h7RH9jP2MygHBonkHfn8TD3h 3qHXuYEG3x4UXG8qmFcsnMODv5xaNIWD4IFIsKVS+w== X-Google-Smtp-Source: ABdhPJzy+GKWYDBgcDFKUOV5Waak21QZOZ8G+R+J87v2HPAdDTSuBDirrSw9Atr+eB+n9M5ag7h6sd+pwLb20DNuOm8= X-Received: by 2002:a5d:6c6b:0:b0:1ea:77ea:dde8 with SMTP id r11-20020a5d6c6b000000b001ea77eadde8mr6655051wrz.690.1653021948566; Thu, 19 May 2022 21:45:48 -0700 (PDT) MIME-Version: 1.0 From: Anup Patel Date: Fri, 20 May 2022 10:15:36 +0530 Message-ID: Subject: KVM/riscv changes for 5.19 To: Paolo Bonzini Cc: Palmer Dabbelt , Atish Patra , KVM General , "open list:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)" , linux-riscv X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_214554_240093_B1C60F10 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) 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: Hi Paolo, We have following KVM RISC-V changes for 5.19: 1) Added Sv57x4 support for G-stage page table 2) Added range based local HFENCE functions 3) Added remote HFENCE functions based on VCPU requests 4) Add [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -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 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 Hi Paolo, We have following KVM RISC-V changes for 5.19: 1) Added Sv57x4 support for G-stage page table 2) Added range based local HFENCE functions 3) Added remote HFENCE functions based on VCPU requests 4) Added ISA extension registers in ONE_REG interface 5) Updated KVM RISC-V maintainers entry to cover selftests support I don't expect any other KVM RISC-V changes for 5.19. Please pull. Regards, Anup The following changes since commit 42226c989789d8da4af1de0c31070c96726d990c: Linux 5.18-rc7 (2022-05-15 18:08:58 -0700) are available in the Git repository at: https://github.com/kvm-riscv/linux.git tags/kvm-riscv-5.19-1 for you to fetch changes up to fed9b26b2501ea0ce41ae3a788bcc498440589c6: MAINTAINERS: Update KVM RISC-V entry to cover selftests support (2022-05-20 09:09:23 +0530) ---------------------------------------------------------------- KVM/riscv changes for 5.19 - Added Sv57x4 support for G-stage page table - Added range based local HFENCE functions - Added remote HFENCE functions based on VCPU requests - Added ISA extension registers in ONE_REG interface - Updated KVM RISC-V maintainers entry to cover selftests support ---------------------------------------------------------------- Anup Patel (9): KVM: selftests: riscv: Improve unexpected guest trap handling RISC-V: KVM: Use G-stage name for hypervisor page table RISC-V: KVM: Add Sv57x4 mode support for G-stage RISC-V: KVM: Treat SBI HFENCE calls as NOPs RISC-V: KVM: Introduce range based local HFENCE functions RISC-V: KVM: Reduce KVM_MAX_VCPUS value RISC-V: KVM: Add remote HFENCE functions based on VCPU requests RISC-V: KVM: Cleanup stale TLB entries when host CPU changes MAINTAINERS: Update KVM RISC-V entry to cover selftests support Atish Patra (1): RISC-V: KVM: Introduce ISA extension register Jiapeng Chong (1): KVM: selftests: riscv: Remove unneeded semicolon MAINTAINERS | 2 + arch/riscv/include/asm/csr.h | 1 + arch/riscv/include/asm/kvm_host.h | 124 +++++- arch/riscv/include/uapi/asm/kvm.h | 20 + arch/riscv/kvm/main.c | 11 +- arch/riscv/kvm/mmu.c | 264 ++++++------ arch/riscv/kvm/tlb.S | 74 ---- arch/riscv/kvm/tlb.c | 461 +++++++++++++++++++++ arch/riscv/kvm/vcpu.c | 144 ++++++- arch/riscv/kvm/vcpu_exit.c | 6 +- arch/riscv/kvm/vcpu_sbi_replace.c | 40 +- arch/riscv/kvm/vcpu_sbi_v01.c | 35 +- arch/riscv/kvm/vm.c | 8 +- arch/riscv/kvm/vmid.c | 30 +- .../selftests/kvm/include/riscv/processor.h | 8 +- tools/testing/selftests/kvm/lib/riscv/processor.c | 11 +- tools/testing/selftests/kvm/lib/riscv/ucall.c | 31 +- 17 files changed, 965 insertions(+), 305 deletions(-) delete mode 100644 arch/riscv/kvm/tlb.S create mode 100644 arch/riscv/kvm/tlb.c