On 4 May 2018 at 18:15, Peter Maydell <peter.mayd...@linaro.org> wrote: > From: Eric Auger <eric.au...@redhat.com> > > This patch implements the page table walk for VMSAv8-64.
Hi Eric; > + * get_block_pte_address - return block descriptor output address and block > size > + * ARM ARM Figure D4-16 VMSAv8-64 level0, level1, and level 2 descriptor > formats > + */ > +static inline hwaddr get_block_pte_address(uint64_t pte, int level, > + int granule_sz, uint64_t *bsz) > +{ > + int n = (granule_sz - 3) * (4 - level) + 3; > + > + *bsz = 1 << n; Coverity (CID 1391010) points out that this can overflow if n > 31, because it's only doing 32-bit arithmetic. I think this is possible for some page table formats, so using "1ULL" rather than "1" should make coverity happy. Incidentally, isn't int n = (granule_sz - 3) * (4 - level) + 3; equivalent to int n = level_shift(level, granule_sz); ? > + return PTE_ADDRESS(pte, n); > +} thanks -- PMM