Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1754092ybk; Mon, 11 May 2020 03:32:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKvsThmcUtFXSYHRNrSzfOOaAApyt0NTzjNW1aYGaab7Z6YWb+XrPFU/lZVG2V1lrwXNFU2 X-Received: by 2002:a17:906:7f13:: with SMTP id d19mr12685809ejr.57.1589193130323; Mon, 11 May 2020 03:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589193130; cv=none; d=google.com; s=arc-20160816; b=s8TeeTysODGxPjatI+cUL7Nu6eRXJssvA4u9SXVi5GuZrWS3FLUlyIPfSt5SF1uqWb 9ZdGcZBAZPaZ2WFnrg12N/tr4FD9uV6CoC9qq9gJYIxcalPMB0n/RioKAtzmZUzAhPXP n9sklhlyK7g4cydfPvca7v27tpgzds6wKDV+72sV5CLArbm/aKvS/aHb7C8k3AvfHgS5 urLNHkCmMsWUMY+BmgO6E6NLPUH+irdHqEapSojQfo4NcdSOrbJGuhXol57PkzDx77VX vkQSSMwViHVMTjsMkA98gm0SR0Y+yKB4Ix244OVan/IGvzqMORnDuSvr5Nb8+LHsBcdb D8FQ== 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:dkim-signature; bh=KH0B+TULN3Sv9of7Lz3KKJVTgg3kWSn+sLstteOyN9s=; b=B978I3fmPeXwn/S0cJT2+lE871Vqv4syUB961KoATq+qOmZUtykdU5SscsH9nfmWnl jO44TAFwPHocwGeJsBjL4W3rKpKXd4ueYpPZ7EhfIJrXkGr2sJL/r0sy0AnMEBa9VSdH ZLVUN1U0kt0xBmRp7DXNm0WI8i495+gpuvyj5XzYOQ7z9pDQVOK3KxF6B2feiKeMqhUA zoFGOdGgLHqzA0wN1YvmYUGjSo+obiWcnwoKB91rGp153vxwJl8epHr8nJAWgXYxymbV nKdEGCKAJQjKcWow2vO+4nqIACQGlWA6rIFzqZF43JgQ+xB5yPRs0pTCXLaJrKhaaGRZ Masg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J0vuf+Zo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si5468763ejb.405.2020.05.11.03.31.46; Mon, 11 May 2020 03:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J0vuf+Zo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729495AbgEKK31 (ORCPT + 99 others); Mon, 11 May 2020 06:29:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:33872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728889AbgEKK31 (ORCPT ); Mon, 11 May 2020 06:29:27 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E97C02080C; Mon, 11 May 2020 10:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589192966; bh=/HtkDEUSJNCGLykcJeF51FbbiEEPPZDAt/jaVHdhRWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J0vuf+ZotQeRxth/qHzk0monizmO/oZrY0XlTEMp3GOvKC2C9ZGzbBQsmEje6tfhV drhODojTl9CKLTGN3jGxEvkg0amm8cChelSejV1audJqLmta+BCdVclouAv4z/FqLZ 5UsKODnRShHCuOk9nIvWvHXpIdZ2tVePfXGqPstU= Date: Mon, 11 May 2020 11:29:21 +0100 From: Will Deacon To: Marc Zyngier Cc: David Brazdil , Catalin Marinas , James Morse , Julien Thierry , Suzuki K Poulose , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/15] arm64: kvm: Move __smccc_workaround_1_smc to .rodata Message-ID: <20200511102921.GA18310@willie-the-truck> References: <20200430144831.59194-1-dbrazdil@google.com> <20200430144831.59194-7-dbrazdil@google.com> <20200511110459.1fcf4db7@why> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200511110459.1fcf4db7@why> 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, May 11, 2020 at 11:04:59AM +0100, Marc Zyngier wrote: > On Thu, 30 Apr 2020 15:48:22 +0100 > David Brazdil wrote: > > > This snippet of assembly is used by cpu_errata.c to overwrite parts of KVM hyp > > vector. It is never directly executed, so move it from .text to .rodata. > > > > Signed-off-by: David Brazdil > > --- > > arch/arm64/kvm/hyp/hyp-entry.S | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S > > index 5986e1d78d3f..7e5f386c5c2d 100644 > > --- a/arch/arm64/kvm/hyp/hyp-entry.S > > +++ b/arch/arm64/kvm/hyp/hyp-entry.S > > @@ -364,6 +364,11 @@ SYM_CODE_END(__bp_harden_hyp_vecs) > > .popsection > > > > #ifndef __HYPERVISOR__ > > + /* > > + * This is not executed directly and is instead copied into the vectors > > + * by install_bp_hardening_cb(). > > + */ > > + .pushsection .rodata > > SYM_CODE_START(__smccc_workaround_1_smc) > > I wonder whether we should keep the SYM_CODE_START() annotation or not. > It feels weird to say "code" in a rodata section, and the alignment > doesn't matter as we copy it in place, as you noticed. The BTI patches hook these, but I don't see that being relevant for a vector entry as PSTATE.BTYPE is zapped to 0. Will