Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-23 Thread Richard Henderson
On 3/23/23 06:24, Wu, Fei wrote: There is MSTATUS_MPRV and MSTATUS_MPP kind of thing, priv+sum is not able to represent all of the status, probably we can just add an extra 'priv' at the back of TB_FLAGS? MPRV+MPP looks not necessary be in TB_FLAGS, it's just used to calculate the mmu_idx. Is

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-23 Thread Richard Henderson
On 3/22/23 17:38, Wu, Fei wrote: There is MSTATUS_MPRV and MSTATUS_MPP kind of thing, priv+sum is not able to represent all of the status, probably we can just add an extra 'priv' at the back of TB_FLAGS? Yes, I think that's required. r~

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-23 Thread Wu, Fei
On 3/23/2023 8:38 AM, Wu, Fei wrote: > On 3/22/2023 9:19 PM, Richard Henderson wrote: >> On 3/22/23 05:12, Fei Wu wrote: >>> Kernel needs to access user mode memory e.g. during syscalls, the window >>> is usually opened up for a very limited time through MSTATUS.SUM, the >>> overhead is too much

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Wu, Fei
On 3/23/2023 8:38 AM, Wu, Fei wrote: > On 3/22/2023 9:19 PM, Richard Henderson wrote: >> On 3/22/23 05:12, Fei Wu wrote: >>> Kernel needs to access user mode memory e.g. during syscalls, the window >>> is usually opened up for a very limited time through MSTATUS.SUM, the >>> overhead is too much

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Wu, Fei
On 3/22/2023 9:19 PM, Richard Henderson wrote: > On 3/22/23 05:12, Fei Wu wrote: >> Kernel needs to access user mode memory e.g. during syscalls, the window >> is usually opened up for a very limited time through MSTATUS.SUM, the >> overhead is too much if tlb_flush() gets called for every SUM

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Richard Henderson
On 3/22/23 05:12, Fei Wu wrote: Kernel needs to access user mode memory e.g. during syscalls, the window is usually opened up for a very limited time through MSTATUS.SUM, the overhead is too much if tlb_flush() gets called for every SUM change. This patch creates a separate MMU index for S+SUM,

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Wu, Fei
On 3/22/2023 8:37 PM, liweiwei wrote: > > On 2023/3/22 20:12, Fei Wu wrote: >> Kernel needs to access user mode memory e.g. during syscalls, the window >> is usually opened up for a very limited time through MSTATUS.SUM, the >> overhead is too much if tlb_flush() gets called for every SUM change.

Re: [PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread liweiwei
On 2023/3/22 20:12, Fei Wu wrote: Kernel needs to access user mode memory e.g. during syscalls, the window is usually opened up for a very limited time through MSTATUS.SUM, the overhead is too much if tlb_flush() gets called for every SUM change. This patch creates a separate MMU index for

[PATCH v3] target/riscv: reduce overhead of MSTATUS_SUM change

2023-03-22 Thread Fei Wu
Kernel needs to access user mode memory e.g. during syscalls, the window is usually opened up for a very limited time through MSTATUS.SUM, the overhead is too much if tlb_flush() gets called for every SUM change. This patch creates a separate MMU index for S+SUM, so that it's not necessary to