Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8490799imu; Tue, 4 Dec 2018 09:10:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uv00Wtyb8TGhix4tjBtPGJXCLcnqJW/USrNcWFHI9E+p6jssTT30dC9Cu0Zq6IgFgVQdVd X-Received: by 2002:a17:902:e085:: with SMTP id cb5mr20484209plb.24.1543943419351; Tue, 04 Dec 2018 09:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543943419; cv=none; d=google.com; s=arc-20160816; b=REdWs3qdBhJNaH68tQfYoTKttJkgnsacfkAyeSiF0sq8LjPvr7qCkNdsOzeKAuir9l A1Bi6NWkjHZGpIYhLIVbaa6lkHzTgQxWNXe5/+e99lSGjIn+Kz3OQv1hsR4hn3i4wagW 2S5+4zVV7KbfOt0DIPdF6O2rsufWT4IDZpmaoCnpmkml0nmuxVRPKp+cAsTLdVX2zQnY uLqFPQChkejcAFLPlWwVOJEx8n9xq9uoaN4LTVecKle2muJ184/G70BD4RoERd3Gx1X5 lHg5lOYq4RfbULEqzHU3p1MwEoB9RDz0ShFZeHoAkJx/nf6tXQuqLvxyzOsV25c5aPJC QFRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xSIglThRKZYTzgvAOT/m22mBtnQb0ny8lv7r/U8E8R0=; b=eF4+vainDpNJLDwDeilM3r5ngsMCpvB1Qz94CKu/VPboXz5inB9XO5EVsU9CUJLAdI ibWhigYPf0zx3LCOWhntl1LCM7WEI9MNZswnMYsPHYSWdnHWAKN+nzDW7QKte7BpUw8I TEPmQ9ihcd/l4SdoitTUkTGmnGpuzAYJpk6l/zmFJAGg8HLYbnKyZRH/LiiOau0T1RbS aP2LhOh3V1n4auPTfPZbn6P1JxDbtIgyhppfXLZEUP009VQ8+h3+8Vuz9Q/rn0gTp/PU qdKxPMCOr2Pd/3M3/mTV2Mf0db9QA4r062XBulGfCXCoYNK0phudfiQzX0W7sjJSZTX3 dKng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si16098229plr.186.2018.12.04.09.10.02; Tue, 04 Dec 2018 09:10:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727138AbeLDRJN (ORCPT + 99 others); Tue, 4 Dec 2018 12:09:13 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37330 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbeLDRJN (ORCPT ); Tue, 4 Dec 2018 12:09:13 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D348A78; Tue, 4 Dec 2018 09:09:13 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 605CF3F614; Tue, 4 Dec 2018 09:09:11 -0800 (PST) Date: Tue, 4 Dec 2018 17:09:08 +0000 From: Catalin Marinas To: Julien Thierry Cc: linux-arm-kernel@lists.infradead.org, daniel.thompson@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, james.morse@arm.com, joel@joelfernandes.org, Dave Martin Subject: Re: [PATCH v6 07/24] arm64: Make PMR part of task context Message-ID: <20181204170908.GB19210@arrakis.emea.arm.com> References: <1542023835-21446-1-git-send-email-julien.thierry@arm.com> <1542023835-21446-8-git-send-email-julien.thierry@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542023835-21446-8-git-send-email-julien.thierry@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 12, 2018 at 11:56:58AM +0000, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > index 039144e..eb8120e 100644 > --- a/arch/arm64/kernel/entry.S > +++ b/arch/arm64/kernel/entry.S > @@ -249,6 +249,12 @@ alternative_else_nop_endif > msr sp_el0, tsk > .endif > > + /* Save pmr */ > +alternative_if ARM64_HAS_IRQ_PRIO_MASKING > + mrs_s x20, SYS_ICC_PMR_EL1 > + str x20, [sp, #S_PMR_SAVE] > +alternative_else_nop_endif > + > /* > * Registers that may be useful after this macro is invoked: > * > @@ -269,6 +275,13 @@ alternative_else_nop_endif > /* No need to restore UAO, it will be restored from SPSR_EL1 */ > .endif > > + /* Restore pmr */ > +alternative_if ARM64_HAS_IRQ_PRIO_MASKING > + ldr x20, [sp, #S_PMR_SAVE] > + msr_s SYS_ICC_PMR_EL1, x20 > + dsb sy > +alternative_else_nop_endif What's this DSB for? If it's needed, please add a comment. I would have expected an ISB (or none at all as we are going to return from an exception). -- Catalin