i386 CPU detection fails if the TSFFS SIMICS object is not named `"tsffs"`

Open Beginner friendly
#515 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Open src/arch/x86.rs and look at the three trace!(get_object(CLASS_NAME)?, ...) calls around lines 57-60, 97-100 and 119; compare with src/arch/x86_64.rs, which never calls get_object(CLASS_NAME)?. Replace each with a log against the cpu object (or drop the get_object call), then build and confirm i386 detection no longer depends on the SIMICS object being named tsffs. The issue notes this was found by reading, not reproduced under SIMICS, so a real run is the way to verify.

Written by the indexing model from the issue text.

Description

Where

Problem
X86ArchitectureOperations::new calls trace!(get_object(CLASS_NAME)?, ...) three times during CPU detection, where CLASS_NAME is "tsffs". None of the other architecture backends call get_object(CLASS_NAME)?. If the user instantiated the TSFFS class under any other SIMICS object name, get_object("tsffs")? returns Err, causing X86ArchitectureOperations::new to fail and Architecture::new to fall through to "Unsupported architecture".

Impact
i386 CPU auto-detection fails solely because of a trace! log call whenever the TSFFS object is not named literally "tsffs".

Suggested fix
Log against cpu (or remove the get_object(CLASS_NAME)? calls to match x86_64.rs).

Status
Found by reading the code at ed67e1c; not reproduced under SIMICS.

Dominant language
Rust
Stars
337
Forks
26
Avg merge
5h 33m
Merged PRs (30d)
30

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from intel/tsffs

All issues in intel/tsffs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.