CPUID leaf 1 bit "HTT" does not mean what it says on the tin

Aperta
#1,265 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cloud

Direzione di ricerca

The CPUID leaf 1 specializer lives in lib/propolis/src/cpuid.rs, where HTT is currently set from has_smt; the topology helpers referenced via #1237 also pass has_smt: true. Read the APM and SDM notes on LogicalProcessorCount and HTT to decide the intended semantics before editing. Done means HTT is set whenever more than one logical processor is exposed, with the specializer and any affected tests updated accordingly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

we set HTT in the CPUID specializer, here. this will imminently change in form, but not function, with #1237. fundamentally, the interpretation of "HTT", called "Hyper-Threading Technology" in the SDM, was "present if hyperthreading is supported".

now, I remember puzzling over this a bit with Greg when this was first being added; you would imagine that that if SMT is not enabled, clearly HTT should be false, right? other parts of the SDM and APM say that some other topology bits are only valid if HTT is set though. the APM, in particular, says that leaf 1 EBX's LogicalProcessorCount is only meaningful if HTT is set.

additionally,

Multiple Processor Calculation says "When HTT = 0, LogicalProcessorCount is reserved and the package contains one logical processor."

well, that's certainly different from how we're setting it. spelunking through docs and blogs with @acfoltzer, we've found https://github.com/InstLatx64/InstLatx64/tree/refs/heads/master/AuthenticAMD (and the corresponding GenuineIntel CPUID readings) point towards a more expansive use of HTT - the bit first was set in the earliest Pentium 4's that supported HyperThreading, and then is set on all x86 processors after that point with >1 logical processor. this writeup on os2museum.com is great reading with some quotes from older SDMs. AMD set it in the non-SMT multi-core Athlon X2s, even! truly, this bit means "there is more than one processor", and should not be connected to has_smt at all.

.. this has no product implication, as it turns out. we always passed true for the old .with_vcpu_count(), and the topology helpers in #1237 both have has_smt: true as well. so guests in the product always have the HTT bit set (even in single-core VMs, which it turns out is probably legal in practice but not strictly what the APM says).

since we always populate LogicalProcessorCount, NC, and other fields via the specializer, we should probably just always set leaf 1 HTT.

Lingua principale
Rust
Stelle
326
Fork
49
Merge medio
1g 13h
PR unite (30g)
10

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/propolis

Tutte le issue di oxidecomputer/propolis

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.