Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2734241ybt; Fri, 3 Jul 2020 17:52:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIuhgciMpEnyBP1COVNTPLiI7j8Y8xAG6xeSL8SX0J5tmDOI8HsxwwWlM9JkNSYbysDX+h X-Received: by 2002:aa7:d1c8:: with SMTP id g8mr43664771edp.337.1593823964548; Fri, 03 Jul 2020 17:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593823964; cv=none; d=google.com; s=arc-20160816; b=HEWdUCwlDvM6tBqZfB0GPu2rIX0gV4wSgxPVsmLnFIddTVXfBPERSj5igP27IVKCmk 34VX1m8CSVFWuVeQd9G7wPZJI7KcXI12SpaETr6anXgADLeLMbR1Jq5Mc65NNu7htKjO 9yaN/XyoOZ9374Ds5prNSACzWosgcKG+YS1U7iZwtly9sLAEBoY6aR8FVduFVq15qN5j CAQSiBGAiaK889muwIKkN8BEAL0gsoZJJjFPPV74o/CUBCdkITf4nsdW8W5tvsl9o1tv j0Ed1LP0VvHMKe62N62lHBY3PYP+7Wij/4o0/cenwxXtadSATGvzvPgPt2a7bt5ofGkV UcWw== 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=82LQIkTj5jJ/JgIy9IgNairqM1DXJ2r13pIDGcqbXEI=; b=s99rnkdvMUUD1lH/66tbf3bCz7nK+anQ9rblqhv57z929jNiMyDyjni4DlRSVAYDCP kukASgTEd2qyHWQHQh7j2jXwAeqqHFlYUSQBruBUpoA33BKQt56rKxpK6ZwQOySFNGHe u9elBK+Qxa6iV6EVmW5Ywds9n120zPqIilXWUPaSX/a0BUzcVS8tJ/YN50qIkPP/Eh3N /EQmuumo2jykcdkcOz3xHjBNRK6VeF13SU/vcHyw4Rp/syqQziznYqCefFIPWSP2/7y+ aljLtSIAJY5rM4xVjJ3P8u81uRmtLm/OqR+mE8XWciwGolTp3iQupciA5N+eTSoNXCAR 4LHA== 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 z27si9855330ejl.277.2020.07.03.17.52.22; Fri, 03 Jul 2020 17:52:44 -0700 (PDT) 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 S1726733AbgGDAuO (ORCPT + 99 others); Fri, 3 Jul 2020 20:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbgGDAuN (ORCPT ); Fri, 3 Jul 2020 20:50:13 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61B9C061794 for ; Fri, 3 Jul 2020 17:50:13 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrWNT-004w6G-Cd; Sat, 04 Jul 2020 00:49:59 +0000 Date: Sat, 4 Jul 2020 01:49:59 +0100 From: Al Viro To: Linus Torvalds Cc: Michael Ellerman , Christophe Leroy , Josh Poimboeuf , Peter Zijlstra , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: objtool clac/stac handling change.. Message-ID: <20200704004959.GY2786714@ZenIV.linux.org.uk> References: <20200701195914.GK2786714@ZenIV.linux.org.uk> <87lfk26nx4.fsf@mpe.ellerman.id.au> <20200702201755.GO2786714@ZenIV.linux.org.uk> <20200702205902.GP2786714@ZenIV.linux.org.uk> <20200703013328.GQ2786714@ZenIV.linux.org.uk> <20200703210237.GS2786714@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200703210237.GS2786714@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 03, 2020 at 10:02:37PM +0100, Al Viro wrote: > PS: I'm still going through the _ASM_EXTABLE... users on x86, so there > might be more fun. Will post when I'm done... Lovely... Not directly related to that, but... WTF? arch/x86/lib/csum-copy_64.S: /* * No _ASM_EXTABLE_UA; this is used for intentional prefetch on a * potentially unmapped kernel address. */ .macro ignore L=.Lignore 30: _ASM_EXTABLE(30b, \L) .endm ... ignore 2f prefetcht0 5*64(%rdi) 2: (and no other users of 'ignore' anywhere). How could prefetcht0 possibly raise an exception? Intel manual says that the only exception is #UD if LOCK PREFETCHT0 is encountered; not here, obviously. AMD manual simply says "no exceptions". Confused... Incidentally, in the same file: SYM_FUNC_START(csum_partial_copy_generic) cmpl $3*64, %edx jle .Lignore .Lignore: .... And it had been that way since "[PATCH] Intel x86-64 support merge" back in 2004, where we had @@ -59,15 +59,6 @@ csum_partial_copy_generic: cmpl $3*64,%edx jle .Lignore - ignore - prefetch (%rdi) - ignore - prefetch 1*64(%rdi) - ignore - prefetchw (%rsi) - ignore - prefetchw 1*64(%rsi) - .Lignore: .... @@ -115,7 +106,7 @@ csum_partial_copy_generic: movq 56(%rdi),%r13 ignore 2f - prefetch 5*64(%rdi) + prefetcht0 5*64(%rdi) 2: adcq %rbx,%rax adcq %r8,%rax What's going on in there? According to AMD manual, prefetch and prefetchw can raise an exception (#UD), if PREFETCH/PREFETCHW are not supported, as indicated by ECX bit 8 of CPUID function 8000_0001h Long Mode is not supported, as indicated by EDX bit 29 of CPUID function 8000_0001h The 3DNow! instructions are not supported, as indicated by EDX bit 31 of CPUID function 8000_0001h. so these at least used to make some sense, but why leave that thing at the place where old prefetch became prefetcht0 and what is that comment in front of 'ignore' definition about? Exceptions there had never been about unmapped addresses - that would make no sense for prefetch. What am I missing here?