lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 10 Sep 2022 19:45:45 -0700
From:   Isaku Yamahata <isaku.yamahata@...il.com>
To:     Chao Gao <chao.gao@...el.com>
Cc:     isaku.yamahata@...el.com, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
        Yuan Yao <yuan.yao@...ux.intel.com>, isaku.yamahata@...il.com,
        Kai Huang <kai.huang@...el.com>,
        Atish Patra <atishp@...shpatra.org>,
        Shaokun Zhang <zhangshaokun@...ilicon.com>,
        Qi Liu <liuqi115@...wei.com>,
        John Garry <john.garry@...wei.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Huang Ying <ying.huang@...el.com>,
        Huacai Chen <chenhuacai@...nel.org>
Subject: Re: [PATCH v4 12/26] KVM: x86: Move TSC fixup logic to KVM arch
 resume callback

On Fri, Sep 09, 2022 at 01:48:32PM +0800,
Chao Gao <chao.gao@...el.com> wrote:

> On Thu, Sep 08, 2022 at 04:25:28PM -0700, isaku.yamahata@...el.com wrote:
> >From: Isaku Yamahata <isaku.yamahata@...el.com>
> >
> >commit 0dd6a6edb012 ("KVM: Dont mark TSC unstable due to S4 suspend") made
> >use of kvm_arch_hardware_enable() callback to detect that TSC goes backward
> >due to S4 suspend.  It has to check it only when resuming from S4. Not
> >every time virtualization hardware ennoblement.  Move the logic to
> >kvm_arch_resume() callback.
> 
> IIUC, kvm_arch_resume() is called on the first CPU waking up from suspension.
> But the detection was done on every CPU. Is it a problem (i.e., we fail to
> detect TSC goes backward on some CPUs)?

The problem is, TSC fixup logic is only needed once on resuming.
The current code calls TSC fixup logic on each cpu onlining.  It's quick
plumbing the logic to each cpu online.  Although it won't harm to call the logic,
it's ugly and this time is good occasion to clean it up.

I will clarify the commit message.
-- 
Isaku Yamahata <isaku.yamahata@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ