Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2481723ybh; Mon, 16 Mar 2020 04:09:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtbD5Us6oli4sgUtMaERs/XY0R94s/LqVCupE71FyEbWx73b47a42ifPBomz4d6wdE8LxOE X-Received: by 2002:a9d:d27:: with SMTP id 36mr22751828oti.230.1584356989574; Mon, 16 Mar 2020 04:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584356989; cv=none; d=google.com; s=arc-20160816; b=CH6DOdizU4Ick43SwNe6h+ERVNb5va/pqOk8P2FeyWsZD2Z1Vp4n3myww/ngd0zWHD rpPk0PbDZqH+UleKw6eJS0GknlWLFijN6OxEqCJb34rcolP5EHrHEeB5/76KA5s1kgid L7JFP0X5UBxxfxUaf5SJwtltMM5AQ5o96aDwWhAj7FvjIzdGB42zbcuIwaK+p18xN4L/ MuK/MEGqWHovbVl/uB+qgN5mLycBgLe6vUYxTMxWldBd/EEzNH+9yAV+kXyx4Ukgsfmy mIxE7/Culub64yDrSrHc5TRPgr0dETOYotMg5nmiVk1S05YnDpBQGKJ/Q1mYRCf8nIG9 8VDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=bQqOc96X1mlG85FMfKIXtPUNvqdwchu1LKvW2xkfVFU=; b=ybpSKTQZJ0macMBVOQ/rRjV1WtjmC6zbauG/F5ya7qvElbr6dgQnB47qOYVGRxIuoL sFtek41pT5v8enYEr1vvR7E0n7YZhdgE2pnLxODf2e6ODdrddDJYVmA6zWqR3PUuT4SL QpVR6Cx1GqxWe+TN4bpoIyZ4PjQgaCPuXdqRjLA10Nwz2fOaZStTUHA5A14hvSCDlDzF SkgmUCxz0bEQFmDcI2lh4Ed1HrLPLR0eZI2fFliT9h6x4Q+6CsGX1eavv5Gajbk81884 bbgzSST/rAJLRUnG5Tmrs9kme2sfcHO1GPBhqGCxhSsZmtbQEF96lnte2EMlJDj1Slqr anQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fXh7WLR8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si513240otg.49.2020.03.16.04.09.36; Mon, 16 Mar 2020 04:09:49 -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=@kernel.org header.s=default header.b=fXh7WLR8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730764AbgCPLJF (ORCPT + 99 others); Mon, 16 Mar 2020 07:09:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:38594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730693AbgCPLJF (ORCPT ); Mon, 16 Mar 2020 07:09:05 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0371C205ED; Mon, 16 Mar 2020 11:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584356945; bh=7GnxZNUgFtH4VyMWdhOlCXj+A6q4k8+r/Ert4LPiEUg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fXh7WLR86Zz7FIHD9/0xetiYssyqwbwXtbSusOmYKXIZUVB57528z/q+NGy6FA0zS uyFKf/ZYX3TH9TVaLtgy7bkAZvRI9/ESDSsLxCKo6SlK4RTHvEF9LJgvNHauqpITXU 3IRFo6Uwdgo4ma5B8B81byHZPU6ckH3rloLCWW5Y= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jDncF-00D3fu-D8; Mon, 16 Mar 2020 11:09:03 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 16 Mar 2020 11:09:03 +0000 From: Marc Zyngier To: Zenghui Yu Cc: KarimAllah Ahmed , linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] KVM: arm64: Use the correct timer for accessing CNT In-Reply-To: <7ed91b9b-e968-770c-28f9-0ca479359657@huawei.com> References: <1584351546-5018-1-git-send-email-karahmed@amazon.de> <7ed91b9b-e968-770c-28f9-0ca479359657@huawei.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.10 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, karahmed@amazon.de, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Zenghui, On 2020-03-16 10:49, Zenghui Yu wrote: > Hi, > > On 2020/3/16 17:39, KarimAllah Ahmed wrote: >> Use the physical timer object when reading the physical timer counter >> instead of using the virtual timer object. This is only visible when >> reading it from user-space as kvm_arm_timer_get_reg() is only executed >> on >> the get register patch from user-space. > > s/patch/path/ > > I think the physical counter hasn't yet been accessed by the current > userspace, wrong? I don't think userspace can access it, as the ONE_REG API only exposes the virtual timer so far, and userspace is much better off just reading the counter directly (it has access to the virtual counter, and the guarantee that cntvoff is 0 in this context). But as we move towards a situation where we can save/restore the physical timer just like the virtual one, we're going to use this path and hit this bug. > >> >> Cc: Marc Zyngier >> Cc: James Morse >> Cc: Julien Thierry >> Cc: Suzuki K Poulose >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: kvmarm@lists.cs.columbia.edu >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: KarimAllah Ahmed > > Reviewed-by: Zenghui Yu > > And this might also deserve: > > Fixes: 84135d3d18da ("KVM: arm/arm64: consolidate arch timer trap > handlers") Indeed. Thanks, M. -- Jazz is not dead. It just smells funny...