From patchwork Fri Sep 11 08:54:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 53410 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id B8C1222DD2 for ; Fri, 11 Sep 2015 08:58:47 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf16171792wic.2 for ; Fri, 11 Sep 2015 01:58: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:mime-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe:cc :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=0qom931OF5SI4EnPCnJanaGFT4fE6p5uk5Sm2QIyzrI=; b=aHZL33r+5nkHqtmN8R2JxsjOA55yQe9SHPIT55HNtbcfH+kJvGQPJVwQV5ecESDtz+ FY/tspWyefG5knt6vxb7tJ0hP9AbU0DPIlR7rxVTwQ4elksvq/YOdXh/eVt7ZCrb5uw/ 3y+iAeY9UvMnhphJOgqDxJhE+J/SzGPeWxSyLtmNjKW41NCOQsbhsb03Iq9eTGb6BV/H c1oODnoJMrB3kXw0qzC97r0cEoJViEAqc+klooCMcwIUgz703lfcLqNKEwu4nv0fpsgO gSMCFasel08iUD01DNoQsP9HZ9G7Z/6qE5STn1GrD+NOAXxf1pHVbMKgdS6/enSe5WG2 iuhg== X-Gm-Message-State: ALoCoQm6ExiR5V9lHi7XFkOeqSxEuIXelAlDi4QCJUD7W1Y7e+lg/yT9PUdP83pgr70Q3ggS9x86 X-Received: by 10.180.188.211 with SMTP id gc19mr2106334wic.6.1441961927087; Fri, 11 Sep 2015 01:58:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.202 with SMTP id p10ls305052lae.95.gmail; Fri, 11 Sep 2015 01:58:46 -0700 (PDT) X-Received: by 10.112.72.97 with SMTP id c1mr26954321lbv.86.1441961926938; Fri, 11 Sep 2015 01:58:46 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id t1si365203lbk.72.2015.09.11.01.58.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 01:58:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbpo4 with SMTP id o4so36263733lbp.2 for ; Fri, 11 Sep 2015 01:58:46 -0700 (PDT) X-Received: by 10.152.22.133 with SMTP id d5mr40661997laf.112.1441961926818; Fri, 11 Sep 2015 01:58:46 -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.59.35 with SMTP id w3csp1447426lbq; Fri, 11 Sep 2015 01:58:46 -0700 (PDT) X-Received: by 10.66.251.136 with SMTP id zk8mr84734891pac.143.1441961925709; Fri, 11 Sep 2015 01:58:45 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id vn9si985475pbc.33.2015.09.11.01.58.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 01:58:45 -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 1ZaK9K-0001My-S3; Fri, 11 Sep 2015 08:57:38 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZaK8w-0000rW-IS for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2015 08:57:15 +0000 Received: from 172.24.1.49 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUU27152; Fri, 11 Sep 2015 16:55:53 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML423-HUB.china.huawei.com (10.82.67.154) with Microsoft SMTP Server id 14.3.235.1; Fri, 11 Sep 2015 16:55:42 +0800 From: Shannon Zhao To: Subject: [PATCH v2 05/22] KVM: ARM64: Add a helper for CP15 registers reset to UNKNOWN Date: Fri, 11 Sep 2015 16:54:58 +0800 Message-ID: <1441961715-11688-6-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1441961715-11688-1-git-send-email-zhaoshenglong@huawei.com> References: <1441961715-11688-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150911_015714_965817_D7B28740 X-CRM114-Status: UNSURE ( 7.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [58.251.152.64 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [58.251.152.64 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: wei@redhat.com, kvm@vger.kernel.org, marc.zyngier@arm.com, will.deacon@arm.com, peter.huangpeng@huawei.com, linux-arm-kernel@lists.infradead.org, zhaoshenglong@huawei.com, alex.bennee@linaro.org, christoffer.dall@linaro.org, shannon.zhao@linaro.org 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: patch@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.169 as permitted sender) smtp.mailfrom=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 From: Shannon Zhao Signed-off-by: Shannon Zhao --- arch/arm64/kvm/sys_regs.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h index d411e25..a0b3811 100644 --- a/arch/arm64/kvm/sys_regs.h +++ b/arch/arm64/kvm/sys_regs.h @@ -104,6 +104,14 @@ static inline void reset_unknown(struct kvm_vcpu *vcpu, vcpu_sys_reg(vcpu, r->reg) = 0x1de7ec7edbadc0deULL; } +static inline void reset_unknown_cp15(struct kvm_vcpu *vcpu, + const struct sys_reg_desc *r) +{ + BUG_ON(!r->reg); + BUG_ON(r->reg >= NR_COPRO_REGS); + vcpu_cp15(vcpu, r->reg) = 0xdecafbad; +} + static inline void reset_val(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) { BUG_ON(!r->reg);