Skip to content

Preserve full XMM registers in Windows VM wrapper#21976

Merged
shivammathur merged 1 commit intophp:PHP-8.4from
shivammathur:fix/windows-vm-save-full-xmm
May 7, 2026
Merged

Preserve full XMM registers in Windows VM wrapper#21976
shivammathur merged 1 commit intophp:PHP-8.4from
shivammathur:fix/windows-vm-save-full-xmm

Conversation

@shivammathur
Copy link
Copy Markdown
Member

We do PGO-optimized builds for Windows releases. In our builds CI, some recorded-error tests are failing on the master branch:
https://github.com/shivammathur/php-windows-builder/actions/runs/25329578176/job/74262237899#step:6:197
https://github.com/shivammathur/php-windows-builder/actions/runs/25329578176/job/74262237943#step:6:477

After checking the trace from the build, orig_errors_buf in zend.c was stored in XMM6 in the PGO build, but the Windows VM wrapper was only preserving half of the XMM registers when execution re-entered the VM:

EG(errors) = orig_errors_buf;

So the lower half was restored correctly, but the upper half, which contained the pointer to the recorded errors array, was lost. That left EG(errors) in an invalid state with a non-zero size but a null errors pointer.

This fixes the wrapper to save and restore the full XMM6-XMM15 registers.

@shivammathur shivammathur requested a review from arnaud-lb May 7, 2026 16:40
@shivammathur shivammathur force-pushed the fix/windows-vm-save-full-xmm branch from f86cd83 to bc2f3ed Compare May 7, 2026 17:30
@shivammathur shivammathur changed the base branch from master to PHP-8.4 May 7, 2026 17:31
Copy link
Copy Markdown
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@shivammathur shivammathur merged commit f79f921 into php:PHP-8.4 May 7, 2026
20 checks passed
shivammathur added a commit to shivammathur/php-src that referenced this pull request May 7, 2026
* PHP-8.5:
  Preserve full XMM registers in Windows VM wrapper (php#21976)
prateekbhujel pushed a commit to prateekbhujel/php-src that referenced this pull request May 7, 2026
* PHP-8.4:
  Preserve full XMM registers in Windows VM wrapper (php#21976)
@shivammathur shivammathur deleted the fix/windows-vm-save-full-xmm branch May 7, 2026 21:12
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.

2 participants