moby / moby/hyperkit

RDTSCP instruction triggers "illegal instruction" for Linux container on macOS

Open
#321 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
3.7k
Forks
336
PR merge metrics
No merged PRs in 30d

Description

OS: Big Sur (11.5.2)

We're trying to use RDTSC and RDTSCP on Core i9 chip for ns-scale perf measurement.

RDTSC works fine.
RDTSCP is supported by the processor based on the spec, but inside the container /proc/cpuinfo doesn't have rdtscp flag, and trying to use it will cause illegal instruction error.

My guess is it's an issue/limitation of VM in macOS itself.
But given there's almost no doc about it, we cannot get any meaningful conclusion.

Can moby side help with some investigation, to see if it's fixable within macOS's own virtualization framework API.
And if not, is it possible to introduce other VM options?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the RDTSCP failure in a Linux container on macOS Big Sur and compare the processor capabilities reported in /proc/cpuinfo with the host processor specification. Determine whether macOS's virtualization framework can expose RDTSCP or whether another VM option is possible; document the conclusion and any supported workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, macos
Domain
infrastructure, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.