Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native/cpu/x86: Add support for CPUID EAX=80000000h #1811

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Oct 6, 2020

cpuid with EAX=80000000h is meant to return the highest "extended function" ID back via EAX.

Both Intel's and AMD's docs are a little oblique when it comes to what exactly an "extended function" ID is, but it seems to just be another EAX value (i.e., CPUID "leaf") with the high bit (i.e. EAX=8xxxxxxxh) set.

Longer term, we should probably support some of these higher extended functions/leaves. In particular, it looks like recent versions of the Linux VDSO check for CPUID EAX=80000001h and then check if EDX.RDTSCP[bit 27] is high in order to use rdtscp (in lieu of rdtsc + a serializing hack?).

Copy link
Contributor

@ekilmer ekilmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs fine in this repo's tests and on our other binaries. Thank you!

@woodruffw
Copy link
Member Author

Awesome. I don't have merge perms, so I'll leave that to you or whoever else feels like it 😉

@woodruffw woodruffw merged commit 2152023 into master Oct 6, 2020
@woodruffw woodruffw deleted the ww/cpuid-extended-funcs branch October 6, 2020 21:07
ekilmer added a commit that referenced this pull request Oct 24, 2020
* master:
  native/cpu/x86: Add support for CPUID EAX=80000000h (#1811)
ekilmer added a commit that referenced this pull request Nov 10, 2020
* master:
  Manticore 0.3.5 (#1808)
  Fix yices timeout argument (#1817)
  Detect default solver (#1820)
  Ignore Gas Calculations by Default (#1816)
  native/cpu/x86: Add support for CPUID EAX=80000000h (#1811)
ekilmer added a commit that referenced this pull request Feb 27, 2021
* master: (43 commits)
  Syscall specific hooks (#2389)
  TUI Support Infrastructure (#1620)
  Fix coveralls upload (#2387)
  docs: fix simple typo, straigth -> straight (#2381)
  Attempt to allow symbolic balances from the start (#1818)
  Fix state.cpu.PC member (#1825)
  Bump black and mypy (#1824)
  Manticore 0.3.5 (#1808)
  Fix yices timeout argument (#1817)
  Detect default solver (#1820)
  Ignore Gas Calculations by Default (#1816)
  native/cpu/x86: Add support for CPUID EAX=80000000h (#1811)
  Change types.FunctionType=<class 'function'> (#1803)
  Fix test regressions (#1804)
  State Introspection API (#1775)
  Fix EVM account existence checks for selfdestruct and call (#1801)
  Add partial implementation of sendto syscall (#1791)
  crytic-compile: use latest release (#1795)
  Update gas metering for calls to empty accounts (#1774)
  Fix BitVec with symbolic offset and fix TranslatorSmtlib.unique thread safety (#1792)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants