Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp628788pxb; Tue, 1 Feb 2022 07:17:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMRgrlLH/aAc49Eiqy31jF4E5EN4eeoc9wiqYAUKMjaxZDg4jKbYqXrN21m7q/RLFauWdP X-Received: by 2002:aa7:cd0e:: with SMTP id b14mr25512282edw.414.1643728643809; Tue, 01 Feb 2022 07:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643728643; cv=none; d=google.com; s=arc-20160816; b=Yq5n05Lwuhtr4/kyl4WnxFa1amvC07eN0pheYTer/uO5fAOTwcXthVLHjr8If8nUSE eO9lB8GDG+z8OBwHBYVXgGpkNob61v0SdyzOK9S3N+ySQT//uYk9rQeMjlKSDGKvFCHn WEH2FBF08MpFnv+LVb1oZ8HqFXjW+AmE4QvchPUGo24NYVFa/MbJvxMVhpPxIvmCDkfr vIokG+X7Tz3FNoB3p01sYr26O4nXccAX+n6/3nTYsORPeWt+QwDnFsL4qyvGkqJbY+zK AuTJ10/T5XyYhi7/UJvGMrg0lMdjZbFrMovFa/2Yu8Xc93K47KXgGVbqkQcER/do2Cu2 y74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LsDHbgTtgDI+RejCblwWdO7t/P+mQnyvyCfhiyn5epA=; b=c3rGuEOe0xoOUK2eNYlUwwfnZQOHz8G2Wee/JjdD7F0EKy12U7g56KasDxl4QeV+fb bsa78WOrXLBTMMeyw7qiVcunYiOY05z2v1iraxsnayFhSk/Q4djxQ2Bkq9QyTE6aXO6v rbLrvwk3B4pX7FyobICWD6uIciwnFu0Ebr8nMkVDoUt0e/l8aSzATqSj2Qs224A5uv/Q c9Up9W686/V7nM3N7QiG6VDSgyXydZ+kB0rSApPtaSglqHf/rlMN8SCQTkB/BpQoQzPl erskydMmRQ03hniZf5A5fMfFdmzUaY0qL4bX+LM9NiU9O2RcKtXZMkc4ULOPGhzIo98S CrTg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ji7si9374396ejc.39.2022.02.01.07.16.56; Tue, 01 Feb 2022 07:17:23 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357315AbiAaC3T (ORCPT + 99 others); Sun, 30 Jan 2022 21:29:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236210AbiAaC3S (ORCPT ); Sun, 30 Jan 2022 21:29:18 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14E6FC061714 for ; Sun, 30 Jan 2022 18:29:18 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEMRG-005yv8-9D; Mon, 31 Jan 2022 02:29:06 +0000 Date: Mon, 31 Jan 2022 02:29:06 +0000 From: Al Viro To: Peter Zijlstra Cc: Eric Dumazet , kernel test robot , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, x86@kernel.org, Alexander Duyck , linux-um@lists.infradead.org Subject: Re: [tip:x86/core 1/1] arch/x86/um/../lib/csum-partial_64.c:98:12: error: implicit declaration of function 'load_unaligned_zeropad' Message-ID: References: <202111180219.YkyoBMpf-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 29, 2021 at 06:00:56AM +0000, Al Viro wrote: > On Thu, Nov 18, 2021 at 05:00:58PM +0100, Peter Zijlstra wrote: > > > Dear um folks, is this indeed the best solution? It's a bit sad to have > > to add this to x86_64, but if that's the way it is... > > Something like this, perhaps? (absolutely untested) [snip] AFAICS, this (on top of current mainline) does the right thing. commit 6692531df62d812de5d22c8bca0d90edc163aa84 Author: Al Viro Date: Sun Jan 30 21:25:53 2022 -0500 uml/x86: use x86 load_unaligned_zeropad() allows, among other things, to drop !DCACHE_WORD_ACCESS mess in x86 csum-partial_64.c Signed-off-by: Al Viro diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index e5a7b552bb384..a58b67ec8119d 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -23,7 +23,6 @@ generic-y += softirq_stack.h generic-y += switch_to.h generic-y += topology.h generic-y += trace_clock.h -generic-y += word-at-a-time.h generic-y += kprobes.h generic-y += mm_hooks.h generic-y += vga.h diff --git a/arch/x86/lib/csum-partial_64.c b/arch/x86/lib/csum-partial_64.c index 1f8a8f8951738..50734a23034c4 100644 --- a/arch/x86/lib/csum-partial_64.c +++ b/arch/x86/lib/csum-partial_64.c @@ -93,7 +93,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum) buff += 8; } if (len & 7) { -#ifdef CONFIG_DCACHE_WORD_ACCESS unsigned int shift = (8 - (len & 7)) * 8; unsigned long trail; @@ -103,31 +102,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum) "adcq $0,%[res]" : [res] "+r" (temp64) : [trail] "r" (trail)); -#else - if (len & 4) { - asm("addq %[val],%[res]\n\t" - "adcq $0,%[res]" - : [res] "+r" (temp64) - : [val] "r" ((u64)*(u32 *)buff) - : "memory"); - buff += 4; - } - if (len & 2) { - asm("addq %[val],%[res]\n\t" - "adcq $0,%[res]" - : [res] "+r" (temp64) - : [val] "r" ((u64)*(u16 *)buff) - : "memory"); - buff += 2; - } - if (len & 1) { - asm("addq %[val],%[res]\n\t" - "adcq $0,%[res]" - : [res] "+r" (temp64) - : [val] "r" ((u64)*(u8 *)buff) - : "memory"); - } -#endif } result = add32_with_carry(temp64 >> 32, temp64 & 0xffffffff); if (unlikely(odd)) { diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 40d6a06e41c81..4eb47d3ba6250 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -8,6 +8,7 @@ endmenu config UML_X86 def_bool y + select DCACHE_WORD_ACCESS config 64BIT bool "64-bit kernel" if "$(SUBARCH)" = "x86"