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=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 1221CC4338F for ; Thu, 29 Jul 2021 09:32:57 +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 CE57A61057 for ; Thu, 29 Jul 2021 09:32:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CE57A61057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+2ZR2pbhjEpm1Qe9dNSDYVT3Tp7gnQNZLzwuh3ZE5Xw=; b=ZBX/8Q7cjS02iO5QyGPxIKVOe9 JLEKcZjkZ/VWAxwwKoVzLR3cDWBA+OZbBv2UA1IDuR9V+aefsohx9Zkd4qsm2Wn0bpthqHiDjF9/5 9Z4mbHUWfSAqyjfcPH1iQ0aoBCWvnWZ2Pc4hZspH5GTgj2VRWsleY0dp24qGDuXzDdKkSVvzuI4/D Tw6a0GkjLkc6Sfhzs9WYQk3MHs7uwGVkCxebEdoZw4lkhETZsdTRIUgxJUDS4+W672puVDomeaBgo n12L+9mq6J41mf1iLZXFeWT4ctwEVOE6iOnDihFSnzTQk5cSwqymRyVoDdaawl7LS0VDWVp1HLyFX AlLJ6maA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m92NJ-003eEk-Go; Thu, 29 Jul 2021 09:30:45 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m92NF-003eE2-MM for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 09:30:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627551039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J23iSJURRvqOkAxJMklwOxLv8DDTdOwhOo68zLNGqb0=; b=HYpJDx39zXvFxJkye6SNZvN+BMxAJBVE3JzwYACGZQBjNadEOk7tEi7CRKN8Q7vW55/RHF BF6TREy9QEvJXR5eC82azUTKU752MUGY+okAslkvLBRLVBUs9rhsKeqMKZt+0dVrekO/RW 58TJ3cj7suC01RMFdtKXhcw6YXc8xRQ= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-267-rUcLS01qPe6i4tEZojZ4zA-1; Thu, 29 Jul 2021 05:30:38 -0400 X-MC-Unique: rUcLS01qPe6i4tEZojZ4zA-1 Received: by mail-ed1-f72.google.com with SMTP id ay20-20020a0564022034b02903bc515b673dso2669313edb.3 for ; Thu, 29 Jul 2021 02:30:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J23iSJURRvqOkAxJMklwOxLv8DDTdOwhOo68zLNGqb0=; b=fEcpt1e4ZAlNoV0Vto7MXDXNIOud62SasV260tJU8Xwc1VRBLIDJV/Mxt0j8siFdy2 qEb2K0G0j86S72CU3+HcGZxtZVbiKVtF1QATCAeCBrGFy9vzZzadw9ThWNvQvcBW7AxI v+TqUyhWu0PfTd1yyiEgn4B/K1spBICSjho5h125niZaUYgr3yP+FS4BX1EVDURD0Y5t AMolBnfuabZPUL87bLxH5uYGXXXM0zdbNVt3h/nL5Fqf+o00TJLyxiLg3vmn6L5JLZr+ BFByQXj8LchOt1Q+2573njdv7o0nyX1ZV3bkVEzj+Y9mt9eU1WtvjY9Cfhvx/gcLgDmx ZcLg== X-Gm-Message-State: AOAM530Gal2lbV/IouRF3Rrf8UbX5jld8hH9IDRwr94WwvvCyvf8Luxw 1omQ78wD3sgSMca9Fh08OYg6m0zqvXJ1D8zArZFR+o+lNk/NM+zPHrQ5xX1RzY0ceJx97d57bcL UAuAxz2e77Xm7RZhreu1IcdyJVpV+RiIei8g= X-Received: by 2002:a17:907:9d4:: with SMTP id bx20mr3676526ejc.123.1627551036987; Thu, 29 Jul 2021 02:30:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3wIR5FM8ntRVfpyHiOWHksHokdn3YpbAIvZT7i5L+rZrnbhYwfbL3DgrDPF/a7EY6Be57TQ== X-Received: by 2002:a17:907:9d4:: with SMTP id bx20mr3676502ejc.123.1627551036834; Thu, 29 Jul 2021 02:30:36 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id v13sm768791ejh.62.2021.07.29.02.30.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jul 2021 02:30:36 -0700 (PDT) Subject: Re: [PATCH v4 03/13] KVM: x86: Expose TSC offset controls to userspace To: Oliver Upton , kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: Sean Christopherson , Marc Zyngier , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Oliver Upton References: <20210729001012.70394-1-oupton@google.com> <20210729001012.70394-4-oupton@google.com> From: Paolo Bonzini Message-ID: <7cb58a33-316c-58b5-b542-671a43dea89c@redhat.com> Date: Thu, 29 Jul 2021 11:30:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210729001012.70394-4-oupton@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_023041_903003_4B49E1F1 X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 29/07/21 02:10, Oliver Upton wrote: > +6. Adjust the guest TSC offsets for every vCPU to account for (1) time > + elapsed since recording state and (2) difference in TSCs between the > + source and destination machine: > + > + new_off_n = t_0 + off_n = (k_1 - k_0) * freq - t_1 The second = should be a +. Otherwise the algorithm seems correct. > + _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel