mbox series

[0/2] target/m68k: add vmstate structure to migrate M68kCPU

Message ID 20201022203000.1922749-1-laurent@vivier.eu
Headers show
Series target/m68k: add vmstate structure to migrate M68kCPU | expand

Message

Laurent Vivier Oct. 22, 2020, 8:29 p.m. UTC
First patch is a cleanup patch.

The second patch defines the vmstate structure for M68kCPU.

I have tested the migration with my experimental machine virt-m68k.

I didn't check if q800 machine type has all the needed vmstates
for all the hardware devices it uses.

Thanks,
Laurent

Laurent Vivier (2):
  target/m68k: remove useless qregs array
  target/m68k: Add vmstate definition for M68kCPU

 target/m68k/cpu.h        |   5 +-
 target/m68k/cpu.c        | 193 ++++++++++++++++++++++++++++++++++++++-
 target/m68k/fpu_helper.c |  10 +-
 3 files changed, 198 insertions(+), 10 deletions(-)

-- 
2.26.2

Comments

Philippe Mathieu-Daudé Oct. 22, 2020, 9:04 p.m. UTC | #1
On 10/22/20 10:29 PM, Laurent Vivier wrote:
> They are unused since the target has been converted to TCG.
> 
> Fixes: e1f3808e03f7 ("Convert m68k target to TCG.")
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   target/m68k/cpu.h | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
> index 521ac67cdd04..9a6f0400fcfe 100644
> --- a/target/m68k/cpu.h
> +++ b/target/m68k/cpu.h
> @@ -33,8 +33,6 @@
>   #define OS_PACKED   6
>   #define OS_UNSIZED  7
>   
> -#define MAX_QREGS 32
> -
>   #define EXCP_ACCESS         2   /* Access (MMU) error.  */
>   #define EXCP_ADDRESS        3   /* Address error.  */
>   #define EXCP_ILLEGAL        4   /* Illegal instruction.  */
> @@ -139,8 +137,6 @@ typedef struct CPUM68KState {
>       int pending_vector;
>       int pending_level;
>   
> -    uint32_t qregs[MAX_QREGS];
> -
>       /* Fields up to this point are cleared by a CPU reset */
>       struct {} end_reset_fields;
>   
>
Thomas Huth Oct. 23, 2020, 7:27 a.m. UTC | #2
On 22/10/2020 22.29, Laurent Vivier wrote:
> They are unused since the target has been converted to TCG.
> 
> Fixes: e1f3808e03f7 ("Convert m68k target to TCG.")
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  target/m68k/cpu.h | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
> index 521ac67cdd04..9a6f0400fcfe 100644
> --- a/target/m68k/cpu.h
> +++ b/target/m68k/cpu.h
> @@ -33,8 +33,6 @@
>  #define OS_PACKED   6
>  #define OS_UNSIZED  7
>  
> -#define MAX_QREGS 32
> -
>  #define EXCP_ACCESS         2   /* Access (MMU) error.  */
>  #define EXCP_ADDRESS        3   /* Address error.  */
>  #define EXCP_ILLEGAL        4   /* Illegal instruction.  */
> @@ -139,8 +137,6 @@ typedef struct CPUM68KState {
>      int pending_vector;
>      int pending_level;
>  
> -    uint32_t qregs[MAX_QREGS];
> -
>      /* Fields up to this point are cleared by a CPU reset */
>      struct {} end_reset_fields;

Reviewed-by: Thomas Huth <thuth@redhat.com>

There are still some references to the term qreg in translate.c:

target/m68k/translate.c:#include "qregs.def"
target/m68k/translate.c:#include "qregs.def"
target/m68k/translate.c:/* Generate a jump to the address in qreg DEST.  */

Should these get renamed?

 Thomas
Laurent Vivier Oct. 23, 2020, 7:54 a.m. UTC | #3
Le 23/10/2020 à 09:27, Thomas Huth a écrit :
> On 22/10/2020 22.29, Laurent Vivier wrote:
>> They are unused since the target has been converted to TCG.
>>
>> Fixes: e1f3808e03f7 ("Convert m68k target to TCG.")
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
>>  target/m68k/cpu.h | 4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
>> index 521ac67cdd04..9a6f0400fcfe 100644
>> --- a/target/m68k/cpu.h
>> +++ b/target/m68k/cpu.h
>> @@ -33,8 +33,6 @@
>>  #define OS_PACKED   6
>>  #define OS_UNSIZED  7
>>  
>> -#define MAX_QREGS 32
>> -
>>  #define EXCP_ACCESS         2   /* Access (MMU) error.  */
>>  #define EXCP_ADDRESS        3   /* Address error.  */
>>  #define EXCP_ILLEGAL        4   /* Illegal instruction.  */
>> @@ -139,8 +137,6 @@ typedef struct CPUM68KState {
>>      int pending_vector;
>>      int pending_level;
>>  
>> -    uint32_t qregs[MAX_QREGS];
>> -
>>      /* Fields up to this point are cleared by a CPU reset */
>>      struct {} end_reset_fields;
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> There are still some references to the term qreg in translate.c:
> 
> target/m68k/translate.c:#include "qregs.def"
> target/m68k/translate.c:#include "qregs.def"
> target/m68k/translate.c:/* Generate a jump to the address in qreg DEST.  */
> 
> Should these get renamed?
We always have something like qregs but they are implemented differently.
I don't know if it is worth renaming.

Thanks,
Laurent
Laurent Vivier Dec. 12, 2020, 5:09 p.m. UTC | #4
Le 22/10/2020 à 22:29, Laurent Vivier a écrit :
> First patch is a cleanup patch.

> 

> The second patch defines the vmstate structure for M68kCPU.

> 

> I have tested the migration with my experimental machine virt-m68k.

> 

> I didn't check if q800 machine type has all the needed vmstates

> for all the hardware devices it uses.

> 

> Thanks,

> Laurent

> 

> Laurent Vivier (2):

>   target/m68k: remove useless qregs array

>   target/m68k: Add vmstate definition for M68kCPU

> 

>  target/m68k/cpu.h        |   5 +-

>  target/m68k/cpu.c        | 193 ++++++++++++++++++++++++++++++++++++++-

>  target/m68k/fpu_helper.c |  10 +-

>  3 files changed, 198 insertions(+), 10 deletions(-)

> 


Applied to my m68k-for-6.0 branch

Thanks,
Laurent