Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2928892imw; Sun, 17 Jul 2022 21:09:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tmOXFPEdpWRYEtEoAWWZrgui3jELxQjV/z/n52c/+wMBVCgEz5+8Juq5vyRTKNRQAycK7t X-Received: by 2002:a63:6902:0:b0:41a:3743:c768 with SMTP id e2-20020a636902000000b0041a3743c768mr147444pgc.512.1658117388614; Sun, 17 Jul 2022 21:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658117388; cv=none; d=google.com; s=arc-20160816; b=siZskPKlwQd0JrrsP6RNnd17PO/k/Ji9IBM3Rm8YrJ4ZbJXKFfGucJ+hbG/b3OiY/Q NwjkKC7pJ2nfTgn2lE9Mhs2Tz9gjZQpDuXy7c1sCYaM4f2XKvsO5VKkXAYN8sVujhvf5 dHcG6wxgNhS/FD4wvgHpV5tu+j8gT4fkQg1FtJw7NLCEQUt/B4WIrnrgx3TVXaFqS1gc vbNbPpfr+fU9ph3xhV4cZtOc9N/B6aKMX4hEeV2pGfnsbg7L/8zZ09BJUwVZtzgOcAoV PawEEvdtIKvedo/vj7j/wRswBvAwSUAcBhLZlafFGfuTBm8V9ZEuSSGQ9jpZeVLAq9d/ WDXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QUmxFHl7udbaeL8gObJYf8R+qnUxXk7ZcjzIWaqyHiU=; b=bIamvyX22VNvjBT+soXS/oexUnXO1LTQb6BABrlukqaNnpcrvRO0HPLTkLlVPQ0EoV kPsDFEFlJTVdIxuFzZrQGzP1hqQSAT2OuGoGX05A3ySFEDIeEETGS35MPEHOiZjACd7P +Ogp7Z8OWTiEBmwA86ggzdcyS+cx+3aG7805KEbwjjFynoY6dsNT5/SP+M5zpkO8sQKe Rxac7cpsFvKxgbU5evH51FfjRpCRcnqr4r+6y6mEtq/PNTXzyE6t0k9+Xo7Jt74NxEO8 SAX3aN565ARj91xDpKGDqITOzDEoBQDTNgU7qLAu5yuqJZMv1mW4ML7REN+RfLN8kRsx TIcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b="UnUh04t/"; 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 oj6-20020a17090b4d8600b001f044828f3dsi14607361pjb.28.2022.07.17.21.09.34; Sun, 17 Jul 2022 21:09:48 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b="UnUh04t/"; 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 S232460AbiGREHV (ORCPT + 99 others); Mon, 18 Jul 2022 00:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbiGREHT (ORCPT ); Mon, 18 Jul 2022 00:07:19 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA5C511C3A for ; Sun, 17 Jul 2022 21:07:17 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id e15so10002211wro.5 for ; Sun, 17 Jul 2022 21:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QUmxFHl7udbaeL8gObJYf8R+qnUxXk7ZcjzIWaqyHiU=; b=UnUh04t/rSmvdG08Yrty3ldek6Nnv0PmCHO9xvpdzMcucRZDVLF0YFkwtiucc8S3fX j/B5ft/44yxZfIJFQL6yKpNHrG7qyZ+Gok3CfVxwSw7ylIEw67z9gMmc5MtZNTI7vqdr Rov70ZXEYbCXKG5R1RqddA+np6zzsQsbJXgQQ7IvF3A/PI0BDjV1BHef3Wtl31bZ2sIQ sWw/4fdTZftmbCX2G/yjlOuHKfkM8/Sn+mbXpiCGLyg7gYh4UG5IfB1M2Kf/1jO7Xdx2 TRC6b2akSnmDPuZh23RHTJhV/DcO0H+LkFpJIp4QI6NeAVdNd3wK/b8l+5KBsWRtVQ9b W8ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QUmxFHl7udbaeL8gObJYf8R+qnUxXk7ZcjzIWaqyHiU=; b=rhePxSLGVMBDEXwQHiU6+eHaJxaAWV/RzoiW6ycMuXhnklGrloRD/E4i9/XxaHSAOu qAuD6sJadnu734h/tp40a8RTDySkGzqyjTj9q9lXvRpS1i4jVLZOzkzMVeL0aym9FgGg Al8NOwmxnA6+PaBeZQTWut2UNL6rk3WT39wFUb6wkuMVYsnZ3/T1AuyLK3Hb5Jhymfhw WWq4M6IfYpE4aGhg9FaZ+1EuLfybsMZ08rgbEJt2sb8/MxeuxDvFGkxLB2QlcnD9WJQl bFqtK2KPOK3fKreXOBhbPBrE0NSn22qHhqDM2AyS7/Yn8nekBLVF9wKEo0COVd8Kj3ai eO9w== X-Gm-Message-State: AJIora9jwJRtpcfemj0XiOkmJATldE8CH8G4nb8VqQ4UqCpZoRtxoelP VrTodXmrjmsXclAg+C8iIQbEQK7RFaoYNujM/gR3AA== X-Received: by 2002:a5d:53c9:0:b0:21d:62f8:f99f with SMTP id a9-20020a5d53c9000000b0021d62f8f99fmr21308980wrw.214.1658117237264; Sun, 17 Jul 2022 21:07:17 -0700 (PDT) MIME-Version: 1.0 References: <20220707145248.458771-1-apatel@ventanamicro.com> <20220707145248.458771-5-apatel@ventanamicro.com> In-Reply-To: From: Anup Patel Date: Mon, 18 Jul 2022 09:37:05 +0530 Message-ID: Subject: Re: [PATCH 4/5] RISC-V: KVM: Use PAGE_KERNEL_IO in kvm_riscv_gstage_ioremap() To: Atish Patra Cc: Anup Patel , Paolo Bonzini , Palmer Dabbelt , Paul Walmsley , Alistair Francis , KVM General , "open list:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)" , linux-riscv , "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 On Wed, Jul 13, 2022 at 6:53 AM Atish Patra wrote: > > On Thu, Jul 7, 2022 at 7:53 AM Anup Patel wrote: > > > > When the host has Svpbmt extension, we should use page based memory > > type 2 (i.e. IO) for IO mappings in the G-stage page table. > > > > To achieve this, we replace use of PAGE_KERNEL with PAGE_KERNEL_IO > > in the kvm_riscv_gstage_ioremap(). > > > > Signed-off-by: Anup Patel > > --- > > arch/riscv/kvm/mmu.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c > > index f7862ca4c4c6..bc545aef6034 100644 > > --- a/arch/riscv/kvm/mmu.c > > +++ b/arch/riscv/kvm/mmu.c > > @@ -361,7 +361,7 @@ int kvm_riscv_gstage_ioremap(struct kvm *kvm, gpa_t gpa, > > pfn = __phys_to_pfn(hpa); > > > > for (addr = gpa; addr < end; addr += PAGE_SIZE) { > > - pte = pfn_pte(pfn, PAGE_KERNEL); > > + pte = pfn_pte(pfn, PAGE_KERNEL_IO); > > > > if (!writable) > > pte = pte_wrprotect(pte); > > -- > > 2.34.1 > > > > LGTM. > > Reviewed-by: Atish Patra Queued this patch for 5.20. Thanks, Anup