Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp444754pxu; Thu, 3 Dec 2020 04:26:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeuVgfjEI7Logpokse354U6ADKve1mf9O/ztkCvg2NZdY/UbvBVfbUs9kZojDwBrMEkGZg X-Received: by 2002:a05:6402:3074:: with SMTP id bs20mr2592054edb.365.1606998393631; Thu, 03 Dec 2020 04:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606998393; cv=none; d=google.com; s=arc-20160816; b=gnjvIj4kwYg20FTq8q9wsTVJM/3PBRuvaUIOijaldXTprnGoAGEHqtScqLvFisHpEd DxcqwMoSXiJaGIP5rCItoV8Birpz8LoljkzhdQRBpfBU3yNjLLBRF2YUOpokgfV9PeDc gXE4i0Yr6cGyYnvLOpmQeWNhYXJTAP2DGk9QBsRPKREPgfnsTQm7OIioIuiz+824GZO7 slhPv3U7x7xuXdbvklDUuh6GVqAEinMbHdkIoapQeoiW8Q2FiVdUbo1y/KOSKhyNMeB9 AN9l5ojLcZhjrb0iC+P7Xl7HCjevUjsik9X1q6IIhhoPEly9oP01xcGE1AI3HFBB5zxH KbAA== 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; bh=dKlyfh/QoMZc/SLQGOUrwkCKzEIPxrd3QzukGB/ACjQ=; b=gNM4waZH2/52af0Hp/cvXMMzdqCRWpYOzn1u3bL4zsoxzgApAH1fzeucR2mf/Zevye zLqHo/d7zO67zKBMy152QGKTTsa9eucchD1eUuNbTVj4dRIh3iVDX1fJspad+rSEdHvi eCAw00FZ4mEZSIFcmhqF8uftrRMt/G49WfK2khLeDCiSx+iOYY6HPIXjUY4W4zWPoSzB tt8RltIoD15/js0vJAfrUqA5mHNre1YNA7AkslvZPc6wM7Igf597+2eQEgGpctmlvy4C mtYFJMNW56GE+XJ1bvD95TRTBRhqol7gvILgGXeHyVEkgXf/dqA0K3aOVbTl4tWKmN5x vPgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k15si1029529ejk.389.2020.12.03.04.26.10; Thu, 03 Dec 2020 04:26:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730454AbgLCMVy (ORCPT + 99 others); Thu, 3 Dec 2020 07:21:54 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9099 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgLCMVy (ORCPT ); Thu, 3 Dec 2020 07:21:54 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cmw0N6bBrzLyy0; Thu, 3 Dec 2020 20:20:36 +0800 (CST) Received: from huawei.com (10.174.186.236) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Thu, 3 Dec 2020 20:21:02 +0800 From: Yifei Jiang To: , , , , , CC: , , , , , , , , , Yifei Jiang Subject: [PATCH RFC 0/3] Implement guest time scaling in RISC-V KVM Date: Thu, 3 Dec 2020 20:18:36 +0800 Message-ID: <20201203121839.308-1-jiangyifei@huawei.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Originating-IP: [10.174.186.236] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series implements guest time scaling based on RDTIME instruction emulation so that we can allow migrating Guest/VM across Hosts with different time frequency. Why not through para-virt. From arm's experience[1], para-virt implementation doesn't really solve the problem for the following two main reasons: - RDTIME not only be used in linux, but also in firmware and userspace. - It is difficult to be compatible with nested virtualization. [1] https://lore.kernel.org/patchwork/cover/1288153/ Yifei Jiang (3): RISC-V: KVM: Change the method of calculating cycles to nanoseconds RISC-V: KVM: Support dynamic time frequency from userspace RISC-V: KVM: Implement guest time scaling arch/riscv/include/asm/csr.h | 3 ++ arch/riscv/include/asm/kvm_vcpu_timer.h | 13 +++++-- arch/riscv/kvm/vcpu_exit.c | 35 +++++++++++++++++ arch/riscv/kvm/vcpu_timer.c | 51 ++++++++++++++++++++++--- 4 files changed, 93 insertions(+), 9 deletions(-) -- 2.19.1