Received: by 10.223.176.5 with SMTP id f5csp1822725wra; Thu, 8 Feb 2018 04:09:39 -0800 (PST) X-Google-Smtp-Source: AH8x226yYHXed/n2M6KFZeYW6PAWjQxNA2m0EH4MwvLvgPiYIr+qJrv/3I19j5s0KLma/oZLjbrk X-Received: by 10.99.114.22 with SMTP id n22mr364406pgc.21.1518091778990; Thu, 08 Feb 2018 04:09:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518091778; cv=none; d=google.com; s=arc-20160816; b=QUGwl350tKBQyw+hBkSpXQw8C+sJBSzKcwQD15Eq0UFJFrZn2gskBHa6uNdK8p/H18 g2R2gQq3X3nnoSadogOTTZ9j1J/iNJkZtfIJajiGju1TBw/jQVNDafkcV7VL91sWBAmB SRtpgJYWPmp2myGTVP2VMZsBkISqGuYr4uKPvMIeJJjZn8ZUhKlzsmyCnXleG6tBhP1m 8dzPAORvHOCLPy43IXNE+NXEjoHnRQ2Z6+p6HE7f1ImtNhEFxiLSEYz6UMFCQP2mhcTH ORZlm6kO3jV8w51P7kFHq05d3WrIChP8B9gWINpGPhlzMWrTnvGjnID9wqkj+iOkKm83 WD4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=JAmYqZcoumTaCCiYSCwz6jfooB2y0dVDLEuiIf0sWFw=; b=Ucj65xaHXMEX6ktkGNL8v6bPLn+omuZWw+w/yxQhLugT9PqHq8Xgr2S/nW4m5lkBA2 4nnUh+JQD349bjH6EEC+RrSMotqpDymW7f2KumL8SzlhZ1k86aTPQ9udsWbgZqyQzP0n febo/hIQED+a105uzMGdNSY+DdGjMvNZPcg04kjIgEd6TTTsbE5LnTMgApKsAZhLR+nL iuOAI0FOa7uXSzkC6pni+qlcgLDYBluu2Qi2WqVQZn9gZUTJJrZgVW9U/Dj6pMEr3rXv 7YxVw+9bswJkowvzdL8grqEe4G0sNeGS4w00xevM2K6qcbejOYvA9YuCZ/Xkuju9RY4i ZcHA== ARC-Authentication-Results: i=1; mx.google.com; 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 bg8-v6si2704389plb.748.2018.02.08.04.09.24; Thu, 08 Feb 2018 04:09:38 -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; 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 S1752308AbeBHMIO (ORCPT + 99 others); Thu, 8 Feb 2018 07:08:14 -0500 Received: from foss.arm.com ([217.140.101.70]:34012 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbeBHMIN (ORCPT ); Thu, 8 Feb 2018 07:08:13 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC01E1435; Thu, 8 Feb 2018 04:08:12 -0800 (PST) Received: from [10.1.207.62] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 667743F24D; Thu, 8 Feb 2018 04:08:11 -0800 (PST) Subject: Re: [PATCH] KVM: arm64: Enable the EL1 physical timer for AArch32 guests To: =?UTF-8?B?SsOpcsOpbXkgRmFuZ3XDqGRl?= , Christoffer Dall , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: tech@virtualopensystems.com, Alvise Rigo References: <1518091039-17356-1-git-send-email-j.fanguede@virtualopensystems.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <51fa6f87-4d4d-0c14-9fb0-6ce0d2808ce3@arm.com> Date: Thu, 8 Feb 2018 12:08:10 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1518091039-17356-1-git-send-email-j.fanguede@virtualopensystems.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/02/18 11:57, Jérémy Fanguède wrote: > Some 32bits guest OS can use the CNTP timer, however KVM does not > handle the accesses, injecting a fault instead. > > Use the proper handlers to emulate the EL1 Physical Timer (CNTP) > register accesses of AArch32 guests. > > Signed-off-by: Jérémy Fanguède > Signed-off-by: Alvise Rigo > --- > arch/arm64/kvm/sys_regs.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 50a43c7..c0ab4f7 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -1545,6 +1545,11 @@ static const struct sys_reg_desc cp15_regs[] = { > > { Op1( 0), CRn(13), CRm( 0), Op2( 1), access_vm_reg, NULL, c13_CID }, > > + /* CNTP_TVAL */ > + { Op1( 0), CRn(14), CRm( 2), Op2( 0), access_cntp_tval }, > + /* CNTP_CTL */ > + { Op1( 0), CRn(14), CRm( 2), Op2( 1), access_cntp_ctl }, > + > /* PMEVCNTRn */ > PMU_PMEVCNTR(0), > PMU_PMEVCNTR(1), > @@ -1618,6 +1623,7 @@ static const struct sys_reg_desc cp15_64_regs[] = { > { Op1( 0), CRn( 0), CRm( 9), Op2( 0), access_pmu_evcntr }, > { Op1( 0), CRn( 0), CRm(12), Op2( 0), access_gic_sgi }, > { Op1( 1), CRn( 0), CRm( 2), Op2( 0), access_vm_reg, NULL, c2_TTBR1 }, > + { Op1( 2), CRn( 0), CRm(14), Op2( 0), access_cntp_cval }, > }; > > /* Target specific emulation tables */ > Seems OK to me. Can you please update the corresponding 32bit code while you're at it? Thanks, M. -- Jazz is not dead. It just smells funny...