Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp404970pxm; Fri, 25 Feb 2022 10:13:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyP2JFGgtZhNFXI0EpoKqurwdE7VxbpkeuKpJFmUxb3zqSfbyVOgbe9BbEB3TIz8M0WTade X-Received: by 2002:a17:906:7d83:b0:6ce:fee:9256 with SMTP id v3-20020a1709067d8300b006ce0fee9256mr7226704ejo.647.1645812830105; Fri, 25 Feb 2022 10:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645812830; cv=none; d=google.com; s=arc-20160816; b=g0kAFKRDAQ6GCMdAlC0P5v7jNouNvbN2/Uk2qLguKFW6gCQRMzKt4j/3m+zmoqKMW5 02WJqoX2uyI3DIo2AY4rk4Rjhlt5lTlSsqPwGcSPioJhN+Lgqrt9AUgXU7fOuw/Jdo4T wIRjopf0PFkPZO/SNVOj1chOxmKalBtiFpNCY5KSCGvxycL9HbdbmlsfJopM44yI9hlj 2qh4gWOYS6iWhbGcv+ztR4M6gLhaUwhyURcWiHj+rFyo5H0ybiBHNAq0uPR8jrXJVZAb vgCraI67usnclSfOdstchxVyJosoZrcS2fbFHe+uVLaye1sRxn44J0IwvYJ0i96wVYNe XSkQ== 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=yyp0XBR2LBG6ybQpSRV5Mk5rlFmokNbyKi7/2GKEXSM=; b=kOypVBkZsESeQSDOh+VI6vhKRg1eeMmyHJhAFZGYp4RR29PJw9PYZCPZ2Yk4tpwFxW BtmZkSxxD1PX6yU+fFK9lYqr79v+2mcySXcn4lmca5RDPU9nvY2NiV2+XM3LOcMWSaUv ntNHNs8+Jz6rzuRBBKSbR4AfK57GPvLSTgGmY2kxJr779N3M5pRHzQx8oeVorzx+dYv/ 8jqJp3cMJbclkfvTLo5D8gqINLxKx/E9rT3vuYMy6bs/BbQya6q6S8NNYqttQCGtyMqZ YxtETibbN9mtoipmTa2LVTMYzVUH7qRkAXjcg112f3sG5mBRYlJl3VweUsFWyBx4RhpP 7QUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=avzQXB0S; 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=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs29-20020a1709073e9d00b006b5974dd1ccsi2219606ejc.546.2022.02.25.10.13.26; Fri, 25 Feb 2022 10:13:50 -0800 (PST) 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=avzQXB0S; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243609AbiBYRW2 (ORCPT + 99 others); Fri, 25 Feb 2022 12:22:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243599AbiBYRW1 (ORCPT ); Fri, 25 Feb 2022 12:22:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE0B22320A; Fri, 25 Feb 2022 09:21:55 -0800 (PST) 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 E0381B832AF; Fri, 25 Feb 2022 17:21:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC609C340E7; Fri, 25 Feb 2022 17:21:51 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="avzQXB0S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1645809710; 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=yyp0XBR2LBG6ybQpSRV5Mk5rlFmokNbyKi7/2GKEXSM=; b=avzQXB0Sz6ebvM/yT8r4bVRCQnlmoohAGQbJf/M8sVjbHOrx/UXxFZNihPoWCeeZrYWaEN qbk23OIlhazsFJLjUT8kd3DcEo8ZCQWTEqRFeQhZKNzBMRDCrGfLmmm5pWnfgoUXQ7LkfT FQxD44/UGXgZmE609kLiFcYDHelRr4E= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id d56f47f5 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 25 Feb 2022 17:21:49 +0000 (UTC) Date: Fri, 25 Feb 2022 18:21:45 +0100 From: "Jason A. Donenfeld" To: Ard Biesheuvel Cc: Alexander Graf , ACPI Devel Maling List , Linux Kernel Mailing List , Len Brown , "Rafael J. Wysocki" , Greg KH , "Woodhouse, David" Subject: Re: [PATCH] ACPI: bus: Match first 9 bytes of device IDs Message-ID: References: <20220225155552.30636-1-graf@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 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,T_SCC_BODY_TEXT_LINE 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, Feb 25, 2022 at 6:13 PM Ard Biesheuvel wrote: > > The device subsystem side of things already deals with this properly: > the modalias of the QEMU vmgenid device comes up as > 'acpi:QEMUVGID:VM_GEN_COUNTER', which means it already captures the > entire string, and exposes it in the correct way (modulo the all caps) Ahh, so the userspace side of this won't work right. Shucks. That's what I was concerned about. > I don't like this hack. If we are going to accept the fact that CIDs > could be arbitrary length strings, we should handle them properly. > > So what we need is a way for a module to describe its compatibility > with such a _CID, which shouldn't be that complicated. Can't we do something more boring and just... diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 4bb71979a8fd..5da5d990ff58 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -210,9 +210,9 @@ struct css_device_id { __u8 type; /* subchannel type */ kernel_ulong_t driver_data; }; -#define ACPI_ID_LEN 9 +#define ACPI_ID_LEN 16 struct acpi_device_id { __u8 id[ACPI_ID_LEN]; kernel_ulong_t driver_data; As you can see from the context, those additional 7 bytes were being wasted on padding anyway inside the acpi_device_id struct, so it's basically free, it would seem. This seems like the least convoluted way of solving this issue? If we ever encounter _more_ ACPI devices with weird names, we could revisit a fancy dynamic solution, but for now, why don't we keep it simple? Jason