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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 A61C1C32792 for ; Thu, 3 Oct 2019 13:22:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FC9D21848 for ; Thu, 3 Oct 2019 13:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730381AbfJCNWn (ORCPT ); Thu, 3 Oct 2019 09:22:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46064 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfJCNWn (ORCPT ); Thu, 3 Oct 2019 09:22:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D0153061213; Thu, 3 Oct 2019 13:22:43 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7094600CD; Thu, 3 Oct 2019 13:22:37 +0000 (UTC) Date: Thu, 3 Oct 2019 15:22:35 +0200 From: Andrew Jones To: Steven Price Cc: Marc Zyngier , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Catalin Marinas , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Russell King , James Morse , Julien Thierry , Suzuki K Pouloze , Mark Rutland , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 05/10] KVM: arm64: Support stolen time reporting via shared structure Message-ID: <20191003132235.ruanyfmdim5s6npj@kamzik.brq.redhat.com> References: <20191002145037.51630-1-steven.price@arm.com> <20191002145037.51630-6-steven.price@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191002145037.51630-6-steven.price@arm.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 03 Oct 2019 13:22:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 03:50:32PM +0100, Steven Price wrote: > +int kvm_update_stolen_time(struct kvm_vcpu *vcpu, bool init) > +{ > + struct kvm *kvm = vcpu->kvm; > + u64 steal; > + u64 steal_le; > + u64 offset; > + int idx; > + u64 base = vcpu->arch.steal.base; > + > + if (base == GPA_INVALID) > + return -ENOTSUPP; > + > + /* Let's do the local bookkeeping */ > + steal = vcpu->arch.steal.steal; > + steal += current->sched_info.run_delay - vcpu->arch.steal.last_steal; > + vcpu->arch.steal.last_steal = current->sched_info.run_delay; > + vcpu->arch.steal.steal = steal; > + > + steal_le = cpu_to_le64(steal); Agreeing on a byte order for this interface makes sense, but I don't see it documented anywhere. Is this an SMCCC thing? Because I skimmed some of those specs and other users too but didn't see anything obvious. Anyway even if everybody but me knows that all data returned from SMCCC calls should be LE, it might be nice to document that in the pvtime doc. Thanks, drew 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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 38F0FC32792 for ; Thu, 3 Oct 2019 13:22:49 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id B7C5C2053B for ; Thu, 3 Oct 2019 13:22:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7C5C2053B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3CFE64A78E; Thu, 3 Oct 2019 09:22:47 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3rYRWMbRdpyj; Thu, 3 Oct 2019 09:22:46 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2FDB24A782; Thu, 3 Oct 2019 09:22:46 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2412F4A782 for ; Thu, 3 Oct 2019 09:22:45 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W1L1f+yfYFu8 for ; Thu, 3 Oct 2019 09:22:44 -0400 (EDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id F3AC44A752 for ; Thu, 3 Oct 2019 09:22:43 -0400 (EDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D0153061213; Thu, 3 Oct 2019 13:22:43 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7094600CD; Thu, 3 Oct 2019 13:22:37 +0000 (UTC) Date: Thu, 3 Oct 2019 15:22:35 +0200 From: Andrew Jones To: Steven Price Subject: Re: [PATCH v5 05/10] KVM: arm64: Support stolen time reporting via shared structure Message-ID: <20191003132235.ruanyfmdim5s6npj@kamzik.brq.redhat.com> References: <20191002145037.51630-1-steven.price@arm.com> <20191002145037.51630-6-steven.price@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191002145037.51630-6-steven.price@arm.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 03 Oct 2019 13:22:43 +0000 (UTC) Cc: kvm@vger.kernel.org, Marc Zyngier , linux-doc@vger.kernel.org, Russell King , linux-kernel@vger.kernel.org, Catalin Marinas , Paolo Bonzini , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Wed, Oct 02, 2019 at 03:50:32PM +0100, Steven Price wrote: > +int kvm_update_stolen_time(struct kvm_vcpu *vcpu, bool init) > +{ > + struct kvm *kvm = vcpu->kvm; > + u64 steal; > + u64 steal_le; > + u64 offset; > + int idx; > + u64 base = vcpu->arch.steal.base; > + > + if (base == GPA_INVALID) > + return -ENOTSUPP; > + > + /* Let's do the local bookkeeping */ > + steal = vcpu->arch.steal.steal; > + steal += current->sched_info.run_delay - vcpu->arch.steal.last_steal; > + vcpu->arch.steal.last_steal = current->sched_info.run_delay; > + vcpu->arch.steal.steal = steal; > + > + steal_le = cpu_to_le64(steal); Agreeing on a byte order for this interface makes sense, but I don't see it documented anywhere. Is this an SMCCC thing? Because I skimmed some of those specs and other users too but didn't see anything obvious. Anyway even if everybody but me knows that all data returned from SMCCC calls should be LE, it might be nice to document that in the pvtime doc. Thanks, drew _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 7D164C10F14 for ; Thu, 3 Oct 2019 13:22:52 +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 50DE6215EA for ; Thu, 3 Oct 2019 13:22:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QFYY6mB5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50DE6215EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DP5RbyzC5tDvNyZ/zUKeDtnCrZYFGvdDJT7WKvKGL04=; b=QFYY6mB5Rjkk2B ccTM/aziYV3KE5s6ERIv0hEnqeVPEmSLnCc+Ov2VuwmKw1dNDtlFRD2kyVAVFMe5wD/r4E+ZbJ7kn VacKtMY8v5JrqqpMhGBmScFhuNct2gMssXgHfmCkm9QpSo1cCHRJoWYlRw2S39PTyLLYoLwhZHb0O P+ZYoXL1u5m2CljBZ2uliQvJYnj0Ecws67FM+s0duLXs2jwJTdNSKAa1zXDRBWUBV5Sj9A7/JqNFS 2GmoRBT7dZTa1Hh+aXjAb5Un0W7kCKtZVPMxtAuVTVZjuIrvqDqweCHjX5i/UwjpSJWOi6aGig4Wi IG3VEliABmax76fU+90Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iG14B-00011Q-1k; Thu, 03 Oct 2019 13:22:47 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iG148-00010b-BL for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2019 13:22:45 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D0153061213; Thu, 3 Oct 2019 13:22:43 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7094600CD; Thu, 3 Oct 2019 13:22:37 +0000 (UTC) Date: Thu, 3 Oct 2019 15:22:35 +0200 From: Andrew Jones To: Steven Price Subject: Re: [PATCH v5 05/10] KVM: arm64: Support stolen time reporting via shared structure Message-ID: <20191003132235.ruanyfmdim5s6npj@kamzik.brq.redhat.com> References: <20191002145037.51630-1-steven.price@arm.com> <20191002145037.51630-6-steven.price@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191002145037.51630-6-steven.price@arm.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 03 Oct 2019 13:22:43 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191003_062244_413066_DF8CF77A X-CRM114-Status: GOOD ( 15.68 ) 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 , kvm@vger.kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Marc Zyngier , Suzuki K Pouloze , linux-doc@vger.kernel.org, Russell King , linux-kernel@vger.kernel.org, James Morse , Julien Thierry , Catalin Marinas , Paolo Bonzini , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 Wed, Oct 02, 2019 at 03:50:32PM +0100, Steven Price wrote: > +int kvm_update_stolen_time(struct kvm_vcpu *vcpu, bool init) > +{ > + struct kvm *kvm = vcpu->kvm; > + u64 steal; > + u64 steal_le; > + u64 offset; > + int idx; > + u64 base = vcpu->arch.steal.base; > + > + if (base == GPA_INVALID) > + return -ENOTSUPP; > + > + /* Let's do the local bookkeeping */ > + steal = vcpu->arch.steal.steal; > + steal += current->sched_info.run_delay - vcpu->arch.steal.last_steal; > + vcpu->arch.steal.last_steal = current->sched_info.run_delay; > + vcpu->arch.steal.steal = steal; > + > + steal_le = cpu_to_le64(steal); Agreeing on a byte order for this interface makes sense, but I don't see it documented anywhere. Is this an SMCCC thing? Because I skimmed some of those specs and other users too but didn't see anything obvious. Anyway even if everybody but me knows that all data returned from SMCCC calls should be LE, it might be nice to document that in the pvtime doc. Thanks, drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel