mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-16 03:58:56 +00:00
Kernel.Vmm: Remove hack from #2726 (#3864)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
* Remove SceKernelInternalMemory mapping Contrary to my initial beliefs, this is very much a hack. * Unreachable for unpatched code This will always infinitely loop, making logs extremely large. * Update linker.cpp
This commit is contained in:
parent
de6c5bbb83
commit
9e7df6ae54
@ -790,11 +790,12 @@ static bool PatchesIllegalInstructionHandler(void* context) {
|
|||||||
Common::Decoder::Instance()->decodeInstruction(instruction, operands, code_address);
|
Common::Decoder::Instance()->decodeInstruction(instruction, operands, code_address);
|
||||||
if (ZYAN_SUCCESS(status) && instruction.mnemonic == ZydisMnemonic::ZYDIS_MNEMONIC_UD2)
|
if (ZYAN_SUCCESS(status) && instruction.mnemonic == ZydisMnemonic::ZYDIS_MNEMONIC_UD2)
|
||||||
[[unlikely]] {
|
[[unlikely]] {
|
||||||
UNREACHABLE_MSG("ud2 at code address {:#x}", (u64)code_address);
|
UNREACHABLE_MSG("ud2 at code address {:#x}", reinterpret_cast<u64>(code_address));
|
||||||
}
|
}
|
||||||
LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: {}", (u64)code_address,
|
UNREACHABLE_MSG("Failed to patch address {:x} -- mnemonic: {}",
|
||||||
ZYAN_SUCCESS(status) ? ZydisMnemonicGetString(instruction.mnemonic)
|
reinterpret_cast<u64>(code_address),
|
||||||
: "Failed to decode");
|
ZYAN_SUCCESS(status) ? ZydisMnemonicGetString(instruction.mnemonic)
|
||||||
|
: "Failed to decode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -104,17 +104,6 @@ void Linker::Execute(const std::vector<std::string>& args) {
|
|||||||
|
|
||||||
memory->SetupMemoryRegions(fmem_size, use_extended_mem1, use_extended_mem2);
|
memory->SetupMemoryRegions(fmem_size, use_extended_mem1, use_extended_mem2);
|
||||||
|
|
||||||
// Simulate sceKernelInternalMemory mapping, a mapping usually performed during libkernel init.
|
|
||||||
// Due to the large size of this mapping, failing to emulate it causes issues in some titles.
|
|
||||||
// This mapping belongs in the system reserved area, which starts at address 0x880000000.
|
|
||||||
static constexpr VAddr KernelAllocBase = 0x880000000ULL;
|
|
||||||
static constexpr s64 InternalMemorySize = 0x1000000;
|
|
||||||
void* addr_out{reinterpret_cast<void*>(KernelAllocBase)};
|
|
||||||
|
|
||||||
s32 ret = Libraries::Kernel::sceKernelMapNamedFlexibleMemory(&addr_out, InternalMemorySize, 3,
|
|
||||||
0, "SceKernelInternalMemory");
|
|
||||||
ASSERT_MSG(ret == 0, "Unable to perform sceKernelInternalMemory mapping");
|
|
||||||
|
|
||||||
main_thread.Run([this, module, &args](std::stop_token) {
|
main_thread.Run([this, module, &args](std::stop_token) {
|
||||||
Common::SetCurrentThreadName("GAME_MainThread");
|
Common::SetCurrentThreadName("GAME_MainThread");
|
||||||
if (auto& ipc = IPC::Instance()) {
|
if (auto& ipc = IPC::Instance()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user