[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 17/44] x86/boot: convert microcode loading to consume struct boot_info


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 8 Oct 2024 08:50:46 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9BxxHN748KKqosFLQm/xYgkzGxJlTZQb0cyL8d+Np04=; b=PanlExWs6WHxewcSsHf14JoTAinmr2Q0cajXt19KyfYPHHOSrqyfnWQB3ueh9o1Z1AvW48gwDf272IN8Jjg5dP5ryYKTK10XlgJ6Zm3D59Q0Z0WnftY+T0TFpHfHJTHOkAo33EGsw9Dg8lQnCLd5gAcbzgHRt9JQO2EHX9NA8qYp0iC0hTNNC/cP66ChaTALNtX5cLV3SjovJvmUPrT8XcwPm8jzL3r9oDFG/yiSuUCYZLauDM4FKUETv3KmWg9fWb+OlVrF62CRx13AdcRMncGCBiHIwwnLV62mFD7x1BONzMvwEtqZRhPkLZT10/IkrLgZ2Wuas9DL8THL5qDTtA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sakpdsTion0Q/fjPI4FhF9ZqdFrexHgMV5LB8DS7B1mPQ6ylF2qViFF5KNy0OI8LIscIDD3HbQOjr18dM9aXpgHIL3W+aXGLLxS0FHkPiDAScdigp6Ud3QYBCf+qY7f54tFnQFKBs5h6VqGka4ovGQdZLUlwX6R5FldGRGueW1AodYQMGymBKBsQfDWbluujfYhzJ/dr+kDj+t37xbHbDvoo8qWnzwzZ/LPK0YiqYIRMC6yt+h5lxBduWYwKWvjBn4kL6TR5dM8gFmgBwBJ5qEeEggOSmfWZ25DCMEcTxeh6mC+vQNeTBRCJFvrs7zoYEqZVWsN+S6AYCJv27+1CNA==
  • Cc: <christopher.w.clark@xxxxxxxxx>, <stefano.stabellini@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 08 Oct 2024 12:50:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2024-10-07 17:22, Jason Andryuk wrote:
On 2024-10-06 17:49, Daniel P. Smith wrote:
Convert the microcode loading functions to take struct boot_info, and then using struct boot_module to map and check for microcode. To keep the changes focused, continue using the struct mod to hold the reference to the microcode
that is used by the late microcode logic.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
  xen/arch/x86/cpu/microcode/core.c    | 37 +++++++++++++---------------
  xen/arch/x86/include/asm/bootinfo.h  |  1 +
  xen/arch/x86/include/asm/microcode.h | 14 ++++++-----
  xen/arch/x86/setup.c                 |  4 +--
  4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 8564e4d2c94c..22fea80bc97e 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c

@@ -205,20 +204,18 @@ static void __init microcode_scan_module(
  }
  static void __init microcode_grab_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+    unsigned long *module_map, struct boot_info *bi)
  {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
-
      if ( ucode_mod_idx < 0 )
-        ucode_mod_idx += mbi->mods_count;
-    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= mbi->mods_count ||
+        ucode_mod_idx += bi->nr_modules;
+    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= bi->nr_modules ||
           !__test_and_clear_bit(ucode_mod_idx, module_map) )
          goto scan;
-    ucode_mod = mod[ucode_mod_idx];
+    bi->mods[ucode_mod_idx].type = BOOTMOD_MICROCODE;
+    ucode_mod = *bi->mods[ucode_mod_idx].mod;

Why the dereference: *bi->mods[ucode_mod_idx].mod; ?  I don't think it should be there.

Oh, the next patch shows ucode_mod is not a pointer, so dereferencing is correct. Sorry for the noise.

Regards,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.