From patchwork Fri Sep 25 12:00:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 54158 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id F41B122B1E for ; Fri, 25 Sep 2015 12:00:57 +0000 (UTC) Received: by lacdq2 with SMTP id dq2sf1489946lac.3 for ; Fri, 25 Sep 2015 05:00:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Hqm+y7R14sVgk93TEre1xx3aLI507IF+6ZiuMrTy6cE=; b=R7R+DKy7WAQtXpRBm7QBKrhHzGRgvKloSg49ani0qOjXTwMUgIXSmbtCptpjFeo6Z2 zXBpCOyMlw1etusneQYbignuavVfmWB1IiCSVIbvKhRxkiPwDlJyrJHRWVaYv7auvFS8 Ga+PuVfPjx0dpm6TVQOMEsxR+wQXvFU3cqx7k0KJMJ4inGGc3X33eoH4J/T4yVehI4yd OJn2rrAb0SjStbIaqT6M+6Z6UG8n2UtJ1WKsl5uEblRzdrtqqi1PjZ9zh0k9KmrbFRDS kZBYLT4NK9avpZ8xZ9Oq0767mqNGzw/OqzdowtlBw8S0KcW+LdmvUSJa8QWADjaexkg4 Z5Mw== X-Gm-Message-State: ALoCoQkSRgVBLcGx9po+kzOM9YCFsa8L7HVpM27ep53g9Q5QdoepFPME5vt2DwLohaRZybbyIqFX X-Received: by 10.180.188.211 with SMTP id gc19mr440417wic.6.1443182456937; Fri, 25 Sep 2015 05:00:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.137 with SMTP id d9ls185999laf.42.gmail; Fri, 25 Sep 2015 05:00:56 -0700 (PDT) X-Received: by 10.25.41.72 with SMTP id p69mr994816lfp.111.1443182456820; Fri, 25 Sep 2015 05:00:56 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id 8si1583462lak.55.2015.09.25.05.00.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2015 05:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laclj5 with SMTP id lj5so570906lac.3 for ; Fri, 25 Sep 2015 05:00:56 -0700 (PDT) X-Received: by 10.112.202.35 with SMTP id kf3mr1544887lbc.19.1443182456591; Fri, 25 Sep 2015 05:00:56 -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 w3csp902871lbq; Fri, 25 Sep 2015 05:00:55 -0700 (PDT) X-Received: by 10.68.215.73 with SMTP id og9mr6781599pbc.122.1443182441027; Fri, 25 Sep 2015 05:00:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wn10si5223050pab.97.2015.09.25.05.00.40; Fri, 25 Sep 2015 05:00:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755923AbbIYMAj (ORCPT + 1 other); Fri, 25 Sep 2015 08:00:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:56686 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755924AbbIYMAh (ORCPT ); Fri, 25 Sep 2015 08:00:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8816AAD2A; Fri, 25 Sep 2015 12:00:35 +0000 (UTC) From: Jiri Slaby To: stable@vger.kernel.org Cc: Will Deacon , Jiri Slaby Subject: [patch added to the 3.12 stable tree] arm64: head.S: initialise mdcr_el2 in el2_setup Date: Fri, 25 Sep 2015 14:00:21 +0200 Message-Id: <1443182432-19692-7-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1443182432-19692-1-git-send-email-jslaby@suse.cz> References: <1443182432-19692-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.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.215.44 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Will Deacon This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit d10bcd473301888f957ec4b6b12aa3621be78d59 upstream. When entering the kernel at EL2, we fail to initialise the MDCR_EL2 register which controls debug access and PMU capabilities at EL1. This patch ensures that the register is initialised so that all traps are disabled and all the PMU counters are available to the host. When a guest is scheduled, KVM takes care to configure trapping appropriately. Acked-by: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jiri Slaby --- arch/arm64/kernel/head.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 7090c126797c..aca41b06dc7a 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -192,6 +192,11 @@ ENTRY(el2_setup) msr hstr_el2, xzr // Disable CP15 traps to EL2 #endif + /* EL2 debug */ + mrs x0, pmcr_el0 // Disable debug access traps + ubfx x0, x0, #11, #5 // to EL2 and allow access to + msr mdcr_el2, x0 // all PMU counters from EL1 + /* Stage-2 translation */ msr vttbr_el2, xzr