Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4831121ybi; Tue, 30 Jul 2019 08:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3hctBDYfp5u7o/cBd5gHJ+wV6LhzUW+Y5+YNTqqrNM3XKZOHWKhF3yI63OurgnwaRuzzD X-Received: by 2002:a62:6:: with SMTP id 6mr41684072pfa.159.1564502071882; Tue, 30 Jul 2019 08:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564502071; cv=none; d=google.com; s=arc-20160816; b=XbvSnJomAr71/KGqL74EbFMlb0P1kezoHQem/OV/TcKSWuarnegn5sMgFUVuCRkAbM cIYZyGZfz0Yk0+P0ikIJ6qrMBSqFKRGyAsxDQDRfepEUeAgeUsNyNnCYWIMp8guRyrnA WuAEzJggU+/vmNGOu065fY2xrzIzc/aIr0qxJoj+bW6+tqWbMzcVS4qAOYdsat2qfnY+ ZYkXubTmFBjYLTiijU7IcfaBtgfY1eUfzzrOzXiyCoeLVkMhVACbU0pYcKkGYbaxQEdy IQA2Wwn8nyI16aBeJKDFfrHSKbE7haV2KVsWVPh9x8mnGNqEN/60A1n9pnETsEDU2yob hCmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nif3qHLVmcvrPjGpxqbZt9/vydbdek0IMR2qJ1UdOfY=; b=iXKCtTTOFkNxemUprUPO0aJERDPJsnqGeHxxsLXBNiBrJ4jB4Qs7nc7kDZX+6DjMaX rFSAeZBKmpgDyf1NGIZJEW6uJUaVXCiNV1vMsN5JAqbcsdwxucIWwGJWWThBaS4mnl45 75ssVvd7Hjv7Cz5vsKD8epYly57/VZeO4WAxzVALWM8o/Xqip1FLgi8RGYXhP7MOy9rX S1qdemhvxosUpwaAccbKCGf/rb9C4fiYuebtYbdub9yk8+2+2xkFxO23JPz2GuYvlZ8l Q+ClHKOKE9n2Ot68MtFk603gdrHJADX9lHUuQYMHJ1VhWWfPjBkcwuvyEm+m8WgowZTr rBlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=rYNoj1tS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f96si29906270plb.339.2019.07.30.08.54.16; Tue, 30 Jul 2019 08:54:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=rYNoj1tS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727590AbfG3MOS (ORCPT + 99 others); Tue, 30 Jul 2019 08:14:18 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36480 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfG3MOS (ORCPT ); Tue, 30 Jul 2019 08:14:18 -0400 Received: by mail-wm1-f68.google.com with SMTP id g67so52325717wme.1 for ; Tue, 30 Jul 2019 05:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nif3qHLVmcvrPjGpxqbZt9/vydbdek0IMR2qJ1UdOfY=; b=rYNoj1tSzf0sttrAZdSs0XsVpgLJYwh2JBmIkgCKdff9t45iEMVp+2cHfJrM/VHequ RbRBhTt/0cXeZKmlYao/z751WpX18xessLddOkzDYTEFnAWXW6Yxse55jAyRcZnxY/tt rJ5tpyDfKCTA8aqaFnZfcwrpxIrSm+Ws2Mu80jZqcAg2UyfC++kD+iiZAtQYDHUbB3uQ Gxn2RTDO3tb9g6OZrrmou3hHxY7gQYhQgSlZViGnC0PN2i7eyno/QKb0uL0z0R5MwRAy 2bfe9WjPvpOblgbSgsYrp++rsj4vBiJAyu8Xblwumon2NV+xuhsRExoLICKISZhnynUl uy+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nif3qHLVmcvrPjGpxqbZt9/vydbdek0IMR2qJ1UdOfY=; b=VXjklsuTjOAuOitjuwU7tXTpBuZVHCcDQxqaY7sXdklioageuXWDfQ2+DuBwkRysAD AVtY9ODDLhFj9CAe6USX/eE3pk/2CSIGrivUltt7dwLqvJLjeORRmwnoWNraj7TroKo3 tnfgGVVcCicbjFJg7PgV2A+M9vTdp4x6QE0M3sCPMfSODG5g9GrUwqZSgAvtM5icpmLM 7Nh6tkKXkWb3NokfHuqjB4V+iLyLHZ1HuKNxdZf4spGPEAjdBK8L4f+Y0Z5eYl3HJqjv EjjVF87sGEhfwDFfgfiwZl3IKVSZc2CNSdbN/gkj36F5lVBO4fyEEmcVid49ndVixUSh pJpg== X-Gm-Message-State: APjAAAUMAa1nVb/3K27R56gmARzL/WSVmJX6QSfiyHCgZSx/k0iPm7xP PRyQma38lAAAygTZFwyyAEuwcpQtayuAU1tnCj8= X-Received: by 2002:a05:600c:254b:: with SMTP id e11mr97987106wma.171.1564488855824; Tue, 30 Jul 2019 05:14:15 -0700 (PDT) MIME-Version: 1.0 References: <20190729115544.17895-1-anup.patel@wdc.com> <20190729115544.17895-12-anup.patel@wdc.com> <6ebde80e-e8a9-6b7b-52ea-656b9a9e5e5b@redhat.com> In-Reply-To: <6ebde80e-e8a9-6b7b-52ea-656b9a9e5e5b@redhat.com> From: Anup Patel Date: Tue, 30 Jul 2019 17:44:03 +0530 Message-ID: Subject: Re: [RFC PATCH 11/16] RISC-V: KVM: Implement stage2 page table programming To: Paolo Bonzini Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Radim K , Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , Christoph Hellwig , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 2:30 PM Paolo Bonzini wrote: > > On 29/07/19 13:57, Anup Patel wrote: > > This patch implements all required functions for programming > > the stage2 page table for each Guest/VM. > > > > At high-level, the flow of stage2 related functions is similar > > from KVM ARM/ARM64 implementation but the stage2 page table > > format is quite different for KVM RISC-V. > > FWIW I very much prefer KVM x86's recursive implementation of the MMU to > the hardcoding of pgd/pmd/pte. I am not asking you to rewrite it, but > I'll mention it because I noticed that you do not support 48-bit guest > physical addresses. Yes, I also prefer recursive page table programming. In fact, the first hypervisor we ported for RISC-V was Xvisor and over there have recursive page table programming for both stage1 and stage2. BTW, 48bit VA and guest physical address is already defined in latest RISC-V spec. It's just that there is not HW (or QEMU) implementation as of now for 4-level page table. I will certainly add this to our TODO list. Regards, Anup