Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3282822imu; Mon, 7 Jan 2019 00:02:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN5YM1vjUxc0vDEEpwGGfZcIiBx55blmJAP5PgAD4NK/A4N8XCC03nI+vjas8y6QITVf1djR X-Received: by 2002:a63:680a:: with SMTP id d10mr10180721pgc.396.1546848141073; Mon, 07 Jan 2019 00:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546848141; cv=none; d=google.com; s=arc-20160816; b=KpeLrnf0s27gkqZI4cHhm6039Rb2g+GzGwUOTyQ81pfLPfPI8ydzmXy0HPylKAh6Hh UDMhghbOGr2UdkLtlKz69xf5MkfnpmywVaU0wfKLzNv6Ly82n3KTuchFzgRflQRAKaun IFKcC7XNonhvm+11q2DbBUy5hd+ZQrwfuEwy93eKW+BNIax3Q2NCiMWR2Z7Jl2ariEq0 rTkht+pWdktgAs3CKF/MCsTt4FcOAUFDAkrQ3WcLnkTdHm/eFhBNJQsyO+h3P0k2Y03F ERizAlGxZJvRM1gHNRf3qnBsBMEKbSh49CH1duhEhNuFUEKvlN2SG/tHVzkl8DotxwiO 9FVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=9oJh1M9BbLSEr/sqQCiH/mX8P+Wr/VWr/BB1kczC47Q=; b=ZrnSizYvdaX0nOPJafdgVNDq4LUjvh7WOd9ra4HMc3CMq34cWhMWxhKmNBCqNR+23G LPZN9k6ru1WvtHXXuLZR6apoa6VJbq2wkdaG4qTX/KoScKoRWA6sgd5MXlhsKYFkYOoE W1hpgL/oQW3hqv2E4KzJxYQSyxOdpwxYW+MrPci0lC/sgWCF7Kl6NEv60iW02aZnMlUL gH7xgoOu5OmbNLbC3cH6ZsfagymeB43Vt7oOJRTHatfKXBGami5f32528Kl0Ryo7ubEg cs97ha/1yKTdh5pLxNfTJinuHBui0Kr3ffUioD1Ez3J/qZGDWuTStkMR66KKHHRXBiwS hpPQ== 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 s4si59003191plr.306.2019.01.07.00.02.04; Mon, 07 Jan 2019 00:02:21 -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 S1726554AbfAGH7h convert rfc822-to-8bit (ORCPT + 99 others); Mon, 7 Jan 2019 02:59:37 -0500 Received: from terminus.zytor.com ([198.137.202.136]:58335 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbfAGH7h (ORCPT ); Mon, 7 Jan 2019 02:59:37 -0500 Received: from wld62.hos.anvin.org (c-24-5-245-234.hsd1.ca.comcast.net [24.5.245.234] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id x077xHl22965441 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 6 Jan 2019 23:59:18 -0800 Date: Sun, 06 Jan 2019 23:59:10 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <20190107074056.12532-1-caoj.fnst@cn.fujitsu.com> References: <20190107074056.12532-1-caoj.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH] x86/boot: drop memset from copy.S To: Cao jin , x86@kernel.org, linux-kernel@vger.kernel.org CC: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de From: hpa@zytor.com Message-ID: <000CE7C8-33F3-404A-9E7D-F2CCB0BA110E@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On January 6, 2019 11:40:56 PM PST, Cao jin wrote: >According to objdump output of setup, function memset is not used in >setup code. Currently, all usage of memset in setup come from macro >definition of string.h. > >Signed-off-by: Cao jin >--- >Compiled and booted under x86_64; compiled under i386. > >Questions: now there is 2 definition of memcpy, one lies in copy.S, >another lies in string.h which is mapped to gcc builtin function. Do we >still need 2 definition? Could we move the content of copy.S to >boot/string.c? > >At first glance, the usage of string.{c.h} of setup is kind of >confusing, >they are also used in compressed/ and purgatory/ > > arch/x86/boot/copy.S | 15 --------------- > 1 file changed, 15 deletions(-) > >diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S >index 15d9f74b0008..5157d08b0ff2 100644 >--- a/arch/x86/boot/copy.S >+++ b/arch/x86/boot/copy.S >@@ -33,21 +33,6 @@ GLOBAL(memcpy) > retl > ENDPROC(memcpy) > >-GLOBAL(memset) >- pushw %di >- movw %ax, %di >- movzbl %dl, %eax >- imull $0x01010101,%eax >- pushw %cx >- shrw $2, %cx >- rep; stosl >- popw %cx >- andw $3, %cx >- rep; stosb >- popw %di >- retl >-ENDPROC(memset) >- > GLOBAL(copy_from_fs) > pushw %ds > pushw %fs This is dependent on both gcc version and flags. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.