Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp224355rwi; Wed, 19 Oct 2022 20:25:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PLeoBuJZpAWjVUJVUFSlfJupQWrqY76KqN9VAouyuyaalMkTsn5TnfZ1UW9qDUR9ccMdr X-Received: by 2002:a17:907:1c96:b0:78d:fe6b:9891 with SMTP id nb22-20020a1709071c9600b0078dfe6b9891mr9248726ejc.746.1666236319265; Wed, 19 Oct 2022 20:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666236319; cv=none; d=google.com; s=arc-20160816; b=g2Et56dGSS6l3l6D8rW95m4zo8RGxcQHFonc3a1dJxzm7mdiwezTjDYXh4DTNln/9x vhbY1VvXhDly3wwiU5O8ZhHm5UYHJAkjHpqp9SPnAxI7+rMQSrr/LjrsgmdaqAmUjsQA lZh/FpHLnr8MLtnbLX+sLdGAk9pdHurqupAPopPo5rHjkM/gXejJUBrkzc9dvLClb6Et 2kMXEh2qow+CoYZCTFDWxEBpcasksgr/zU4+V1wotujA+kT4ybuYXcAAiRZNoCcjAKU0 +FsaDmvZxnyvuU4N+6INzrp1tf6djMTfrzeEs3kvB5uNwhhK97bBJGWaDJLKi2GWtl8Z L62g== 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=JZNUaZDaHnzZsUmQctOVwbGgLyndW6prLbOXUbqsna0=; b=tcg/7jHRshKbYwAin0wEpSuH6Pttx+BgskVTM4U2bOXrYjwEvr8B5J3m8uj1+2wMpJ bbu+k4g5I97gbbHC+AVWJ6NxEedJbRlki+78O9KJTVnZeJCdXtPxYZHAsVeKxZsHa7P8 VSeXHxbUDeBMG2XEUaH0wcNi8imKH+UBdk+2Lj11jLaUtOumKp11WDPjonqztE0G8sDX N6JEet2Oiu65rJ4lxWW9qWOFv4bId0h5OjIh7QB/2kswKRCN0x4p4S9IEfrqiXTMlf/d pH/wBMxh96OOp/CVQfJHR/MBDv0SBnSXrur9qoUw/AY/9gu9c52nWrmx4LXK0bwBbwsn GPLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=fU541ryY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dy12-20020a05640231ec00b004585c0fe21csi13927297edb.536.2022.10.19.20.24.31; Wed, 19 Oct 2022 20:25:19 -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=@zx2c4.com header.s=20210105 header.b=fU541ryY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiJTDAK (ORCPT + 99 others); Wed, 19 Oct 2022 23:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbiJTDAF (ORCPT ); Wed, 19 Oct 2022 23:00:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 690E1E09C1; Wed, 19 Oct 2022 20:00:01 -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 ams.source.kernel.org (Postfix) with ESMTPS id 30053B82660; Thu, 20 Oct 2022 03:00:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E02FBC433D6; Thu, 20 Oct 2022 02:59:57 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="fU541ryY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1666234796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZNUaZDaHnzZsUmQctOVwbGgLyndW6prLbOXUbqsna0=; b=fU541ryY3FgZlW4sy4ZBU2+3tuFup0EiTiAzLaXAMN1R88EcqVK7kqDHzbrgpE8O2EDtdx z3NaSZd3R3nk15Y1zIh3kjGP3UgbUcUFi8+xMhwPm5vTuWVK7SET0bG61Nty/K7ytPES2t ocFi3PpAuYJskEbIOHYho0vam5dn0vA= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 3befa121 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 20 Oct 2022 02:59:55 +0000 (UTC) Date: Wed, 19 Oct 2022 20:59:53 -0600 From: "Jason A. Donenfeld" To: Linus Torvalds 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 Subject: Re: [PATCH v2] kbuild: treat char as always unsigned Message-ID: References: <20221019203034.3795710-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 Wed, Oct 19, 2022 at 05:38:55PM -0700, Linus Torvalds wrote: > 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. > 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. Or even just some allyesconfig diffing. > 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 Seems harmless though. > tracing code has the > > .is_signed = is_signed_type(_type) > > initializers, which obviously change when the type is 'char'. And likewise, looking at the types of initializers that's used with. Actually, for the array one, unsigned is probably more sensible anyway. The thing is, anyhow, that most code that works without -funsigned-char *will* work with it, because the core of the kernel obviously works fine on ARM already. The problematic areas will be x86-specific drivers that have never been tested on other archs. i915 comes to mind -- as a general rule, it already does all manner of insane things. But there's obviously a lot of other hardware that's only ever run on Intel. So I'm much more concerned about that than I am about code in, say, kernel/sched. Jason