From patchwork Wed May 10 17:01:59 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: 9720257 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 275AE6035D for ; Wed, 10 May 2017 17:02:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1666A27813 for ; Wed, 10 May 2017 17:02:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AC4028608; Wed, 10 May 2017 17:02:06 +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 8819D27813 for ; Wed, 10 May 2017 17:02:05 +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=2APSQ5kkDpVoqhSb4+LmQPxV713KO7vHfm676C68/hA=; b=CFui7q+BSvNjPV XMRJOgowZKiDnOUkxXuM3zL+HmawS35emBLIRYWzs34Oq3peynwXWv8PNXvG5+l+274mrY2xxuVhu DG3yBCfpqJm5haFJLT7s95aws+TQcFniSlgO5IhhJJCkVO6mLdN7lKLIj31SXWbLFFvEEZMJegZpa x7xyf2HYIkqUlOoOqAtvTnBdq+lXptl4ZQ6JkeeZIAYu/1IeRcvJJIVpgm3QXSCk7SMr1MEZSZLNL DCDBWfbWCb4JhNnv7b5UTaiLf2gWTcR4Ghmj7C/6HR6w3hnNxltm3qUenWc5r7lcQSwoqsMg5tNqp B87h07wMYqtEEymp8YYQ==; 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 1d8V00-0006MV-DY; Wed, 10 May 2017 17:02:04 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d8Uza-0005nj-0F for linux-arm-kernel@lists.infradead.org; Wed, 10 May 2017 17:01:40 +0000 Received: by mail-wm0-x229.google.com with SMTP id m123so6406904wma.0 for ; Wed, 10 May 2017 10:01:17 -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=bHvty5Fq/TkIBFIwnWu0LUjbm2nmRdM9MZR9Mc2Cvb8=; b=ISY6h0hgWmkY//OSXbqmDl+JVVfce/DOo39tx17iU01Wo0TXMHveeTN0RD7YbumjRb K+hCLxrWJ76GhAuSy0RXAWqbCUZueTDnk6N6xhqj8uWBMi5PEJx7U2Drump1uRiumzhi usBgnjSulQ5PgwCSad3SoAtB5VEHjqAR3z5V0= 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=bHvty5Fq/TkIBFIwnWu0LUjbm2nmRdM9MZR9Mc2Cvb8=; b=H2zX0sfT534r6PS9M2YnFVJZjub15uPCASmeUQly5rOl4L6MP4B7kCJN7V8BXb+H11 HRJS92Ucc0khVDxcwOvMstqy73vRzw8WghXDgt8M72CxRHfDYyEf2WeuOyVDMgtdskfv +eLfJ/ELrokUmqvubiJKZqTbYEgfccAQl9Jy7pXd9QV9iT7lNro61uNmDn/wlOeJFv1v PY60j4aygSLDnVLxEBgKNMGeUb+mp1tMcr6aDAImXUEb+Vo9aih4lZoZwbuCZ7a0P5GR v69lKT8nTyosbfQ0jpFRcq3o8jpDh4lf9qoXYclrGrF0prjBU4e5w/jPH3F++tqsSsiO +zjQ== X-Gm-Message-State: AODbwcC3eVtdnlX4SdMkvGhgM6j4e3NRAgZ+9T7Tju16vISv9aQi4fj8 yRkwNWoRxKibnLw1 X-Received: by 10.28.178.201 with SMTP id b192mr3922320wmf.127.1494435676046; Wed, 10 May 2017 10:01:16 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y60sm3438973wrb.39.2017.05.10.10.01.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 10:01:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 384933E0355; Wed, 10 May 2017 18:02:01 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v1 2/2] KVM: arm: rename pm_fake handler to trap_raz_wi Date: Wed, 10 May 2017 18:01:59 +0100 Message-Id: <20170510170200.13285-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170510170200.13285-1-alex.bennee@linaro.org> References: <20170510170200.13285-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-20170510_100138_197171_14E5C09A X-CRM114-Status: GOOD ( 13.11 ) 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 Signed-off-by: Alex BennĂ©e Acked-by: Marc Zyngier --- 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 b2053393bb1f..6919363ce7cc 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 @@ -527,7 +527,7 @@ static int kvm_handle_cp_64(struct kvm_vcpu *vcpu, struct kvm_run *run, return emulate_cp15(vcpu, ¶ms); /* raz_wi cp14 */ - (void)pm_fake(vcpu, ¶ms, NULL); + (void)trap_raz_wi(vcpu, ¶ms, NULL); /* handled */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); @@ -583,7 +583,7 @@ static int kvm_handle_cp_32(struct kvm_vcpu *vcpu, struct kvm_run *run, return emulate_cp15(vcpu, ¶ms); /* raz_wi cp14 */ - (void)pm_fake(vcpu, ¶ms, NULL); + (void)trap_raz_wi(vcpu, ¶ms, NULL); /* handled */ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));