From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC389C3A59D for ; Thu, 22 Aug 2019 11:01:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7ECE6233A0 for ; Thu, 22 Aug 2019 11:01:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l4rp+6Jx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ECE6233A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dSDBnllM6+mcGpxJDyxCZHtLi5jyewqF4fsJsF2SEyo=; b=l4rp+6JxU4kR0+ as9usDKLHde2T/RVJFm+fPt79McW0E7ldI9MIHmuZjA4CocFSztk24nd99MFPu8K5iA0n2RFn7rm9 V1CPhPT2cRSREkryiOxZ8U6XFFqXi82SlolDs1tim1t1HzNIeerq2ByLSQ2iz1YpS7gFPi3ETgN7z 2A/H8tmNqMFvlYfDOfHMThYlNX04niP8NiJmdPKBMFkiRjnULl8UeLTTMqlaVLOwgkeqMUEJRoXr/ 8Qij8Z+4zoTIcjWQwM9dInyUxl3A6KDhkSdQuxt19HHOGJ+1iFW872cXl8weZfA5pNelVloWnprfU mhj+PTVJJ5Vb7TvI0LJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0kpx-0000MD-QS; Thu, 22 Aug 2019 11:01:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0kpv-0000Lk-8t for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2019 11:01:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D3F691596; Thu, 22 Aug 2019 04:00:57 -0700 (PDT) Received: from [10.1.196.133] (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E5B673F246; Thu, 22 Aug 2019 04:00:55 -0700 (PDT) Subject: Re: [PATCH v3 05/10] KVM: arm64: Support stolen time reporting via shared structure To: Jonathan Cameron References: <20190821153656.33429-1-steven.price@arm.com> <20190821153656.33429-6-steven.price@arm.com> <20190822113942.0000701f@huawei.com> From: Steven Price Message-ID: <301610cc-ba04-89d6-a0b6-d37ecf4a717a@arm.com> Date: Thu, 22 Aug 2019 12:00:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190822113942.0000701f@huawei.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190822_040059_357315_339F9FFF X-CRM114-Status: GOOD ( 16.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , kvm@vger.kernel.org, Suzuki K Pouloze , Marc Zyngier , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King , James Morse , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Paolo Bonzini , Will Deacon , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 22/08/2019 11:39, Jonathan Cameron wrote: > On Wed, 21 Aug 2019 16:36:51 +0100 > 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. 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 > > One totally trivial comment inline... Feel free to ignore :) > [...] >> +int kvm_hypercall_stolen_time(struct kvm_vcpu *vcpu) >> +{ >> + u64 ret; >> + int err; >> + >> + /* >> + * Start counting stolen time from the time the guest requests >> + * the feature enabled. >> + */ >> + vcpu->arch.steal.steal = 0; >> + vcpu->arch.steal.last_steal = current->sched_info.run_delay; >> + >> + err = kvm_update_stolen_time(vcpu, true); >> + >> + if (err) >> + ret = SMCCC_RET_NOT_SUPPORTED; > > Trivial by why not > return SMCCC_RET_NOT_SUPPORTED; > > return vcpu->kvm->arch.pvtime.st_base + > ... > Drops the indentation a bit and puts the error handling out of > line which is slightly nicer to read (to my eyes). Yes that's a nice change - drops the extra "ret" variable too. Thanks, Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel