From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 604CFECAAD8 for ; Tue, 20 Sep 2022 09:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KVJJ0Z63dPGs1T/QsR5L25vU84hRXisDlfNJtK1kMZQ=; b=WK+7e/UXN7aFDH +aI51wTIWEOQ0fR1KlwhYI+F2y34YoET1Ue6fcyvIXSJ5+8u87h0JnY9RonFNBfkiCLv8woPg7cxY 3idN7lsysNjZ8/QRzkcAIKLGKD+rktTbhjaukk2u1N9ILhhZicZ7hWa3qH6Mf8mFapT6MS8K0tjqr nvj3CVV9Sqjl+0bI+OCPLKJC5ujIK7kycw7jd1OxUVv9peYBb/rj2QrFdja9IlrcASmeKouT6sbvZ oAV3QZMNB2HiLJOyoVAUEOJ5jVelkrtL/7yCepbfv+Hv/dgBIhhGIEbfk2FbmKwHy56q6w35FJupT A48hsQ63/yI5yk9gSr6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaZxa-002eue-H7; Tue, 20 Sep 2022 09:54:34 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaZxW-002esD-SY for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 09:54:32 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id AE744B82742; Tue, 20 Sep 2022 09:54:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7684BC433C1; Tue, 20 Sep 2022 09:54:24 +0000 (UTC) Date: Tue, 20 Sep 2022 10:54:21 +0100 From: Catalin Marinas To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Matthew Garrett , Peter Jones , Ilias Apalodimas , Heinrich Schuchardt , AKASHI Takahiro , Palmer Dabbelt , Atish Patra , Arnd Bergmann , Huacai Chen , Xi Ruoyao , Lennart Poettering , Jeremy Linton , Will Deacon Subject: Re: [PATCH v5 3/8] efi/libstub: use EFI provided memcpy/memset routines Message-ID: References: <20220910081152.2238369-1-ardb@kernel.org> <20220910081152.2238369-4-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220910081152.2238369-4-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220920_025431_099975_6E47BD22 X-CRM114-Status: GOOD ( 18.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Sep 10, 2022 at 10:11:47AM +0200, Ard Biesheuvel wrote: > The stub is used in different execution environments, but on arm64, > RISC-V and LoongArch, we still use the core kernel's implementation of > memcpy and memset, as they are just a branch instruction away, and can > generally be reused even from code such as the EFI stub that runs in a > completely different address space. > > KAsan complicates this slightly, resulting in the need for some hacks to > expose the uninstrumented, __ prefixed versions as the normal ones, as > the latter are instrumented to include the KAsan checks, which only work > in the core kernel. > > Unfortunately, #define'ing memcpy to __memcpy when building C code does > not guarantee that no explicit memcpy() calls will be emitted. And with > the upcoming zboot support, which consists of a separate binary which > therefore needs its own implementation of memcpy/memset anyway, it's > better to provide one explicitly instead of linking to the existing one. > > Given that EFI exposes implementations of memmove() and memset() via the > boot services table, let's wire those up in the appropriate way, and > drop the references to the core kernel ones. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/kernel/image-vars.h | 13 --------- Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel