Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing the Memory Mapping. #17

Closed
Maschell opened this issue Apr 4, 2018 · 9 comments
Closed

Testing the Memory Mapping. #17

Maschell opened this issue Apr 4, 2018 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@Maschell
Copy link
Collaborator

Maschell commented Apr 4, 2018

Commit a839430 added inital support for mapping some extra memory.
This memory is currently not used as it's still unclear if it's really unused.
To check this, I need some people to run some tests on their console. At the moment I have only done it on mine ( EUR 5.5.2).
What the memory mapping testing is doing:

  • Setting up the segment registers and page table to map memory to (hopefully) unused places
  • Write specific values to the physical addresses of the memory
  • Then reading it the values from the effective_ addresses of the memory and comparing them
  • Check if memory was overriden (=> was not unused memory..)
  • Loading it with any plugins is NOT required.

What the tester should do:

Once you are in the system menu, check the log for something like this

[     memory_mapping.cpp]      readTestValuesFromMemory@L0213: Testing reading the written values.
[     memory_mapping.cpp]      readTestValuesFromMemory@L0236: Flushing 00800000 (8192 kB) at 80000000 to map memory.
[     memory_mapping.cpp]      readTestValuesFromMemory@L0239: Testing memory region 1. 0x80000000 - 0x80800000. Size 0x00800000 (8192 KBytes).
[     memory_mapping.cpp]      readTestValuesFromMemory@L0266: + Good  between 0x80000000 and 0x80800000 size: 8192 kB
[     memory_mapping.cpp]      readTestValuesFromMemory@L0271: Test 1 was successful!
[     memory_mapping.cpp]      readTestValuesFromMemory@L0236: Flushing 01000000 (16384 kB) at 80800000 to map memory.
[     memory_mapping.cpp]      readTestValuesFromMemory@L0239: Testing memory region 2. 0x80800000 - 0x81800000. Size 0x01000000 (16384 KBytes).
[     memory_mapping.cpp]      readTestValuesFromMemory@L0266: + Good  between 0x80800000 and 0x81800000 size: 16384 kB
[     memory_mapping.cpp]      readTestValuesFromMemory@L0271: Test 2 was successful!
[     memory_mapping.cpp]      readTestValuesFromMemory@L0236: Flushing 02B40000 (44288 kB) at 88000000 to map memory.
[     memory_mapping.cpp]      readTestValuesFromMemory@L0239: Testing memory region 3. 0x88000000 - 0x8AB40000. Size 0x02B40000 (44288 KBytes).
[     memory_mapping.cpp]      readTestValuesFromMemory@L0266: + Good  between 0x88000000 and 0x8AB40000 size: 44288 kB
[     memory_mapping.cpp]      readTestValuesFromMemory@L0271: Test 3 was successful!
[     memory_mapping.cpp]      readTestValuesFromMemory@L0275: All tests done.

This gets logged whenever the application was switched. However, you can trigger it manually by pressing L,R and PLUS on the Gamepad. The goal is now trying override the mapped memory so the test is failing. In best case our mapped memory is really unused, and overriding is impossible. Otherwise we have to exclude the overridden memory.

So how to break this?

  • Try to load as many games as possible. Maybe some game already used the memory region we mapped our to.
  • Attach some peripheral like USB Controllers, keyboard,
  • Open overlay apps. Browser, Friendlist, Miiverse, EShop, Browser, Notification, Downloader Manager, Manual. Combine this. While ingame open notifcation and jump to the browser. Stuff like that.
  • Try to use the gamepad camera (in game, miimaker not available) or NFC sensor.
  • Get creative. I want this to be as stable a possible. So even if some parts of the memory are only used in really rare and strange situations - I won't take it.
  • Load different virtual console games (I only tested nes and snes so far)

Keep a copy of the UDPReader log. You can press "f" to save the log to the files. If you found something interesting, copy/paste the log in here.

If you see any crash, please send me the full log (+ some details where it crashed).
It would be also awesome if you could re-run the step to trigger the step, but load the plugin loader normally this time (with Plus). This still logs some memory stuff, but doesn't map new memory (and hopefully don't crash). Both logs would be very helpful.

If you have any questions, feel free to ask!

FAQ:
Will the memory mapping always take sooooo long?
No. Only writing 65MB to the physical memory addresses is slow. This is not required, only for testing.
Why do we need to map extra memory?
More plugins at the same time. Memory is always good. This is also a huge step into getting plugins working together with homebrew applications.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Maschell Maschell added the help wanted Extra attention is needed label Apr 4, 2018
@piratesephiroth
Copy link

piratesephiroth commented Apr 5, 2018

I'm using a North American 8GB Wii U on v5.5.2

I saw errors only on region 3. It happens after I go to Notifications and then click an outdated eShop link, like Kirby 25th Anniversary (get an error 111-1006, cannot display the page).

I guess it's caused by any error while loading the eshop.

Testing memory region 3. 0x88000000 - 0x8AB40000. Size 0x02B40000 (44288 KBytes).

  • Good between 0x88000000 and 0x88856800 size: 8538 kB
  • Error between 0x88856800 and 0x88860340 size: 38 kB
  • Good between 0x88860340 and 0x88860800 size: 1 kB
  • Error between 0x88860800 and 0x88880000 size: 126 kB
  • Good between 0x88880000 and 0x8AB40000 size: 35584 kB

@FunThomas76
Copy link

EU WiiU 32GB on 5.5.1:

Testing reading the written values.
Flushing 00800000 (8192 kB) at 80000000 to map memory.
Testing memory region 1. 0x80000000 - 0x80800000. Size 0x00800000 (8192 KBytes).

  • Good between 0x80000000 and 0x80800000 size: 8192 kB
    Test 1 was successful!
    Flushing 01000000 (16384 kB) at 80800000 to map memory.
    Testing memory region 2. 0x80800000 - 0x81800000. Size 0x01000000 (16384 KBytes).
  • Good between 0x80800000 and 0x81800000 size: 16384 kB
    Test 2 was successful!
    Flushing 02B40000 (44288 kB) at 88000000 to map memory.
    Testing memory region 3. 0x88000000 - 0x8AB40000. Size 0x02B40000 (44288 KBytes).
  • Good between 0x88000000 and 0x8AB40000 size: 44288 kB
    Test 3 was successful!
    All tests done.
    Testing reading the written values.
    Flushing 00800000 (8192 kB) at 80000000 to map memory.
    Testing memory region 1. 0x80000000 - 0x80800000. Size 0x00800000 (8192 KBytes).
  • Good between 0x80000000 and 0x80800000 size: 8192 kB
    Test 1 was successful!
    Flushing 01000000 (16384 kB) at 80800000 to map memory.
    Testing memory region 2. 0x80800000 - 0x81800000. Size 0x01000000 (16384 KBytes).
  • Good between 0x80800000 and 0x81800000 size: 16384 kB
    Test 2 was successful!
    Flushing 02B40000 (44288 kB) at 88000000 to map memory.
    Testing memory region 3. 0x88000000 - 0x8AB40000. Size 0x02B40000 (44288 KBytes).
  • Good between 0x88000000 and 0x8AB40000 size: 44288 kB
    Test 3 was successful!
    All tests done.

@Maschell
Copy link
Collaborator Author

Maschell commented Apr 5, 2018

@piratesephiroth thanks, that's helpful. Can you verifiy that all test are passing with the newest nightly?
@FunThomas76 Good to see no issues on 5.5.1

Someone reported that GBA VC games are not working. Can somebody confirm if virtual console games in general don't work with memory mapping enabled?

If you see any crash, please send me the full log (+ some details where it crashed).
It would be also awesome if you could re-run the step to trigger the step, but load the plugin loader normally this time (with Plus). This still logs some memory stuff, but doesn't map new memory (and hopefully don't crash). Both logs would be very helpful.

@piratesephiroth
Copy link

piratesephiroth commented Apr 5, 2018

Both SNES VC and GBA VC work fine here.

All tests pass normally until after I visit the eshop link in the notifications.
Results seems to vary slightly depending on which notification I open.

Testing memory region 3. 0x88000000 - 0x8AB20000. Size 0x02B20000 (44160 KBytes).

  • Good between 0x88000000 and 0x88856800 size: 8538 kB
  • Error between 0x88856800 and 0x88860000 size: 38 kB
  • Good between 0x88860000 and 0x8AB20000 size: 35584 kB

Testing memory region 3. 0x88000000 - 0x8AB20000. Size 0x02B20000 (44160 KBytes).

  • Good between 0x88000000 and 0x888552AC size: 8532 kB
  • Error between 0x888552AC and 0x88860000 size: 43 kB
  • Good between 0x88860000 and 0x8AB20000 size: 35584 kB

Testing memory region 3. 0x88000000 - 0x8AB20000. Size 0x02B20000 (44160 KBytes).

  • Good between 0x88000000 and 0x88853BDC size: 8526 kB
  • Error between 0x88853BDC and 0x88860000 size: 49 kB
  • Good between 0x88860000 and 0x8AB20000 size: 35584 kB

@wicksand420
Copy link

wicksand420 commented Apr 6, 2018

The GBA VC's inject is what was crashing for me.

@Maschell
Copy link
Collaborator Author

Maschell commented Apr 7, 2018

@piratesephiroth Thanks, Once again I adjusted the size of the chunk. Now it should work?

@wicksand420 That shouldn't make a difference if it's injected. Which base game are you using? That could be the problem.

@downloadpizza
Copy link

I can play Splatoon or Sm4sh modded (1Gig Modpack) with HIDtoVPAD Network Client and no problems

@piratesephiroth
Copy link

@Maschell, yep, no errors at all now.

@wicksand420
Copy link

@Maschell I'm not sure what the base was on the inject, I got it like 3 years ago, but I loaded a wii u game before the gba inject and got a crash, I'm not sure if that makes a difference, but I'm about to try a few more things with your latest nightly, so I'll try that again and post my results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants