On 9/10/2025 11:33 AM, Borislav Petkov wrote: > On Sat, Aug 23, 2025 at 08:52:08AM -0700, Chang S. Bae wrote: >> diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c >> index 3ca22457d839..a1b13202330d 100644 >> --- a/arch/x86/kernel/cpu/microcode/intel.c >> +++ b/arch/x86/kernel/cpu/microcode/intel.c >> @@ -20,6 +20,8 @@ >> #include >> #include >> #include >> +#include >> +#include > > You do see those are sorted by header name length in a reverse order, right? Okay, fixed -- and I adjusted patch6 as well: #include #include #include +#include #include #include #include >> +/* Defines for the microcode staging mailbox interface */ >> + > > ^ Superfluous newline. Dropped. >> +/* >> + * Return PAGE_SIZE, or remaining bytes if this is the final chunk >> + */ >> +static inline unsigned int calc_next_chunk_size(unsigned int ucode_len, unsigned int offset) >> +{ >> + return min(PAGE_SIZE, ucode_len - offset); >> +} > > That oneliner looks useless - sticking a comment over tne min() and putting it > at the single callsite below is good enough. Agreed -- removed the helper and moved them. >> +/* >> + * Update the chunk size and decide whether another chunk can be sent. >> + * This accounts for remaining data and retry limits. >> + */ >> +static bool can_send_next_chunk(struct staging_state *ss) >> +{ >> + ss->chunk_size = calc_next_chunk_size(ss->ucode_len, ss->offset); >> + /* >> + * Each microcode image is divided into chunks, each at most >> + * one page size. A 10-chunk image would typically require 10 > ^^^^ Fixed. Just to make sure, include the diff here. Thanks for the careful review and for sticking with this set.