From patchwork Thu May 11 12:46:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 9721387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 964D460236 for ; Thu, 11 May 2017 12:46:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AE9028653 for ; Thu, 11 May 2017 12:46:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FB4F28660; Thu, 11 May 2017 12:46:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E4A3A28653 for ; Thu, 11 May 2017 12:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RqXfjUY0qmnz1TAtB9cTffp0ykuMpZbXa4HO9kp+Zis=; b=ZU0wUECrrDeCwZ 8VrWVdVKa8U9ah5FBdN/4wg/dTdo6j20N1qssZvYhChW/ZyYjlXGUhOkwJpWRYHH1YSZF1iZvxt5r UuYv+vs5kXNZ4Ye1Yve3pFMTfh/1rYlSvSodwj8+fE7z2+q7J2xQ+NHkiVh3d21a41WkA2GkZgOJ6 raSiUWX97GRN2+peu417epOayZGLN8BZauMP3+GvyZccG/od7JlRwXLIG1PRRV8Tfk9EsUw97p7ML fMfCGiDwJfoWC5uMLHznlKdr2uoX61PjF+CGFQ29bUut7VY0zXnibYZj17b+beEbg719qinZqRYNu 5dSJ5QXgG6wayWLe0BrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d8nTz-00029F-E1; Thu, 11 May 2017 12:46:15 +0000 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8nTZ-0001dc-EV for linux-arm-kernel@lists.infradead.org; Thu, 11 May 2017 12:45:51 +0000 Received: by mail-wr0-x231.google.com with SMTP id l50so19568710wrc.3 for ; Thu, 11 May 2017 05:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1kPcwTmlYGq9Erbg+ibjJGfNBPErz9QGCBeNSOhdbtk=; b=aUA5VKj42KVPeZJufIUSPNzTfi1uQ5w7+ISrAUsNbPCskUZtEzUeep2/rqw965BaP7 iIjhuO+vrW36z+0EO2GPErNrdC/ja+2s370eQhg+JoL1LbQSLdaRDdpQ0yN6wZOhRZdU oGDh0xjBQTvKwI3+TJsRUXClOkUfEaF0QMrWo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1kPcwTmlYGq9Erbg+ibjJGfNBPErz9QGCBeNSOhdbtk=; b=lHPd5ZHcmNB0tyc4GaDcfkTeIdR76FmIxWzbUW6GX2AN8XWAuW3IicQZ6BLczIjlKe +pcWII7yj5pf+o1C+/genSSwTy+T3eaCnnbSCn+hUArTFd+D7N6OcvMLiqsixMwNVO2S 6Nq9YqVITEUnqZuw7phSHbonzXBX6xmXo5FuGREawyyHR+rmM3VtP++gtrDppGvQUqfz DnY+M4CAmzMJDdTjk6KAR4re5UBRFN599rRN6q1xTn1Tjo9Us/B34SB7s81R9CbJZ2Xb NvUn2xMOvHsWW7nwy3f2vquBxZfggLdSkN4Pbrmp0iRjXAVI930bDuu06ZbUpN10Pmew 6pkw== X-Gm-Message-State: AODbwcDRx0OQL9G2ztSFyJkkLYgcTfqsQcDsObhHUkCKU7iW/FNjUuwo pAsBIMijXYJoTIQB X-Received: by 10.223.164.153 with SMTP id g25mr77829wrb.103.1494506727586; Thu, 11 May 2017 05:45:27 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y16sm75643wry.46.2017.05.11.05.45.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 05:45:25 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 27AEA3E0355; Thu, 11 May 2017 13:46:14 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v2 2/2] KVM: arm: rename pm_fake handler to trap_raz_wi Date: Thu, 11 May 2017 13:46:12 +0100 Message-Id: <20170511124612.11212-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170511124612.11212-1-alex.bennee@linaro.org> References: <20170511124612.11212-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170511_054549_647363_2D340835 X-CRM114-Status: GOOD ( 13.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Russell King , open list , Zhichao Huang , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zhichao Huang 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 Acked-by: Marc Zyngier Signed-off-by: Alex BennĂ©e --- v2: - fix minor merge conflicts - add maz a-b --- arch/arm/kvm/coproc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index c3ed6bd5ddf3..31bd9bb0b765 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c @@ -260,7 +260,7 @@ static bool access_gic_sre(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) { @@ -270,19 +270,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 @@ -547,7 +547,7 @@ int kvm_handle_cp14_64(struct kvm_vcpu *vcpu, struct kvm_run *run) struct coproc_params params = decode_64bit_hsr(vcpu); /* raz_wi cp14 */ - pm_fake(vcpu, ¶ms, NULL); + trap_raz_wi(vcpu, ¶ms, NULL); /* handled */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); @@ -602,7 +602,7 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run) struct coproc_params params = decode_32bit_hsr(vcpu); /* raz_wi cp14 */ - pm_fake(vcpu, ¶ms, NULL); + trap_raz_wi(vcpu, ¶ms, NULL); /* handled */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));