Received: by 10.223.185.116 with SMTP id b49csp1982421wrg; Sun, 4 Mar 2018 15:02:37 -0800 (PST) X-Google-Smtp-Source: AG47ELs8zPlbEtgMrL6u4SyHQ6DtrashpMqYRddeCS7WvDXwPAOOX83M8s7z5y4gIeePU5DqYmcB X-Received: by 10.99.114.24 with SMTP id n24mr10082866pgc.400.1520204557861; Sun, 04 Mar 2018 15:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520204557; cv=none; d=google.com; s=arc-20160816; b=ZfhPVPGY3DGDn08anZalzKTw2sFhIjPMS6zZyHvKKlPwBjMtqkkWE4TzYcdsH5FUyU YyrE05Jw4AiKMYEzJmCyMU1pacSFoTvz7DjeTVMUn7IKZIPYYpYuxg/gVOIhpVDiC9l/ 8omcjm9ab9O7UXI1tzdsQ2dCl/clJEa0wEMYs1OMA4L8nJVkyBX4W/947aCPhiDzcoek 622V1NaEhWdiU7n+mKs4RciqKp+tLkYRorfKXWuTHCBjdx/2XjgOO9ETYb9FfcMMo00/ RJqem5sEXcesVJ7nrnb0d6cuyxYHUzGgngL94XAMyYuKgPW9514dy6FcauLK3exqyyTT gOeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Uv2HpSZ3Q83lP6O5Rlo2ktGEhg8jKb9FV2Tp68wwTkA=; b=YuUWGUK+BHfvwHHqx2wIOKEugXKrzxaTCnvR4L8aHI39MiBw98m6wMAVlrzcpUS8FT G27LgRbl8g3UyevbKgBgIMCTjTbx0T7R9eF3HNOV23tWTaBFRPL/QpwcgIPEziGYRfQZ BrVubxWvmsiKb5kOr9A6/JAlEBesCfaIuknFtPjnITQ3nrrkg9nBAYvrhUCYeGJTJQGT XKX+i2mu6uODyw6ajVMiaAJfJhVJHUK8Ft1E6iwe+pHxZHmLJF9NZLB2dn7lSKQ/cnzy SifdCJBmi2ptoWdaYaLU/08EspWWO5lMBRCnFANLdrY0xPE5DZSJXC9SV4M/YEFaV+/R 0GKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs.org header.s=201707 header.b=nfNcG+0q; 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 x20si7516084pgv.227.2018.03.04.15.02.23; Sun, 04 Mar 2018 15:02:37 -0800 (PST) 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=@ozlabs.org header.s=201707 header.b=nfNcG+0q; 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 S932405AbeCDXBJ (ORCPT + 99 others); Sun, 4 Mar 2018 18:01:09 -0500 Received: from ozlabs.org ([103.22.144.67]:53721 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088AbeCDXBG (ORCPT ); Sun, 4 Mar 2018 18:01:06 -0500 Received: by ozlabs.org (Postfix, from userid 1003) id 3zvdnD5ptdz9sYc; Mon, 5 Mar 2018 10:01:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1520204464; bh=++uGXdc955tH5uuTwDqjx6iLTvA3JRUf2eg3SEo8fNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nfNcG+0qYmHy6FT2ZR0rZMmChUrkJJgk3NKh7BVl14V3bMDNPKPUDwCb4F1w1yAUx PYtiVzZzpM52L+ZZ/IQ9NjHEHvc7F26d4QfEID0Nk6kOGnOhYghXu43EqwYKHL2e3L 1IyI+Ql1v4lW99pUM4sUsFeTtRf6uMvs4SDSn7CBF0d+k2wP/B70D4R13ud6d6OIk9 n8XeDuHYg1MgS8NApHJ+TIaM67H/KCSggyQdMuoyz/iRfLTnkjFc6qGd4aTqAJk3Xr Bhjn3/6UUfpraTAxQa6lPcdSyt/wemg9Kmf1H4Eq8xmmdnpEWb+oKy5AO67zJUpq70 7yeAnoaADs8oQ== Date: Mon, 5 Mar 2018 09:49:27 +1100 From: Paul Mackerras To: Laurent Vivier Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, David Gibson , Paolo Bonzini Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN Message-ID: <20180304224927.GB14569@fergus.ozlabs.ibm.com> References: <20180302105156.19506-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180302105156.19506-1-lvivier@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 02, 2018 at 11:51:56AM +0100, Laurent Vivier wrote: > Since commit 8b24e69fc47e ("KVM: PPC: Book3S HV: Close race with testing > for signals on guest entry"), if CONFIG_VIRT_CPU_ACCOUNTING_GEN is set, the > guest time is not accounted to guest time and user time, but instead to > system time. > > This is because guest_enter()/guest_exit() are called while interrupts > are disabled and the tick counter cannot be updated between them. > > To fix that, move guest_exit() after local_irq_enable(), and as > guest_enter() is called with IRQ disabled, calls guest_enter_irqoff() > instead. > > Fixes: 8b24e69fc47e > ("KVM: PPC: Book3S HV: Close race with testing for signals on guest entry") > Signed-off-by: Laurent Vivier Thanks, applied to my kvm-ppc-fixes branch. Paul.