Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 81b1ec18a5924fa0be64a4226901911f8c0af274
      
https://github.com/tianocore/edk2/commit/81b1ec18a5924fa0be64a4226901911f8c0af274
  Author: Richard Lyu <[email protected]>
  Date:   2026-02-22 (Sun, 22 Feb 2026)

  Changed paths:
    M OvmfPkg/Library/CcExitLib/CcExitVcHandler.c

  Log Message:
  -----------
  OvmfPkg/CcExitLib: Initialize XCr0 in else-path to fix build error

Add an else-path to explicitly set XCr0 to 0 when EaxIn is not
CPUID_EXTENDED_STATE. This ensures XCr0 is initialized across all
logic paths and resolves the GCC build error regarding a potential
uninitialized variable.

CcExitVcHandler.c:1470:10: error: 'XCr0' may be used uninitialized
[-Werror=maybe-uninitialized]
      |          ^~~~~~~~~~~~~
 1471 |            Ghcb,
      |            ~~~~~
 1472 |            EaxIn,
      |            ~~~~~~
 1473 |            EcxIn,
      |            ~~~~~~
 1474 |            XCr0,
      |            ~~~~~
 1475 |            &Eax,
      |            ~~~~~
 1476 |            &Ebx,
      |            ~~~~~
 1477 |            &Ecx,
      |            ~~~~~
 1478 |            &Edx,
      |            ~~~~~
 1479 |            &Status,
      |            ~~~~~~~~
 1480 |            &Unsupported
      |            ~~~~~~~~~~~~
 1481 |            ))
      |            ~
CcExitVcHandler.c:1436:12: note: 'XCr0' was declared here
 1436 |   UINT64   XCr0;
      |            ^~~~

Signed-off-by: Richard Lyu <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to