Re: [RFC][PATCH] m68k/parisc: Convert hp_sdc_rtc driver to rtc framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

Am 30.01.2019 um 21:08 schrieb Geert Uytterhoeven:

The remainder is a fix for address wrap around when there is memory located
at the end of the 32-bit address space.
That part looks OK to me, and is still applicable.

I will retest with just the last part of the patch applied.

max_addr was reduced  by one earlier in the last part, so isn't this one

  min_low_pfn = availmem >> PAGE_SHIFT;
- max_low_pfn = max_addr >> PAGE_SHIFT;
+ max_low_pfn = (max_addr >> PAGE_SHIFT) + 1;

wrong? i.e. shouldn't we use

    max_low_pfn = (max_addr+1) >> PAGE_SHIFT;

instead?

That would give 0 if max_addr = 0xffffffff, due to overflow.

Yep, figured that out right after hitting 'send'. The PFN doesn't overflow, but wouldn't calculating end addresses from max_low_pfn lead to overflow later on? It seems to me that max_low_pfn would point to the page right after max_addr i.e. beyond end of memory? Is that expected behaviour?

However, the workaround is not correct in the (unlikely) case where the
memory block size is not a multiple of PAGE_SIZE.

The only likely case would be the memory chunk containing the kernel, i.e. availmem, and that's page aligned, so no problem there...

Cheers,

	Michael


Gr{oetje,eeting}s,

                        Geert




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux