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=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 B1AD3C432BE for ; Thu, 26 Aug 2021 12:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85D4060FDC for ; Thu, 26 Aug 2021 12:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241138AbhHZMtc (ORCPT ); Thu, 26 Aug 2021 08:49:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57631 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232506AbhHZMtc (ORCPT ); Thu, 26 Aug 2021 08:49:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629982124; 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: in-reply-to:in-reply-to:references:references; bh=bUwJRAJ6EB5NdhoyuMNoCLrXGQTwaXG75pAqtPkBtiI=; b=WRVuWhzMUVvKaC/4Hll9dSgaI5GTKU4jAcOVnYSrZdfYttj3H4LRSHJDRi6F4E/Vygho+m +vkPwkjCd1HpSM31y8Cw+f1Q9KNPqH0cROHSD6Zb4LNvsWiGBXo0w6xL64N9uhNonrzeHa WZDs9BcR4ANT0STcZ0gufdBr6Wt0ZzY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-uQCCp8p9MEGitVIWfr94Lw-1; Thu, 26 Aug 2021 08:48:43 -0400 X-MC-Unique: uQCCp8p9MEGitVIWfr94Lw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8E86190B2A0; Thu, 26 Aug 2021 12:48:40 +0000 (UTC) Received: from fuller.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BFE1604CC; Thu, 26 Aug 2021 12:48:40 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 8B23F416CE49; Thu, 26 Aug 2021 09:48:36 -0300 (-03) Date: Thu, 26 Aug 2021 09:48:36 -0300 From: Marcelo Tosatti To: Oliver Upton 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: <20210826124836.GA155749@fuller.cnet> References: <20210816001130.3059564-1-oupton@google.com> <20210816001130.3059564-7-oupton@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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? 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=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,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 9E3E6C432BE for ; Thu, 26 Aug 2021 12:48:54 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 0F229610A3 for ; Thu, 26 Aug 2021 12:48:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F229610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7D6E84B0F7; Thu, 26 Aug 2021 08:48:53 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com 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 Zzbd-rVpcaZb; Thu, 26 Aug 2021 08:48:49 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9CA434B104; Thu, 26 Aug 2021 08:48:49 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 01E034B0FE for ; Thu, 26 Aug 2021 08:48:48 -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 5IePnGHxMqFa for ; Thu, 26 Aug 2021 08:48:46 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E24F34B0F7 for ; Thu, 26 Aug 2021 08:48:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629982126; 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: in-reply-to:in-reply-to:references:references; bh=bUwJRAJ6EB5NdhoyuMNoCLrXGQTwaXG75pAqtPkBtiI=; b=Nf+lxU5DsqYqDpKx5bEbRfHvqL46kdySvgr5aVr1+OOzOS/LySRnqCjK25AiqOKmkJYgn5 24YN/+a5eVvBRjRDABEOjVZ4mNpGRpXPVfZHn6SGmRQ6iTGtN1nzTOK3vbG63ZUI3P3p2v nEKmXBR1pDn13MYuI6k9YjpKaY3G3kY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-uQCCp8p9MEGitVIWfr94Lw-1; Thu, 26 Aug 2021 08:48:43 -0400 X-MC-Unique: uQCCp8p9MEGitVIWfr94Lw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8E86190B2A0; Thu, 26 Aug 2021 12:48:40 +0000 (UTC) Received: from fuller.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BFE1604CC; Thu, 26 Aug 2021 12:48:40 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 8B23F416CE49; Thu, 26 Aug 2021 09:48:36 -0300 (-03) Date: Thu, 26 Aug 2021 09:48:36 -0300 From: Marcelo Tosatti To: Oliver Upton Subject: Re: [PATCH v7 6/6] KVM: x86: Expose TSC offset controls to userspace Message-ID: <20210826124836.GA155749@fuller.cnet> References: <20210816001130.3059564-1-oupton@google.com> <20210816001130.3059564-7-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Cc: Catalin Marinas , kvm@vger.kernel.org, Will Deacon , Marc Zyngier , Peter Shier , Sean Christopherson , David Matlack , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Jim Mattson 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 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? _______________________________________________ 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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,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 794A0C432BE for ; Thu, 26 Aug 2021 12:51:11 +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 4334A60184 for ; Thu, 26 Aug 2021 12:51:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4334A60184 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-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=g6i6k//53dUaFVOwvO2EWd1ujZxg4l4nJnYkhduAHYQ=; b=eJsk+NDgVRpQrJ ZyvzIBL94QyVkK+lyRxdjKKCZ4H2HvSWS6+9e4pXNYmxH6lntBLHz/PCYI6EzM0iPIqRWdJDrwVTV algcrbVu4ioGgUtWo5CCBliMrbFb00PWRSQJjqHnI8ogiPDIXqK23kwx7KSCzKoWqn886Kqs89iYD XH79wrFxo0UwtPXPpWzY/m+8lV9ILLPHF+6Uf0tDAnFd1Fbj30v30sVRXjOQD87OzoB/dr02lcgZp u/OTQe3Yx8P01JeRYNrbC/bzuqwQJYolQdplpc39AwOu0aLB2jobkBUONgLJa73Eenicme8+d09ih RsnZNxeCWQdeF9cgofNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJEoM-00AA3p-CF; Thu, 26 Aug 2021 12:48:50 +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 1mJEoI-00AA34-S6 for linux-arm-kernel@lists.infradead.org; Thu, 26 Aug 2021 12:48:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629982124; 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: in-reply-to:in-reply-to:references:references; bh=bUwJRAJ6EB5NdhoyuMNoCLrXGQTwaXG75pAqtPkBtiI=; b=WRVuWhzMUVvKaC/4Hll9dSgaI5GTKU4jAcOVnYSrZdfYttj3H4LRSHJDRi6F4E/Vygho+m +vkPwkjCd1HpSM31y8Cw+f1Q9KNPqH0cROHSD6Zb4LNvsWiGBXo0w6xL64N9uhNonrzeHa WZDs9BcR4ANT0STcZ0gufdBr6Wt0ZzY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-uQCCp8p9MEGitVIWfr94Lw-1; Thu, 26 Aug 2021 08:48:43 -0400 X-MC-Unique: uQCCp8p9MEGitVIWfr94Lw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8E86190B2A0; Thu, 26 Aug 2021 12:48:40 +0000 (UTC) Received: from fuller.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BFE1604CC; Thu, 26 Aug 2021 12:48:40 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 8B23F416CE49; Thu, 26 Aug 2021 09:48:36 -0300 (-03) Date: Thu, 26 Aug 2021 09:48:36 -0300 From: Marcelo Tosatti To: Oliver Upton 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: <20210826124836.GA155749@fuller.cnet> References: <20210816001130.3059564-1-oupton@google.com> <20210816001130.3059564-7-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_054847_031751_6B4311AC X-CRM114-Status: GOOD ( 22.62 ) 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 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? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel