Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Galaxy s7 edge crash
05-18-2016, 04:35 AM (This post was last modified: 05-18-2016 04:35 AM by [Unknown].)
Post: #66
RE: Galaxy s7 edge crash
Interesting, it sounds like +/- 4096 (typical size of a page) and the 256 alignment (which seems large for a cache line) are working best. To confirm, with option 1 + 0xFF (which is the 4096 + 256 option), you haven't gotten any crashes?

Unfortunately, I don't feel 100% confident in this since the two components seemingly required don't seem related, and it doesn't totally make sense. I'm a little concerned that 256 is just leaving enough holes that it's significantly less likely to crash, but will eventually still crash. But, I'm not sure what else to try... Henrik?

Actually, I had one more idea. Instead of that one HINT part, what if you try:

Code:
for (int h = 0; h < 64; ++h) {
    HINT(HINT_NOP);
}

This will do a different thing than before. If this works also, it may mean that what we really need is space between blocks, not alignment. Since most blocks are pretty small, it might be that alignment was just giving us space.

If that does work, can you try 32 and 16 also, in place of 64? If it doesn't, there's no need to bother. If 64 doesn't work, those others are very unlikely to work.

The next thing is, what does it show under System Info? We might have to do this based on the "Name" under "CPU Information", I suppose.

I don't think it's interesting to try the other alignment values with block link off. If 0xFF works reliably and 0x3F doesn't, I don't expect that to be impacted by block linking.



To explain a bit about what's happening and what you're debugging -

Jit breaks the game's code into small pieces, called "basic blocks." These are typically short sections of MIPS code (that's the CPU the PSP has.) Then it translates that basic block into ARM64 code (which is what your phone's CPU uses.) Then the pieces of the program are stored in memory as jit blocks.

Normally, CPUs can count on program code not changing - sometimes they don't even look at the code, because they just want to go fast. They just run the program from "the instruction cache," which is like saying it knows the program by heart. When we change the code, we have to tell it - or it just won't know. This is what "invalidation" is.

Normally, after writing new code, we tell the operating system - I started writing new code HERE, and I finished with the new code HERE. So forget anything between those two places. The 4096 change makes us lie: we say we invalidated 1024 more bits of program code each direction than we really did.

Basic blocks are really small, but there's lots of them. 4096 bytes / 1024 instructions will probably cover many blocks. This will hurt performance (more or less depending on different CPUs), but usually only temporarily.

Block linking is a trick where we tie blocks together, directly. With block linking off, we run one block at a time. There's overhead while the jit reaches into its bag to pull out the next block. But sometimes, code goes in sequence - we can just send the CPU from one block directly to the next. To do this, after we've created both blocks, we go back and modify the first one to point directly to the second. This invalidates again (and with the changes, also invalidates +/- 1024 instructions.)

Lastly, the alignment makes it so every block starts at an "even" position. It's like if you started paragraphs on lined paper, only on every 5th line. If your first paragraph was 6 lines long, oh well, you'll just skip 4 lines to start the next one.

My big worry is that, aligning to 256 might mean that most blocks have a bunch of blank lines between them. This wastes the limited jit space some, but more importantly it could be it's only working when there's enough blank space between all blocks. Maybe the CPU really just wants two blank lines between each paragraph. Sometimes (it's not common), there will be larger blocks, and it could be these will still crash (i.e. when a boss uses an unusual and complicated move, or etc.)

-[Unknown]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Galaxy s7 edge crash - cha0tic - 03-12-2016, 02:34 PM
RE: Galaxy s7 edge crash - KingPepper - 03-12-2016, 04:55 PM
RE: Galaxy s7 edge crash - cha0tic - 03-12-2016, 07:08 PM
RE: Galaxy s7 edge crash - Henrik - 03-12-2016, 07:20 PM
RE: Galaxy s7 edge crash - cha0tic - 03-12-2016, 07:23 PM
RE: Galaxy s7 edge crash - cha0tic - 03-13-2016, 05:31 PM
RE: Galaxy s7 edge crash - thienbaont - 03-14-2016, 03:40 AM
RE: Galaxy s7 edge crash - cha0tic - 03-14-2016, 04:02 AM
RE: Galaxy s7 edge crash - jajabinx35 - 03-15-2016, 08:30 PM
RE: Galaxy s7 edge crash - cha0tic - 03-16-2016, 11:14 PM
RE: Galaxy s7 edge crash - nex86 - 03-17-2016, 04:05 AM
RE: Galaxy s7 edge crash - thienbaont - 03-17-2016, 04:12 AM
RE: Galaxy s7 edge crash - nex86 - 03-17-2016, 04:14 AM
RE: Galaxy s7 edge crash - cha0tic - 03-17-2016, 08:09 AM
RE: Galaxy s7 edge crash - heneli627 - 03-17-2016, 02:46 PM
RE: Galaxy s7 edge crash - nex86 - 03-17-2016, 03:24 PM
RE: Galaxy s7 edge crash - Ifoozle - 03-18-2016, 04:32 AM
RE: Galaxy s7 edge crash - jajabinx35 - 03-18-2016, 09:30 AM
RE: Galaxy s7 edge crash - cha0tic - 03-20-2016, 06:09 AM
RE: Galaxy s7 edge crash - Bronxc - 03-20-2016, 04:50 PM
RE: Galaxy s7 edge crash - Ifoozle - 03-20-2016, 07:46 PM
RE: Galaxy s7 edge crash - [Unknown] - 03-22-2016, 03:01 AM
RE: Galaxy s7 edge crash - cha0tic - 03-22-2016, 07:49 PM
RE: Galaxy s7 edge crash - [Unknown] - 03-22-2016, 11:45 PM
RE: Galaxy s7 edge crash - chdcchris - 03-22-2016, 10:15 PM
RE: Galaxy s7 edge crash - nex86 - 03-23-2016, 01:53 AM
RE: Galaxy s7 edge crash - Warmachine02 - 04-04-2016, 06:07 PM
RE: Galaxy s7 edge crash - heneli627 - 04-06-2016, 07:19 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-07-2016, 08:56 AM
RE: Galaxy s7 edge crash - TkSilver - 04-07-2016, 01:33 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-09-2016, 03:47 PM
RE: Galaxy s7 edge crash - Henrik - 04-09-2016, 05:32 PM
RE: Galaxy s7 edge crash - Warmachine02 - 04-09-2016, 05:49 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-09-2016, 06:40 PM
RE: Galaxy s7 edge crash - solid89 - 04-12-2016, 08:05 AM
RE: Galaxy s7 edge crash - LoAndEvolve - 04-12-2016, 10:05 AM
RE: Galaxy s7 edge crash - [Unknown] - 04-12-2016, 12:41 PM
RE: Galaxy s7 edge crash - brujo55 - 04-12-2016, 03:51 PM
RE: Galaxy s7 edge crash - [Unknown] - 04-12-2016, 06:08 PM
RE: Galaxy s7 edge crash - hitori - 04-13-2016, 04:58 PM
RE: Galaxy s7 edge crash - nex86 - 04-15-2016, 06:05 AM
RE: Galaxy s7 edge crash - hitori - 04-15-2016, 05:58 PM
RE: Galaxy s7 edge crash - destinyfates - 04-21-2016, 12:35 PM
RE: Galaxy s7 edge crash - jajabinx35 - 04-21-2016, 01:49 PM
RE: Galaxy s7 edge crash - TkSilver - 04-21-2016, 03:40 PM
RE: Galaxy s7 edge crash - fredwu - 04-27-2016, 03:17 PM
RE: Galaxy s7 edge crash - dazemu - 04-30-2016, 10:48 AM
RE: Galaxy s7 edge crash - jajabinx35 - 05-03-2016, 11:15 AM
RE: Galaxy s7 edge crash - Warmachine02 - 05-04-2016, 10:10 PM
RE: Galaxy s7 edge crash - jajabinx35 - 05-05-2016, 08:19 AM
RE: Galaxy s7 edge crash - Bobby_Flamingo - 05-15-2016, 06:24 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-15-2016, 08:19 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 11:30 AM
RE: Galaxy s7 edge crash - Henrik - 05-16-2016, 01:11 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 01:35 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-16-2016, 03:54 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 04:14 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-16-2016, 04:27 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 04:53 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-16-2016, 05:57 PM
RE: Galaxy s7 edge crash - Jaaan - 05-16-2016, 06:49 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-17-2016, 12:45 AM
RE: Galaxy s7 edge crash - Jaaan - 05-17-2016, 11:07 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-17-2016, 05:17 PM
RE: Galaxy s7 edge crash - Jaaan - 05-17-2016, 06:59 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-18-2016 04:35 AM
RE: Galaxy s7 edge crash - Jaaan - 05-18-2016, 10:59 AM
RE: Galaxy s7 edge crash - Bobby_Flamingo - 05-18-2016, 11:58 PM
RE: Galaxy s7 edge crash - [Unknown] - 05-22-2016, 01:40 AM
RE: Galaxy s7 edge crash - jakal7x - 05-22-2016, 08:21 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-22-2016, 03:13 PM
RE: Galaxy s7 edge crash - jakal7x - 05-23-2016, 12:15 PM
RE: Galaxy s7 edge crash - cha0tic - 05-23-2016, 03:58 AM
RE: Galaxy s7 edge crash - [Unknown] - 05-24-2016, 03:49 AM
RE: Galaxy s7 edge crash - Henrik - 05-24-2016, 06:58 AM
RE: Galaxy s7 edge crash - jakal7x - 05-25-2016, 01:20 AM
RE: Galaxy s7 edge crash - jajabinx35 - 05-25-2016, 05:53 PM
RE: Galaxy s7 edge crash - jajabinx35 - 05-28-2016, 12:36 PM
RE: Galaxy s7 edge crash - HANZ64 - 07-19-2016, 09:22 PM
RE: Galaxy s7 edge crash - PsyEd - 08-18-2016, 06:03 AM
RE: Galaxy s7 edge crash - n1kokpo12 - 08-26-2016, 02:36 AM
RE: Galaxy s7 edge crash - n1kokpo12 - 08-27-2016, 12:13 AM
RE: Galaxy s7 edge crash - TkSilver - 08-27-2016, 02:51 AM
RE: Galaxy s7 edge crash - [Unknown] - 09-10-2016, 05:47 PM
RE: Galaxy s7 edge crash - PsyEd - 09-21-2016, 11:20 PM
RE: Galaxy s7 edge crash - HANZ64 - 09-22-2016, 04:18 AM
RE: Galaxy s7 edge crash - RoronoARK - 09-23-2016, 03:10 PM

Forum Jump: