Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2222302rwi; Fri, 21 Oct 2022 00:56:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PAcyouel/WES5vgU+OZ6lgDuxR2c1PqTb1mLzXHyOyCzaWqyBQ2qObgkBCDnZNyFhi/KF X-Received: by 2002:a17:906:730d:b0:78e:9ca5:3269 with SMTP id di13-20020a170906730d00b0078e9ca53269mr14376416ejc.366.1666338974169; Fri, 21 Oct 2022 00:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666338974; cv=none; d=google.com; s=arc-20160816; b=KoU6015Ok14FVKIrajn8aMQ9lgPNx2V57V5Pb/vXCEjs21ZvKeDF6XEj+LHYF5ZRdH Lx3CP9Hyf9hIUX4wuFP01lHYUq5QBJlaRfD+HyLQaejZ50zruljO2WpoNvXz4bouElra AMmxuQx5R0JEzS3mP4MAPDCjvIPEVg7ro+HcMZKesBScZ3oO/wMwV9mon4YkGwRiO7ql NRY8xWLbiEQffB5uQD/kSEN2OM+egUvos8czpSdebMckxgNyguCvDTYREsWeLAZrfLNC JEfpM6Ihe5ayEksMD00gP7kBMGuHiSDuO9o6rrEsTIL8yzHMWZeIJuAdNENLfPuJ9mOd MnMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EsplvAD0YnBguXQlzUFoC3GmIDeXTyF4HsNuxqTuuJ8=; b=K2C682KDFLVpooaSt7IL/1TQ+wQpD84SiWnU9N90iE1PwX4xlFJJy9+JSSy6D7yjUH d+7CljOjJKs2WdBWtKXSsCCNlpCy8Do5bIStD9eq0cBv912YNx2BRinpH2mYWjmtMhI0 YI+9xYiSfG2SUYdp/9LfVf6Zee4I6lRaIhi0mQm6xeBlD6gxikyVcrYV5rRP2QntoYK1 DphmTKR9EEs95gB241XWVRbt2vQVdxSJzdWAdNiLhVG1Lb9uFBiZj3zRwwfWEE3+0Y+k K9SYiMyRD9MTgMhpqYl5j3Bz6pyhfD1iiKdwGIDMGe2GTf3bs6ubwCqoYjifbLkqmaex RI5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vZI/il1c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sz15-20020a1709078b0f00b0078d4a0c77f9si14009836ejc.458.2022.10.21.00.55.49; Fri, 21 Oct 2022 00:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="vZI/il1c"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbiJUHgs (ORCPT + 99 others); Fri, 21 Oct 2022 03:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiJUHgr (ORCPT ); Fri, 21 Oct 2022 03:36:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55623239201; Fri, 21 Oct 2022 00:36:46 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id EA88061DDD; Fri, 21 Oct 2022 07:36:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB284C433D7; Fri, 21 Oct 2022 07:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666337805; bh=qcoFQ3Y1t/OCn1xo7MF0G3Jg4ODkh6FFpJxwxnaf5dQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vZI/il1cIufXd8K1qI1xAjT1PC3P6iuEQ0DkEJHKU/tPFqixNUIMswm8t01ZxtRIh 9mXPw1m0VK334fDfV108iafCJka7qzFFr1NUy6kVQc++k6xCFvkvvxNXnLxa5OJXjJ sHwpnVggKa0wSW7dMqiEg66Qm481cjX2xe9L43mc= Date: Fri, 21 Oct 2022 09:36:42 +0200 From: Greg KH To: "Jason A. Donenfeld" Cc: Linus Torvalds , Kees Cook , Alexey Dobriyan , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org, masahiroy@kernel.org, andriy.shevchenko@linux.intel.com, Stephen Rothwell Subject: Re: [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array Message-ID: References: <202210201151.ECC19BC97A@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 21, 2022 at 03:24:27AM -0400, Jason A. Donenfeld wrote: > Hi Greg, > > On Fri, Oct 21, 2022 at 2:48 AM Greg KH wrote: > > > > On Thu, Oct 20, 2022 at 01:17:33PM -0700, Linus Torvalds wrote: > > > And in other cases, there's no actual difference at all, just > > > different register usage, so the diff looks fairly big, but doesn't > > > seem to be real. In one case I looked at, it started with a 'movzbl', > > > but it was that in both cases, because the type was actually 'unsigned > > > char' to begin with. But for some reason it just used different > > > registers. Example: > > > > > > - handle_control_request() in drivers/usb/gadget/udc/dummy_hcd.c > > > > > > The reason here *seems* to be that > > > > > > char *buf; > > > buf = (char *)urb->transfer_buffer; > > > > > > where it really probably should be 'u8 *buf', since it actually > > > does a cast to 'u8' in one place, but there isn't even any read of > > > that 'buf' pointer. So the difference seems to be entirely just some > > > "different type in assignment" cast internal to gcc that then > > > incidentally generated a random other choice in register allocation. > > > > I've send a patch for this now: > > https://lore.kernel.org/r/20221021064453.3341050-1-gregkh@linuxfoundation.org > > and will take it through the USB tree, unless Jason wants to grab it > > through his tree. > > This doesn't appear to have any actual effect, but just changes gcc's > register allocation unexpectedly. So feel free to take it, as it > doesn't seem like it's "one of those bad cases" that I'm keeping track > of. Great, will take it through my tree, thanks! greg k-h