linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>, rafael@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-acpi@vger.kernel.org, Alexander Graf <graf@amazon.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Len Brown <lenb@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH 2/3 v6] ACPI: allow longer device IDs
Date: Tue, 1 Mar 2022 11:35:12 +0100	[thread overview]
Message-ID: <e9bfc654-5504-29ff-5a5a-b73f24691600@redhat.com> (raw)
In-Reply-To: <20220228183355.9090-1-Jason@zx2c4.com>

Hi,

On 2/28/22 19:33, Jason A. Donenfeld wrote:
> From: Alexander Graf <graf@amazon.com>
> 
> We create a list of ACPI "PNP" IDs which contains _HID, _CID, and CLS
> entries of the respective devices. However, when making structs for
> matching, we squeeze those IDs into acpi_device_id, which only has 9
> bytes space to store the identifier. The subsystem actually captures the
> full length of the IDs, and the modalias has the full length, but this
> struct we use for matching is limited. It originally had 16 bytes, but
> was changed to only have 9 in 6543becf26ff ("mod/file2alias: make
> modalias generation safe for cross compiling"), presumably on the theory
> that it would match the ACPI spec so it didn't matter.
> 
> Unfortunately, while most people adhere to the ACPI specs, Microsoft
> decided that its VM Generation Counter device [1] should only be
> identifiable by _CID with a value of "VM_Gen_Counter", which is longer
> than 9 characters.
> 
> To allow device drivers to match identifiers that exceed the 9 byte
> limit, this simply ups the length to 16, just like it was before the
> aforementioned commit. Empirical testing indicates that this
> doesn't actually increase vmlinux size on 64-bit, because the ulong in
> the same struct caused there to be 7 bytes of padding anyway, and when
> doing a s/M/Y/g i386_defconfig build, the bzImage only increased by
> 0.0055%, so negligible.
> 
> This patch is a prerequisite to add support for VMGenID in Linux, the
> subsequent patch in this series. It has been confirmed to also work on
> the udev/modalias side in userspace.
> 
> [1] https://download.microsoft.com/download/3/1/C/31CFC307-98CA-4CA5-914C-D9772691E214/VirtualMachineGenerationID.docx
> 
> Signed-off-by: Alexander Graf <graf@amazon.com>
> Cc: Rafael J. Wysocki <rafael@kernel.org>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Co-authored-by: Jason A. Donenfeld <Jason@zx2c4.com>
> [Jason: reworked commit message a bit, went with len=16 approach.]
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

The need for this is a bit meh, but I have no objections against
solving it this way:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
> Hi Rafael,
> 
> This patch is directed toward you specifically. The first and last patch
> of the series this is part of have been through the ringer of review a
> bit already and do not specifically require your attention, but we wound
> up getting hung up on an ACPI ID matching API limitation. This patch
> fixes that limitation with this patch that you see here, with a trivial
> one line fix, which does require your attention.
> 
> The other patches will go through my random.git tree naturally, but
> because those patches depend on this one here, in order to compile
> without warnings (and be functional at all), it would be nice if you
> would provide an "Acked-by" on it and permit me to /also/ take it
> through my random.git tree (if it looks like a correct patch to you, of
> course). This would make the merge logistics a lot easier. Plus it's a
> small +1/-1 line change.
> 
> This v6 updates the commit message.
> 
> Please have a look and let me know what you think.
> 
> Thanks,
> Jason
> 
>  include/linux/mod_devicetable.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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
> @@ -211,7 +211,7 @@ struct css_device_id {
>  	kernel_ulong_t driver_data;
>  };
>  
> -#define ACPI_ID_LEN	9
> +#define ACPI_ID_LEN	16
>  
>  struct acpi_device_id {
>  	__u8 id[ACPI_ID_LEN];


  parent reply	other threads:[~2022-03-01 10:35 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 22:06 [PATCH v5 0/3] ACPI: VM fork detection for RNG Jason A. Donenfeld
2022-02-26 22:06 ` [PATCH v5 1/3] random: add mechanism for VM forks to reinitialize crng Jason A. Donenfeld
2022-02-26 22:06 ` [PATCH v5 2/3] ACPI: allow longer device IDs Jason A. Donenfeld
2022-02-27  7:31   ` Ard Biesheuvel
2022-02-27  7:37     ` Ard Biesheuvel
2022-02-27 10:03     ` Jason A. Donenfeld
2022-02-27 10:30       ` Ard Biesheuvel
2022-02-27 10:47         ` Ard Biesheuvel
2022-02-27 11:38           ` Alexander Graf
2022-02-27 11:43             ` Ard Biesheuvel
2022-02-27 11:48               ` Alexander Graf
2022-02-27 11:59                 ` Ard Biesheuvel
2022-02-27 11:42   ` Alexander Graf
2022-02-27 12:43     ` Jason A. Donenfeld
2022-02-27 23:27       ` Jason A. Donenfeld
2022-02-28 18:19         ` Rafael J. Wysocki
2022-02-28 18:21           ` Jason A. Donenfeld
2022-02-28 18:33             ` [PATCH 2/3 v6] " Jason A. Donenfeld
2022-02-28 20:46               ` Andy Shevchenko
2022-02-28 20:58                 ` Jason A. Donenfeld
2022-02-28 21:02                 ` Ard Biesheuvel
2022-02-28 21:27                   ` Andy Shevchenko
2022-02-28 21:54                     ` Jason A. Donenfeld
2022-02-28 22:14                       ` Michael Kelley (LINUX)
2022-02-28 22:17                         ` Jason A. Donenfeld
2022-02-28 22:21                         ` Ard Biesheuvel
2022-02-28 22:38                           ` Michael Kelley (LINUX)
2022-02-28 22:46                             ` Ard Biesheuvel
2022-03-22 19:58                               ` Michael Kelley (LINUX)
2022-03-22 20:11                                 ` Jason A. Donenfeld
2022-03-24 19:25                                   ` Michael Kelley (LINUX)
2022-03-22 22:06                                 ` Ard Biesheuvel
2022-03-24 19:24                                   ` Michael Kelley (LINUX)
2022-03-24 19:45                                     ` Jason A. Donenfeld
2022-03-24 20:14                                       ` Michael Kelley (LINUX)
2022-03-01 13:12                         ` Andy Shevchenko
2022-02-28 22:00                     ` Alexander Graf
2022-02-28 22:17                       ` Ard Biesheuvel
2022-03-01 10:35               ` Hans de Goede [this message]
2022-03-01 10:38                 ` Jason A. Donenfeld
2022-03-01 10:49                   ` Hans de Goede
2022-03-01 14:25                 ` Andy Shevchenko
2022-03-01 14:48                   ` Jason A. Donenfeld
2022-03-01 12:29               ` Rafael J. Wysocki
2022-03-01 10:31           ` [PATCH v5 2/3] " Hans de Goede
2022-02-26 22:06 ` [PATCH v5 3/3] virt: vmgenid: introduce driver for reinitializing RNG on VM fork Jason A. Donenfeld
2022-03-06 16:02   ` Michael Kelley (LINUX)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9bfc654-5504-29ff-5a5a-b73f24691600@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=Jason@zx2c4.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ardb@kernel.org \
    --cc=graf@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).