Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D18FC05027 for ; Sun, 12 Feb 2023 15:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbjBLPsd (ORCPT ); Sun, 12 Feb 2023 10:48:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjBLPsc (ORCPT ); Sun, 12 Feb 2023 10:48:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A3F74C29 for ; Sun, 12 Feb 2023 07:48:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01C6460D37 for ; Sun, 12 Feb 2023 15:48:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC434C433EF; Sun, 12 Feb 2023 15:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676216910; bh=Vukdoymwm/wEA58+hycxqrl3bmx2LN+x0akzNw5Yu2s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s4hRk23TmcLpC3qBZrOU7D2TKEUlF7xHXzs3SYhgVfrPxWvNBDxb2dvz/pbrehLJ5 ibjxhOPLcd/aUKIHHA1rK9qmS1W+ilXlxSnSAB90r2GzrogU0/PQoVDbYP8FOQ6pMu ho4fp2QY+4mJnQGoYqPj0cVZQrEobBnIlodAHaSLR7u7QhXuM9BJm3flou3ajE0b3V RO9IXfldG2mgrpJ5UDLsln9X64bd/kUzM5uNTBoVY9gDXF9d0PnUDjXYGxIhR1aK7N +xTDGqNAXTXgdMYkGuHn927KUviECLNxqll2KcUXjocfIKRUqVLgKHeK6CTJqkTToG gxFxDyC6rPnLQ== Date: Sun, 12 Feb 2023 15:48:25 +0000 From: Conor Dooley To: Samuel Holland Cc: Heiko Stuebner , Jisheng Zhang , Palmer Dabbelt , linux-riscv@lists.infradead.org, Andrew Jones , Christoph Muellner , Conor Dooley , Guo Ren , Heiko Stuebner , Nathan Chancellor , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] riscv: Fix early alternative patching Message-ID: References: <20230212021534.59121-1-samuel@sholland.org> <20230212021534.59121-2-samuel@sholland.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZZwqfOBoXuz7+HRs" Content-Disposition: inline In-Reply-To: <20230212021534.59121-2-samuel@sholland.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ZZwqfOBoXuz7+HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2023 at 08:15:32PM -0600, Samuel Holland wrote: > Now that the text to patch is located using a relative offset from the > alternative entry, the text address should be computed without applying > the kernel mapping offset, both before and after VM setup. >=20 > Fixes: 8d23e94a4433 ("riscv: switch to relative alternative entries") Reviewed-by: Conor Dooley > Signed-off-by: Samuel Holland > --- >=20 > arch/riscv/errata/thead/errata.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/e= rrata.c > index c0bea5c94128..1dd90a5f86f0 100644 > --- a/arch/riscv/errata/thead/errata.c > +++ b/arch/riscv/errata/thead/errata.c > @@ -102,9 +102,7 @@ void __init_or_module thead_errata_patch_func(struct = alt_entry *begin, struct al > =20 > /* On vm-alternatives, the mmu isn't running yet */ > if (stage =3D=3D RISCV_ALTERNATIVES_EARLY_BOOT) > - memcpy((void *)__pa_symbol(oldptr), > - (void *)__pa_symbol(altptr), > - alt->alt_len); > + memcpy(oldptr, altptr, alt->alt_len); > else > patch_text_nosync(oldptr, altptr, alt->alt_len); > } > --=20 > 2.37.4 >=20 --ZZwqfOBoXuz7+HRs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCY+kKSQAKCRB4tDGHoIJi 0hTXAP9igWO796XC6hLAXjhirFkpfB6Cxc4+Iy3v0XaTjWbkKQD43amLsSE0ma63 mWwEfULUWh6gbSdqjnv3HsVqCG9+DA== =O9Y0 -----END PGP SIGNATURE----- --ZZwqfOBoXuz7+HRs--