From patchwork Fri Sep 11 08:55:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 53419 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 640A722B26 for ; Fri, 11 Sep 2015 09:07:14 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf22233458lbc.1 for ; Fri, 11 Sep 2015 02:07:13 -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=AlLoTv3atF1mIr+5kyU8vK++yKflYNjEK2Sjtjv/r7Q=; b=ENtlP3qYKvZlHlZQhDINrYqSoz82qKDtpICVn34aZmsrZWan+Y+K6RaV94tBTY4+IU KP8wWStwRt05oII8u8PxLv0qRsgm5ubCKprzZR0Ri/RVDbOssxBH7OV2Do+YJ3K/kLUm mB1oQe+ekXrGBcrt+e1z6w+fCgbt2Ri4BcHFXEPHKcaH3xnjgB9Z6e2swqf//DmIL8qq s71Ojs0xGZH6PfDVJ+qNlbez1Kv1iPJaCAbScJJWAZBgzaLvhwFGgaWT44/AUUOnb5AH fZv5YOI9fp2tHiWdj8uqCulWXR31RICPyg7VLz2vxQZBreIHCZruCGMrYSoJN2F+I7GT J+2w== X-Gm-Message-State: ALoCoQnC0/BP94DzOSLLITgLSWcq4bWWKM/pJjxVJ7vvbqEEiJVmgrpRuudbbgIwFAF9oYCgoyzz X-Received: by 10.112.144.99 with SMTP id sl3mr10827334lbb.12.1441962433350; Fri, 11 Sep 2015 02:07:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls345368lac.79.gmail; Fri, 11 Sep 2015 02:07:13 -0700 (PDT) X-Received: by 10.112.171.69 with SMTP id as5mr7148173lbc.111.1441962433225; Fri, 11 Sep 2015 02:07:13 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id ua1si399421lbb.29.2015.09.11.02.07.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 02:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbpo4 with SMTP id o4so36368187lbp.2 for ; Fri, 11 Sep 2015 02:07:13 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr39703099lbc.41.1441962433074; Fri, 11 Sep 2015 02:07:13 -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 w3csp1452708lbq; Fri, 11 Sep 2015 02:07:12 -0700 (PDT) X-Received: by 10.68.227.8 with SMTP id rw8mr94371360pbc.74.1441962431895; Fri, 11 Sep 2015 02:07:11 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id pm10si1009428pac.92.2015.09.11.02.07.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 02:07:11 -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 1ZaKGa-0001dc-3i; Fri, 11 Sep 2015 09:05:08 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZaK93-00019p-JQ for linux-arm-kernel@bombadil.infradead.org; Fri, 11 Sep 2015 08:57:21 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZaK90-0005Zw-G9 for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2015 08:57:19 +0000 Received: from 172.24.1.48 (EHLO SZXEML423-HUB.china.huawei.com) ([172.24.1.48]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUU27177; Fri, 11 Sep 2015 16:55:59 +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:50 +0800 From: Shannon Zhao To: Subject: [PATCH v2 15/22] KVM: ARM64: Add a helper for CP15 registers reset to specified value Date: Fri, 11 Sep 2015 16:55:08 +0800 Message-ID: <1441961715-11688-16-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_095718_965284_838017CA X-CRM114-Status: GOOD ( 11.36 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-4.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [58.251.152.64 listed in wl.mailspike.net] -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 SPF_PASS SPF: sender matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -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.174 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 a0b3811..a476b1b 100644 --- a/arch/arm64/kvm/sys_regs.h +++ b/arch/arm64/kvm/sys_regs.h @@ -119,6 +119,14 @@ static inline void reset_val(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r vcpu_sys_reg(vcpu, r->reg) = r->val; } +static inline void reset_val_cp15(struct kvm_vcpu *vcpu, + const struct sys_reg_desc *r) +{ + BUG_ON(!r->reg); + BUG_ON(r->reg >= NR_SYS_REGS); + vcpu_cp15(vcpu, r->reg) = r->val; +} + static inline int cmp_sys_reg(const struct sys_reg_desc *i1, const struct sys_reg_desc *i2) {