Commit 3cefc718 authored by Jay Cornwall's avatar Jay Cornwall Committed by Alex Deucher

drm/amdkfd: Support debugger in Navi1x trap handler

- Preserve scalar GPRs ttmp[4:11] and ttmp13
- Add single step exception during context save workaround
- Remove incorrect PC adjustment during context save
Signed-off-by: default avatarJay Cornwall <jay.cornwall@amd.com>
Reviewed-by: default avatarYong Zhao <Yong.Zhao@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d0f1a853
...@@ -680,389 +680,404 @@ static const uint32_t cwsr_trap_gfx9_hex[] = { ...@@ -680,389 +680,404 @@ static const uint32_t cwsr_trap_gfx9_hex[] = {
}; };
static const uint32_t cwsr_trap_nv1x_hex[] = { static const uint32_t cwsr_trap_nv1x_hex[] = {
0xbf820001, 0xbf8201bc, 0xbf820001, 0xbf8201cd,
0xb0804004, 0xb978f802, 0xb0804004, 0xb978f802,
0x8a788678, 0xb971f803, 0x8a788678, 0xb96ef801,
0x876eff71, 0x00000400, 0x876eff6e, 0x00000800,
0xbf850033, 0x876eff71, 0xbf840003, 0x876eff78,
0x00000100, 0xbf840002, 0x00002000, 0xbf840009,
0x8878ff78, 0x00002000, 0xb97bf803, 0x876eff7b,
0x8a77ff77, 0xff000000, 0x00000400, 0xbf850033,
0xb96ef807, 0x876fff6e, 0x876eff7b, 0x00000100,
0x02000000, 0x8f6f866f, 0xbf840002, 0x8878ff78,
0x88776f77, 0x876fff6e, 0x00002000, 0x8a77ff77,
0x003f8000, 0x8f6f896f, 0xff000000, 0xb96ef807,
0x88776f77, 0x8a6eff6e, 0x876fff6e, 0x02000000,
0x023f8000, 0xb9eef807, 0x8f6f866f, 0x88776f77,
0xb97af812, 0xb97bf813, 0x876fff6e, 0x003f8000,
0x8ffa887a, 0xf4051bbd, 0x8f6f896f, 0x88776f77,
0xfa000000, 0xbf8cc07f, 0x8a6eff6e, 0x023f8000,
0xf4051ebd, 0xfa000008, 0xb9eef807, 0xb97af812,
0xbf8cc07f, 0x87ee6e6e, 0xb97bf813, 0x8ffa887a,
0xbf840001, 0xbe80206e, 0xf4051bbd, 0xfa000000,
0xb971f803, 0x8771ff71, 0xbf8cc07f, 0xf4051ebd,
0x000001ff, 0xbf850002, 0xfa000008, 0xbf8cc07f,
0x806c846c, 0x826d806d, 0x87ee6e6e, 0xbf840001,
0x876dff6d, 0x0000ffff, 0xbe80206e, 0xb97bf803,
0x906e8977, 0x876fff6e, 0x877bff7b, 0x000001ff,
0x003f8000, 0x906e8677, 0xbf850002, 0x806c846c,
0x876eff6e, 0x02000000, 0x826d806d, 0x876dff6d,
0x886e6f6e, 0xb9eef807, 0x0000ffff, 0x906e8977,
0x87fe7e7e, 0x87ea6a6a, 0x876fff6e, 0x003f8000,
0xb9f8f802, 0xbe80226c, 0x906e8677, 0x876eff6e,
0xb971f803, 0x8771ff71, 0x02000000, 0x886e6f6e,
0x00000100, 0xbf840006, 0xb9eef807, 0x87fe7e7e,
0xbef60380, 0xb9f60203, 0x87ea6a6a, 0xb9f8f802,
0x876dff6d, 0x0000ffff, 0xbe80226c, 0x876dff6d,
0x80ec886c, 0x82ed806d, 0x0000ffff, 0xbefa0380,
0xbef60380, 0xb9f60283, 0xb9fa0283, 0xb97a2c07,
0xb972f816, 0xb9762c07, 0x8f7a9a7a, 0x886d7a6d,
0x8f769a76, 0x886d766d, 0xb97a03c7, 0x8f7a997a,
0xb97603c7, 0x8f769976, 0x886d7a6d, 0xb97a0647,
0x886d766d, 0xb9760647, 0x8f7a987a, 0x886d7a6d,
0x8f769876, 0x886d766d, 0xb97af807, 0x877aff7a,
0xb976f807, 0x8776ff76, 0x00007fff, 0xb9faf807,
0x00007fff, 0xb9f6f807,
0xbeee037e, 0xbeef037f, 0xbeee037e, 0xbeef037f,
0xbefe0480, 0xbf900004, 0xbefe0480, 0xbf900004,
0xbf8e0002, 0xbf88fffe, 0xbf8e0002, 0xbf88fffe,
0xb97b02dc, 0x8f7b997b,
0x887b7b7f, 0xb97a2a05,
0x807a817a, 0xbf0d997b,
0xbf850002, 0x8f7a897a,
0xbf820001, 0x8f7a8a7a,
0x877bff7f, 0x0000ffff,
0x807aff7a, 0x00000200,
0x807a7e7a, 0x827b807b,
0xf4491c3d, 0xfa000050,
0xf4491d3d, 0xfa000060,
0xf4411e7d, 0xfa000074,
0xbef4037e, 0x8775ff7f, 0xbef4037e, 0x8775ff7f,
0x0000ffff, 0x8875ff75, 0x0000ffff, 0x8875ff75,
0x00040000, 0xbef60380, 0x00040000, 0xbef60380,
0xbef703ff, 0x10807fac, 0xbef703ff, 0x10807fac,
0x8776ff7f, 0x08000000, 0x877aff7f, 0x08000000,
0x90768376, 0x88777677, 0x907a837a, 0x88777a77,
0x8776ff7f, 0x70000000, 0x877aff7f, 0x70000000,
0x90768176, 0x88777677, 0x907a817a, 0x88777a77,
0xbefb037c, 0xbefa0380, 0xbef1037c, 0xbef00380,
0xb97302dc, 0x8f739973, 0xb97302dc, 0x8f739973,
0x8873737f, 0xbefe03c1, 0x8873737f, 0xb97bf816,
0x907c9973, 0x877c817c, 0xba80f816, 0x00000000,
0xbf06817c, 0xbf850002, 0xbefe03c1, 0x907c9973,
0xbeff0380, 0xbf820002,
0xbeff03c1, 0xbf82000b,
0xbef603ff, 0x01000000,
0xe0704000, 0x7a5d0000,
0xe0704080, 0x7a5d0100,
0xe0704100, 0x7a5d0200,
0xe0704180, 0x7a5d0300,
0xbf82000a, 0xbef603ff,
0x01000000, 0xe0704000,
0x7a5d0000, 0xe0704100,
0x7a5d0100, 0xe0704200,
0x7a5d0200, 0xe0704300,
0x7a5d0300, 0xb97a2a05,
0x807a817a, 0x907c9973,
0x877c817c, 0xbf06817c, 0x877c817c, 0xbf06817c,
0xbf850002, 0x8f7a897a, 0xbf850002, 0xbeff0380,
0xbf820001, 0x8f7a8a7a, 0xbf820002, 0xbeff03c1,
0xb9761e06, 0x8f768a76, 0xbf82000b, 0xbef603ff,
0x807a767a, 0x807aff7a, 0x01000000, 0xe0704000,
0x00000200, 0xbef603ff, 0x705d0000, 0xe0704080,
0x01000000, 0xbefe037c, 0x705d0100, 0xe0704100,
0xbefc037a, 0xf4611efa, 0x705d0200, 0xe0704180,
0xf8000000, 0x807a847a, 0x705d0300, 0xbf82000a,
0xbefc037e, 0xbefe037c, 0xbef603ff, 0x01000000,
0xbefc037a, 0xf4611b3a, 0xe0704000, 0x705d0000,
0xf8000000, 0x807a847a, 0xe0704100, 0x705d0100,
0xbefc037e, 0xbefe037c, 0xe0704200, 0x705d0200,
0xbefc037a, 0xf4611b7a, 0xe0704300, 0x705d0300,
0xf8000000, 0x807a847a, 0xb9702a05, 0x80708170,
0xbefc037e, 0xbefe037c, 0xbf0d9973, 0xbf850002,
0xbefc037a, 0xf4611bba, 0x8f708970, 0xbf820001,
0xf8000000, 0x807a847a, 0x8f708a70, 0xb97a1e06,
0xbefc037e, 0xbefe037c, 0x8f7a8a7a, 0x80707a70,
0xbefc037a, 0xf4611bfa, 0x8070ff70, 0x00000200,
0xf8000000, 0x807a847a, 0xbef603ff, 0x01000000,
0xbefe037c, 0xbefc0370,
0xf4611c7a, 0xf8000000,
0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc0370,
0xf4611b3a, 0xf8000000,
0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc0370,
0xf4611b7a, 0xf8000000,
0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc0370,
0xf4611bba, 0xf8000000,
0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc0370,
0xf4611bfa, 0xf8000000,
0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc0370,
0xf4611e3a, 0xf8000000,
0x80708470, 0xbefc037e,
0xb97af803, 0xbefe037c,
0xbefc0370, 0xf4611eba,
0xf8000000, 0x80708470,
0xbefc037e, 0xbefe037c, 0xbefc037e, 0xbefe037c,
0xbefc037a, 0xf4611e3a, 0xbefc0370, 0xf4611efa,
0xf8000000, 0x807a847a, 0xf8000000, 0x80708470,
0xbefc037e, 0xb971f803, 0xbefc037e, 0xb971f801,
0xbefe037c, 0xbefc037a, 0xbefe037c, 0xbefc0370,
0xf4611c7a, 0xf8000000, 0xf4611c7a, 0xf8000000,
0x807a847a, 0xbefc037e, 0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc037a, 0xb971f814, 0xbefe037c,
0xf4611cba, 0xf8000000, 0xbefc0370, 0xf4611c7a,
0x807a847a, 0xbefc037e, 0xf8000000, 0x80708470,
0xb97bf801, 0xbefe037c, 0xbefc037e, 0xb971f815,
0xbefc037a, 0xf4611efa, 0xbefe037c, 0xbefc0370,
0xf8000000, 0x807a847a, 0xf4611c7a, 0xf8000000,
0xbefc037e, 0xb97bf814, 0x80708470, 0xbefc037e,
0xbefe037c, 0xbefc037a, 0xb9702a05, 0x80708170,
0xf4611efa, 0xf8000000, 0xbf0d9973, 0xbf850002,
0x807a847a, 0xbefc037e, 0x8f708970, 0xbf820001,
0xb97bf815, 0xbefe037c, 0x8f708a70, 0xb97a1e06,
0xbefc037a, 0xf4611efa, 0x8f7a8a7a, 0x80707a70,
0xf8000000, 0x807a847a,
0xbefc037e, 0xb97a2a05,
0x807a817a, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850002, 0x8f7a897a,
0xbf820001, 0x8f7a8a7a,
0xb9761e06, 0x8f768a76,
0x807a767a, 0xbef603ff,
0x01000000, 0xbef20374,
0x80747a74, 0x82758075,
0xbefc0380, 0xbf800000,
0xbe802f00, 0xbe822f02,
0xbe842f04, 0xbe862f06,
0xbe882f08, 0xbe8a2f0a,
0xbe8c2f0c, 0xbe8e2f0e,
0xf469003a, 0xfa000000,
0xf469013a, 0xfa000010,
0xf469023a, 0xfa000020,
0xf469033a, 0xfa000030,
0x8074c074, 0x82758075,
0x807c907c, 0xbf0aff7c,
0x00000060, 0xbf85ffea,
0xbe802f00, 0xbe822f02,
0xbe842f04, 0xbe862f06,
0xbe882f08, 0xbe8a2f0a,
0xf469003a, 0xfa000000,
0xf469013a, 0xfa000010,
0xf469023a, 0xfa000020,
0x8074b074, 0x82758075,
0xbef40372, 0xbefe03c1,
0x907c9973, 0x877c817c,
0xbf06817c, 0xbf850002,
0xbeff0380, 0xbf820001,
0xbeff03c1, 0xb9714306,
0x8771c171, 0xbf840046,
0xbf8a0000, 0x8776ff73,
0x04000000, 0xbf840042,
0x8f718671, 0x8f718271,
0xbef60371, 0xb97a2a05,
0x807a817a, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850002, 0x8f7a897a,
0xbf820001, 0x8f7a8a7a,
0xb9761e06, 0x8f768a76,
0x807a767a, 0x807aff7a,
0x00000200, 0x807aff7a,
0x00000080, 0xbef603ff,
0x01000000, 0xd7650000,
0x000100c1, 0xd7660000,
0x000200c1, 0x16000084,
0x907c9973, 0x877c817c,
0xbf06817c, 0xbefc0380,
0xbf850012, 0xbe8303ff,
0x00000080, 0xbf800000,
0xbf800000, 0xbf800000,
0xd8d80000, 0x01000000,
0xbf8c0000, 0xe0704000,
0x7a5d0100, 0x807c037c,
0x807a037a, 0xd5250000,
0x0001ff00, 0x00000080,
0xbf0a717c, 0xbf85fff4,
0xbf820011, 0xbe8303ff,
0x00000100, 0xbf800000,
0xbf800000, 0xbf800000,
0xd8d80000, 0x01000000,
0xbf8c0000, 0xe0704000,
0x7a5d0100, 0x807c037c,
0x807a037a, 0xd5250000,
0x0001ff00, 0x00000100,
0xbf0a717c, 0xbf85fff4,
0xbefe03c1, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850004, 0xbefa03ff,
0x00000200, 0xbeff0380,
0xbf820003, 0xbefa03ff,
0x00000400, 0xbeff03c1,
0xb9712a05, 0x80718171,
0x8f718271, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850017, 0xbef603ff,
0x01000000, 0xbefc0384,
0xbf0a717c, 0xbf840037,
0x7e008700, 0x7e028701,
0x7e048702, 0x7e068703,
0xe0704000, 0x7a5d0000,
0xe0704080, 0x7a5d0100,
0xe0704100, 0x7a5d0200,
0xe0704180, 0x7a5d0300,
0x807c847c, 0x807aff7a,
0x00000200, 0xbf0a717c,
0xbf85ffef, 0xbf820025,
0xbef603ff, 0x01000000, 0xbef603ff, 0x01000000,
0xbefc0384, 0xbf0a717c, 0xbefb0374, 0x80747074,
0xbf840020, 0x7e008700, 0x82758075, 0xbefc0380,
0x7e028701, 0x7e048702, 0xbf800000, 0xbe802f00,
0x7e068703, 0xe0704000, 0xbe822f02, 0xbe842f04,
0x7a5d0000, 0xe0704100, 0xbe862f06, 0xbe882f08,
0x7a5d0100, 0xe0704200, 0xbe8a2f0a, 0xbe8c2f0c,
0x7a5d0200, 0xe0704300, 0xbe8e2f0e, 0xf469003a,
0x7a5d0300, 0x807c847c, 0xfa000000, 0xf469013a,
0x807aff7a, 0x00000400, 0xfa000010, 0xf469023a,
0xbf0a717c, 0xbf85ffef, 0xfa000020, 0xf469033a,
0xb9711e06, 0x8771c171, 0xfa000030, 0x8074c074,
0xbf84000c, 0x8f718371, 0x82758075, 0x807c907c,
0x80717c71, 0xbefe03c1, 0xbf0aff7c, 0x00000060,
0xbeff0380, 0x7e008700, 0xbf85ffea, 0xbe802f00,
0xe0704000, 0x7a5d0000, 0xbe822f02, 0xbe842f04,
0x807c817c, 0x807aff7a, 0xbe862f06, 0xbe882f08,
0x00000080, 0xbf0a717c, 0xbe8a2f0a, 0xf469003a,
0xbf85fff8, 0xbf820142, 0xfa000000, 0xf469013a,
0xbef4037e, 0x8775ff7f, 0xfa000010, 0xf469023a,
0x0000ffff, 0x8875ff75, 0xfa000020, 0x8074b074,
0x00040000, 0xbef60380, 0x82758075, 0xbef4037b,
0xbef703ff, 0x10807fac,
0x8772ff7f, 0x08000000,
0x90728372, 0x88777277,
0x8772ff7f, 0x70000000,
0x90728172, 0x88777277,
0xb97302dc, 0x8f739973,
0x8873737f, 0x8772ff7f,
0x04000000, 0xbf840036,
0xbefe03c1, 0x907c9973, 0xbefe03c1, 0x907c9973,
0x877c817c, 0xbf06817c, 0x877c817c, 0xbf06817c,
0xbf850002, 0xbeff0380, 0xbf850002, 0xbeff0380,
0xbf820001, 0xbeff03c1, 0xbf820001, 0xbeff03c1,
0xb96f4306, 0x876fc16f, 0xb97b4306, 0x877bc17b,
0xbf84002b, 0x8f6f866f, 0xbf840044, 0xbf8a0000,
0x8f6f826f, 0xbef6036f, 0x877aff73, 0x04000000,
0xb9782a05, 0x80788178, 0xbf840040, 0x8f7b867b,
0x907c9973, 0x877c817c, 0x8f7b827b, 0xbef6037b,
0xbf06817c, 0xbf850002, 0xb9702a05, 0x80708170,
0x8f788978, 0xbf820001, 0xbf0d9973, 0xbf850002,
0x8f788a78, 0xb9721e06, 0x8f708970, 0xbf820001,
0x8f728a72, 0x80787278, 0x8f708a70, 0xb97a1e06,
0x8078ff78, 0x00000200, 0x8f7a8a7a, 0x80707a70,
0x8078ff78, 0x00000080, 0x8070ff70, 0x00000200,
0x8070ff70, 0x00000080,
0xbef603ff, 0x01000000, 0xbef603ff, 0x01000000,
0xd7650000, 0x000100c1,
0xd7660000, 0x000200c1,
0x16000084, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbefc0380, 0xbf850012,
0xbe8303ff, 0x00000080,
0xbf800000, 0xbf800000,
0xbf800000, 0xd8d80000,
0x01000000, 0xbf8c0000,
0xe0704000, 0x705d0100,
0x807c037c, 0x80700370,
0xd5250000, 0x0001ff00,
0x00000080, 0xbf0a7b7c,
0xbf85fff4, 0xbf820011,
0xbe8303ff, 0x00000100,
0xbf800000, 0xbf800000,
0xbf800000, 0xd8d80000,
0x01000000, 0xbf8c0000,
0xe0704000, 0x705d0100,
0x807c037c, 0x80700370,
0xd5250000, 0x0001ff00,
0x00000100, 0xbf0a7b7c,
0xbf85fff4, 0xbefe03c1,
0x907c9973, 0x877c817c, 0x907c9973, 0x877c817c,
0xbf06817c, 0xbefc0380, 0xbf06817c, 0xbf850004,
0xbf850009, 0xe0310000, 0xbef003ff, 0x00000200,
0x781d0000, 0x807cff7c, 0xbeff0380, 0xbf820003,
0x00000080, 0x8078ff78, 0xbef003ff, 0x00000400,
0x00000080, 0xbf0a6f7c, 0xbeff03c1, 0xb97b2a05,
0xbf85fff8, 0xbf820008, 0x807b817b, 0x8f7b827b,
0xe0310000, 0x781d0000,
0x807cff7c, 0x00000100,
0x8078ff78, 0x00000100,
0xbf0a6f7c, 0xbf85fff8,
0xbef80380, 0xbefe03c1,
0x907c9973, 0x877c817c, 0x907c9973, 0x877c817c,
0xbf06817c, 0xbf850017,
0xbef603ff, 0x01000000,
0xbefc0384, 0xbf0a7b7c,
0xbf840037, 0x7e008700,
0x7e028701, 0x7e048702,
0x7e068703, 0xe0704000,
0x705d0000, 0xe0704080,
0x705d0100, 0xe0704100,
0x705d0200, 0xe0704180,
0x705d0300, 0x807c847c,
0x8070ff70, 0x00000200,
0xbf0a7b7c, 0xbf85ffef,
0xbf820025, 0xbef603ff,
0x01000000, 0xbefc0384,
0xbf0a7b7c, 0xbf840020,
0x7e008700, 0x7e028701,
0x7e048702, 0x7e068703,
0xe0704000, 0x705d0000,
0xe0704100, 0x705d0100,
0xe0704200, 0x705d0200,
0xe0704300, 0x705d0300,
0x807c847c, 0x8070ff70,
0x00000400, 0xbf0a7b7c,
0xbf85ffef, 0xb97b1e06,
0x877bc17b, 0xbf84000c,
0x8f7b837b, 0x807b7c7b,
0xbefe03c1, 0xbeff0380,
0x7e008700, 0xe0704000,
0x705d0000, 0x807c817c,
0x8070ff70, 0x00000080,
0xbf0a7b7c, 0xbf85fff8,
0xbf82014f, 0xbef4037e,
0x8775ff7f, 0x0000ffff,
0x8875ff75, 0x00040000,
0xbef60380, 0xbef703ff,
0x10807fac, 0x876eff7f,
0x08000000, 0x906e836e,
0x88776e77, 0x876eff7f,
0x70000000, 0x906e816e,
0x88776e77, 0xb97202dc,
0x8f729972, 0x8872727f,
0x876eff7f, 0x04000000,
0xbf840034, 0xbefe03c1,
0x907c9972, 0x877c817c,
0xbf06817c, 0xbf850002, 0xbf06817c, 0xbf850002,
0xbeff0380, 0xbf820001, 0xbeff0380, 0xbf820001,
0xbeff03c1, 0xb96f2a05, 0xbeff03c1, 0xb96f4306,
0x806f816f, 0x8f6f826f, 0x876fc16f, 0xbf840029,
0x907c9973, 0x877c817c, 0x8f6f866f, 0x8f6f826f,
0xbf06817c, 0xbf850021, 0xbef6036f, 0xb9782a05,
0xbef603ff, 0x01000000, 0x80788178, 0xbf0d9972,
0xbef20378, 0x8078ff78, 0xbf850002, 0x8f788978,
0x00000200, 0xbefc0384, 0xbf820001, 0x8f788a78,
0xe0304000, 0x785d0000, 0xb96e1e06, 0x8f6e8a6e,
0xe0304080, 0x785d0100, 0x80786e78, 0x8078ff78,
0xe0304100, 0x785d0200, 0x00000200, 0x8078ff78,
0xe0304180, 0x785d0300, 0x00000080, 0xbef603ff,
0xbf8c3f70, 0x7e008500, 0x01000000, 0x907c9972,
0x7e028501, 0x7e048502, 0x877c817c, 0xbf06817c,
0x7e068503, 0x807c847c, 0xbefc0380, 0xbf850009,
0xe0310000, 0x781d0000,
0x807cff7c, 0x00000080,
0x8078ff78, 0x00000080,
0xbf0a6f7c, 0xbf85fff8,
0xbf820008, 0xe0310000,
0x781d0000, 0x807cff7c,
0x00000100, 0x8078ff78,
0x00000100, 0xbf0a6f7c,
0xbf85fff8, 0xbef80380,
0xbefe03c1, 0x907c9972,
0x877c817c, 0xbf06817c,
0xbf850002, 0xbeff0380,
0xbf820001, 0xbeff03c1,
0xb96f2a05, 0x806f816f,
0x8f6f826f, 0x907c9972,
0x877c817c, 0xbf06817c,
0xbf850021, 0xbef603ff,
0x01000000, 0xbeee0378,
0x8078ff78, 0x00000200, 0x8078ff78, 0x00000200,
0xbf0a6f7c, 0xbf85ffee,
0xe0304000, 0x725d0000,
0xe0304080, 0x725d0100,
0xe0304100, 0x725d0200,
0xe0304180, 0x725d0300,
0xbf820032, 0xbef603ff,
0x01000000, 0xbef20378,
0x8078ff78, 0x00000400,
0xbefc0384, 0xe0304000, 0xbefc0384, 0xe0304000,
0x785d0000, 0xe0304100, 0x785d0000, 0xe0304080,
0x785d0100, 0xe0304200, 0x785d0100, 0xe0304100,
0x785d0200, 0xe0304300, 0x785d0200, 0xe0304180,
0x785d0300, 0xbf8c3f70, 0x785d0300, 0xbf8c3f70,
0x7e008500, 0x7e028501, 0x7e008500, 0x7e028501,
0x7e048502, 0x7e068503, 0x7e048502, 0x7e068503,
0x807c847c, 0x8078ff78, 0x807c847c, 0x8078ff78,
0x00000400, 0xbf0a6f7c, 0x00000200, 0xbf0a6f7c,
0xbf85ffee, 0xb96f1e06, 0xbf85ffee, 0xe0304000,
0x876fc16f, 0xbf84000e, 0x6e5d0000, 0xe0304080,
0x8f6f836f, 0x806f7c6f, 0x6e5d0100, 0xe0304100,
0xbefe03c1, 0xbeff0380, 0x6e5d0200, 0xe0304180,
0x6e5d0300, 0xbf820032,
0xbef603ff, 0x01000000,
0xbeee0378, 0x8078ff78,
0x00000400, 0xbefc0384,
0xe0304000, 0x785d0000, 0xe0304000, 0x785d0000,
0xe0304100, 0x785d0100,
0xe0304200, 0x785d0200,
0xe0304300, 0x785d0300,
0xbf8c3f70, 0x7e008500, 0xbf8c3f70, 0x7e008500,
0x807c817c, 0x8078ff78, 0x7e028501, 0x7e048502,
0x00000080, 0xbf0a6f7c, 0x7e068503, 0x807c847c,
0xbf85fff7, 0xbeff03c1, 0x8078ff78, 0x00000400,
0xe0304000, 0x725d0000, 0xbf0a6f7c, 0xbf85ffee,
0xe0304100, 0x725d0100, 0xb96f1e06, 0x876fc16f,
0xe0304200, 0x725d0200, 0xbf84000e, 0x8f6f836f,
0xe0304300, 0x725d0300, 0x806f7c6f, 0xbefe03c1,
0xbf8c3f70, 0xb9782a05, 0xbeff0380, 0xe0304000,
0x80788178, 0x907c9973, 0x785d0000, 0xbf8c3f70,
0x877c817c, 0xbf06817c, 0x7e008500, 0x807c817c,
0xbf850002, 0x8f788978, 0x8078ff78, 0x00000080,
0xbf820001, 0x8f788a78, 0xbf0a6f7c, 0xbf85fff7,
0xb9721e06, 0x8f728a72, 0xbeff03c1, 0xe0304000,
0x80787278, 0x8078ff78, 0x6e5d0000, 0xe0304100,
0x00000200, 0x80f8ff78, 0x6e5d0100, 0xe0304200,
0x00000050, 0xbef603ff, 0x6e5d0200, 0xe0304300,
0x01000000, 0xbefc03ff, 0x6e5d0300, 0xbf8c3f70,
0x0000006c, 0x80f89078, 0xb9782a05, 0x80788178,
0xf429003a, 0xf0000000, 0xbf0d9972, 0xbf850002,
0xbf8cc07f, 0x80fc847c, 0x8f788978, 0xbf820001,
0xbf800000, 0xbe803100, 0x8f788a78, 0xb96e1e06,
0xbe823102, 0x80f8a078, 0x8f6e8a6e, 0x80786e78,
0xf42d003a, 0xf0000000, 0x8078ff78, 0x00000200,
0xbf8cc07f, 0x80fc887c, 0x80f8ff78, 0x00000050,
0xbf800000, 0xbe803100, 0xbef603ff, 0x01000000,
0xbe823102, 0xbe843104, 0xbefc03ff, 0x0000006c,
0xbe863106, 0x80f8c078, 0x80f89078, 0xf429003a,
0xf431003a, 0xf0000000, 0xf0000000, 0xbf8cc07f,
0xbf8cc07f, 0x80fc907c, 0x80fc847c, 0xbf800000,
0xbf800000, 0xbe803100, 0xbe803100, 0xbe823102,
0xbe823102, 0xbe843104, 0x80f8a078, 0xf42d003a,
0xbe863106, 0xbe883108, 0xf0000000, 0xbf8cc07f,
0xbe8a310a, 0xbe8c310c, 0x80fc887c, 0xbf800000,
0xbe8e310e, 0xbf06807c, 0xbe803100, 0xbe823102,
0xbf84fff0, 0xb9782a05, 0xbe843104, 0xbe863106,
0x80788178, 0x907c9973, 0x80f8c078, 0xf431003a,
0x877c817c, 0xbf06817c, 0xf0000000, 0xbf8cc07f,
0xbf850002, 0x8f788978, 0x80fc907c, 0xbf800000,
0xbf820001, 0x8f788a78, 0xbe803100, 0xbe823102,
0xb9721e06, 0x8f728a72, 0xbe843104, 0xbe863106,
0x80787278, 0x8078ff78, 0xbe883108, 0xbe8a310a,
0x00000200, 0xbef603ff, 0xbe8c310c, 0xbe8e310e,
0x01000000, 0xf4211bfa, 0xbf06807c, 0xbf84fff0,
0xb9782a05, 0x80788178,
0xbf0d9972, 0xbf850002,
0x8f788978, 0xbf820001,
0x8f788a78, 0xb96e1e06,
0x8f6e8a6e, 0x80786e78,
0x8078ff78, 0x00000200,
0xbef603ff, 0x01000000,
0xf4211bfa, 0xf0000000,
0x80788478, 0xf4211b3a,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211b3a, 0xf0000000, 0xf4211b7a, 0xf0000000,
0x80788478, 0xf4211b7a, 0x80788478, 0xf4211c3a,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211eba, 0xf0000000, 0xf4211c7a, 0xf0000000,
0x80788478, 0xf4211efa, 0x80788478, 0xf4211eba,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211c3a, 0xf0000000, 0xf4211efa, 0xf0000000,
0x80788478, 0xf4211c7a, 0x80788478, 0xf4211e7a,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211e7a, 0xf0000000, 0xf4211cfa, 0xf0000000,
0x80788478, 0xf4211cfa, 0x80788478, 0xf4211bba,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xbf8cc07f, 0xb9eef814,
0xf4211bba, 0xf0000000, 0xf4211bba, 0xf0000000,
0x80788478, 0xbf8cc07f, 0x80788478, 0xbf8cc07f,
0xb9eef814, 0xf4211bba, 0xb9eef815, 0xbefc036f,
0xf0000000, 0x80788478, 0xbefe0370, 0xbeff0371,
0xbf8cc07f, 0xb9eef815, 0x876f7bff, 0x000003ff,
0xbef2036d, 0x876dff72,
0x0000ffff, 0xbefc036f,
0xbefe037a, 0xbeff037b,
0x876f71ff, 0x000003ff,
0xb9ef4803, 0xb9f9f816, 0xb9ef4803, 0xb9f9f816,
0x876f71ff, 0xfffff800, 0x876f7bff, 0xfffff800,
0x906f8b6f, 0xb9efa2c3, 0x906f8b6f, 0xb9efa2c3,
0xb9f3f801, 0x876fff72, 0xb9f3f801, 0xb96e2a05,
0x806e816e, 0xbf0d9972,
0xbf850002, 0x8f6e896e,
0xbf820001, 0x8f6e8a6e,
0x806eff6e, 0x00000200,
0x806e746e, 0x826f8075,
0x876fff6f, 0x0000ffff,
0xf4091c37, 0xfa000050,
0xf4091d37, 0xfa000060,
0xf4011e77, 0xfa000074,
0xbf8cc07f, 0x876fff6d,
0xfc000000, 0x906f9a6f, 0xfc000000, 0x906f9a6f,
0x8f6f906f, 0xbef30380, 0x8f6f906f, 0xbeee0380,
0x88736f73, 0x876fff72, 0x886e6f6e, 0x876fff6d,
0x02000000, 0x906f996f, 0x02000000, 0x906f996f,
0x8f6f8f6f, 0x88736f73, 0x8f6f8f6f, 0x886e6f6e,
0x876fff72, 0x01000000, 0x876fff6d, 0x01000000,
0x906f986f, 0x8f6f996f, 0x906f986f, 0x8f6f996f,
0x88736f73, 0x876fff70, 0x886e6f6e, 0x876fff7a,
0x00800000, 0x906f976f, 0x00800000, 0x906f976f,
0xb9f3f807, 0x87fe7e7e, 0xb9eef807, 0x876dff6d,
0x87ea6a6a, 0xb9f0f802, 0x0000ffff, 0x87fe7e7e,
0x87ea6a6a, 0xb9faf802,
0xbf8a0000, 0xbe80226c, 0xbf8a0000, 0xbe80226c,
0xbf810000, 0xbf9f0000, 0xbf810000, 0xbf9f0000,
0xbf9f0000, 0xbf9f0000, 0xbf9f0000, 0xbf9f0000,
...@@ -1560,384 +1575,395 @@ static const uint32_t cwsr_trap_arcturus_hex[] = { ...@@ -1560,384 +1575,395 @@ static const uint32_t cwsr_trap_arcturus_hex[] = {
}; };
static const uint32_t cwsr_trap_gfx10_hex[] = { static const uint32_t cwsr_trap_gfx10_hex[] = {
0xbf820001, 0xbf8201c6, 0xbf820001, 0xbf8201cf,
0xb0804004, 0xb978f802, 0xb0804004, 0xb978f802,
0x8a788678, 0xb971f803, 0x8a788678, 0xb96ef801,
0x876eff71, 0x00000400, 0x876eff6e, 0x00000800,
0xbf85001d, 0x876eff71, 0xbf840003, 0x876eff78,
0x00000100, 0xbf840002, 0x00002000, 0xbf840009,
0x8878ff78, 0x00002000, 0xb97bf803, 0x876eff7b,
0xb970f812, 0xb971f813, 0x00000400, 0xbf85001d,
0x8ff08870, 0xf4051bb8, 0x876eff7b, 0x00000100,
0xfa000000, 0xbf8cc07f, 0xbf840002, 0x8878ff78,
0xf4051c38, 0xfa000008, 0x00002000, 0xb97af812,
0xbf8cc07f, 0x87ee6e6e, 0xb97bf813, 0x8ffa887a,
0xbf840001, 0xbe80206e, 0xf4051bbd, 0xfa000000,
0xb971f803, 0x8771ff71, 0xbf8cc07f, 0xf4051ebd,
0x000001ff, 0xbf850002, 0xfa000008, 0xbf8cc07f,
0x806c846c, 0x826d806d, 0x87ee6e6e, 0xbf840001,
0x876dff6d, 0x0000ffff, 0xbe80206e, 0xb97bf803,
0x87fe7e7e, 0x87ea6a6a, 0x877bff7b, 0x000001ff,
0xb9f8f802, 0xbe80226c, 0xbf850002, 0x806c846c,
0xb971f803, 0x8771ff71, 0x826d806d, 0x876dff6d,
0x00000100, 0xbf840006, 0x0000ffff, 0x87fe7e7e,
0xbef60380, 0xb9f60203, 0x87ea6a6a, 0xb9f8f802,
0x876dff6d, 0x0000ffff, 0xbe80226c, 0x876dff6d,
0x80ec886c, 0x82ed806d, 0x0000ffff, 0xbefa0380,
0xbef60380, 0xb9f60283, 0xb9fa0283, 0xbeee037e,
0xbeee037e, 0xbeef037f, 0xbeef037f, 0xbefe0480,
0xbefe0480, 0xbf900004, 0xbf900004, 0xbf8cc07f,
0xbf8cc07f, 0xbef4037e, 0xb97b02dc, 0x8f7b997b,
0x8775ff7f, 0x0000ffff, 0x887b7b7f, 0xb97a2a05,
0x8875ff75, 0x00040000, 0x807a817a, 0xbf0d997b,
0xbef60380, 0xbef703ff, 0xbf850002, 0x8f7a897a,
0x10807fac, 0x8776ff7f, 0xbf820001, 0x8f7a8a7a,
0x08000000, 0x90768376, 0x877bff7f, 0x0000ffff,
0x88777677, 0x8776ff7f, 0x807aff7a, 0x00000200,
0x70000000, 0x90768176, 0x807a7e7a, 0x827b807b,
0x88777677, 0xbefb037c, 0xbef4037e, 0x8775ff7f,
0xbefa0380, 0xb97302dc, 0x0000ffff, 0x8875ff75,
0x8f739973, 0x8873737f, 0x00040000, 0xbef60380,
0xbefe03c1, 0x907c9973, 0xbef703ff, 0x10807fac,
0x877c817c, 0xbf06817c, 0x877aff7f, 0x08000000,
0xbf850002, 0xbeff0380, 0x907a837a, 0x88777a77,
0xbf820002, 0xbeff03c1, 0x877aff7f, 0x70000000,
0xbf82000b, 0xbef603ff, 0x907a817a, 0x88777a77,
0x01000000, 0xe0704000, 0xbef1037c, 0xbef00380,
0x7a5d0000, 0xe0704080, 0xb97302dc, 0x8f739973,
0x7a5d0100, 0xe0704100, 0x8873737f, 0xbefe03c1,
0x7a5d0200, 0xe0704180,
0x7a5d0300, 0xbf82000a,
0xbef603ff, 0x01000000,
0xe0704000, 0x7a5d0000,
0xe0704100, 0x7a5d0100,
0xe0704200, 0x7a5d0200,
0xe0704300, 0x7a5d0300,
0xb97a2a05, 0x807a817a,
0x907c9973, 0x877c817c, 0x907c9973, 0x877c817c,
0xbf06817c, 0xbf850002, 0xbf06817c, 0xbf850002,
0x8f7a897a, 0xbf820001, 0xbeff0380, 0xbf820002,
0x8f7a8a7a, 0xb9761e06, 0xbeff03c1, 0xbf82000b,
0x8f768a76, 0x807a767a,
0x807aff7a, 0x00000200,
0xbef603ff, 0x01000000, 0xbef603ff, 0x01000000,
0x7e000280, 0x7e020280, 0xe0704000, 0x705d0000,
0x7e040280, 0xbefc0380, 0xe0704080, 0x705d0100,
0xd7610002, 0x0000f87b, 0xe0704100, 0x705d0200,
0xe0704180, 0x705d0300,
0xbf82000a, 0xbef603ff,
0x01000000, 0xe0704000,
0x705d0000, 0xe0704100,
0x705d0100, 0xe0704200,
0x705d0200, 0xe0704300,
0x705d0300, 0xb9702a05,
0x80708170, 0xbf0d9973,
0xbf850002, 0x8f708970,
0xbf820001, 0x8f708a70,
0xb97a1e06, 0x8f7a8a7a,
0x80707a70, 0x8070ff70,
0x00000200, 0xbef603ff,
0x01000000, 0x7e000280,
0x7e020280, 0x7e040280,
0xbefc0380, 0xd7610002,
0x0000f871, 0x807c817c,
0xd7610002, 0x0000f86c,
0x807c817c, 0xd7610002, 0x807c817c, 0xd7610002,
0x0000f86c, 0x807c817c, 0x0000f86d, 0x807c817c,
0xd7610002, 0x0000f86d, 0xd7610002, 0x0000f86e,
0x807c817c, 0xd7610002, 0x807c817c, 0xd7610002,
0x0000f86e, 0x807c817c, 0x0000f86f, 0x807c817c,
0xd7610002, 0x0000f86f, 0xd7610002, 0x0000f878,
0x807c817c, 0xb97af803,
0xd7610002, 0x0000f87a,
0x807c817c, 0xd7610002, 0x807c817c, 0xd7610002,
0x0000f878, 0x807c817c, 0x0000f87b, 0x807c817c,
0xb971f803, 0xd7610002, 0xb971f801, 0xd7610002,
0x0000f871, 0x807c817c, 0x0000f871, 0x807c817c,
0xd7610002, 0x0000f872, 0xb971f814, 0xd7610002,
0x807c817c, 0xb97bf801, 0x0000f871, 0x807c817c,
0xd7610002, 0x0000f87b, 0xb971f815, 0xd7610002,
0x807c817c, 0xb97bf814, 0x0000f871, 0x807c817c,
0xd7610002, 0x0000f87b, 0xbeff0380, 0xe0704000,
0x807c817c, 0xb97bf815, 0x705d0200, 0xb9702a05,
0xd7610002, 0x0000f87b, 0x80708170, 0xbf0d9973,
0x807c817c, 0xbeff0380, 0xbf850002, 0x8f708970,
0xe0704000, 0x7a5d0200, 0xbf820001, 0x8f708a70,
0xb97a2a05, 0x807a817a, 0xb97a1e06, 0x8f7a8a7a,
0x907c9973, 0x877c817c, 0x80707a70, 0xbef603ff,
0xbf06817c, 0xbf850002, 0x01000000, 0xbef90380,
0x8f7a897a, 0xbf820001, 0xbefc0380, 0xbf800000,
0x8f7a8a7a, 0xb9761e06, 0xbe802f00, 0xbe822f02,
0x8f768a76, 0x807a767a, 0xbe842f04, 0xbe862f06,
0xbef603ff, 0x01000000, 0xbe882f08, 0xbe8a2f0a,
0xbef90380, 0xbefc0380, 0xbe8c2f0c, 0xbe8e2f0e,
0xbf800000, 0xbe802f00, 0xd7610002, 0x0000f200,
0xbe822f02, 0xbe842f04,
0xbe862f06, 0xbe882f08,
0xbe8a2f0a, 0xbe8c2f0c,
0xbe8e2f0e, 0xd7610002,
0x0000f200, 0x80798179,
0xd7610002, 0x0000f201,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f202, 0x80798179, 0x0000f201, 0x80798179,
0xd7610002, 0x0000f203, 0xd7610002, 0x0000f202,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f204, 0x80798179, 0x0000f203, 0x80798179,
0xd7610002, 0x0000f205, 0xd7610002, 0x0000f204,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f206, 0x80798179, 0x0000f205, 0x80798179,
0xd7610002, 0x0000f207, 0xd7610002, 0x0000f206,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f208, 0x80798179, 0x0000f207, 0x80798179,
0xd7610002, 0x0000f209, 0xd7610002, 0x0000f208,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f20a, 0x80798179, 0x0000f209, 0x80798179,
0xd7610002, 0x0000f20b, 0xd7610002, 0x0000f20a,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f20c, 0x80798179, 0x0000f20b, 0x80798179,
0xd7610002, 0x0000f20d, 0xd7610002, 0x0000f20c,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f20e, 0x80798179, 0x0000f20d, 0x80798179,
0xd7610002, 0x0000f20f, 0xd7610002, 0x0000f20e,
0x80798179, 0xbf06a079,
0xbf840006, 0xe0704000,
0x7a5d0200, 0x807aff7a,
0x00000080, 0xbef90380,
0x7e040280, 0x807c907c,
0xbf0aff7c, 0x00000060,
0xbf85ffbc, 0xbe802f00,
0xbe822f02, 0xbe842f04,
0xbe862f06, 0xbe882f08,
0xbe8a2f0a, 0xd7610002,
0x0000f200, 0x80798179,
0xd7610002, 0x0000f201,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f202, 0x80798179, 0x0000f20f, 0x80798179,
0xd7610002, 0x0000f203, 0xbf06a079, 0xbf840006,
0xe0704000, 0x705d0200,
0x8070ff70, 0x00000080,
0xbef90380, 0x7e040280,
0x807c907c, 0xbf0aff7c,
0x00000060, 0xbf85ffbc,
0xbe802f00, 0xbe822f02,
0xbe842f04, 0xbe862f06,
0xbe882f08, 0xbe8a2f0a,
0xd7610002, 0x0000f200,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f204, 0x80798179, 0x0000f201, 0x80798179,
0xd7610002, 0x0000f205, 0xd7610002, 0x0000f202,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f206, 0x80798179, 0x0000f203, 0x80798179,
0xd7610002, 0x0000f207, 0xd7610002, 0x0000f204,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f208, 0x80798179, 0x0000f205, 0x80798179,
0xd7610002, 0x0000f209, 0xd7610002, 0x0000f206,
0x80798179, 0xd7610002, 0x80798179, 0xd7610002,
0x0000f20a, 0x80798179, 0x0000f207, 0x80798179,
0xd7610002, 0x0000f20b, 0xd7610002, 0x0000f208,
0x80798179, 0xe0704000, 0x80798179, 0xd7610002,
0x7a5d0200, 0xbefe03c1, 0x0000f209, 0x80798179,
0x907c9973, 0x877c817c, 0xd7610002, 0x0000f20a,
0xbf06817c, 0xbf850002, 0x80798179, 0xd7610002,
0xbeff0380, 0xbf820001, 0x0000f20b, 0x80798179,
0xbeff03c1, 0xb9714306, 0xe0704000, 0x705d0200,
0x8771c171, 0xbf840046,
0xbf8a0000, 0x8776ff73,
0x04000000, 0xbf840042,
0x8f718671, 0x8f718271,
0xbef60371, 0xb97a2a05,
0x807a817a, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850002, 0x8f7a897a,
0xbf820001, 0x8f7a8a7a,
0xb9761e06, 0x8f768a76,
0x807a767a, 0x807aff7a,
0x00000200, 0x807aff7a,
0x00000080, 0xbef603ff,
0x01000000, 0xd7650000,
0x000100c1, 0xd7660000,
0x000200c1, 0x16000084,
0x907c9973, 0x877c817c,
0xbf06817c, 0xbefc0380,
0xbf850012, 0xbe8303ff,
0x00000080, 0xbf800000,
0xbf800000, 0xbf800000,
0xd8d80000, 0x01000000,
0xbf8c0000, 0xe0704000,
0x7a5d0100, 0x807c037c,
0x807a037a, 0xd5250000,
0x0001ff00, 0x00000080,
0xbf0a717c, 0xbf85fff4,
0xbf820011, 0xbe8303ff,
0x00000100, 0xbf800000,
0xbf800000, 0xbf800000,
0xd8d80000, 0x01000000,
0xbf8c0000, 0xe0704000,
0x7a5d0100, 0x807c037c,
0x807a037a, 0xd5250000,
0x0001ff00, 0x00000100,
0xbf0a717c, 0xbf85fff4,
0xbefe03c1, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850004, 0xbefa03ff,
0x00000200, 0xbeff0380,
0xbf820003, 0xbefa03ff,
0x00000400, 0xbeff03c1,
0xb9712a05, 0x80718171,
0x8f718271, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbf850017, 0xbef603ff,
0x01000000, 0xbefc0384,
0xbf0a717c, 0xbf840037,
0x7e008700, 0x7e028701,
0x7e048702, 0x7e068703,
0xe0704000, 0x7a5d0000,
0xe0704080, 0x7a5d0100,
0xe0704100, 0x7a5d0200,
0xe0704180, 0x7a5d0300,
0x807c847c, 0x807aff7a,
0x00000200, 0xbf0a717c,
0xbf85ffef, 0xbf820025,
0xbef603ff, 0x01000000,
0xbefc0384, 0xbf0a717c,
0xbf840020, 0x7e008700,
0x7e028701, 0x7e048702,
0x7e068703, 0xe0704000,
0x7a5d0000, 0xe0704100,
0x7a5d0100, 0xe0704200,
0x7a5d0200, 0xe0704300,
0x7a5d0300, 0x807c847c,
0x807aff7a, 0x00000400,
0xbf0a717c, 0xbf85ffef,
0xb9711e06, 0x8771c171,
0xbf84000c, 0x8f718371,
0x80717c71, 0xbefe03c1,
0xbeff0380, 0x7e008700,
0xe0704000, 0x7a5d0000,
0x807c817c, 0x807aff7a,
0x00000080, 0xbf0a717c,
0xbf85fff8, 0xbf82012d,
0xbef4037e, 0x8775ff7f,
0x0000ffff, 0x8875ff75,
0x00040000, 0xbef60380,
0xbef703ff, 0x10807fac,
0x8772ff7f, 0x08000000,
0x90728372, 0x88777277,
0x8772ff7f, 0x70000000,
0x90728172, 0x88777277,
0xb97302dc, 0x8f739973,
0x8873737f, 0x8772ff7f,
0x04000000, 0xbf840036,
0xbefe03c1, 0x907c9973, 0xbefe03c1, 0x907c9973,
0x877c817c, 0xbf06817c, 0x877c817c, 0xbf06817c,
0xbf850002, 0xbeff0380, 0xbf850002, 0xbeff0380,
0xbf820001, 0xbeff03c1, 0xbf820001, 0xbeff03c1,
0xb96f4306, 0x876fc16f, 0xb97b4306, 0x877bc17b,
0xbf84002b, 0x8f6f866f, 0xbf840044, 0xbf8a0000,
0x8f6f826f, 0xbef6036f, 0x877aff73, 0x04000000,
0xb9782a05, 0x80788178, 0xbf840040, 0x8f7b867b,
0x907c9973, 0x877c817c, 0x8f7b827b, 0xbef6037b,
0xbf06817c, 0xbf850002, 0xb9702a05, 0x80708170,
0x8f788978, 0xbf820001, 0xbf0d9973, 0xbf850002,
0x8f788a78, 0xb9721e06, 0x8f708970, 0xbf820001,
0x8f728a72, 0x80787278, 0x8f708a70, 0xb97a1e06,
0x8078ff78, 0x00000200, 0x8f7a8a7a, 0x80707a70,
0x8078ff78, 0x00000080, 0x8070ff70, 0x00000200,
0x8070ff70, 0x00000080,
0xbef603ff, 0x01000000, 0xbef603ff, 0x01000000,
0xd7650000, 0x000100c1,
0xd7660000, 0x000200c1,
0x16000084, 0x907c9973,
0x877c817c, 0xbf06817c,
0xbefc0380, 0xbf850012,
0xbe8303ff, 0x00000080,
0xbf800000, 0xbf800000,
0xbf800000, 0xd8d80000,
0x01000000, 0xbf8c0000,
0xe0704000, 0x705d0100,
0x807c037c, 0x80700370,
0xd5250000, 0x0001ff00,
0x00000080, 0xbf0a7b7c,
0xbf85fff4, 0xbf820011,
0xbe8303ff, 0x00000100,
0xbf800000, 0xbf800000,
0xbf800000, 0xd8d80000,
0x01000000, 0xbf8c0000,
0xe0704000, 0x705d0100,
0x807c037c, 0x80700370,
0xd5250000, 0x0001ff00,
0x00000100, 0xbf0a7b7c,
0xbf85fff4, 0xbefe03c1,
0x907c9973, 0x877c817c, 0x907c9973, 0x877c817c,
0xbf06817c, 0xbefc0380, 0xbf06817c, 0xbf850004,
0xbf850009, 0xe0310000, 0xbef003ff, 0x00000200,
0x781d0000, 0x807cff7c, 0xbeff0380, 0xbf820003,
0x00000080, 0x8078ff78, 0xbef003ff, 0x00000400,
0x00000080, 0xbf0a6f7c, 0xbeff03c1, 0xb97b2a05,
0xbf85fff8, 0xbf820008, 0x807b817b, 0x8f7b827b,
0xe0310000, 0x781d0000,
0x807cff7c, 0x00000100,
0x8078ff78, 0x00000100,
0xbf0a6f7c, 0xbf85fff8,
0xbef80380, 0xbefe03c1,
0x907c9973, 0x877c817c, 0x907c9973, 0x877c817c,
0xbf06817c, 0xbf850017,
0xbef603ff, 0x01000000,
0xbefc0384, 0xbf0a7b7c,
0xbf840037, 0x7e008700,
0x7e028701, 0x7e048702,
0x7e068703, 0xe0704000,
0x705d0000, 0xe0704080,
0x705d0100, 0xe0704100,
0x705d0200, 0xe0704180,
0x705d0300, 0x807c847c,
0x8070ff70, 0x00000200,
0xbf0a7b7c, 0xbf85ffef,
0xbf820025, 0xbef603ff,
0x01000000, 0xbefc0384,
0xbf0a7b7c, 0xbf840020,
0x7e008700, 0x7e028701,
0x7e048702, 0x7e068703,
0xe0704000, 0x705d0000,
0xe0704100, 0x705d0100,
0xe0704200, 0x705d0200,
0xe0704300, 0x705d0300,
0x807c847c, 0x8070ff70,
0x00000400, 0xbf0a7b7c,
0xbf85ffef, 0xb97b1e06,
0x877bc17b, 0xbf84000c,
0x8f7b837b, 0x807b7c7b,
0xbefe03c1, 0xbeff0380,
0x7e008700, 0xe0704000,
0x705d0000, 0x807c817c,
0x8070ff70, 0x00000080,
0xbf0a7b7c, 0xbf85fff8,
0xbf82013a, 0xbef4037e,
0x8775ff7f, 0x0000ffff,
0x8875ff75, 0x00040000,
0xbef60380, 0xbef703ff,
0x10807fac, 0x876eff7f,
0x08000000, 0x906e836e,
0x88776e77, 0x876eff7f,
0x70000000, 0x906e816e,
0x88776e77, 0xb97202dc,
0x8f729972, 0x8872727f,
0x876eff7f, 0x04000000,
0xbf840034, 0xbefe03c1,
0x907c9972, 0x877c817c,
0xbf06817c, 0xbf850002, 0xbf06817c, 0xbf850002,
0xbeff0380, 0xbf820001, 0xbeff0380, 0xbf820001,
0xbeff03c1, 0xb96f2a05, 0xbeff03c1, 0xb96f4306,
0x806f816f, 0x8f6f826f, 0x876fc16f, 0xbf840029,
0x907c9973, 0x877c817c, 0x8f6f866f, 0x8f6f826f,
0xbf06817c, 0xbf850021, 0xbef6036f, 0xb9782a05,
0xbef603ff, 0x01000000, 0x80788178, 0xbf0d9972,
0xbef20378, 0x8078ff78, 0xbf850002, 0x8f788978,
0x00000200, 0xbefc0384, 0xbf820001, 0x8f788a78,
0xe0304000, 0x785d0000, 0xb96e1e06, 0x8f6e8a6e,
0xe0304080, 0x785d0100, 0x80786e78, 0x8078ff78,
0xe0304100, 0x785d0200, 0x00000200, 0x8078ff78,
0xe0304180, 0x785d0300, 0x00000080, 0xbef603ff,
0xbf8c3f70, 0x7e008500, 0x01000000, 0x907c9972,
0x7e028501, 0x7e048502, 0x877c817c, 0xbf06817c,
0x7e068503, 0x807c847c, 0xbefc0380, 0xbf850009,
0xe0310000, 0x781d0000,
0x807cff7c, 0x00000080,
0x8078ff78, 0x00000080,
0xbf0a6f7c, 0xbf85fff8,
0xbf820008, 0xe0310000,
0x781d0000, 0x807cff7c,
0x00000100, 0x8078ff78,
0x00000100, 0xbf0a6f7c,
0xbf85fff8, 0xbef80380,
0xbefe03c1, 0x907c9972,
0x877c817c, 0xbf06817c,
0xbf850002, 0xbeff0380,
0xbf820001, 0xbeff03c1,
0xb96f2a05, 0x806f816f,
0x8f6f826f, 0x907c9972,
0x877c817c, 0xbf06817c,
0xbf850021, 0xbef603ff,
0x01000000, 0xbeee0378,
0x8078ff78, 0x00000200, 0x8078ff78, 0x00000200,
0xbf0a6f7c, 0xbf85ffee,
0xe0304000, 0x725d0000,
0xe0304080, 0x725d0100,
0xe0304100, 0x725d0200,
0xe0304180, 0x725d0300,
0xbf820032, 0xbef603ff,
0x01000000, 0xbef20378,
0x8078ff78, 0x00000400,
0xbefc0384, 0xe0304000, 0xbefc0384, 0xe0304000,
0x785d0000, 0xe0304100, 0x785d0000, 0xe0304080,
0x785d0100, 0xe0304200, 0x785d0100, 0xe0304100,
0x785d0200, 0xe0304300, 0x785d0200, 0xe0304180,
0x785d0300, 0xbf8c3f70, 0x785d0300, 0xbf8c3f70,
0x7e008500, 0x7e028501, 0x7e008500, 0x7e028501,
0x7e048502, 0x7e068503, 0x7e048502, 0x7e068503,
0x807c847c, 0x8078ff78, 0x807c847c, 0x8078ff78,
0x00000400, 0xbf0a6f7c, 0x00000200, 0xbf0a6f7c,
0xbf85ffee, 0xb96f1e06, 0xbf85ffee, 0xe0304000,
0x876fc16f, 0xbf84000e, 0x6e5d0000, 0xe0304080,
0x8f6f836f, 0x806f7c6f, 0x6e5d0100, 0xe0304100,
0xbefe03c1, 0xbeff0380, 0x6e5d0200, 0xe0304180,
0x6e5d0300, 0xbf820032,
0xbef603ff, 0x01000000,
0xbeee0378, 0x8078ff78,
0x00000400, 0xbefc0384,
0xe0304000, 0x785d0000, 0xe0304000, 0x785d0000,
0xe0304100, 0x785d0100,
0xe0304200, 0x785d0200,
0xe0304300, 0x785d0300,
0xbf8c3f70, 0x7e008500, 0xbf8c3f70, 0x7e008500,
0x807c817c, 0x8078ff78, 0x7e028501, 0x7e048502,
0x00000080, 0xbf0a6f7c, 0x7e068503, 0x807c847c,
0xbf85fff7, 0xbeff03c1, 0x8078ff78, 0x00000400,
0xe0304000, 0x725d0000, 0xbf0a6f7c, 0xbf85ffee,
0xe0304100, 0x725d0100, 0xb96f1e06, 0x876fc16f,
0xe0304200, 0x725d0200, 0xbf84000e, 0x8f6f836f,
0xe0304300, 0x725d0300, 0x806f7c6f, 0xbefe03c1,
0xbf8c3f70, 0xb9782a05, 0xbeff0380, 0xe0304000,
0x80788178, 0x907c9973, 0x785d0000, 0xbf8c3f70,
0x877c817c, 0xbf06817c, 0x7e008500, 0x807c817c,
0xbf850002, 0x8f788978, 0x8078ff78, 0x00000080,
0xbf820001, 0x8f788a78, 0xbf0a6f7c, 0xbf85fff7,
0xb9721e06, 0x8f728a72, 0xbeff03c1, 0xe0304000,
0x80787278, 0x8078ff78, 0x6e5d0000, 0xe0304100,
0x00000200, 0x80f8ff78, 0x6e5d0100, 0xe0304200,
0x00000050, 0xbef603ff, 0x6e5d0200, 0xe0304300,
0x01000000, 0xbefc03ff, 0x6e5d0300, 0xbf8c3f70,
0x0000006c, 0x80f89078, 0xb9782a05, 0x80788178,
0xf429003a, 0xf0000000, 0xbf0d9972, 0xbf850002,
0xbf8cc07f, 0x80fc847c, 0x8f788978, 0xbf820001,
0xbf800000, 0xbe803100, 0x8f788a78, 0xb96e1e06,
0xbe823102, 0x80f8a078, 0x8f6e8a6e, 0x80786e78,
0xf42d003a, 0xf0000000, 0x8078ff78, 0x00000200,
0xbf8cc07f, 0x80fc887c, 0x80f8ff78, 0x00000050,
0xbf800000, 0xbe803100, 0xbef603ff, 0x01000000,
0xbe823102, 0xbe843104, 0xbefc03ff, 0x0000006c,
0xbe863106, 0x80f8c078, 0x80f89078, 0xf429003a,
0xf431003a, 0xf0000000, 0xf0000000, 0xbf8cc07f,
0xbf8cc07f, 0x80fc907c, 0x80fc847c, 0xbf800000,
0xbf800000, 0xbe803100, 0xbe803100, 0xbe823102,
0xbe823102, 0xbe843104, 0x80f8a078, 0xf42d003a,
0xbe863106, 0xbe883108, 0xf0000000, 0xbf8cc07f,
0xbe8a310a, 0xbe8c310c, 0x80fc887c, 0xbf800000,
0xbe8e310e, 0xbf06807c, 0xbe803100, 0xbe823102,
0xbf84fff0, 0xb9782a05, 0xbe843104, 0xbe863106,
0x80788178, 0x907c9973, 0x80f8c078, 0xf431003a,
0x877c817c, 0xbf06817c, 0xf0000000, 0xbf8cc07f,
0xbf850002, 0x8f788978, 0x80fc907c, 0xbf800000,
0xbf820001, 0x8f788a78, 0xbe803100, 0xbe823102,
0xb9721e06, 0x8f728a72, 0xbe843104, 0xbe863106,
0x80787278, 0x8078ff78, 0xbe883108, 0xbe8a310a,
0x00000200, 0xbef603ff, 0xbe8c310c, 0xbe8e310e,
0x01000000, 0xf4211bfa, 0xbf06807c, 0xbf84fff0,
0xb9782a05, 0x80788178,
0xbf0d9972, 0xbf850002,
0x8f788978, 0xbf820001,
0x8f788a78, 0xb96e1e06,
0x8f6e8a6e, 0x80786e78,
0x8078ff78, 0x00000200,
0xbef603ff, 0x01000000,
0xf4211bfa, 0xf0000000,
0x80788478, 0xf4211b3a,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211b3a, 0xf0000000, 0xf4211b7a, 0xf0000000,
0x80788478, 0xf4211b7a, 0x80788478, 0xf4211c3a,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211eba, 0xf0000000, 0xf4211c7a, 0xf0000000,
0x80788478, 0xf4211efa, 0x80788478, 0xf4211eba,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211c3a, 0xf0000000, 0xf4211efa, 0xf0000000,
0x80788478, 0xf4211c7a, 0x80788478, 0xf4211e7a,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xf4211e7a, 0xf0000000, 0xf4211cfa, 0xf0000000,
0x80788478, 0xf4211cfa, 0x80788478, 0xf4211bba,
0xf0000000, 0x80788478, 0xf0000000, 0x80788478,
0xbf8cc07f, 0xb9eef814,
0xf4211bba, 0xf0000000, 0xf4211bba, 0xf0000000,
0x80788478, 0xbf8cc07f, 0x80788478, 0xbf8cc07f,
0xb9eef814, 0xf4211bba, 0xb9eef815, 0xbefc036f,
0xf0000000, 0x80788478, 0xbefe0370, 0xbeff0371,
0xbf8cc07f, 0xb9eef815, 0x876f7bff, 0x000003ff,
0xbef2036d, 0x876dff72, 0xb9ef4803, 0x876f7bff,
0x0000ffff, 0xbefc036f,
0xbefe037a, 0xbeff037b,
0x876f71ff, 0x000003ff,
0xb9ef4803, 0x876f71ff,
0xfffff800, 0x906f8b6f, 0xfffff800, 0x906f8b6f,
0xb9efa2c3, 0xb9f3f801, 0xb9efa2c3, 0xb9f3f801,
0xb96e2a05, 0x806e816e,
0xbf0d9972, 0xbf850002,
0x8f6e896e, 0xbf820001,
0x8f6e8a6e, 0x806eff6e,
0x00000200, 0x806e746e,
0x826f8075, 0x876fff6f,
0x0000ffff, 0xf4091c37,
0xfa000050, 0xf4091d37,
0xfa000060, 0xf4011e77,
0xfa000074, 0xbf8cc07f,
0x876dff6d, 0x0000ffff,
0x87fe7e7e, 0x87ea6a6a, 0x87fe7e7e, 0x87ea6a6a,
0xb9f0f802, 0xbf8a0000, 0xb9faf802, 0xbf8a0000,
0xbe80226c, 0xbf810000, 0xbe80226c, 0xbf810000,
0xbf9f0000, 0xbf9f0000, 0xbf9f0000, 0xbf9f0000,
0xbf9f0000, 0xbf9f0000, 0xbf9f0000, 0xbf9f0000,
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#define NO_SQC_STORE !ASIC_TARGET_NAVI1X #define NO_SQC_STORE !ASIC_TARGET_NAVI1X
var SINGLE_STEP_MISSED_WORKAROUND = 1 //workaround for lost MODE.DEBUG_EN exception when SAVECTX raised
var SQ_WAVE_STATUS_INST_ATC_SHIFT = 23 var SQ_WAVE_STATUS_INST_ATC_SHIFT = 23
var SQ_WAVE_STATUS_INST_ATC_MASK = 0x00800000 var SQ_WAVE_STATUS_INST_ATC_MASK = 0x00800000
var SQ_WAVE_STATUS_SPI_PRIO_MASK = 0x00000006 var SQ_WAVE_STATUS_SPI_PRIO_MASK = 0x00000006
...@@ -72,6 +74,8 @@ var SQ_WAVE_IB_STS_RCNT_SIZE = 6 ...@@ -72,6 +74,8 @@ var SQ_WAVE_IB_STS_RCNT_SIZE = 6
var SQ_WAVE_IB_STS_RCNT_FIRST_REPLAY_MASK = 0x003F8000 var SQ_WAVE_IB_STS_RCNT_FIRST_REPLAY_MASK = 0x003F8000
var SQ_WAVE_IB_STS_RCNT_FIRST_REPLAY_MASK_NEG = 0x00007FFF var SQ_WAVE_IB_STS_RCNT_FIRST_REPLAY_MASK_NEG = 0x00007FFF
var SQ_WAVE_MODE_DEBUG_EN_MASK = 0x800
var SQ_BUF_RSRC_WORD1_ATC_SHIFT = 24 var SQ_BUF_RSRC_WORD1_ATC_SHIFT = 24
var SQ_BUF_RSRC_WORD3_MTYPE_SHIFT = 27 var SQ_BUF_RSRC_WORD3_MTYPE_SHIFT = 27
...@@ -109,17 +113,19 @@ var s_save_pc_hi = ttmp1 ...@@ -109,17 +113,19 @@ var s_save_pc_hi = ttmp1
var s_save_exec_lo = ttmp2 var s_save_exec_lo = ttmp2
var s_save_exec_hi = ttmp3 var s_save_exec_hi = ttmp3
var s_save_status = ttmp12 var s_save_status = ttmp12
var s_save_trapsts = ttmp5 var s_save_trapsts = ttmp15
var s_save_xnack_mask = ttmp6 var s_save_xnack_mask = s_save_trapsts
var s_wave_size = ttmp7 var s_wave_size = ttmp7
var s_save_buf_rsrc0 = ttmp8 var s_save_buf_rsrc0 = ttmp8
var s_save_buf_rsrc1 = ttmp9 var s_save_buf_rsrc1 = ttmp9
var s_save_buf_rsrc2 = ttmp10 var s_save_buf_rsrc2 = ttmp10
var s_save_buf_rsrc3 = ttmp11 var s_save_buf_rsrc3 = ttmp11
var s_save_mem_offset = ttmp14 var s_save_mem_offset = ttmp4
var s_save_alloc_size = s_save_trapsts var s_save_alloc_size = s_save_trapsts
var s_save_tmp = s_save_buf_rsrc2 var s_save_tmp = ttmp14
var s_save_m0 = ttmp15 var s_save_m0 = ttmp5
var s_save_ttmps_lo = s_save_tmp
var s_save_ttmps_hi = s_save_trapsts
var S_RESTORE_BUF_RSRC_WORD1_STRIDE = S_SAVE_BUF_RSRC_WORD1_STRIDE var S_RESTORE_BUF_RSRC_WORD1_STRIDE = S_SAVE_BUF_RSRC_WORD1_STRIDE
var S_RESTORE_BUF_RSRC_WORD3_MISC = S_SAVE_BUF_RSRC_WORD3_MISC var S_RESTORE_BUF_RSRC_WORD3_MISC = S_SAVE_BUF_RSRC_WORD3_MISC
...@@ -141,23 +147,25 @@ var s_restore_spi_init_lo = exec_lo ...@@ -141,23 +147,25 @@ var s_restore_spi_init_lo = exec_lo
var s_restore_spi_init_hi = exec_hi var s_restore_spi_init_hi = exec_hi
var s_restore_mem_offset = ttmp12 var s_restore_mem_offset = ttmp12
var s_restore_alloc_size = ttmp3 var s_restore_alloc_size = ttmp3
var s_restore_tmp = ttmp6 var s_restore_tmp = ttmp2
var s_restore_mem_offset_save = s_restore_tmp var s_restore_mem_offset_save = s_restore_tmp
var s_restore_m0 = s_restore_alloc_size var s_restore_m0 = s_restore_alloc_size
var s_restore_mode = ttmp7 var s_restore_mode = ttmp7
var s_restore_flat_scratch = ttmp2 var s_restore_flat_scratch = s_restore_tmp
var s_restore_pc_lo = ttmp0 var s_restore_pc_lo = ttmp0
var s_restore_pc_hi = ttmp1 var s_restore_pc_hi = ttmp1
var s_restore_exec_lo = ttmp14 var s_restore_exec_lo = ttmp4
var s_restore_exec_hi = ttmp15 var s_restore_exec_hi = ttmp5
var s_restore_status = ttmp4 var s_restore_status = ttmp14
var s_restore_trapsts = ttmp5 var s_restore_trapsts = ttmp15
var s_restore_xnack_mask = ttmp13 var s_restore_xnack_mask = ttmp13
var s_restore_buf_rsrc0 = ttmp8 var s_restore_buf_rsrc0 = ttmp8
var s_restore_buf_rsrc1 = ttmp9 var s_restore_buf_rsrc1 = ttmp9
var s_restore_buf_rsrc2 = ttmp10 var s_restore_buf_rsrc2 = ttmp10
var s_restore_buf_rsrc3 = ttmp11 var s_restore_buf_rsrc3 = ttmp11
var s_restore_size = ttmp7 var s_restore_size = ttmp6
var s_restore_ttmps_lo = s_restore_tmp
var s_restore_ttmps_hi = s_restore_alloc_size
shader main shader main
asic(DEFAULT) asic(DEFAULT)
...@@ -172,6 +180,24 @@ L_JUMP_TO_RESTORE: ...@@ -172,6 +180,24 @@ L_JUMP_TO_RESTORE:
L_SKIP_RESTORE: L_SKIP_RESTORE:
s_getreg_b32 s_save_status, hwreg(HW_REG_STATUS) //save STATUS since we will change SCC s_getreg_b32 s_save_status, hwreg(HW_REG_STATUS) //save STATUS since we will change SCC
s_andn2_b32 s_save_status, s_save_status, SQ_WAVE_STATUS_SPI_PRIO_MASK s_andn2_b32 s_save_status, s_save_status, SQ_WAVE_STATUS_SPI_PRIO_MASK
if SINGLE_STEP_MISSED_WORKAROUND
// No single step exceptions if MODE.DEBUG_EN=0.
s_getreg_b32 ttmp2, hwreg(HW_REG_MODE)
s_and_b32 ttmp2, ttmp2, SQ_WAVE_MODE_DEBUG_EN_MASK
s_cbranch_scc0 L_NO_SINGLE_STEP_WORKAROUND
// Second-level trap already handled exception if STATUS.HALT=1.
s_and_b32 ttmp2, s_save_status, SQ_WAVE_STATUS_HALT_MASK
// Prioritize single step exception over context save.
// Second-level trap will halt wave and RFE, re-entering for SAVECTX.
s_cbranch_scc0 L_FETCH_2ND_TRAP
L_NO_SINGLE_STEP_WORKAROUND:
end
s_getreg_b32 s_save_trapsts, hwreg(HW_REG_TRAPSTS) s_getreg_b32 s_save_trapsts, hwreg(HW_REG_TRAPSTS)
s_and_b32 ttmp2, s_save_trapsts, SQ_WAVE_TRAPSTS_SAVECTX_MASK //check whether this is for save s_and_b32 ttmp2, s_save_trapsts, SQ_WAVE_TRAPSTS_SAVECTX_MASK //check whether this is for save
s_cbranch_scc1 L_SAVE s_cbranch_scc1 L_SAVE
...@@ -241,25 +267,11 @@ L_EXCP_CASE: ...@@ -241,25 +267,11 @@ L_EXCP_CASE:
s_rfe_b64 [ttmp0, ttmp1] s_rfe_b64 [ttmp0, ttmp1]
L_SAVE: L_SAVE:
//check whether there is mem_viol
s_getreg_b32 s_save_trapsts, hwreg(HW_REG_TRAPSTS)
s_and_b32 s_save_trapsts, s_save_trapsts, SQ_WAVE_TRAPSTS_MEM_VIOL_MASK
s_cbranch_scc0 L_NO_PC_REWIND
//if so, need rewind PC assuming GDS operation gets NACKed
s_mov_b32 s_save_tmp, 0
s_setreg_b32 hwreg(HW_REG_TRAPSTS, SQ_WAVE_TRAPSTS_MEM_VIOL_SHIFT, 1), s_save_tmp //clear mem_viol bit
s_and_b32 s_save_pc_hi, s_save_pc_hi, 0x0000ffff //pc[47:32] s_and_b32 s_save_pc_hi, s_save_pc_hi, 0x0000ffff //pc[47:32]
s_sub_u32 s_save_pc_lo, s_save_pc_lo, 8 //pc[31:0]-8
s_subb_u32 s_save_pc_hi, s_save_pc_hi, 0x0
L_NO_PC_REWIND:
s_mov_b32 s_save_tmp, 0 s_mov_b32 s_save_tmp, 0
s_setreg_b32 hwreg(HW_REG_TRAPSTS, SQ_WAVE_TRAPSTS_SAVECTX_SHIFT, 1), s_save_tmp //clear saveCtx bit s_setreg_b32 hwreg(HW_REG_TRAPSTS, SQ_WAVE_TRAPSTS_SAVECTX_SHIFT, 1), s_save_tmp //clear saveCtx bit
#if ASIC_TARGET_NAVI1X #if ASIC_TARGET_NAVI1X
s_getreg_b32 s_save_xnack_mask, hwreg(HW_REG_SHADER_XNACK_MASK)
s_getreg_b32 s_save_tmp, hwreg(HW_REG_IB_STS, SQ_WAVE_IB_STS_RCNT_SHIFT, SQ_WAVE_IB_STS_RCNT_SIZE) s_getreg_b32 s_save_tmp, hwreg(HW_REG_IB_STS, SQ_WAVE_IB_STS_RCNT_SHIFT, SQ_WAVE_IB_STS_RCNT_SIZE)
s_lshl_b32 s_save_tmp, s_save_tmp, S_SAVE_PC_HI_RCNT_SHIFT s_lshl_b32 s_save_tmp, s_save_tmp, S_SAVE_PC_HI_RCNT_SHIFT
s_or_b32 s_save_pc_hi, s_save_pc_hi, s_save_tmp s_or_b32 s_save_pc_hi, s_save_pc_hi, s_save_tmp
...@@ -293,6 +305,21 @@ L_SLEEP: ...@@ -293,6 +305,21 @@ L_SLEEP:
s_waitcnt lgkmcnt(0) s_waitcnt lgkmcnt(0)
#endif #endif
// Save trap temporaries 4-11, 13 initialized by SPI debug dispatch logic
// ttmp SR memory offset : size(VGPR)+size(SGPR)+0x40
get_wave_size(s_save_ttmps_hi)
get_vgpr_size_bytes(s_save_ttmps_lo, s_save_ttmps_hi)
s_and_b32 s_save_ttmps_hi, s_save_spi_init_hi, 0xFFFF
s_add_u32 s_save_ttmps_lo, s_save_ttmps_lo, get_sgpr_size_bytes()
s_add_u32 s_save_ttmps_lo, s_save_ttmps_lo, s_save_spi_init_lo
s_addc_u32 s_save_ttmps_hi, s_save_ttmps_hi, 0x0
#if ASIC_TARGET_NAVI1X
s_store_dwordx4 [ttmp4, ttmp5, ttmp6, ttmp7], [s_save_ttmps_lo, s_save_ttmps_hi], 0x50 glc:1
s_store_dwordx4 [ttmp8, ttmp9, ttmp10, ttmp11], [s_save_ttmps_lo, s_save_ttmps_hi], 0x60 glc:1
s_store_dword ttmp13, [s_save_ttmps_lo, s_save_ttmps_hi], 0x74 glc:1
#endif
/* setup Resource Contants */ /* setup Resource Contants */
s_mov_b32 s_save_buf_rsrc0, s_save_spi_init_lo //base_addr_lo s_mov_b32 s_save_buf_rsrc0, s_save_spi_init_lo //base_addr_lo
s_and_b32 s_save_buf_rsrc1, s_save_spi_init_hi, 0x0000FFFF //base_addr_hi s_and_b32 s_save_buf_rsrc1, s_save_spi_init_hi, 0x0000FFFF //base_addr_hi
...@@ -310,9 +337,13 @@ L_SLEEP: ...@@ -310,9 +337,13 @@ L_SLEEP:
/* global mem offset */ /* global mem offset */
s_mov_b32 s_save_mem_offset, 0x0 s_mov_b32 s_save_mem_offset, 0x0
s_getreg_b32 s_wave_size, hwreg(HW_REG_IB_STS2,SQ_WAVE_IB_STS2_WAVE64_SHIFT,SQ_WAVE_IB_STS2_WAVE64_SIZE) get_wave_size(s_wave_size)
s_lshl_b32 s_wave_size, s_wave_size, S_WAVE_SIZE
s_or_b32 s_wave_size, s_save_spi_init_hi, s_wave_size //share s_wave_size with exec_hi, it's at bit25 #if ASIC_TARGET_NAVI1X
// Save and clear vector XNACK state late to free up SGPRs.
s_getreg_b32 s_save_xnack_mask, hwreg(HW_REG_SHADER_XNACK_MASK)
s_setreg_imm32_b32 hwreg(HW_REG_SHADER_XNACK_MASK), 0x0
#endif
/* save first 4 VGPRs, needed for SGPR save */ /* save first 4 VGPRs, needed for SGPR save */
s_mov_b32 exec_lo, 0xFFFFFFFF //need every thread from now on s_mov_b32 exec_lo, 0xFFFFFFFF //need every thread from now on
...@@ -371,8 +402,8 @@ L_SAVE_HWREG: ...@@ -371,8 +402,8 @@ L_SAVE_HWREG:
write_hwreg_to_mem(s_save_exec_hi, s_save_buf_rsrc0, s_save_mem_offset) write_hwreg_to_mem(s_save_exec_hi, s_save_buf_rsrc0, s_save_mem_offset)
write_hwreg_to_mem(s_save_status, s_save_buf_rsrc0, s_save_mem_offset) write_hwreg_to_mem(s_save_status, s_save_buf_rsrc0, s_save_mem_offset)
s_getreg_b32 s_save_trapsts, hwreg(HW_REG_TRAPSTS) s_getreg_b32 s_save_tmp, hwreg(HW_REG_TRAPSTS)
write_hwreg_to_mem(s_save_trapsts, s_save_buf_rsrc0, s_save_mem_offset) write_hwreg_to_mem(s_save_tmp, s_save_buf_rsrc0, s_save_mem_offset)
// Not used on Sienna_Cichlid but keep layout same for debugger. // Not used on Sienna_Cichlid but keep layout same for debugger.
write_hwreg_to_mem(s_save_xnack_mask, s_save_buf_rsrc0, s_save_mem_offset) write_hwreg_to_mem(s_save_xnack_mask, s_save_buf_rsrc0, s_save_mem_offset)
...@@ -650,9 +681,7 @@ L_RESTORE: ...@@ -650,9 +681,7 @@ L_RESTORE:
s_lshr_b32 s_restore_tmp, s_restore_tmp, (S_RESTORE_SPI_INIT_MTYPE_SHIFT-SQ_BUF_RSRC_WORD3_MTYPE_SHIFT) s_lshr_b32 s_restore_tmp, s_restore_tmp, (S_RESTORE_SPI_INIT_MTYPE_SHIFT-SQ_BUF_RSRC_WORD3_MTYPE_SHIFT)
s_or_b32 s_restore_buf_rsrc3, s_restore_buf_rsrc3, s_restore_tmp //or MTYPE s_or_b32 s_restore_buf_rsrc3, s_restore_buf_rsrc3, s_restore_tmp //or MTYPE
//determine it is wave32 or wave64 //determine it is wave32 or wave64
s_getreg_b32 s_restore_size, hwreg(HW_REG_IB_STS2,SQ_WAVE_IB_STS2_WAVE64_SHIFT,SQ_WAVE_IB_STS2_WAVE64_SIZE) get_wave_size(s_restore_size)
s_lshl_b32 s_restore_size, s_restore_size, S_WAVE_SIZE
s_or_b32 s_restore_size, s_restore_spi_init_hi, s_restore_size
s_and_b32 s_restore_tmp, s_restore_spi_init_hi, S_RESTORE_SPI_INIT_FIRST_WAVE_MASK s_and_b32 s_restore_tmp, s_restore_spi_init_hi, S_RESTORE_SPI_INIT_FIRST_WAVE_MASK
s_cbranch_scc0 L_RESTORE_VGPR s_cbranch_scc0 L_RESTORE_VGPR
...@@ -686,7 +715,7 @@ L_RESTORE_LDS_NORMAL: ...@@ -686,7 +715,7 @@ L_RESTORE_LDS_NORMAL:
s_mov_b32 s_restore_buf_rsrc2, 0x1000000 //NUM_RECORDS in bytes s_mov_b32 s_restore_buf_rsrc2, 0x1000000 //NUM_RECORDS in bytes
s_lshr_b32 m0, s_wave_size, S_WAVE_SIZE s_lshr_b32 m0, s_restore_size, S_WAVE_SIZE
s_and_b32 m0, m0, 1 s_and_b32 m0, m0, 1
s_cmp_eq_u32 m0, 1 s_cmp_eq_u32 m0, 1
s_mov_b32 m0, 0x0 s_mov_b32 m0, 0x0
...@@ -894,9 +923,6 @@ L_RESTORE_HWREG: ...@@ -894,9 +923,6 @@ L_RESTORE_HWREG:
s_setreg_b32 hwreg(HW_REG_SHADER_FLAT_SCRATCH_HI), s_restore_flat_scratch s_setreg_b32 hwreg(HW_REG_SHADER_FLAT_SCRATCH_HI), s_restore_flat_scratch
s_mov_b32 s_restore_tmp, s_restore_pc_hi
s_and_b32 s_restore_pc_hi, s_restore_tmp, 0x0000ffff //pc[47:32] //Do it here in order not to affect STATUS
s_mov_b32 m0, s_restore_m0 s_mov_b32 m0, s_restore_m0
s_mov_b32 exec_lo, s_restore_exec_lo s_mov_b32 exec_lo, s_restore_exec_lo
s_mov_b32 exec_hi, s_restore_exec_hi s_mov_b32 exec_hi, s_restore_exec_hi
...@@ -913,26 +939,39 @@ L_RESTORE_HWREG: ...@@ -913,26 +939,39 @@ L_RESTORE_HWREG:
s_setreg_b32 hwreg(HW_REG_TRAPSTS, SQ_WAVE_TRAPSTS_POST_SAVECTX_SHIFT, SQ_WAVE_TRAPSTS_POST_SAVECTX_SIZE), s_restore_m0 s_setreg_b32 hwreg(HW_REG_TRAPSTS, SQ_WAVE_TRAPSTS_POST_SAVECTX_SHIFT, SQ_WAVE_TRAPSTS_POST_SAVECTX_SIZE), s_restore_m0
s_setreg_b32 hwreg(HW_REG_MODE), s_restore_mode s_setreg_b32 hwreg(HW_REG_MODE), s_restore_mode
// Restore trap temporaries 4-11, 13 initialized by SPI debug dispatch logic
// ttmp SR memory offset : size(VGPR)+size(SGPR)+0x40
get_vgpr_size_bytes(s_restore_ttmps_lo, s_restore_size)
s_add_u32 s_restore_ttmps_lo, s_restore_ttmps_lo, get_sgpr_size_bytes()
s_add_u32 s_restore_ttmps_lo, s_restore_ttmps_lo, s_restore_buf_rsrc0
s_addc_u32 s_restore_ttmps_hi, s_restore_buf_rsrc1, 0x0
s_and_b32 s_restore_ttmps_hi, s_restore_ttmps_hi, 0xFFFF
s_load_dwordx4 [ttmp4, ttmp5, ttmp6, ttmp7], [s_restore_ttmps_lo, s_restore_ttmps_hi], 0x50 glc:1
s_load_dwordx4 [ttmp8, ttmp9, ttmp10, ttmp11], [s_restore_ttmps_lo, s_restore_ttmps_hi], 0x60 glc:1
s_load_dword ttmp13, [s_restore_ttmps_lo, s_restore_ttmps_hi], 0x74 glc:1
s_waitcnt lgkmcnt(0)
#if ASIC_TARGET_NAVI1X #if ASIC_TARGET_NAVI1X
s_and_b32 s_restore_m0, s_restore_tmp, S_SAVE_PC_HI_RCNT_MASK s_and_b32 s_restore_m0, s_restore_pc_hi, S_SAVE_PC_HI_RCNT_MASK
s_lshr_b32 s_restore_m0, s_restore_m0, S_SAVE_PC_HI_RCNT_SHIFT s_lshr_b32 s_restore_m0, s_restore_m0, S_SAVE_PC_HI_RCNT_SHIFT
s_lshl_b32 s_restore_m0, s_restore_m0, SQ_WAVE_IB_STS_RCNT_SHIFT s_lshl_b32 s_restore_m0, s_restore_m0, SQ_WAVE_IB_STS_RCNT_SHIFT
s_mov_b32 s_restore_mode, 0x0 s_mov_b32 s_restore_tmp, 0x0
s_or_b32 s_restore_mode, s_restore_mode, s_restore_m0 s_or_b32 s_restore_tmp, s_restore_tmp, s_restore_m0
s_and_b32 s_restore_m0, s_restore_tmp, S_SAVE_PC_HI_FIRST_REPLAY_MASK s_and_b32 s_restore_m0, s_restore_pc_hi, S_SAVE_PC_HI_FIRST_REPLAY_MASK
s_lshr_b32 s_restore_m0, s_restore_m0, S_SAVE_PC_HI_FIRST_REPLAY_SHIFT s_lshr_b32 s_restore_m0, s_restore_m0, S_SAVE_PC_HI_FIRST_REPLAY_SHIFT
s_lshl_b32 s_restore_m0, s_restore_m0, SQ_WAVE_IB_STS_FIRST_REPLAY_SHIFT s_lshl_b32 s_restore_m0, s_restore_m0, SQ_WAVE_IB_STS_FIRST_REPLAY_SHIFT
s_or_b32 s_restore_mode, s_restore_mode, s_restore_m0 s_or_b32 s_restore_tmp, s_restore_tmp, s_restore_m0
s_and_b32 s_restore_m0, s_restore_tmp, S_SAVE_PC_HI_REPLAY_W64H_MASK s_and_b32 s_restore_m0, s_restore_pc_hi, S_SAVE_PC_HI_REPLAY_W64H_MASK
s_lshr_b32 s_restore_m0, s_restore_m0, S_SAVE_PC_HI_REPLAY_W64H_SHIFT s_lshr_b32 s_restore_m0, s_restore_m0, S_SAVE_PC_HI_REPLAY_W64H_SHIFT
s_lshl_b32 s_restore_m0, s_restore_m0, SQ_WAVE_IB_STS_REPLAY_W64H_SHIFT s_lshl_b32 s_restore_m0, s_restore_m0, SQ_WAVE_IB_STS_REPLAY_W64H_SHIFT
s_or_b32 s_restore_mode, s_restore_mode, s_restore_m0 s_or_b32 s_restore_tmp, s_restore_tmp, s_restore_m0
s_and_b32 s_restore_m0, s_restore_status, SQ_WAVE_STATUS_INST_ATC_MASK s_and_b32 s_restore_m0, s_restore_status, SQ_WAVE_STATUS_INST_ATC_MASK
s_lshr_b32 s_restore_m0, s_restore_m0, SQ_WAVE_STATUS_INST_ATC_SHIFT s_lshr_b32 s_restore_m0, s_restore_m0, SQ_WAVE_STATUS_INST_ATC_SHIFT
s_setreg_b32 hwreg(HW_REG_IB_STS), s_restore_mode s_setreg_b32 hwreg(HW_REG_IB_STS), s_restore_tmp
#endif #endif
s_and_b32 s_restore_pc_hi, s_restore_pc_hi, 0x0000ffff //pc[47:32] //Do it here in order not to affect STATUS
s_and_b64 exec, exec, exec // Restore STATUS.EXECZ, not writable by s_setreg_b32 s_and_b64 exec, exec, exec // Restore STATUS.EXECZ, not writable by s_setreg_b32
s_and_b64 vcc, vcc, vcc // Restore STATUS.VCCZ, not writable by s_setreg_b32 s_and_b64 vcc, vcc, vcc // Restore STATUS.VCCZ, not writable by s_setreg_b32
s_setreg_b32 hwreg(HW_REG_STATUS), s_restore_status // SCC is included, which is changed by previous salu s_setreg_b32 hwreg(HW_REG_STATUS), s_restore_status // SCC is included, which is changed by previous salu
...@@ -1022,9 +1061,7 @@ end ...@@ -1022,9 +1061,7 @@ end
function get_vgpr_size_bytes(s_vgpr_size_byte, s_size) function get_vgpr_size_bytes(s_vgpr_size_byte, s_size)
s_getreg_b32 s_vgpr_size_byte, hwreg(HW_REG_GPR_ALLOC,SQ_WAVE_GPR_ALLOC_VGPR_SIZE_SHIFT,SQ_WAVE_GPR_ALLOC_VGPR_SIZE_SIZE) s_getreg_b32 s_vgpr_size_byte, hwreg(HW_REG_GPR_ALLOC,SQ_WAVE_GPR_ALLOC_VGPR_SIZE_SHIFT,SQ_WAVE_GPR_ALLOC_VGPR_SIZE_SIZE)
s_add_u32 s_vgpr_size_byte, s_vgpr_size_byte, 1 s_add_u32 s_vgpr_size_byte, s_vgpr_size_byte, 1
s_lshr_b32 m0, s_size, S_WAVE_SIZE s_bitcmp1_b32 s_size, S_WAVE_SIZE
s_and_b32 m0, m0, 1
s_cmp_eq_u32 m0, 1
s_cbranch_scc1 L_ENABLE_SHIFT_W64 s_cbranch_scc1 L_ENABLE_SHIFT_W64
s_lshl_b32 s_vgpr_size_byte, s_vgpr_size_byte, (2+7) //Number of VGPRs = (vgpr_size + 1) * 4 * 32 * 4 (non-zero value) s_lshl_b32 s_vgpr_size_byte, s_vgpr_size_byte, (2+7) //Number of VGPRs = (vgpr_size + 1) * 4 * 32 * 4 (non-zero value)
s_branch L_SHIFT_DONE s_branch L_SHIFT_DONE
...@@ -1045,3 +1082,9 @@ end ...@@ -1045,3 +1082,9 @@ end
function get_hwreg_size_bytes function get_hwreg_size_bytes
return 128 return 128
end end
function get_wave_size(s_reg)
s_getreg_b32 s_reg, hwreg(HW_REG_IB_STS2,SQ_WAVE_IB_STS2_WAVE64_SHIFT,SQ_WAVE_IB_STS2_WAVE64_SIZE)
s_lshl_b32 s_reg, s_reg, S_WAVE_SIZE
s_or_b32 s_reg, s_save_spi_init_hi, s_reg //share with exec_hi, it's at bit25
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment