Skip to content

feat: VMware mouse + networking fixes#258

Merged
ryanbreen merged 3 commits intomainfrom
feat/vmware-fixes
Mar 11, 2026
Merged

feat: VMware mouse + networking fixes#258
ryanbreen merged 3 commits intomainfrom
feat/vmware-fixes

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Per-endpoint USB HID button tracking — VMware exposes dual mouse HID endpoints that race on button state. Each endpoint's buttons are now tracked independently and OR-merged, preventing one endpoint from canceling the other's press. Fixes drag dropping after 1-2 pixels.
  • Partial drag redraw — New compose_partial_redraw() limits VRAM writes to the union of old+new window bounds during drag, replacing full 9.2MB screen copies. Major drag performance improvement on SVGA3 STDU.
  • e1000 networking on aarch64 — HHDM mapping, RCTL_BSEX fix, softirq polling in timer interrupt, VMware DNS auto-detection. All 23 bcheck tests pass.
  • SVGA3 cursor updates on mouse-only composite frames (no content dirty).
  • Memory ram_base_offset for VMware's 0x80000000 RAM base on aarch64.

Test plan

  • VMware Fusion: drag windows smoothly, no 1-2px stalls
  • VMware Fusion: click-to-focus works without sticking
  • VMware Fusion: 23/23 bcheck tests pass (DNS + HTTP)
  • VMware Fusion: cursor renders and moves correctly
  • Parallels: verify no regression (single HID endpoint, VirGL path)

🤖 Generated with Claude Code

ryanbreen and others added 3 commits March 10, 2026 10:17
… stacks

Three fixes for VMware desktop parity:

1. Enable SMP on VMware (was deliberately skipped):
   - Add SMP_STACK_BASE_PHYS variable in boot.S — CPU 0 writes the
     platform-correct physical stack base before PSCI CPU_ON
   - Replace hardcoded 0x4100_0000 with percpu_stack_region_base() in
     smp.rs, exception.rs, context_switch.rs, constants.rs
   - On VMware (RAM at 0x80000000): stacks at 0x8100_0000
   - On QEMU/Parallels (RAM at 0x40000000): stacks at 0x4100_0000
   - Remove is_vmware() guard from SMP init in main_aarch64.rs

2. Fix mouse click getting permanently stuck in drag:
   - Root cause: press sustain mechanism deadlocked with compositor_wait.
     After physical release, sustained latch kept mouse_state() returning
     buttons=1, compositor_wait saw no change, BWM never woke, sustain
     counter never decremented. Permanent deadlock.
   - Fix: mouse_state() (peek) now returns raw MOUSE_BUTTONS only, not
     buttons|pressed. compositor_wait detects physical release immediately.
   - Remove sustain mechanism entirely — simple latch + swap(0) on consume
     is sufficient for fast click-release detection.

3. Network on VMware still broken (documented, not fixed):
   - VMware presents Intel 82574L (8086:10d3), not VirtIO
   - e1000 driver is x86-only and only matches 0x100E
   - Needs e1000 aarch64 port (separate branch)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nostics

- Port Intel e1000 driver to aarch64 for VMware Fusion (Intel 82574L,
  device ID 0x10D3). The driver is pure MMIO so no arch-specific code
  needed — just remove the cfg guard and handle the e1000e EEPROM
  register layout difference (DONE=bit 1, ADDR_SHIFT=2 vs bit 4/8).
  Falls back to RAL/RAH MAC read when EEPROM fails.

- Wire e1000 into aarch64 net stack: auto-detect in driver init (when
  VirtIO net unavailable), VMware NAT config (172.16.45.x/24, gw .2),
  e1000 polling in process_rx, transmit, and MAC address paths.

- Fix mouse click-stuck deadlock with compositor_wait: add
  has_pending_press() non-consuming peek for latched button presses.
  compositor_wait checks this at both early and post-wake points so
  fast press-release cycles aren't invisible.

- SMP diagnostics for VMware: add PSCI CPU_ON 32-bit function ID
  fallback (HVC32), MPIDR logging, detailed error reporting. SMC
  conduit defined but not called (unsafe without EL3).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Per-endpoint USB HID button tracking: VMware's dual mouse endpoints
  no longer race on button state. Each endpoint's buttons tracked
  independently, merged via OR so one can't cancel the other's press.
- Partial drag redraw: compose_partial_redraw() limits VRAM writes to
  the union of old+new window bounds during drag, eliminating full 9.2MB
  VRAM copies per frame on SVGA3.
- Window bounds +3px for drop shadow coverage in dirty rect calculations.
- e1000 softirq polling in timer interrupt for VMware network RX.
- VMware DNS (172.16.45.2) added to resolver auto-detection.
- e1000 HHDM mapping on aarch64, RCTL_BSEX removal.
- SVGA3 cursor update on mouse-only composite frames.
- Memory subsystem ram_base_offset for VMware aarch64.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit d24200f into main Mar 11, 2026
1 of 4 checks passed
@ryanbreen ryanbreen deleted the feat/vmware-fixes branch March 11, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant