Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1102589ybl; Fri, 23 Aug 2019 13:16:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH+P2Ed+LZ8Xn4Qmpxie/yL6EZ/u+nkjtglUxx/no+3RQjoTyXeLP7p81eQbnRGFVFvMh+ X-Received: by 2002:a17:902:9889:: with SMTP id s9mr6903097plp.100.1566591363888; Fri, 23 Aug 2019 13:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566591363; cv=none; d=google.com; s=arc-20160816; b=xrjkLkgkY0X/Fh5noPTbhXRm18uZklA7J1FtpgwnKkeYFbarLQcREWiKJ4X3aiqTFq MUo27WVuLDWvo6JBd6DfsKBcHkqev/RzrMLoExeL2Y6SG6wVIlTk3+/DKO2WE1CbZniZ vTBcvYK8QVidtE1yWwa/3urAYa2mTrAMtvdmhkv3jSWHyD6E0QGrUPYOVIXyEqySDwdX tHJFrmoKahG+U6APBNsN+Gtjtmn5mvyFp/T03Bab3U1jVks67faeca5U9F5jEN3Znelc UG7M1omoj7EaB91B+FSTSXfi9gnB2aeRhAfJ32rtt7TVojctRc9lYd4TFzkpKTHbBqUX vf9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=p8k+BwEXxcgqgLdTcHBDrzbBbly6hFrYYffkrNC6Kj0=; b=KSOEp0SR7Y3lU/DNS10PKGNt5juOvRGNJJiNqNuxK484EZdpQzmBSrrs7bgzBSj4lj OaflnrIyXZZhJBC6hrv4jwr1AYd/FLtHag/TmMweTxP5d3Q8nd2/+ajh3VWd0shGiuil LKbM69D5gCtjCt2buCsdBUO6fBEwXl2TSE+TOBAh4tnluq+sRFSeuKJupXEvGzsIwiz9 +DMLUcdhF5BWoenMPiRLwBUCfdYoUaJMvc0XfBxi3OM6GMWp8tOZt4Q89a6hqiiCfapV SMgzNg3WyAmLF3z9j0JU0eKBT9F+sMnwrveeBWseq9PUth4ScG4MEVtn2THEfdsAOM/D rafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=nItEzEUZ; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si3285945pjf.60.2019.08.23.13.15.36; Fri, 23 Aug 2019 13:16:03 -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=@amazon.com header.s=amazon201209 header.b=nItEzEUZ; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389215AbfHWIJE (ORCPT + 99 others); Fri, 23 Aug 2019 04:09:04 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:2819 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731543AbfHWIJE (ORCPT ); Fri, 23 Aug 2019 04:09:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1566547743; x=1598083743; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=p8k+BwEXxcgqgLdTcHBDrzbBbly6hFrYYffkrNC6Kj0=; b=nItEzEUZ0LvYapOYyaIiVW79mGqYzro1mPhFZb52LEPqFSPT4gcWIoRu Q6aWHPffJhJ8lcpQJl6vROetnencCFfu+kzQc7fsOOht7kfvMq8LraMZq a1P1JapcFFYa4b2lhfqJFBS/fyf0yBrbHzP8BDAbK6WBJkZhq3QXY9sdK 8=; X-IronPort-AV: E=Sophos;i="5.64,420,1559520000"; d="scan'208";a="696736472" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1e-17c49630.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 23 Aug 2019 08:08:54 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-17c49630.us-east-1.amazon.com (Postfix) with ESMTPS id 607BBA0696; Fri, 23 Aug 2019 08:08:49 +0000 (UTC) Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 23 Aug 2019 08:08:48 +0000 Received: from 38f9d3867b82.ant.amazon.com (10.43.161.214) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 23 Aug 2019 08:08:44 +0000 Subject: Re: [PATCH v5 00/20] KVM RISC-V Support To: Anup Patel , Palmer Dabbelt , "Paul Walmsley" , Paolo Bonzini , Radim K CC: Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , "Christoph Hellwig" , Anup Patel , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20190822084131.114764-1-anup.patel@wdc.com> From: Alexander Graf Message-ID: <8a2a9ea6-5636-e79a-b041-580159e703b2@amazon.com> Date: Fri, 23 Aug 2019 10:08:42 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190822084131.114764-1-anup.patel@wdc.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.161.214] X-ClientProxiedBy: EX13D17UWB002.ant.amazon.com (10.43.161.141) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.08.19 10:42, Anup Patel wrote: > This series adds initial KVM RISC-V support. Currently, we are able to boot > RISC-V 64bit Linux Guests with multiple VCPUs. > > Few key aspects of KVM RISC-V added by this series are: > 1. Minimal possible KVM world-switch which touches only GPRs and few CSRs. > 2. Full Guest/VM switch is done via vcpu_get/vcpu_put infrastructure. > 3. KVM ONE_REG interface for VCPU register access from user-space. > 4. PLIC emulation is done in user-space. In-kernel PLIC emulation, will > be added in future. > 5. Timer and IPI emuation is done in-kernel. > 6. MMU notifiers supported. > 7. FP lazy save/restore supported. > 8. SBI v0.1 emulation for KVM Guest available. > > Here's a brief TODO list which we will work upon after this series: > 1. Handle trap from unpriv access in reading Guest instruction > 2. Handle trap from unpriv access in SBI v0.1 emulation > 3. Implement recursive stage2 page table programing > 4. SBI v0.2 emulation in-kernel > 5. SBI v0.2 hart hotplug emulation in-kernel > 6. In-kernel PLIC emulation > 7. ..... and more ..... Please consider patches I did not comment on as Reviewed-by: Alexander Graf Overall, I'm quite happy with the code. It's a very clean implementation of a KVM target. The only major nit I have is the guest address space read: I don't think we should pull in code that we know allows user space to DOS the kernel. For that, we need to find an alternative. Either you implement a software page table walker and resolve VAs manually or you find a way to ensure that *any* exception taken during the read does not affect general code execution. Thanks, Alex