Skip to content

FPU Tag Word reset to wrong value #904

Closed

Description

@ludfjig

We currently use pub(crate) const FP_TAG_WORD_DEFAULT: u8 = 0xff; // each 8 of x87 fpu registers is empty which is incorrect (at least for kvm), which uses abridged format (FXSAVE, not FSAVE), so we should set this to 0x00 to indicate empty, instead of 0xff.

See:
https://docs.kernel.org/virt/kvm/api.html#kvm-get-fpu
https://www.felixcloutier.com/x86/fxsave

Activity

  1. jsturtevant commented on Sep 23, 2025

    @jsturtevant
    Contributor

    The confusion comes from the docs in AMD64 Architecture Programmer’s Manual Volume 1 6.2.4 x87 Tag Word Register (FTW) where Empty is 11 == empty

    But in the fxsave docs undersection AMD64 Architecture Programmer’s Manual Volume 2 11.5.10.1 FXSAVE Format for x87 Tag Word:

    A two-bit value of 11 is encoded as a 0, indicating the corresponding x87 FPRn is empty.
    
  2. self-assigned this
    on Sep 23, 2025
  3. added
    lifecycle/confirmedBug is verified or proposal seems reasonable
    and removed on Oct 1, 2025
  4. added this to the v0.11.0 milestone on Oct 1, 2025
  5. modified the milestones: v0.11.0, v0.12.0 on Nov 5, 2025
  6. ludfjig commented on Dec 16, 2025

    @ludfjig
    ContributorAuthor

    Closed by #924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

lifecycle/confirmedBug is verified or proposal seems reasonable

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions