Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3804486imw; Thu, 7 Jul 2022 07:55:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tuAWtWvA4wxlSxOqEQxSXDhZOtoyddiZlNKqwqvEh4nSqC5ym4Ov82Po21rON2xoGxcwOR X-Received: by 2002:a17:903:1c7:b0:16a:2762:88d1 with SMTP id e7-20020a17090301c700b0016a276288d1mr53717880plh.76.1657205716901; Thu, 07 Jul 2022 07:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657205716; cv=none; d=google.com; s=arc-20160816; b=Gb+gOyHmodj5mIEDfJoQSXsCZyOGOpDdnV44NJES1zg48Cm4gP/Afaj8sNqikghD3G /6w3oyFmK41hpaGRqH1BtT9aswzIOTu2lruXxilK0JKDbZXRNYG74rNM37YwJ9noE8dZ Iapx0OOez5TqNCvl8XALKcx7g92SS7X4G7llaWfRdTOh+xsvO3rmJWtYpW2Kgy8WkXa9 8BHcC5T2Px00Hu02UMExcsz6Egt9MJ8z2HxjjqObIO5XHS0lKFQbvAEj9u9I78XLoFdF fqX066C8k1PV1QopGLACTiT2SD7G+i3bRHkcMZLSv53ZHrlDtTFKgW8Hp+cozdC6O46q OLdg== 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=2/cSQRYg50JuMF0k4CiBLOOMScUk3mXsGoE8DMLTmGQ=; b=j4GZUeNWljSb/qCem61VPMOrujcrLh6GpiQ47oPAtr+cwgzxWP7CABvXdicOoB27v+ gmbBaIPue7R+BJzHhdCOMYVPIw3dpe1u6eIp0dRePa1IZpaf27AmkZYIaBbVNa9Bi1ps YuXz/rAy1AcQw/BNAOpt9PtXOiES9hsoiJTA0sbNdcYU385lojb8FDpxNe6RKr5B+aYI H+kKt+pHLCx3S1YpnKPVItRh/7kXIbxCOe7AZ7V7xBwbeAC4m9yIzCv0Z7+loDvYFjlR gQwVkFotokBZ6GZHoTu/cg53UpaQk6YKMgxB1fscN7hTquN69c23RxRpeTn8aWBYgGYl 1rPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=er9nqWUP; 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 g14-20020aa79dce000000b005256b0ab23bsi48054130pfq.191.2022.07.07.07.55.02; Thu, 07 Jul 2022 07:55:16 -0700 (PDT) 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=er9nqWUP; 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 S233831AbiGGOya (ORCPT + 99 others); Thu, 7 Jul 2022 10:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235355AbiGGOyQ (ORCPT ); Thu, 7 Jul 2022 10:54:16 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BEE45A45B for ; Thu, 7 Jul 2022 07:53:18 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id e16so7105466pfm.11 for ; Thu, 07 Jul 2022 07:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2/cSQRYg50JuMF0k4CiBLOOMScUk3mXsGoE8DMLTmGQ=; b=er9nqWUP8eP6usOXt23apNRzaB+sp9s0z7ZvXZctGj3Om3+CrQ463jXIqaq0Olo7cA eLVU8m4qvUPEKhD35qoudlMRRWzhftZF2RzvL1qICwipTKw6ml05b8wHU8hudZEuGfON +xDaFvG1KOiNdB6l6W4oYPYwTd3zUsifB5zQzeTYpLjCnllDQv9fv4dSmKe5BQIPOInq juBSjYjMYn3KOEJKZGUW/wKoq0bI1MT2nuOZ3Wa43ilVxvbgUDkKdKBBAYtJq5UewcQg nCDZMgk0ulSCy9Ded1j4Vm1hK33lAQREgPfY7MB3Wh3rBZjOfUpWcmfX2KahyaibpiRz fZ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2/cSQRYg50JuMF0k4CiBLOOMScUk3mXsGoE8DMLTmGQ=; b=gFfOW2R5QvXkaHm6DaeG1KkW9ZxBrb3PVnDLGbviP/jqqb+YbetR6by0JtDH4FTncG G7+uIpGpwHh/ceewP3ehiFI2tcilA90O/MkjKe1CyAajaqwnh1GrV5jfWUkLh3V/V7CS CJMve0EBirJ6/kQf9SXZdwn/s8xlKnXv1LolFeCE4KrfaXTnCUEzkuLINxno04Bh445y XNmm6PunbKZ51xEH+9huQScTEw22Zv3Lkb/sdhhRgwV+7UXOxZU1CZT62Srq9rE9uP47 wPXPMwYRebJrbdVnRDqcg42XhKC3+F6i/w3vJyONQ3/DnM/jK75QKM4OV6aWVcw+Ujri nQxw== X-Gm-Message-State: AJIora+D4Kj3nMC3TK1UyzZ4k142ZvJj+s7yEIa4oPvDeQUWhuwjBYE9 ngHmBfbVZguGbigYQNRMc42Yjg== X-Received: by 2002:a17:903:110c:b0:168:fa61:1440 with SMTP id n12-20020a170903110c00b00168fa611440mr52729714plh.149.1657205596753; Thu, 07 Jul 2022 07:53:16 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([223.226.40.162]) by smtp.gmail.com with ESMTPSA id b26-20020aa7951a000000b0052535e7c489sm27144231pfp.114.2022.07.07.07.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 07:53:16 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra Cc: Palmer Dabbelt , Paul Walmsley , Alistair Francis , 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/5] KVM RISC-V Svpbmt support Date: Thu, 7 Jul 2022 20:22:43 +0530 Message-Id: <20220707145248.458771-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,T_SCC_BODY_TEXT_LINE 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 extends KVM RISC-V to detect and use Svpbmt for both G-stage (hypervisor) and VS-stage (guest) page table. The corresponding KVMTOOL patches used for testing this series can be found in riscv_svpbmt_sstc_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in riscv_kvm_svpbmt_v1 branch at: https://github.com/avpatel/linux.git Alexandre Ghiti (1): riscv: Fix missing PAGE_PFN_MASK Anup Patel (4): KVM: Add gfp_custom flag in struct kvm_mmu_memory_cache RISC-V: KVM: Add G-stage ioremap() and iounmap() functions RISC-V: KVM: Use PAGE_KERNEL_IO in kvm_riscv_gstage_ioremap() RISC-V: KVM: Add support for Svpbmt inside Guest/VM arch/riscv/include/asm/csr.h | 16 ++++++++++++++++ arch/riscv/include/asm/kvm_host.h | 5 +++++ arch/riscv/include/asm/pgtable-64.h | 12 ++++++------ arch/riscv/include/asm/pgtable.h | 6 +++--- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/mmu.c | 22 ++++++++++++++++------ arch/riscv/kvm/vcpu.c | 16 ++++++++++++++++ include/linux/kvm_types.h | 1 + virt/kvm/kvm_main.c | 4 +++- 9 files changed, 67 insertions(+), 16 deletions(-) -- 2.34.1