From b1089ab1a3150bd5810c7bf3956987d2ad438639 Mon Sep 17 00:00:00 2001 From: kd-11 <15904127+kd-11@users.noreply.github.com> Date: Thu, 4 Dec 2025 16:11:08 +0300 Subject: [PATCH] Fix hypervisor context memory placement --- rpcs3/Emu/Cell/PPUThread.h | 6 +++--- rpcs3/Emu/Cell/SPUThread.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index 97c705aed5..66d6be2bcb 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -257,6 +257,9 @@ public: // Sticky saturation bit v128 sat{}; + // Hypervisor context data + rpcs3::hypervisor_context_t hv_ctx; // HV context for gate enter exit. Keep at a low struct offset. + // Optimization: precomputed java-mode mask for handling denormals u32 jm_mask = 0x7f80'0000; @@ -307,9 +310,6 @@ public: // Thread name atomic_ptr ppu_tname; - // Hypervisor context data - rpcs3::hypervisor_context_t hv_ctx; // HV context for gate enter exit. Keep at a low struct offset. - u64 last_ftsc = 0; u64 last_ftime = 0; u32 last_faddr = 0; diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 9596f7b006..b54fc830f9 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -673,6 +673,9 @@ public: std::array gpr{}; SPU_FPSCR fpscr{}; + // Hypervisor context data + rpcs3::hypervisor_context_t hv_ctx; // NOTE: The offset within the class must be within the first 1MiB (10 bits max) + // MFC command data spu_mfc_cmd ch_mfc_cmd{}; @@ -788,8 +791,6 @@ public: u64 block_recover = 0; u64 block_failure = 0; - rpcs3::hypervisor_context_t hv_ctx; // NOTE: The offset within the class must be within the first 1MiB - u64 ftx = 0; // Failed transactions u64 stx = 0; // Succeeded transactions (pure counters)