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

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

2022-06-15 Thread Nicolas Pitre
: Nicolas Pitre diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 151da3fa08..ea2b67d947 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -167,6 +167,9 @@ void pmp_update_rule_addr(CPURISCVState *env, uint32_t pmp_index) case PMP_AMATCH_TOR: sa = prev_addr <

[PATCH] target/riscv/pmp: fix NAPOT range computation overflow

2022-04-08 Thread Nicolas Pitre
-by: Nicolas Pitre --- This is in fact the same patch I posted yesterday but turns out its scope is far more important than I initially thought. diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 81b61bb65c..151da3fa08 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -141,17

[PATCH] target/riscv/pmp: simplify NAPOT address range computation

2022-04-07 Thread Nicolas Pitre
No need for ctz64() nor special case for -1. Signed-off-by: Nicolas Pitre diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 81b61bb65c..151da3fa08 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -141,17 +141,9 @@ static void pmp_decode_napot(target_ulong a, target_ulong

Re: [Qemu-devel] Change of TEXT_OFFSET for multi_v7_defconfig

2014-04-22 Thread Nicolas Pitre
On Tue, 22 Apr 2014, Jason Gunthorpe wrote: > On Tue, Apr 22, 2014 at 10:44:14AM +0100, Daniel Thompson wrote: > > On 17/04/14 21:35, Jason Gunthorpe wrote: > > >>> The above is useful for loading the raw uncompressed Image without > > >>> carrying the full ELF baggage. > > >> > > >> What exactly

Re: [Qemu-devel] Change of TEXT_OFFSET for multi_v7_defconfig

2014-04-17 Thread Nicolas Pitre
On Thu, 17 Apr 2014, Rob Herring wrote: > Here's a simple test of what I was trying to point out. I took a > working kernel with TEXT_OFFSET of 0x8000 and booted it on QEMU using > the "virt" machine which RAM normally starts at 0x4000. Then > varying the RAM base, I get these results: > > 0x

Re: [Qemu-devel] Change of TEXT_OFFSET for multi_v7_defconfig

2014-04-17 Thread Nicolas Pitre
On Thu, 17 Apr 2014, Rob Herring wrote: > On Wed, Apr 16, 2014 at 2:14 PM, Nicolas Pitre > wrote: > > On Wed, 16 Apr 2014, Christopher Covington wrote: > > > >> On 04/15/2014 06:44 AM, Daniel Thompson wrote: > >> > Hi Folks > > [snip] > > &g

Re: [Qemu-devel] Change of TEXT_OFFSET for multi_v7_defconfig

2014-04-17 Thread Nicolas Pitre
On Thu, 17 Apr 2014, Christopher Covington wrote: > On 04/16/2014 07:21 PM, Nicolas Pitre wrote: > > On Wed, 16 Apr 2014, Christopher Covington wrote: > > >> Thank you for the suggestion. This approach also came to mind, but it would > >> require new documentation a

Re: [Qemu-devel] Change of TEXT_OFFSET for multi_v7_defconfig

2014-04-16 Thread Nicolas Pitre
On Wed, 16 Apr 2014, Christopher Covington wrote: > On 04/16/2014 03:14 PM, Nicolas Pitre wrote: > > On Wed, 16 Apr 2014, Christopher Covington wrote: > > > >> It seems to me that if external/uncompressed image loaders could query the > >> text offset in a

Re: [Qemu-devel] Change of TEXT_OFFSET for multi_v7_defconfig

2014-04-16 Thread Nicolas Pitre
On Wed, 16 Apr 2014, Christopher Covington wrote: > On 04/15/2014 06:44 AM, Daniel Thompson wrote: > > Hi Folks > > > > I've just been rebasing some of my development branches against v3.15rc1 > > and observed some boot regressions due to TEXT_OFFSET changing from > > 0x8000 to 0x208000. > > > >