Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2662614imm; Wed, 3 Oct 2018 07:22:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV61FkpK6GMyNQ4JRJ+q7JvislzvgPzdfT1VMIEQT3HILpUMRkBWQt+8NmSHttpc7KEd8qbaE X-Received: by 2002:a17:902:3324:: with SMTP id a33-v6mr1899781plc.208.1538576557151; Wed, 03 Oct 2018 07:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538576557; cv=none; d=google.com; s=arc-20160816; b=iQYhgZT9rAPjhOC3+dhe5KiG8/REkD72NcnA+Uz9f5CmOqc5IiVdfNtYWYEChRGiy8 Ht/kjBcQ0SEUzJmAIuBRdXVSjTaBryKXQ9Y0QsZHFo7czp5W8oKiMljuxgQv66Zkp/Dt smCl8p5EFYUuzP/hXk4yH9D4ikww5lYH6QIz3BMhXY4nR3yLHZmUQOwbXKDS9JpImnNX LzBvgtEtNH0KRQNZjtH0gIC3tGNlEl6JTA9XNIeuO4blrwTQ+CPthC0n5Nda8NmVJyun CJaL8f4c9EdjVOcARnU3O3lhbYnI74628y4O9g3ECaIw7cmobG1H4tBEt8HomvJjDzm5 U7Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=0u7aFXMRCz0LMThvMU6QvhX239Wk/UjHjFvdT9aMSP4=; b=ByjjI8O7oisTJmspWwH0pOSwJyFBYSAj7SG+iQH97yPohSeUEOqA7mvxJ1VJZhx0yK zRAeYwYHEqVdUBVqdtj+nckXP1S/gH1DvPuGIRH27XNSOUXazqQOPw/6ex81fTkUPeo1 tFqcAdm8j7V7r0r8MvY3I33nxA3waRr24jS199xNt+h2wThxI0W+r1+6imdvYknSO/3m FbawT5jsX5+ctSTGllYlqvl06rR4FIgRJaMWtll/U3hp0QLDTrqEzmclBf7PNWrDIHEx VTDZbHuGKVSoABTPrBympGJklFUe6a4oBO/kYWFZ/fowr9JfSkqrenRVJekIMLV1DwAI TCJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=NwcAGVgT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si1700230pfg.157.2018.10.03.07.22.21; Wed, 03 Oct 2018 07:22:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=NwcAGVgT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbeJCVJ0 (ORCPT + 99 others); Wed, 3 Oct 2018 17:09:26 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36207 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726543AbeJCVJ0 (ORCPT ); Wed, 3 Oct 2018 17:09:26 -0400 Received: by mail-pl1-f196.google.com with SMTP id y11-v6so419893plt.3 for ; Wed, 03 Oct 2018 07:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0u7aFXMRCz0LMThvMU6QvhX239Wk/UjHjFvdT9aMSP4=; b=NwcAGVgT1cJ0xLmM3bb2P1RzG8Q64n0caQclhHbzqW8HATGr4Dzmsfbm6IEGwSzM4Z Wb97E1bRP1rAKgy+IzsEnDdebWXw7dkbrrYk0Qzv7iMpOpxX06qZc7H7D789FvmQExwX V4M7wJ9ybfLPtjMPCfjTLs3Ml7nMM5Bz5DKXtrOh1AFcbMxpNbzToK0RuGaF/oMMxsOA YFM/fAIyWAJVbee+t48xF46lAWaGYEhb1Na2nBIc/fqo1LrPJ/5BPeYgFKdpcjdEUv08 NWkz0BCvLfs1WEwJGZDAiBPCLm60QmOixFTMGCMNR+w+nxmTXoEaFvBvPCSbT1W66p7R PGTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0u7aFXMRCz0LMThvMU6QvhX239Wk/UjHjFvdT9aMSP4=; b=B9+kOcCUxQvNbErdnMaYup2qI4TKk4YZa5JZbNE6tM3BcVMJOXkO/GGqGnK5N9mddu nyq5nFvF1X71+ZobY6aOXlh1GKbKT6/ukSVZQk0LwJIRYa2leldSWgFTiT1W/xPJtWpW ZEQ0BTcmEKAyBcTupv3wtl5J8dA1+BAZzHpapfgq5QiMqzJNjh+G3LS5xp/FFn2hdLE5 3QULAbpG3ygtIbk3qgFRREovWM1IHqDSLwiAK42l9bYqkAJc1ODXY1APjZQK15k0u6xs o99mSb2caiCTKvJuV/8A9e+s1TjyiJRvh+qXbp7rHEYtCQkS2T+OW3ngr8uszKZQ4Kto O0PQ== X-Gm-Message-State: ABuFfoioqrN0MVn9oUZTHpfTtnGO0ZPLeb1CM5LjcuE+TKhJo3akaMZP aBCnwEqGyJX11dvyyulOCIYZyQ== X-Received: by 2002:a17:902:32c3:: with SMTP id z61-v6mr1882966plb.324.1538576450174; Wed, 03 Oct 2018 07:20:50 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:4492:ec6e:54db:bcc9? ([2601:646:c200:7429:4492:ec6e:54db:bcc9]) by smtp.gmail.com with ESMTPSA id d7-v6sm6453796pfm.23.2018.10.03.07.20.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 07:20:48 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support From: Andy Lutomirski X-Mailer: iPhone Mail (16A366) In-Reply-To: <87murvdysd.fsf@vitty.brq.redhat.com> Date: Wed, 3 Oct 2018 07:20:48 -0700 Cc: Andy Lutomirski , Thomas Gleixner , Marcelo Tosatti , Paolo Bonzini , Radim Krcmar , Wanpeng Li , LKML , X86 ML , Peter Zijlstra , Matt Rickard , Stephen Boyd , John Stultz , Florian Weimer , KY Srinivasan , devel@linuxdriverproject.org, Linux Virtualization , Arnd Bergmann , Juergen Gross Content-Transfer-Encoding: quoted-printable Message-Id: <8C316427-8BEC-4979-8AB2-5E385066BB6F@amacapital.net> References: <20180914125006.349747096@linutronix.de> <87sh1ne64t.fsf@vitty.brq.redhat.com> <4B6A97E1-17E6-40F2-A7A0-87731668A07C@amacapital.net> <87murvdysd.fsf@vitty.brq.redhat.com> To: Vitaly Kuznetsov Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Oct 3, 2018, at 5:01 AM, Vitaly Kuznetsov wrote: >=20 > Andy Lutomirski writes: >=20 >>> On Oct 3, 2018, at 2:22 AM, Vitaly Kuznetsov wrote= : >>>=20 >>> Andy Lutomirski writes: >>>=20 >>>> Hi Vitaly, Paolo, Radim, etc., >>>>=20 >>> The notification you're talking about exists, it is called >>> Reenligntenment, see 0092e4346f49 "x86/kvm: Support Hyper-V >>> reenlightenment"). When TSC page changes (and this only happens when L1 >>> is migrated to a different host with a different TSC frequency and TSC >>> scaling is not supported by the CPU) we receive an interrupt in L1 (at >>> this moment all TSC accesses are emulated which guarantees the >>> correctness of the readings), pause all L2 guests, update their kvmclock= >>> structures with new data (we already know the new TSC frequency) and >>> then tell L0 that we're done and it can stop emulating TSC accesses. >>=20 >> That=E2=80=99s delightful! Does the emulation magic also work for L1 use= r >> mode? >=20 > As far as I understand - yes, all rdtsc* calls will trap into L0. >=20 >> If so, couldn=E2=80=99t we drop the HyperV vclock entirely and just >> fold the adjustment into the core timekeeping data? (Preferably the >> actual core data, which would require core changes, but it could >> plausibly be done in arch code, too.) >=20 > Not all Hyper-V hosts support reenlightenment notifications (and, if I'm > not mistaken, you need to enable nesting for the VM to get the feature - > and most VMs don't have this) so I think we'll have to keep Hyper-V > vclock for the time being. >=20 >=20 But this does suggest that the correct way to pass a clock through to an L2 g= uest where L0 is HV is to make L1 use the =E2=80=9Ctsc=E2=80=9D clock and L2= use kvmclock (or something newer and better). This would require adding su= pport for atomic frequency changes all the way through the timekeeping and a= rch code. John, tglx, would that be okay or crazy?=