From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B7AAC433FE for ; Fri, 21 Oct 2022 06:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiJUGtY (ORCPT ); Fri, 21 Oct 2022 02:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbiJUGtM (ORCPT ); Fri, 21 Oct 2022 02:49:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11253244191; Thu, 20 Oct 2022 23:48:53 -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 0B56B61B39; Fri, 21 Oct 2022 06:48:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2EEAC433B5; Fri, 21 Oct 2022 06:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666334932; bh=GkJW0rhkNtgNET6DTbBjkqNJSetsUPif97QcFj6cITM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AFpVfJBkCtT8rtyEZ8VWmgJPv4V9sZOIwi1hyEhZzwRic/j8fBDyJSWoWhx0u6Ykn ftTsmDSLbGNgRHMEhJsra6zAkEs0wA0WlYOUkx+KMMeUfWrnqg+FcTDsa2LD9z/AFb c7kwtvv5igsR0AgKdoNA1p4dcMAgWU1PeBJpP3Wk= Date: Fri, 21 Oct 2022 08:48:49 +0200 From: Greg KH To: Linus Torvalds Cc: Kees Cook , "Jason A. Donenfeld" , 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: <20221020000356.177CDC433C1@smtp.kernel.org> <202210201151.ECC19BC97A@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, greg k-h