Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1713582ybe; Tue, 3 Sep 2019 02:21:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi/mi8t7QNp/PRrrW5fv+t+jRU0uJKAz9HFP8fuC9zp+5MK47mhoeDyA5PQdmNtq0Vl/GM X-Received: by 2002:a17:902:fe93:: with SMTP id x19mr6188273plm.337.1567502478790; Tue, 03 Sep 2019 02:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567502478; cv=none; d=google.com; s=arc-20160816; b=Ns9Ac+Q1SWwM70BU1HPWQoec7JX39Ey+AG0w15iSww2+Peh2/HjzQuZDDP+XxZ8qJp is3orvp4P/ChzKQNbOHkTyVU313iXdq7LpvsMezANqZ58F/w2449D4kYT6s/X5Lj8ak6 CMJN3iY7WRM5OrJpo8aPLg7rnao9FwUz2uhFrPEwzH1r6Z1489mE1GKOwqCxtuNudmW5 jjM7ptd/cd/cOoFiH0ToCkuAIg50F/aEK2RWLgbacNxFZ+sew4I9HzmylsnWIVYuCPET EQqCtyh6c2rWVanqwTsaKfUvQfspq1i+SA5WKbzn4xhOhNEsErAlc/xJleEB00GY9fec v9Jg== 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; bh=oh5n3zC5M3BBWSyEYtqY2vKFiOsbMfrqe/BQlCSUeOE=; b=COB98Gy5YwrPFHmnB/XCJxkCk5Mzig5vjD+ZtcEKKnH+L/KrB7mJva1ko2E94q8zKV cU0+TM9c3EfrtO0AH5oJmP/ep6+/VJojiB7DPbg05Z0TaRFEFpNLjErqW3QRAOF0fhr/ oCrNZkULdLKP6KZo55SFmYPhHAMR3hiNAfCFildEtgsD3rB4IlqRtDr565DvLJKvbl72 wRaE8/6bv5YSTxeg/F2WAGkewAcur3omimh3vfD/OoybELS9vdjmBcs7Q9W6wm7W8xiZ hJJ+FVnRmka7xnuKSuxctbG6gDkpTIuJ8/NVJfsPnLbFDo3MFVnJQEWZK5iPPG1cKUrd Oy7A== ARC-Authentication-Results: i=1; mx.google.com; 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 e66si14096110pgc.197.2019.09.03.02.21.03; Tue, 03 Sep 2019 02:21:18 -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; 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 S1728513AbfICJTD (ORCPT + 99 others); Tue, 3 Sep 2019 05:19:03 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:38466 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727077AbfICJTB (ORCPT ); Tue, 3 Sep 2019 05:19:01 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 33C4E53355E7BE0D137C; Tue, 3 Sep 2019 17:18:58 +0800 (CST) Received: from [127.0.0.1] (10.184.12.158) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Sep 2019 17:18:50 +0800 Subject: Re: [PATCH v4 05/10] KVM: arm64: Support stolen time reporting via shared structure To: Steven Price , Marc Zyngier , "Will Deacon" , , CC: , , Catalin Marinas , , Russell King , Paolo Bonzini References: <20190830084255.55113-1-steven.price@arm.com> <20190830084255.55113-6-steven.price@arm.com> From: Zenghui Yu Message-ID: Date: Tue, 3 Sep 2019 17:14:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Thunderbird/64.0 MIME-Version: 1.0 In-Reply-To: <20190830084255.55113-6-steven.price@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.184.12.158] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/8/30 16:42, Steven Price wrote: > Implement the service call for configuring a shared structure between a > VCPU and the hypervisor in which the hypervisor can write the time > stolen from the VCPU's execution time by other tasks on the host. > > The hypervisor allocates memory which is placed at an IPA chosen by user > space. It seems that no allocation happens in the hypervisor code. User space will do it instead? > The hypervisor then updates the shared structure using > kvm_put_guest() to ensure single copy atomicity of the 64-bit value > reporting the stolen time in nanoseconds. > > Whenever stolen time is enabled by the guest, the stolen time counter is > reset. > > The stolen time itself is retrieved from the sched_info structure > maintained by the Linux scheduler code. We enable SCHEDSTATS when > selecting KVM Kconfig to ensure this value is meaningful. > > Signed-off-by: Steven Price Thanks, zenghui