Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp104407rwi; Wed, 19 Oct 2022 18:08:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JcwDlLWy77Jd0jsrJ+rag4veY+N7LZ6ORyvY5xyJcamBcNn1M873hWumPKbu4SSmoF4K7 X-Received: by 2002:a17:907:6d08:b0:78e:e87:5c06 with SMTP id sa8-20020a1709076d0800b0078e0e875c06mr8642614ejc.511.1666228102448; Wed, 19 Oct 2022 18:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666228102; cv=none; d=google.com; s=arc-20160816; b=T97YqpS9mBrPhl8pE9ox754OFjfpikkH2humWswCVN+tXLPe4UzwyYYmteoWlLYdVl u+gXa4zdryJbeld02ElFmHWx+vgVbzzfxchPivvH0kOTKY7lKr5ASTsNpmBmsUm6TsOR 0BsXdkAkCw0xynuPZ3NIrCmmVL1+Grn1cAcc+9DUrzIY2WzuxYXJdL6SH0A46jG7MkVm CUNtypbK9k6ONEDU5FPHnOThSJoGYImJ5cXNmzPS6Pdy8STAu2mdAumy+p+eZGurScRa 34sN1j4Q4vK5NAb3sJ6Y+d6btLIG+ZiLzfsgHnUPi02oRcfZvvEHk41VSQCKuzNtYDFe RQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tWFty6dFQpYyrkEdAH1uJ4wkhdCD5dnU4AL+htgFXmY=; b=LiY0pWvv6wB2UH45XhvFyaiwkWwJqi5uMPOSyM+B4TUs3eaiE892y8HSN46N24s+1e SYUVbmEsPCKhqCSke0xS5NiIz1iNBnfNtCwfKrSvI/e+uPXybKWCPS/DrGs0cQJmtm59 GBZWQwOfrRMjPNxKjfaVDeNhA5+a4OuE5P13H3byvrq03hEmVbHjpFmmbLiLnYC07mWs 7zfvSsSfYx/s4qySTk6v9XEK0PFuuJpcDYy2ZJWCpXLMFvtp/Giz6HlQFThqzPl6N5Pt FSLZ5kiowBIA9HcEXwiI5pYPsTVcsoSPYjTm8BdBohQbsgsygrHio9088Yd/B0/EbZky BTkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=GyjTTjrE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd12-20020a170907628c00b0078e25345011si16092564ejc.926.2022.10.19.18.07.56; Wed, 19 Oct 2022 18:08:22 -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=@linux-foundation.org header.s=google header.b=GyjTTjrE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230335AbiJTAjT (ORCPT + 99 others); Wed, 19 Oct 2022 20:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbiJTAjR (ORCPT ); Wed, 19 Oct 2022 20:39:17 -0400 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E8A7193EE7 for ; Wed, 19 Oct 2022 17:39:16 -0700 (PDT) Received: by mail-qk1-x735.google.com with SMTP id m6so11883228qkm.4 for ; Wed, 19 Oct 2022 17:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tWFty6dFQpYyrkEdAH1uJ4wkhdCD5dnU4AL+htgFXmY=; b=GyjTTjrEberaB84XqhfJGUe6Z01GsAcKjAHnBqgJULvR918dxSuZNti9tMFPxpuGlE MYZAPh1ARSVn2/jBiolCEQ3kg9ZQ9llE8CPAlIrRJxj2yWaHhmOhxJ9mpdfddf98hnfa Es3WUJRJ1Fv9UyZKqqXCbXXO+DHe7Ajo9i65c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tWFty6dFQpYyrkEdAH1uJ4wkhdCD5dnU4AL+htgFXmY=; b=EjZrairSZXXpUONxtZ4oWexqwkYZmuMaSeIsXoGmUgqJMiMrLXYIfcSrK5USbgBLwg H45J++tjcKWWfNPiDiOxR+qt4PlEqwf4TQcWJueH5IgqbT3t4sppkKmbxYiKEHEsXp57 wXszeUxu4Y7BXqRsh3buk4KNPfutQ00B8J1d3LkBFmu1zMfcFX2dhFONGcCiT3Uk6xKL L6lnDkCfcvlYDpcdpKX4R1R2byHih54PLYZibWQG0jVBxnTyRuvkI/kj1onb3+Rj2b6n MUWWXcDfNsmGcvy1X45bsuigQesdrAoSf8RE0VD5OH2uRNI5Xq4f17CqepSJDrLcoL7t ETGg== X-Gm-Message-State: ACrzQf32Ay+J3G7n/HsnOAYYCMwWzdmESVHKKLxyuxWfv1hERZVH6Xlg eJo7NjgPvGzHT9qqdqMCXQllkk6sAnBfww== X-Received: by 2002:a05:620a:2495:b0:6ee:b318:32f with SMTP id i21-20020a05620a249500b006eeb318032fmr7723569qkn.605.1666226355181; Wed, 19 Oct 2022 17:39:15 -0700 (PDT) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id x7-20020ac85387000000b0039cc944ebdasm5077979qtp.54.2022.10.19.17.39.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 17:39:13 -0700 (PDT) Received: by mail-qt1-f169.google.com with SMTP id z8so12821226qtv.5 for ; Wed, 19 Oct 2022 17:39:13 -0700 (PDT) X-Received: by 2002:a05:622a:420d:b0:38d:961c:a57c with SMTP id cp13-20020a05622a420d00b0038d961ca57cmr8975604qtb.678.1666226353131; Wed, 19 Oct 2022 17:39:13 -0700 (PDT) MIME-Version: 1.0 References: <20221019203034.3795710-1-Jason@zx2c4.com> In-Reply-To: From: Linus Torvalds Date: Wed, 19 Oct 2022 17:38:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] kbuild: treat char as always unsigned To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-toolchains@vger.kernel.org, Masahiro Yamada , Kees Cook , Andrew Morton , Andy Shevchenko , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 Wed, Oct 19, 2022 at 5:02 PM Jason A. Donenfeld wrote: > > Given I've started with cleaning up one driver already, I'll keep my eye > on further breakage. I wonder if we could just check for code generation differences some way. I tested a couple of files, and was able to find differences, eg # kernel/sched/core.c:8861: pr_info("task:%-15.15s state:%c", p->comm, task_state_to_char(p)); - movzbl state_char.149(%rax), %edx # state_char[_60], state_char[_60] + movsbl state_char.149(%rax), %edx # state_char[_60], state_char[_60] call _printk # because the 'char' for the '%c' is passed as an integer. And the tracing code has the .is_signed = is_signed_type(_type) initializers, which obviously change when the type is 'char'. But I also checked a number of other files that didn't have that pattern at all, and there was zero code generation difference, even when the "readable asm" output itself had some changes in some of the internal label names. That was what my old 'sparse' trial thing was actually *hoping* (but failed) to do, ie notice when the signedness of a char actually affects code generation. And it does in fact seem fairly rare. Having some scripting automation that just notices "this changes code generation in function X" might actually be interesting, and judging by my quick tests might not be *too* verbose. Linus