Skip to contentSkip to conversation

Microblaze Cleanups

PATCH Applied Peter Crosthwaite 5 participants 14 messages Apr 26, 2015 – Apr 30, 2015

lore
Share & tools
lore
#0 lore raw

cover Microblaze Cleanups

Hi Edgar,

This is some code cleanup of Microblaze. Mainly unused code deletion but also code share of the defconfig (P1).

Regards,
Peter

Peter Crosthwaite (6):
defconfigs: Piggyback microblazeel on microblaze
mb: mmu: Delete flip_um fn prototype
mb: cpu: Remote unused cpu_get_pc
mb: cpu: Remove unused CC_OP enum
mb: cpu: Delete EXCP_NMI
mb: cpu: delete unused cpu_interrupts_enabled

 default-configs/microblazeel-softmmu.mak | 10 +---------
 target-microblaze/cpu.h                  | 17 -----------------
 target-microblaze/mmu.h                  |  1 -
 3 files changed, 1 insertion(+), 27 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/6 defconfigs: Piggyback microblazeel on microblaze

Theres no difference in defconfig. Going forward microblazeel should superset microblaze so use an include.

---
 default-configs/microblazeel-softmmu.mak | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
default-configs/microblazeel-softmmu.mak +1 -9
index acf22c5..2fcf442 100644
@@ -1,11 +1,3 @@
 # Default configuration for microblazeel-softmmu
 
-CONFIG_PTIMER=y
-CONFIG_PFLASH_CFI01=y
-CONFIG_SERIAL=y
-CONFIG_XILINX=y
-CONFIG_XILINX_AXI=y
-CONFIG_XILINX_SPI=y
-CONFIG_XILINX_ETHLITE=y
-CONFIG_SSI=y
-CONFIG_SSI_M25P80=y
+include microblaze-softmmu.mak
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/6 mb: mmu: Delete flip_um fn prototype

In reply to Peter Crosthwaite

This is not implemented or used.

---
 target-microblaze/mmu.h | 1 -
 1 file changed, 1 deletion(-)
target-microblaze/mmu.h +0 -1
index 3f74dda..3b7a998 100644
@@ -82,7 +82,6 @@ struct microblaze_mmu_lookup
     } err;
 };
 
-void mmu_flip_um(CPUMBState *env, unsigned int um);
 unsigned int mmu_translate(struct microblaze_mmu *mmu,
                            struct microblaze_mmu_lookup *lu,
                            target_ulong vaddr, int rw, int mmu_idx);
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/6 mb: cpu: Remote unused cpu_get_pc

In reply to Peter Crosthwaite

This function is not used by anything. Remove.

---
 target-microblaze/cpu.h | 5 -----
 1 file changed, 5 deletions(-)
target-microblaze/cpu.h +0 -5
index 7d06227..2c18b49 100644
@@ -333,11 +333,6 @@ static inline int cpu_interrupts_enabled(CPUMBState *env)
 
 #include "exec/cpu-all.h"
 
-static inline target_ulong cpu_get_pc(CPUMBState *env)
-{
-    return env->sregs[SR_PC];
-}
-
 static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc,
                                         target_ulong *cs_base, int *flags)
 {
Signature · 1 line
1.9.1
#5 lore raw

PATCH 4/6 mb: cpu: Remove unused CC_OP enum

In reply to Peter Crosthwaite

This enum is not used by anything. Remove.

---
 target-microblaze/cpu.h | 6 ------
 1 file changed, 6 deletions(-)
target-microblaze/cpu.h +0 -6
index 2c18b49..f21da2f 100644
@@ -284,12 +284,6 @@ int cpu_mb_exec(CPUMBState *s);
 int cpu_mb_signal_handler(int host_signum, void *pinfo,
                           void *puc);
 
-enum {
-    CC_OP_DYNAMIC, /* Use env->cc_op  */
-    CC_OP_FLAGS,
-    CC_OP_CMP,
-};
-
 /* FIXME: MB uses variable pages down to 1K but linux only uses 4k.  */
 #define TARGET_PAGE_BITS 12
 #define MMAP_SHIFT TARGET_PAGE_BITS
Signature · 1 line
1.9.1
#6 lore raw

PATCH 5/6 mb: cpu: Delete EXCP_NMI

In reply to Peter Crosthwaite

This define is unused. Remove.

---
 target-microblaze/cpu.h | 1 -
 1 file changed, 1 deletion(-)
target-microblaze/cpu.h +0 -1
index f21da2f..6522af7 100644
@@ -36,7 +36,6 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE	EM_MICROBLAZE
 
-#define EXCP_NMI        1
 #define EXCP_MMU        2
 #define EXCP_IRQ        3
 #define EXCP_BREAK      4
Signature · 1 line
1.9.1
#11 lore raw

PATCH 6/6 mb: cpu: delete unused cpu_interrupts_enabled

In reply to Peter Crosthwaite

This function is unused. Remove.

---
 target-microblaze/cpu.h | 5 -----
 1 file changed, 5 deletions(-)
target-microblaze/cpu.h +0 -5
index 6522af7..56d3403 100644
@@ -319,11 +319,6 @@ static inline int cpu_mmu_index (CPUMBState *env)
 int mb_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
                             int mmu_idx);
 
-static inline int cpu_interrupts_enabled(CPUMBState *env)
-{
-    return env->sregs[SR_MSR] & MSR_IE;
-}
-
 #include "exec/cpu-all.h"
 
 static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc,
Signature · 1 line
1.9.1
#7 lore raw

Re: [Qemu-devel] [PATCH microblaze v1 5/6] mb: cpu: Delete EXCP_NMI

In reply to Peter Crosthwaite
Quoted 3 lines · Peter Crosthwaite

This define is unused. Remove.

Hi,

Any reason not to shift down the numbering?

Otherwise the whole series looks good to me.

Thanks,
Edgar

Quoted 20 lines
---
 target-microblaze/cpu.h | 1 -
 1 file changed, 1 deletion(-)
target-microblaze/cpu.h +0 -1
index f21da2f..6522af7 100644
@@ -36,7 +36,6 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE	EM_MICROBLAZE
 
-#define EXCP_NMI        1
 #define EXCP_MMU        2
 #define EXCP_IRQ        3
 #define EXCP_BREAK      4
Signature · 1 line
1.9.1
#8 lore raw

Re: [Qemu-devel] [PATCH microblaze v1 5/6] mb: cpu: Delete EXCP_NMI

Quoted 10 lines · Edgar E. Iglesias
Quoted 3 lines · Peter Crosthwaite

This define is unused. Remove.

Hi,

Any reason not to shift down the numbering?

Otherwise the whole series looks good to me.

What does this mean, "looks good", is it your R-b? :)

Quoted 8 lines

target-microblaze/cpu.h typedef struct CPUMBState CPUMBState; · line 41

Quoted 8 lines
target-microblaze/cpu.h +0 -1
@@ -36,7 +36,6 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE	EM_MICROBLAZE
 
-#define EXCP_NMI        1
 #define EXCP_MMU        2
 #define EXCP_IRQ        3
 #define EXCP_BREAK      4

I can renumber this on commit just fine, there's no need to resend whole thing, is it okay with you Peter?

Thanks,

/mjt

#9 lore raw

Re: [Qemu-devel] [PATCH microblaze v1 5/6] mb: cpu: Delete EXCP_NMI

Quoted 9 lines · Michael Tokarev
Quoted 8 lines · Edgar E. Iglesias
Quoted 3 lines · Peter Crosthwaite

This define is unused. Remove.

Hi,

Any reason not to shift down the numbering?

None. Although my goal was to make no code change in the trivial patch series.

Quoted 9 lines
Quoted 2 lines

Otherwise the whole series looks good to me.

What does this mean, "looks good", is it your R-b? :)

Quoted 4 lines
Quoted 4 lines
target-microblaze/cpu.h +0 -0
@@ -36,7 +36,6 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE EM_MICROBLAZE
 
Quoted 8 lines
Quoted 4 lines

target-microblaze/cpu.h typedef struct CPUMBState CPUMBState; · line 41

Quoted 4 lines
target-microblaze/cpu.h +0 -1
-#define EXCP_NMI        1
 #define EXCP_MMU        2
 #define EXCP_IRQ        3
 #define EXCP_BREAK      4

I can renumber this on commit just fine, there's no need to resend whole thing, is it okay with you Peter?

It's ok with me. Thanks.

Regards,
Peter

Quoted 4 lines

Thanks,

/mjt

#12 lore raw
In reply to Peter Crosthwaite
Quoted 4 lines · Peter Crosthwaite

Hi Edgar,

This is some code cleanup of Microblaze. Mainly unused code deletion but also code share of the defconfig (P1).

Applied all 6 to -trivial, as is, since the whole series does not perform any code changes. Renumbering EXCP_* constants can be done later.

Thanks,

/mjt

Reviewed-by
#10 lore raw

Re: [Qemu-devel] [PATCH microblaze v1 5/6] mb: cpu: Delete EXCP_NMI

In reply to Michael Tokarev
Quoted 6 lines · Michael Tokarev
Quoted 5 lines · Edgar E. Iglesias
Quoted 3 lines · Peter Crosthwaite

This define is unused. Remove.

Quoted 7 lines
Quoted 5 lines

Hi,

Any reason not to shift down the numbering?

Otherwise the whole series looks good to me.

What does this mean, "looks good", is it your R-b? :)

Sure, with the change:

Quoted 16 lines
Quoted 9 lines

target-microblaze/cpu.h typedef struct CPUMBState CPUMBState; · line 41

Quoted 9 lines
target-microblaze/cpu.h +0 -1
@@ -36,7 +36,6 @@ typedef struct CPUMBState CPUMBState;
 
 #define ELF_MACHINE	EM_MICROBLAZE
 
-#define EXCP_NMI        1
 #define EXCP_MMU        2
 #define EXCP_IRQ        3
 #define EXCP_BREAK      4

I can renumber this on commit just fine, there's no need to resend whole thing, is it okay with you Peter?

Thanks,

/mjt

#13 lore raw
In reply to Michael Tokarev
Quoted 9 lines · Michael Tokarev
Quoted 4 lines · Peter Crosthwaite

Hi Edgar,

This is some code cleanup of Microblaze. Mainly unused code deletion but also code share of the defconfig (P1).

Applied all 6 to -trivial, as is, since the whole series does not perform any code changes. Renumbering EXCP_* constants can be done later.

(Just sent the renumbering change separately, to hopefully get final R-b from Edgar ;)

But one more thing. I'd like to rename "mb:" in subjects to be "microblaze:", since the top message (this 0/6) wont be in git and "mb:" prefix is somewhat too short ;)

Thanks,

/mjt

Reviewed-by on v1 3/6
#4 lore raw

Re: [Qemu-devel] [PATCH microblaze v1 3/6] mb: cpu: Remote unused cpu_get_pc

In reply to Peter Crosthwaite
Quoted 13 lines · Peter Crosthwaite

This function is not used by anything. Remove.

---
 target-microblaze/cpu.h | 5 -----
 1 file changed, 5 deletions(-)
target-microblaze/cpu.h +0 -0
index 7d06227..2c18b49 100644
@@ -333,11 +333,6 @@ static inline int cpu_interrupts_enabled(CPUMBState *env)
 

target-microblaze/cpu.h static inline int cpu_interrupts_enabled(CPUMBState *env) · line 338

Quoted 10 lines
target-microblaze/cpu.h +0 -5
 #include "exec/cpu-all.h"
 
-static inline target_ulong cpu_get_pc(CPUMBState *env)
-{
-    return env->sregs[SR_PC];
-}
-
 static inline void cpu_get_tb_cpu_state(CPUMBState *env, target_ulong *pc,
                                         target_ulong *cs_base, int *flags)
 {

Ahh I see that now ;-)

Signature · 1 line
Alex Bennée