Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1293377pxb; Wed, 10 Feb 2021 05:14:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDSGTdqmuS/IaqXlkSnfhMagGMEJKPmAkjZw5PvfgMX4FD4et7P9ypnSVtNpylm5nKocG8 X-Received: by 2002:a17:906:6087:: with SMTP id t7mr2970654ejj.90.1612962868832; Wed, 10 Feb 2021 05:14:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612962868; cv=none; d=google.com; s=arc-20160816; b=VExINTzWGFym9elHAbHpX232OqFC8PbsKIE28zncJwOPoKoHAc8TQ80lGKV7gS7US0 tjwIB0ncSv08YFnN7bp2ZIFfwg5FVrFBOanw/GpO1GGidv2JiOgcWifeOEmdYz8jUUwK aj0AltssZ6H9ttsYM8uEHY1leat9TDInSV2uMZhDg2BeEWB6plIi0Kzlc5Fryo0nczPz kmT84H242vNELYDTM3jjfFAFIJ7QT0Bb7S3VZSvYm3fHgj+otbzxLl9DHhaqE7lfGmz8 zW0VAVSz1BYP0KhUIAVbp3ujaU2uiKXMkByBR0BtlCelbyD4OngSi7sVMxLQfZ4yH5bT xtZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=j47nNp+SD+H9c+k5EegmkzNDcoY6wFWyStCOtk4WgM0=; b=Njg4EB7HGE8RuzyK1IuoFsHWDWTumX2ZJ4esghunFKYymARZB3nCy64fJqfzg4rR9n p7bp4bz1/M1XXznYUV1DCZFKOr1zSJtp9D90Ucq8lU0/SsGxnPPuBmM78sXJvBeyXy+0 EGMZGmfZuyZD8f9lhGQgRnfzax78V9RYwo5hjSeNVQ79VmuYttyHWuzg+eZMI69ajqXS youcx8pXcYGv0qPVPAWcYDY7ImncTXKG8zdW8KijnBEaovlQTNtZtBdfmW/xsX8RK3VG rX/8gdTlA3kgobCdTVcX5YsptHopEtOk8MbE1vBkf8AycBuDvVj2d4Qn2NOtfdx56ZJR mt8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=AMF21FWD; dkim=neutral (no key) header.i=@linutronix.de header.b=xaevcwaE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si1389525ejs.79.2021.02.10.05.14.04; Wed, 10 Feb 2021 05:14:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=AMF21FWD; dkim=neutral (no key) header.i=@linutronix.de header.b=xaevcwaE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbhBJNLS (ORCPT + 99 others); Wed, 10 Feb 2021 08:11:18 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:59628 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229465AbhBJNLO (ORCPT ); Wed, 10 Feb 2021 08:11:14 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1612962631; 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=j47nNp+SD+H9c+k5EegmkzNDcoY6wFWyStCOtk4WgM0=; b=AMF21FWD7XWLudLEWa/MTcigwDP3U/1VqQDtWbHwbDwIoEnPgkgXe7U5Nm2wI4VcZVcCA8 OLIfm3u8wjrOHiKU28EQj7oCcdBeF1GpYGp+N9z1eT/iDKfe3tMgzFeY3p3VFLd4pt7Bax rU+f4mushiUzzCj1qz7ypqgDv+x9KNLMZqqXtrV7xFMB2kLpJfz1kB3aO9PDdVSKM74d0b 8YQaEzMchzCYo7qumv0vvOCbfw57OjuJQvTjSPFzXx9DJI9w3EKg5oX5w6hsOnWIeJe+85 rQ3rM1cDiqKBEBhVXnAYdgcWx6W9I/Ioj1NLOVjrm0f9CzuSUechIsJrO+SdEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1612962631; 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=j47nNp+SD+H9c+k5EegmkzNDcoY6wFWyStCOtk4WgM0=; b=xaevcwaELiQtvo2LwuzOJKEUnkwR3sBzAwQkH8/KaF/T0usQepGpkea8b37kwGMWTzJDC5 jF2dOH0w7+UxHvAA== To: Hikaru Nishida , linux-kernel@vger.kernel.org Cc: suleiman@google.com, Hikaru Nishida , Alexander Graf , Andra Paraschiv , Greg Kroah-Hartman , Masahiro Yamada , kvm@vger.kernel.org, Paolo Bonzini , Peter Zijlstra Subject: Re: [RFC PATCH 2/2] drivers/virt: introduce CLOCK_BOOTTIME adjustment sysfs interface driver In-Reply-To: <20210210193728.RFC.2.I03c0323c1564a18210ec98fb78b3eb728a90c2d2@changeid> References: <20210210103908.1720658-1-hikalium@google.com> <20210210193728.RFC.2.I03c0323c1564a18210ec98fb78b3eb728a90c2d2@changeid> Date: Wed, 10 Feb 2021 14:10:31 +0100 Message-ID: <87eehoax14.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10 2021 at 19:39, Hikaru Nishida wrote: > From: Hikaru Nishida > > This adds a sysfs interface /sys/kernel/boottime_adj to enable advancing > CLOCK_BOOTTIME from the userspace without actual susupend/resume cycles. > > This gives a way to mitigate CLOCK_BOOTTIME divergence between guest > and host on virtualized environments after suspend/resume cycles on > the host. > > We observed an issue of a guest application that expects there is a gap > between CLOCK_BOOTTIME and CLOCK_MONOTONIC after the device is suspended > to detect whether the device went into suspend or not. > Since the guest is paused instead of being actually suspended during the > host's suspension, guest kernel doesn't advance CLOCK_BOOTTIME correctly > and there is no way to correct that. > > To solve the problem, this change introduces a way to modify a gap > between those clocks and align the timer behavior to host's one. That's not a solution, that's a bandaid and just creating a horrible user space ABI which we can't get rid off anymore. The whole approach of virt vs. pausing and timekeeping is busted as I pointed out several times before. Just papering over it with random interfaces which fiddle with the timekeeping internals is not going to happen. Thanks, tglx