From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CC453546E8 for ; Sat, 30 May 2026 23:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780185466; cv=none; b=EZX74Mv0wBlrrdw+nEHaz8uOdluNKZWcwIHZZt/nTbRvPXrFbTarV46Zxx0fRsEbUNvXaqjhlMvLDOW6LiLDD94uHp6vYj7hC+sctRn5VmdB/b70IT+zJi5DoLOne1M6B7HxCxzUNilG2oeRU2UizrQGrTI0CDueLG+ywEmBKkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780185466; c=relaxed/simple; bh=FCsw9ZvGfh1ZNaTydv735tuRV00ufivhgWnCsYprfGY=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=dCDlT3H7IkZUw7uOE6p3t8FXoX14mErdeZMcbBlpxUX5F4XIBTq1UdGqly4UPww6ZCn3apapzwMtRcysTWHr7goFwaBidsxvicnJnYbGdJxQx7AD2rDXDR41mR2uT3isLu1ck6SPELY5UUNrOy/EAssVuxaiCnHt3DviVjhgKao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=qnIO4wNx; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="qnIO4wNx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Bg/X9f6yBi+M3ht1lgBwAQhSZSPfBcd2GOjHrohqvmU=; b=qnIO4wNx9IYcl3RIa2Apc4VNJ+ cjBxfwb8om/Gs7YOpR/rP93sZyQ7rXqz8c95t9ldYTf551SN4jkfsP1atTEHS3bLFVP73JwnC4qHk 1QB/gnv9V0vnBeuMN+afB0Liw/Zmje/GXWu6aRo5lajuPZBIRaf2oSKJjPNqafHBU8xPbkA/o5mVr IlJUzR5SE8hMhqt0J/X3YYxoVch3ElvNMyqYgfvkYadvmJpn2TJRoysvbYPS7I4sVCrhNDb4/utko khUBZ4QfMyP6X1RLInaopyYW2h2eViW2GmgQQepSJScYaF4HmfxKt1yeA5h6wPkvtHTFXog2Zwmoh ZsCSAXXw==; Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com) by fanzine2.igalia.com with esmtps (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1wTTYO-00APX3-4O; Sun, 31 May 2026 01:57:20 +0200 Received: from webmail.service.igalia.com ([192.168.21.45]) by mail.igalia.com with esmtp (Exim) id 1wTTYL-003ubH-Lj; Sun, 31 May 2026 01:57:20 +0200 Received: from localhost ([127.0.0.1] helo=webmail.igalia.com) by webmail.service.igalia.com with esmtp (Exim 4.98.2) (envelope-from ) id 1wTTYK-00000005chD-46OS; Sun, 31 May 2026 01:57:17 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Sat, 30 May 2026 20:57:17 -0300 From: Mauricio Faria de Oliveira To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Juergen Gross , Alexey Dobriyan , Boris Ostrovsky , kernel-dev@igalia.com, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, kernel test robot Subject: Re: [PATCH v4 1/4] x86/asm: move inline string functions to In-Reply-To: <20260530234840.GBaht3WL8L15zfNvBF@fat_crate.local> References: <20260526-pvh-kasan-inline-v4-0-a310e6a25ecd@igalia.com> <20260526-pvh-kasan-inline-v4-1-a310e6a25ecd@igalia.com> <20260530234840.GBaht3WL8L15zfNvBF@fat_crate.local> Message-ID: <482d866c513a0ada46b221602a0824f8@igalia.com> X-Sender: mfo@igalia.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Report: NO, Score=-4.7, Tests=ALL_TRUSTED=-3,AWL=-2.550,BAYES_50=0.8,URIBL_BLOCKED=0.001,URIBL_DBL_BLOCKED_OPENDNS=0.001,URIBL_ZEN_BLOCKED_OPENDNS=0.001 X-Spam-Score: -46 X-Spam-Bar: ---- On 2026-05-30 20:48, Borislav Petkov wrote: > On Tue, May 26, 2026 at 11:52:33AM -0300, Mauricio Faria de Oliveira wrote: >> In a future patch, 'boot/string.c' will include inline string functions. >> >> Using the header is problematic for a couple of reasons >> (i.e., build errors), which can be addressed, but introduce unnecessary >> complexity and regression risk (beyond these _found_ couple of reasons). >> >> Using a new header is simpler and transparent to >> existing users of , with less changes to 'boot/string.c' >> and its users (eg 'boot/compressed/string.c' and 'purgatory/purgatory.ro'), >> which minimize regression risk. >> >> No functional change intended. >> >> Reported-by: kernel test robot >> Closes: https://lore.kernel.org/oe-kbuild-all/202605140922.q7IlUv7o-lkp@intel.com/ >> Signed-off-by: Mauricio Faria de Oliveira >> Reviewed-by: Juergen Gross >> >> --- >> (*) Reasons not to include in 'boot/string.c': >> >> 1) 'boot/string.c' is built for 16-bit/real mode thus some type and word >> size errors happen when include, e.g., . >> >> This can be addressed with '#ifndef _SETUP' (defined by 'boot/Makefile'). >> >> 2) 'boot/string.c' is included by 'boot/compressed/string.c' which is >> the source of 'purgatory/string.o', linked by 'purgatory/purgatory.ro' >> (CONFIG_KEXEC_FILE). >> >> In 64BIT, includes , which references >> __memset() and __memmove() with KCFI_REFERENCE(), ie, __ADDRESSABLE(); >> however, 'purgatory/purgatory.ro' is not linked with implementations. >> >> So, CONFIG_KEXEC_FILE and CONFIG_CFI without CONFIG_KASAN hit errors: >> >> >> ld.lld: error: undefined symbol: __memset >> >>> referenced by string.c >> >>> arch/x86/purgatory/purgatory.ro:\ >> (__UNIQUE_ID_addressable___memset_0) >> -- >> >> ld.lld: error: undefined symbol: __memmove >> >>> referenced by string.c >> >>> arch/x86/purgatory/purgatory.ro:\ >> (__UNIQUE_ID_addressable___memmove_1) >> >> (Note: this is not hit with CONFIG_KASAN because 'boot/compressed/string.c' >> adds aliases __memset()/__memmove() to memset()/memmove() in that case.) >> >> This can be addressed with 'CFLAGS_string.o := -D__DISABLE_EXPORTS' so to >> disable KCFI_REFERENCE() in 'purgatory/Makefile' (it removes CC_FLAGS_CFI >> anyway). >> >> ... >> >> However, since a change in this series would need more changes to address >> errors it causes, it is reasonable to change the series not to cause them, >> by using a separate header with _just_ inline string functions. > > This is very long-winded and it meanders across things. Write it more > disciplined, please, and formulate it such that you're writing the commit > message of a standalone patch. It should have merit on its own and not talk > about future patches and so on. > > And yes, the intent to have a separate header which doesn't pull in > nasty deps between decompressor and kernel proper, is ok. > > For that, we have arch/x86/include/asm/shared/ which contains functionality > shared between the two objects so I think you should move it there. It'll also > make it a "clean" header which contains solely this stuff and doesn't pull in > any other shit. Ack; thanks for the feedback and pointers, I'll take a look. > > Thx. -- Mauricio