Skip to content

[Bug] VM Failing to start on XSTATE check #5438

@andrewla

Description

@andrewla

Describe the bug

On trying to start a VM, we get this error from Firecracker (v1.13.1):

RunWithApiError error: 
  Failed to build MicroVM from Json:
  Could not Start MicroVM from one single json:
  Kvm error:
    Architecture specific error:
      Failed to request permission for dynamic XSTATE features:
        Failed to request permission for XSTATE feature (18):
          Invalid argument (os error 22)
Error: RunWithApi(BuildFromJson(StartMicroVM(Kvm(ArchError(XstateFeatures(RequestFeaturePermission(18, Os { code: 22, kind: InvalidInput, message: "Invalid argument" })))))))

To Reproduce

It appears that this happens on older kernels (pre-5.16) running on CPUs that support AMX. The supported flags apparently returns TILE_DATA, but that flag is greater than XFEATURE_MAX (https://github.com/torvalds/linux/blame/master/arch/x86/include/asm/fpu/types.h#L130) in the kernel, so attempting to request permissions fails with EINVAL

Expected behaviour

Should boot successfully.

Environment

  • Firecracker version: 1.13.1
  • Host and guest kernel versions: 5.15.0-1090-aws; failure is before guest kernel starts
  • Rootfs used: not used
  • Architecture: x86_64 -- works on 8252C but fails on 8488C
  • Any other relevant software versions:

Additional context

This is in a cloud environment where we do not have strict control over CPU models

Checks

  • Have you searched the Firecracker Issues database for similar problems?
  • Have you read the existing relevant Firecracker documentation?
  • [~] Are you certain the bug being reported is a Firecracker issue?
    • This seems like it could be more of a kernel issue; it is saying that it supports a flag but erroring on its use

Metadata

Metadata

Assignees

Labels

Status: WIPIndicates that an issue is currently being worked on or triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions