From patchwork Mon Jun 22 10:41:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Huang X-Patchwork-Id: 50146 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1206821575 for ; Mon, 22 Jun 2015 10:44:48 +0000 (UTC) Received: by wicnd19 with SMTP id nd19sf20574220wic.0 for ; Mon, 22 Jun 2015 03:44:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=eXuQzudgWvl/3Zlhcedhbcgz2RRHy+kpu4ZYVNCGZpg=; b=djcg1pz/vBL9BHhvc6cd0ovmRX8L9DKqg9KYJFVVjmpJIk2hGv51mCDAXcGUvbjnlv Qu39UgQ/6nvK3COYJJkRIrGnrKr5YyiQnfvKTAsJElRaziB4FGkaVGg8WdAPIdwuVMqV nMcJuOK8FLz+WDlfXakVsdx3DX8LrWST4Ti013V3bmXou8bEQZp9cfftLVvAoZzegq/B tvZw8BBR7oGgIMwlBSRKtALczwVmWPTiRmxJ19j3c8x+WyOIqzZ8tlwsDh62AqnULXrX iriOaoyDxhCjPr0oN/LlGvERaqSheVea6AhJZxBUOF7Ia3aTHlUFZGBNHfJcf+G+8L5o AHbw== X-Gm-Message-State: ALoCoQkGhgWMzbhbNK10Vpw1qMk+YDOyTbbhvqNh16OejCi6DAaV9Yp4OgC4eGfV3e5sxn/X8HKV X-Received: by 10.152.22.71 with SMTP id b7mr27473598laf.3.1434969887363; Mon, 22 Jun 2015 03:44:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.35 with SMTP id cj3ls913793lad.7.gmail; Mon, 22 Jun 2015 03:44:47 -0700 (PDT) X-Received: by 10.112.157.100 with SMTP id wl4mr29595703lbb.20.1434969887150; Mon, 22 Jun 2015 03:44:47 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id rk9si16210667lbb.152.2015.06.22.03.44.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 03:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbti3 with SMTP id ti3so105942087lbb.1 for ; Mon, 22 Jun 2015 03:44:47 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr29501354laj.88.1434969887035; Mon, 22 Jun 2015 03:44:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2288801lbb; Mon, 22 Jun 2015 03:44:46 -0700 (PDT) X-Received: by 10.70.102.11 with SMTP id fk11mr57424816pdb.144.1434969884100; Mon, 22 Jun 2015 03:44:44 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id gf2si29000509pbd.94.2015.06.22.03.44.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 03:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z6zBS-0005xq-A3; Mon, 22 Jun 2015 10:42:34 +0000 Received: from mail-pd0-f169.google.com ([209.85.192.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z6zB8-0005rB-JI for linux-arm-kernel@lists.infradead.org; Mon, 22 Jun 2015 10:42:15 +0000 Received: by pdbci14 with SMTP id ci14so77728263pdb.2 for ; Mon, 22 Jun 2015 03:41:53 -0700 (PDT) X-Received: by 10.70.49.43 with SMTP id r11mr56936151pdn.91.1434969713230; Mon, 22 Jun 2015 03:41:53 -0700 (PDT) Received: from localhost ([104.207.83.42]) by mx.google.com with ESMTPSA id oo3sm19561155pac.31.2015.06.22.03.41.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Jun 2015 03:41:52 -0700 (PDT) From: Zhichao Huang To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.bennee@linaro.org, will.deacon@arm.com Subject: [PATCH v3 02/11] KVM: arm: rename pm_fake handler to trap_raz_wi Date: Mon, 22 Jun 2015 18:41:25 +0800 Message-Id: <1434969694-7432-3-git-send-email-zhichao.huang@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> References: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150622_034214_738076_A622A475 X-CRM114-Status: GOOD ( 11.06 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.169 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.169 listed in wl.mailspike.net] Cc: huangzhichao@huawei.com, Zhichao Huang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhichao.huang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 pm_fake doesn't quite describe what the handler does (ignoring writes and returning 0 for reads). As we're about to use it (a lot) in a different context, rename it with a (admitedly cryptic) name that make sense for all users. Signed-off-by: Zhichao Huang Reviewed-by: Alex Bennee Acked-by: Christoffer Dall --- arch/arm/kvm/coproc.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 2e12760..9d283d9 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c @@ -229,7 +229,7 @@ bool access_vm_reg(struct kvm_vcpu *vcpu, * must always support PMCCNTR (the cycle counter): we just RAZ/WI for * all PM registers, which doesn't crash the guest kernel at least. */ -static bool pm_fake(struct kvm_vcpu *vcpu, +static bool trap_raz_wi(struct kvm_vcpu *vcpu, const struct coproc_params *p, const struct coproc_reg *r) { @@ -239,19 +239,19 @@ static bool pm_fake(struct kvm_vcpu *vcpu, return read_zero(vcpu, p); } -#define access_pmcr pm_fake -#define access_pmcntenset pm_fake -#define access_pmcntenclr pm_fake -#define access_pmovsr pm_fake -#define access_pmselr pm_fake -#define access_pmceid0 pm_fake -#define access_pmceid1 pm_fake -#define access_pmccntr pm_fake -#define access_pmxevtyper pm_fake -#define access_pmxevcntr pm_fake -#define access_pmuserenr pm_fake -#define access_pmintenset pm_fake -#define access_pmintenclr pm_fake +#define access_pmcr trap_raz_wi +#define access_pmcntenset trap_raz_wi +#define access_pmcntenclr trap_raz_wi +#define access_pmovsr trap_raz_wi +#define access_pmselr trap_raz_wi +#define access_pmceid0 trap_raz_wi +#define access_pmceid1 trap_raz_wi +#define access_pmccntr trap_raz_wi +#define access_pmxevtyper trap_raz_wi +#define access_pmxevcntr trap_raz_wi +#define access_pmuserenr trap_raz_wi +#define access_pmintenset trap_raz_wi +#define access_pmintenclr trap_raz_wi /* Architected CP15 registers. * CRn denotes the primary register number, but is copied to the CRm in the @@ -532,8 +532,7 @@ int kvm_handle_cp14_64(struct kvm_vcpu *vcpu, struct kvm_run *run) params.Rt2 = (kvm_vcpu_get_hsr(vcpu) >> 10) & 0xf; params.CRm = 0; - /* raz_wi */ - (void)pm_fake(vcpu, ¶ms, NULL); + (void)trap_raz_wi(vcpu, ¶ms, NULL); /* handled */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); @@ -559,8 +558,7 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run) params.Op2 = (kvm_vcpu_get_hsr(vcpu) >> 17) & 0x7; params.Rt2 = 0; - /* raz_wi */ - (void)pm_fake(vcpu, ¶ms, NULL); + (void)trap_raz_wi(vcpu, ¶ms, NULL); /* handled */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));