Re: [PATCH] target/riscv/pmp: guard against PMP ranges with a negative size

2022-06-16 Thread Alistair Francis
On Thu, Jun 16, 2022 at 7:12 AM Nicolas Pitre wrote: > > For a TOR entry to match, the stard address must be lower than the end > address. Normally this is always the case, but correct code might still > run into the following scenario: > > Initial state: > > pmpaddr3 = 0x2000 pmp3cf

Re: [PATCH] target/riscv/pmp: guard against PMP ranges with a negative size

2022-06-16 Thread Alistair Francis
On Thu, Jun 16, 2022 at 10:20 PM Nicolas Pitre wrote: > > On Thu, 16 Jun 2022, Alistair Francis wrote: > > > On Thu, Jun 16, 2022 at 7:12 AM Nicolas Pitre wrote: > > > > > > For a TOR entry to match, the stard address must be lower than the end > > > address. Normally this is always the case, but

Re: [PATCH] target/riscv/pmp: guard against PMP ranges with a negative size

2022-06-16 Thread Nicolas Pitre
On Thu, 16 Jun 2022, Alistair Francis wrote: > On Thu, Jun 16, 2022 at 7:12 AM Nicolas Pitre wrote: > > > > For a TOR entry to match, the stard address must be lower than the end > > address. Normally this is always the case, but correct code might still > > run into the following scenario: > > >

Re: [PATCH] target/riscv/pmp: guard against PMP ranges with a negative size

2022-06-15 Thread Alistair Francis
On Thu, Jun 16, 2022 at 7:12 AM Nicolas Pitre wrote: > > For a TOR entry to match, the stard address must be lower than the end > address. Normally this is always the case, but correct code might still > run into the following scenario: > > Initial state: > > pmpaddr3 = 0x2000 pmp3cf

[PATCH] target/riscv/pmp: guard against PMP ranges with a negative size

2022-06-15 Thread Nicolas Pitre
For a TOR entry to match, the stard address must be lower than the end address. Normally this is always the case, but correct code might still run into the following scenario: Initial state: pmpaddr3 = 0x2000 pmp3cfg = OFF pmpaddr4 = 0x3000 pmp4cfg = TOR Execution: