confidential-containers / td-shim

Confidential Containers Shim Firmware
Other
97 stars 53 forks source link

Wrong bitmask on GPAW? #734

Closed dingelish closed 1 month ago

dingelish commented 3 months ago

In Flat32ToFlat64.asm I see a weird bitmask 0x2f. it is 0010 1111 and cannot precisely extract [6:0] bits of gpaw. the correct bitmask should be 0x3f which is 0011 1111.

    ;
    ; esp [6:0] holds gpaw, if it is at least 52 bits, need to set
    ; LA57 and use 5-level paging
    ;
    mov     ecx, esp
    and     ecx, 0x2f

https://github.com/confidential-containers/td-shim/blob/9dea7d2bf0a0bccd621a3a692a2809148f691e96/td-shim/ResetVector/Ia32/Flat32ToFlat64.asm#L25