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=-9.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 B3D2DC432BE for ; Thu, 26 Aug 2021 20:30:25 +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 86C466101A for ; Thu, 26 Aug 2021 20:30:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 86C466101A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=FdqZeb2SO0AKrhqd9Wuq0KDvUW2c6hnPEb4Pw4psmKU=; b=p9Sl1AVaj1s1oN K7q+798DGBrD+k4/ruttwpVCrg/W9ySw8B7Tk2+8U2kNaC8bqBeDdz5YoWRT91nXSP+MVyTUzFpWi oYaZHOJG1T/Q/t8O9bc76AitE+/RCjdoUfD6R4hvtKTXavwjfQup/n0qrTEIFSnmdPJs7Y0Kn8Co1 M38NBGWMk0I5qAaEzbGzrT5v4/F/9xajcLcGj5QIiuh+K7MaX6we3NDc1TTNzEw6TFMjmQK+eIXIu Q+TNHrHPZ2r5Fu6dAJctd5cBKeDRRxULngrc78vJz2Z05b7ivTjIGha5FAqwpboLCAJkLoq0Tgsng LnHhR/doC3mJBMz/GSeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJLyl-00AslQ-KQ; Thu, 26 Aug 2021 20:28:03 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJLyg-00AskC-Vm for linux-arm-kernel@lists.infradead.org; Thu, 26 Aug 2021 20:28:00 +0000 Received: by mail-il1-x135.google.com with SMTP id j15so4622498ila.1 for ; Thu, 26 Aug 2021 13:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AwDm+mXSvlo5Neiekp0GAgNRqFQziU4+j890jb22XOk=; b=qeNfkkt3UntsGfR34EMyrGz6DwD4eZGa/xrYQ0kX3UP52yq2/1YyMxaDslK4Tsler8 C2KD8TEdVVKz/jSaS3VS053Djd4dzRCkEnDC3fgmqMl4yaYJYs+NVu6DMqLRq+4ZIseZ BZmWyU+ILyFVViRWa33c/pp9kUAHe+mgq8P6S0Wh2gF68UquFTqVyWGSCjqMp/lR+SDi 89KUDLXNZhKY92uHH6y/JBJZ0J4t6UoR7CiPWLJ2rspNHd7EG32Tbkb6gcZVpFyyIBg/ gBTRY85POJ0UeKuKSUMhxLSO2aQRKW4CXZZk29uLFXndKYrQBwjUrz3cWVVlj+83olMy jF4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AwDm+mXSvlo5Neiekp0GAgNRqFQziU4+j890jb22XOk=; b=iQQZqeFNiVX4I2ZstzK3l+LIRWtdRlqaSd7Y5ufIY5Drzbj47hVNyK6t4CVTQNoGMi fPU4HWF6ln9TaXGcY7abRIZm7jP3V87F26L07rjJ/m3Ak/QEv2kG+4ctzAbLYYEOqLS7 iZqe8nqazuqi7+vbhmigm20iavLbq7IBEdaBMdLxlb9NH15mCSvU/v/yxtFB/S/M3pAx a9GizJOSVpVKSfN+w4n0ch2S6t0iIlxNjESGLZddJM+w4lF+EujQnYvLqzA/Jmmo4n7k jFKdKQNUHgjuafuwjZCvT9UjDQcWuIj1YnB/JsTU3AiFBJyMPnIQfIw0slA4fxY1Jugn y73w== X-Gm-Message-State: AOAM530ZKuI0mwJa7uy4WDEFHkHuxDdxjKSD81Do3SfEbJ5w4s4KhiM7 XGCL8KwwBVhDz81pd230XluWyw== X-Google-Smtp-Source: ABdhPJxeTBH+DbI4bX1tRHeZzKIvT/4efUkT/jM1XYfogFV5usnZuUXcUrUYOTAvOqiM4kxoO07UxQ== X-Received: by 2002:a05:6e02:128b:: with SMTP id y11mr3913467ilq.104.1630009677230; Thu, 26 Aug 2021 13:27:57 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id o2sm2359596ilg.47.2021.08.26.13.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 13:27:56 -0700 (PDT) Date: Thu, 26 Aug 2021 20:27:53 +0000 From: Oliver Upton To: Marcelo Tosatti Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , 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 , Will Deacon , Catalin Marinas Subject: Re: [PATCH v7 6/6] KVM: x86: Expose TSC offset controls to userspace Message-ID: References: <20210816001130.3059564-1-oupton@google.com> <20210816001130.3059564-7-oupton@google.com> <20210826124836.GA155749@fuller.cnet> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210826124836.GA155749@fuller.cnet> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_132759_083070_A6BDA9B7 X-CRM114-Status: GOOD ( 25.71 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Marcelo, On Thu, Aug 26, 2021 at 09:48:36AM -0300, Marcelo Tosatti wrote: > On Mon, Aug 23, 2021 at 01:56:30PM -0700, Oliver Upton wrote: > > Paolo, > > > > On Sun, Aug 15, 2021 at 5:11 PM Oliver Upton wrote: > > > > > > To date, VMM-directed TSC synchronization and migration has been a bit > > > messy. KVM has some baked-in heuristics around TSC writes to infer if > > > the VMM is attempting to synchronize. This is problematic, as it depends > > > on host userspace writing to the guest's TSC within 1 second of the last > > > write. > > > > > > A much cleaner approach to configuring the guest's views of the TSC is to > > > simply migrate the TSC offset for every vCPU. Offsets are idempotent, > > > and thus not subject to change depending on when the VMM actually > > > reads/writes values from/to KVM. The VMM can then read the TSC once with > > > KVM_GET_CLOCK to capture a (realtime, host_tsc) pair at the instant when > > > the guest is paused. > > > > > > Cc: David Matlack > > > Cc: Sean Christopherson > > > Signed-off-by: Oliver Upton > > > > Could you please squash the following into this patch? We need to > > advertise KVM_CAP_VCPU_ATTRIBUTES to userspace. Otherwise, happy to > > resend. > > > > Thanks, > > Oliver > > Oliver, > > Is there QEMU support for this, or are you using your own > userspace with this? Apologies for not getting back to you on your first mail. Sadly, I am using our own userspace for this. That being said, adding support to QEMU shouldn't be too challenging. I can take a stab at it if it makes the series more amenable to upstream, with the giant disclaimer that I haven't done work in QEMU before. Otherwise, happy to review someone else's implementation. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel