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=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 81880C83014 for ; Thu, 3 Dec 2020 11:53:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46DB522256 for ; Thu, 3 Dec 2020 11:53:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730288AbgLCLw7 (ORCPT ); Thu, 3 Dec 2020 06:52:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58938 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729184AbgLCLw6 (ORCPT ); Thu, 3 Dec 2020 06:52:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606996292; 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=ScdhfDhjAuXu+GH71ihpEjaoSfXwj3jq1ZQT+u4Lu1w=; b=ClVFEh3R8i/QQKO/+/Vq7bnll4hrplARIiIXE/QBcGxZPy7kcOPKOu+jFiGY05tmMzrtfQ vaaG0SaQ4UDq7DD2GKWy2KEUERwFb74Y7I+SIbDh8i43cTgXP924rfANMRnBhwkrI5Yz8E kreUzOj8CU/I9OnIJvN9xSwO9DDKMC4= 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-142-PhTLFyMHNrWoWeCpjN9RLA-1; Thu, 03 Dec 2020 06:51:28 -0500 X-MC-Unique: PhTLFyMHNrWoWeCpjN9RLA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D192219357A8; Thu, 3 Dec 2020 11:51:25 +0000 (UTC) Received: from starship (unknown [10.35.206.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id AAC6860BFA; Thu, 3 Dec 2020 11:51:19 +0000 (UTC) Message-ID: <77e48fe09de55fa77a9e33a2c6212e42c83556be.camel@redhat.com> Subject: Re: [PATCH 0/2] RFC: Precise TSC migration From: Maxim Levitsky To: Marcelo Tosatti , Thomas Gleixner Cc: kvm@vger.kernel.org, Paolo Bonzini , Oliver Upton , Ingo Molnar , Sean Christopherson , open list , Jonathan Corbet , Wanpeng Li , Borislav Petkov , Jim Mattson , "H. Peter Anvin" , "open list:DOCUMENTATION" , Joerg Roedel , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Vitaly Kuznetsov Date: Thu, 03 Dec 2020 13:51:18 +0200 In-Reply-To: <20201201150205.GA42117@fuller.cnet> References: <20201130133559.233242-1-mlevitsk@redhat.com> <20201130191643.GA18861@fuller.cnet> <877dq1hc2s.fsf@nanos.tec.linutronix.de> <20201201150205.GA42117@fuller.cnet> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-12-01 at 12:02 -0300, Marcelo Tosatti wrote: > On Tue, Dec 01, 2020 at 02:48:11PM +0100, Thomas Gleixner wrote: > > On Mon, Nov 30 2020 at 16:16, Marcelo Tosatti wrote: > > > > Besides, Linux guests don't sync the TSC via IA32_TSC write, > > > > but rather use IA32_TSC_ADJUST which currently doesn't participate > > > > in the tsc sync heruistics. > > > > > > Linux should not try to sync the TSC with IA32_TSC_ADJUST. It expects > > > the BIOS to boot with synced TSCs. > > > > That's wishful thinking. > > > > Reality is that BIOS tinkerers fail to get it right. TSC_ADJUST allows > > us to undo the wreckage they create. > > > > Thanks, > > > > tglx > > Have not seen any multicore Dell/HP systems require that. > > Anyway, for QEMU/KVM it should be synced (unless there is a bug > in the sync logic in the first place). > I agree with that, and that is why I suggested to make the guest avoid TSC syncing when KVM is detected. I don't mind how to implement this. It can be either done with new CPUID bit, or always when KVM is detected, (or even when *any* hypervisor is detected) I also don't mind if we only disable tsc sync logic or set X86_FEATURE_TSC_RELIABLE which will disable it and the clocksource watchdog. Best regards, Maxim Levitsky