Re: [PATCH 3/3] drm/amdkfd: Save/restore vcc on gfx10

2019-07-29 Thread Liu, Shaoyun
Series is:
reviewed-by: shaoyunl 

On 2019-07-29 11:31 a.m., Cornwall, Jay wrote:
> VCC moved out of user SGPR allocation in gfx10. It's now stored
> in SGPRs 106-107.
>
> Also fixes incorrect SGPR read offsets.
>
> Cc: Shaoyun Liu 
> Signed-off-by: Jay Cornwall 
> ---
>   drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 452 
> ++---
>   .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm |  34 +-
>   2 files changed, 243 insertions(+), 243 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h 
> b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
> index 8089bb3..a8cf82d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
> +++ b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
> @@ -680,7 +680,7 @@ static const uint32_t cwsr_trap_gfx9_hex[] = {
>   };
>   
>   static const uint32_t cwsr_trap_gfx10_hex[] = {
> - 0xbf820001, 0xbf8201c0,
> + 0xbf820001, 0xbf8201c1,
>   0xb0804004, 0xb978f802,
>   0x8a788678, 0xb971f803,
>   0x876eff71, 0x0400,
> @@ -804,271 +804,271 @@ static const uint32_t cwsr_trap_gfx10_hex[] = {
>   0x0060, 0xbf85ffea,
>   0xbe802f00, 0xbe822f02,
>   0xbe842f04, 0xbe862f06,
> - 0xbe882f08, 0xf469003a,
> - 0xfa00, 0xf469013a,
> - 0xfa10, 0xf465023a,
> - 0xfa20, 0x8074c074,
> - 0x82758075, 0xbef40372,
> - 0xbefa0380, 0xbefe03c1,
> - 0x907c9973, 0x877c817c,
> - 0xbf06817c, 0xbf850002,
> - 0xbeff0380, 0xbf820002,
> - 0xbeff03c1, 0xbf82000b,
> + 0xbe882f08, 0xbe8a2f0a,
> + 0xf469003a, 0xfa00,
> + 0xf469013a, 0xfa10,
> + 0xf469023a, 0xfa20,
> + 0x8074b074, 0x82758075,
> + 0xbef40372, 0xbefa0380,
> + 0xbefe03c1, 0x907c9973,
> + 0x877c817c, 0xbf06817c,
> + 0xbf850002, 0xbeff0380,
> + 0xbf820002, 0xbeff03c1,
> + 0xbf82000b, 0xbef603ff,
> + 0x0100, 0xe0704000,
> + 0x7a5d, 0xe0704080,
> + 0x7a5d0100, 0xe0704100,
> + 0x7a5d0200, 0xe0704180,
> + 0x7a5d0300, 0xbf82000a,
>   0xbef603ff, 0x0100,
>   0xe0704000, 0x7a5d,
> - 0xe0704080, 0x7a5d0100,
> - 0xe0704100, 0x7a5d0200,
> - 0xe0704180, 0x7a5d0300,
> - 0xbf82000a, 0xbef603ff,
> - 0x0100, 0xe0704000,
> - 0x7a5d, 0xe0704100,
> - 0x7a5d0100, 0xe0704200,
> - 0x7a5d0200, 0xe0704300,
> - 0x7a5d0300, 0xbefe03c1,
> + 0xe0704100, 0x7a5d0100,
> + 0xe0704200, 0x7a5d0200,
> + 0xe0704300, 0x7a5d0300,
> + 0xbefe03c1, 0x907c9973,
> + 0x877c817c, 0xbf06817c,
> + 0xbf850002, 0xbeff0380,
> + 0xbf820001, 0xbeff03c1,
> + 0xb9714306, 0x8771c171,
> + 0xbf840046, 0xbf8a,
> + 0x8776ff6f, 0x0400,
> + 0xbf840042, 0x8f718671,
> + 0x8f718271, 0xbef60371,
> + 0xb97a2a05, 0x807a817a,
>   0x907c9973, 0x877c817c,
>   0xbf06817c, 0xbf850002,
> - 0xbeff0380, 0xbf820001,
> - 0xbeff03c1, 0xb9714306,
> - 0x8771c171, 0xbf840046,
> - 0xbf8a, 0x8776ff6f,
> - 0x0400, 0xbf840042,
> - 0x8f718671, 0x8f718271,
> - 0xbef60371, 0xb97a2a05,
> - 0x807a817a, 0x907c9973,
> + 0x8f7a897a, 0xbf820001,
> + 0x8f7a8a7a, 0xb9761e06,
> + 0x8f768a76, 0x807a767a,
> + 0x807aff7a, 0x0200,
> + 0x807aff7a, 0x0080,
> + 0xbef603ff, 0x0100,
> + 0xd765, 0x000100c1,
> + 0xd766, 0x000200c1,
> + 0x1684, 0x907c9973,
>   0x877c817c, 0xbf06817c,
> - 0xbf850002, 0x8f7a897a,
> - 0xbf820001, 0x8f7a8a7a,
> - 0xb9761e06, 0x8f768a76,
> - 0x807a767a, 0x807aff7a,
> - 0x0200, 0x807aff7a,
> - 0x0080, 0xbef603ff,
> - 0x0100, 0xd765,
> - 0x000100c1, 0xd766,
> - 0x000200c1, 0x1684,
> - 0x907c9973, 0x877c817c,
> - 0xbf06817c, 0xbefc0380,
> - 0xbf850012, 0xbe8303ff,
> - 0x0080, 0xbf80,
> + 0xbefc0380, 0xbf850012,
> + 0xbe8303ff, 0x0080,
>   0xbf80, 0xbf80,
> - 0xd8d8, 0x0100,
> - 0xbf8c, 0xe0704000,
> - 0x7a5d0100, 0x807c037c,
> - 0x807a037a, 0xd525,
> - 0x0001ff00, 0x0080,
> - 0xbf0a717c, 0xbf85fff4,
> - 0xbf820011, 0xbe8303ff,
> - 0x0100, 0xbf80,
> + 0xbf80, 0xd8d8,
> + 0x0100, 0xbf8c,
> + 0xe0704000, 0x7a5d0100,
> + 0x807c037c, 0x807a037a,
> + 0xd525, 0x0001ff00,
> + 0x0080, 0xbf0a717c,
> + 0xbf85fff4, 0xbf820011,
> + 0xbe8303ff, 0x0100,
>   0xbf80, 0xbf80,
> - 0xd8d8, 0x0100,
> - 0xbf8c, 0xe0704000,
> - 0x7a5d0100, 0x807c037c,
> - 0x807a037a, 0xd525,
> - 0x0001ff00, 0x0100,
> - 0xbf0a717c, 0xbf85fff4,
> - 0xbefe03c1, 0x907c9973,
> - 0x877c817c, 0xbf06817c,
> - 0xbf850004, 0xbefa03ff,
> - 0x0200, 0xbeff0380,
> - 0xbf820003, 0xbefa03ff,
> - 0x0400, 0xbeff03c1,
> - 0xb9712a05, 0x80718171,
> - 0x8f718271, 0x907c9973,
> - 0x877c817c, 0xbf06817c,
> - 0xbf850017, 

Re: [PATCH 3/3] drm/amdkfd: Save/restore vcc on gfx10

2019-07-29 Thread Alex Deucher
On Mon, Jul 29, 2019 at 11:31 AM Cornwall, Jay  wrote:
>
> VCC moved out of user SGPR allocation in gfx10. It's now stored
> in SGPRs 106-107.
>
> Also fixes incorrect SGPR read offsets.
>
> Cc: Shaoyun Liu 
> Signed-off-by: Jay Cornwall 

Series is:
Acked-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 452 
> ++---
>  .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm |  34 +-
>  2 files changed, 243 insertions(+), 243 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h 
> b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
> index 8089bb3..a8cf82d 100644
> --- a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
> +++ b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
> @@ -680,7 +680,7 @@ static const uint32_t cwsr_trap_gfx9_hex[] = {
>  };
>
>  static const uint32_t cwsr_trap_gfx10_hex[] = {
> -   0xbf820001, 0xbf8201c0,
> +   0xbf820001, 0xbf8201c1,
> 0xb0804004, 0xb978f802,
> 0x8a788678, 0xb971f803,
> 0x876eff71, 0x0400,
> @@ -804,271 +804,271 @@ static const uint32_t cwsr_trap_gfx10_hex[] = {
> 0x0060, 0xbf85ffea,
> 0xbe802f00, 0xbe822f02,
> 0xbe842f04, 0xbe862f06,
> -   0xbe882f08, 0xf469003a,
> -   0xfa00, 0xf469013a,
> -   0xfa10, 0xf465023a,
> -   0xfa20, 0x8074c074,
> -   0x82758075, 0xbef40372,
> -   0xbefa0380, 0xbefe03c1,
> -   0x907c9973, 0x877c817c,
> -   0xbf06817c, 0xbf850002,
> -   0xbeff0380, 0xbf820002,
> -   0xbeff03c1, 0xbf82000b,
> +   0xbe882f08, 0xbe8a2f0a,
> +   0xf469003a, 0xfa00,
> +   0xf469013a, 0xfa10,
> +   0xf469023a, 0xfa20,
> +   0x8074b074, 0x82758075,
> +   0xbef40372, 0xbefa0380,
> +   0xbefe03c1, 0x907c9973,
> +   0x877c817c, 0xbf06817c,
> +   0xbf850002, 0xbeff0380,
> +   0xbf820002, 0xbeff03c1,
> +   0xbf82000b, 0xbef603ff,
> +   0x0100, 0xe0704000,
> +   0x7a5d, 0xe0704080,
> +   0x7a5d0100, 0xe0704100,
> +   0x7a5d0200, 0xe0704180,
> +   0x7a5d0300, 0xbf82000a,
> 0xbef603ff, 0x0100,
> 0xe0704000, 0x7a5d,
> -   0xe0704080, 0x7a5d0100,
> -   0xe0704100, 0x7a5d0200,
> -   0xe0704180, 0x7a5d0300,
> -   0xbf82000a, 0xbef603ff,
> -   0x0100, 0xe0704000,
> -   0x7a5d, 0xe0704100,
> -   0x7a5d0100, 0xe0704200,
> -   0x7a5d0200, 0xe0704300,
> -   0x7a5d0300, 0xbefe03c1,
> +   0xe0704100, 0x7a5d0100,
> +   0xe0704200, 0x7a5d0200,
> +   0xe0704300, 0x7a5d0300,
> +   0xbefe03c1, 0x907c9973,
> +   0x877c817c, 0xbf06817c,
> +   0xbf850002, 0xbeff0380,
> +   0xbf820001, 0xbeff03c1,
> +   0xb9714306, 0x8771c171,
> +   0xbf840046, 0xbf8a,
> +   0x8776ff6f, 0x0400,
> +   0xbf840042, 0x8f718671,
> +   0x8f718271, 0xbef60371,
> +   0xb97a2a05, 0x807a817a,
> 0x907c9973, 0x877c817c,
> 0xbf06817c, 0xbf850002,
> -   0xbeff0380, 0xbf820001,
> -   0xbeff03c1, 0xb9714306,
> -   0x8771c171, 0xbf840046,
> -   0xbf8a, 0x8776ff6f,
> -   0x0400, 0xbf840042,
> -   0x8f718671, 0x8f718271,
> -   0xbef60371, 0xb97a2a05,
> -   0x807a817a, 0x907c9973,
> +   0x8f7a897a, 0xbf820001,
> +   0x8f7a8a7a, 0xb9761e06,
> +   0x8f768a76, 0x807a767a,
> +   0x807aff7a, 0x0200,
> +   0x807aff7a, 0x0080,
> +   0xbef603ff, 0x0100,
> +   0xd765, 0x000100c1,
> +   0xd766, 0x000200c1,
> +   0x1684, 0x907c9973,
> 0x877c817c, 0xbf06817c,
> -   0xbf850002, 0x8f7a897a,
> -   0xbf820001, 0x8f7a8a7a,
> -   0xb9761e06, 0x8f768a76,
> -   0x807a767a, 0x807aff7a,
> -   0x0200, 0x807aff7a,
> -   0x0080, 0xbef603ff,
> -   0x0100, 0xd765,
> -   0x000100c1, 0xd766,
> -   0x000200c1, 0x1684,
> -   0x907c9973, 0x877c817c,
> -   0xbf06817c, 0xbefc0380,
> -   0xbf850012, 0xbe8303ff,
> -   0x0080, 0xbf80,
> +   0xbefc0380, 0xbf850012,
> +   0xbe8303ff, 0x0080,
> 0xbf80, 0xbf80,
> -   0xd8d8, 0x0100,
> -   0xbf8c, 0xe0704000,
> -   0x7a5d0100, 0x807c037c,
> -   0x807a037a, 0xd525,
> -   0x0001ff00, 0x0080,
> -   0xbf0a717c, 0xbf85fff4,
> -   0xbf820011, 0xbe8303ff,
> -   0x0100, 0xbf80,
> +   0xbf80, 0xd8d8,
> +   0x0100, 0xbf8c,
> +   0xe0704000, 0x7a5d0100,
> +   0x807c037c, 0x807a037a,
> +   0xd525, 0x0001ff00,
> +   0x0080, 0xbf0a717c,
> +   0xbf85fff4, 0xbf820011,
> +   0xbe8303ff, 0x0100,
> 0xbf80, 0xbf80,
> -   0xd8d8, 0x0100,
> -   0xbf8c, 0xe0704000,
> -   0x7a5d0100, 0x807c037c,
> -   0x807a037a, 0xd525,
> -   0x0001ff00, 0x0100,
> -   0xbf0a717c, 0xbf85fff4,
> -   0xbefe03c1, 0x907c9973,
> -   0x877c817c, 0xbf06817c,
> -

[PATCH 3/3] drm/amdkfd: Save/restore vcc on gfx10

2019-07-29 Thread Cornwall, Jay
VCC moved out of user SGPR allocation in gfx10. It's now stored
in SGPRs 106-107.

Also fixes incorrect SGPR read offsets.

Cc: Shaoyun Liu 
Signed-off-by: Jay Cornwall 
---
 drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h | 452 ++---
 .../gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm |  34 +-
 2 files changed, 243 insertions(+), 243 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h 
b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
index 8089bb3..a8cf82d 100644
--- a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
+++ b/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
@@ -680,7 +680,7 @@ static const uint32_t cwsr_trap_gfx9_hex[] = {
 };
 
 static const uint32_t cwsr_trap_gfx10_hex[] = {
-   0xbf820001, 0xbf8201c0,
+   0xbf820001, 0xbf8201c1,
0xb0804004, 0xb978f802,
0x8a788678, 0xb971f803,
0x876eff71, 0x0400,
@@ -804,271 +804,271 @@ static const uint32_t cwsr_trap_gfx10_hex[] = {
0x0060, 0xbf85ffea,
0xbe802f00, 0xbe822f02,
0xbe842f04, 0xbe862f06,
-   0xbe882f08, 0xf469003a,
-   0xfa00, 0xf469013a,
-   0xfa10, 0xf465023a,
-   0xfa20, 0x8074c074,
-   0x82758075, 0xbef40372,
-   0xbefa0380, 0xbefe03c1,
-   0x907c9973, 0x877c817c,
-   0xbf06817c, 0xbf850002,
-   0xbeff0380, 0xbf820002,
-   0xbeff03c1, 0xbf82000b,
+   0xbe882f08, 0xbe8a2f0a,
+   0xf469003a, 0xfa00,
+   0xf469013a, 0xfa10,
+   0xf469023a, 0xfa20,
+   0x8074b074, 0x82758075,
+   0xbef40372, 0xbefa0380,
+   0xbefe03c1, 0x907c9973,
+   0x877c817c, 0xbf06817c,
+   0xbf850002, 0xbeff0380,
+   0xbf820002, 0xbeff03c1,
+   0xbf82000b, 0xbef603ff,
+   0x0100, 0xe0704000,
+   0x7a5d, 0xe0704080,
+   0x7a5d0100, 0xe0704100,
+   0x7a5d0200, 0xe0704180,
+   0x7a5d0300, 0xbf82000a,
0xbef603ff, 0x0100,
0xe0704000, 0x7a5d,
-   0xe0704080, 0x7a5d0100,
-   0xe0704100, 0x7a5d0200,
-   0xe0704180, 0x7a5d0300,
-   0xbf82000a, 0xbef603ff,
-   0x0100, 0xe0704000,
-   0x7a5d, 0xe0704100,
-   0x7a5d0100, 0xe0704200,
-   0x7a5d0200, 0xe0704300,
-   0x7a5d0300, 0xbefe03c1,
+   0xe0704100, 0x7a5d0100,
+   0xe0704200, 0x7a5d0200,
+   0xe0704300, 0x7a5d0300,
+   0xbefe03c1, 0x907c9973,
+   0x877c817c, 0xbf06817c,
+   0xbf850002, 0xbeff0380,
+   0xbf820001, 0xbeff03c1,
+   0xb9714306, 0x8771c171,
+   0xbf840046, 0xbf8a,
+   0x8776ff6f, 0x0400,
+   0xbf840042, 0x8f718671,
+   0x8f718271, 0xbef60371,
+   0xb97a2a05, 0x807a817a,
0x907c9973, 0x877c817c,
0xbf06817c, 0xbf850002,
-   0xbeff0380, 0xbf820001,
-   0xbeff03c1, 0xb9714306,
-   0x8771c171, 0xbf840046,
-   0xbf8a, 0x8776ff6f,
-   0x0400, 0xbf840042,
-   0x8f718671, 0x8f718271,
-   0xbef60371, 0xb97a2a05,
-   0x807a817a, 0x907c9973,
+   0x8f7a897a, 0xbf820001,
+   0x8f7a8a7a, 0xb9761e06,
+   0x8f768a76, 0x807a767a,
+   0x807aff7a, 0x0200,
+   0x807aff7a, 0x0080,
+   0xbef603ff, 0x0100,
+   0xd765, 0x000100c1,
+   0xd766, 0x000200c1,
+   0x1684, 0x907c9973,
0x877c817c, 0xbf06817c,
-   0xbf850002, 0x8f7a897a,
-   0xbf820001, 0x8f7a8a7a,
-   0xb9761e06, 0x8f768a76,
-   0x807a767a, 0x807aff7a,
-   0x0200, 0x807aff7a,
-   0x0080, 0xbef603ff,
-   0x0100, 0xd765,
-   0x000100c1, 0xd766,
-   0x000200c1, 0x1684,
-   0x907c9973, 0x877c817c,
-   0xbf06817c, 0xbefc0380,
-   0xbf850012, 0xbe8303ff,
-   0x0080, 0xbf80,
+   0xbefc0380, 0xbf850012,
+   0xbe8303ff, 0x0080,
0xbf80, 0xbf80,
-   0xd8d8, 0x0100,
-   0xbf8c, 0xe0704000,
-   0x7a5d0100, 0x807c037c,
-   0x807a037a, 0xd525,
-   0x0001ff00, 0x0080,
-   0xbf0a717c, 0xbf85fff4,
-   0xbf820011, 0xbe8303ff,
-   0x0100, 0xbf80,
+   0xbf80, 0xd8d8,
+   0x0100, 0xbf8c,
+   0xe0704000, 0x7a5d0100,
+   0x807c037c, 0x807a037a,
+   0xd525, 0x0001ff00,
+   0x0080, 0xbf0a717c,
+   0xbf85fff4, 0xbf820011,
+   0xbe8303ff, 0x0100,
0xbf80, 0xbf80,
-   0xd8d8, 0x0100,
-   0xbf8c, 0xe0704000,
-   0x7a5d0100, 0x807c037c,
-   0x807a037a, 0xd525,
-   0x0001ff00, 0x0100,
-   0xbf0a717c, 0xbf85fff4,
-   0xbefe03c1, 0x907c9973,
-   0x877c817c, 0xbf06817c,
-   0xbf850004, 0xbefa03ff,
-   0x0200, 0xbeff0380,
-   0xbf820003, 0xbefa03ff,
-   0x0400, 0xbeff03c1,
-   0xb9712a05, 0x80718171,
-   0x8f718271, 0x907c9973,
-   0x877c817c, 0xbf06817c,
-   0xbf850017, 0xbef603ff,
-   0x0100, 0xbefc0384,
-   0xbf0a717c, 0xbf840037,
-   0x7e008700, 0x7e028701,
-   0x7e048702,