Re: [Qemu-devel] [PATCH] target/xtensa: rework zero overhead loops implementation

2019-01-11 Thread Richard Henderson
On 1/11/19 10:49 PM, Max Filippov wrote: > @@ -706,6 +716,17 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState > *env, target_ulong *pc, > *flags |= xtensa_get_ring(env); > if (env->sregs[PS] & PS_EXCM) { > *flags |= XTENSA_TBFLAG_EXCM; > +} else if (xtensa_option_en

Re: [Qemu-devel] [PATCH] target/xtensa: rework zero overhead loops implementation

2019-01-11 Thread Max Filippov
On Fri, Jan 11, 2019 at 12:53 PM Richard Henderson wrote: > > On 1/11/19 10:49 PM, Max Filippov wrote: > > +#define LINKABLE_BITS 12 > > +#define LINKABLE_SIZE (1u << LINKABLE_BITS) > > +#define LINKABLE_MASK (-LINKABLE_SIZE) > > What is this for? It seems to be replicating TARGET_PAGE_BITS. I u

Re: [Qemu-devel] [PATCH] target/xtensa: rework zero overhead loops implementation

2019-01-11 Thread Richard Henderson
On 1/11/19 10:49 PM, Max Filippov wrote: > +#define LINKABLE_BITS 12 > +#define LINKABLE_SIZE (1u << LINKABLE_BITS) > +#define LINKABLE_MASK (-LINKABLE_SIZE) What is this for? It seems to be replicating TARGET_PAGE_BITS. r~

[Qemu-devel] [PATCH] target/xtensa: rework zero overhead loops implementation

2019-01-11 Thread Max Filippov
Don't invalidate TB with the end of zero overhead loop when LBEG or LEND change. Instead encode the distance from the start of the page where the TB starts to the LEND in the TB cs_base and generate loopback code when the next PC matches encoded LEND. Distance to a destination within the same page