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

Re: NMI watchdog: BUG: soft lockup



From: James Clarke <jrtc27@jrtc27.com>
Date: Tue, 25 Oct 2016 18:09:12 +0100

>> On 25 Oct 2016, at 18:04, David Miller <davem@davemloft.net> wrote:
>> 
>> From: James Clarke <jrtc27@jrtc27.com>
>> Date: Tue, 25 Oct 2016 16:59:04 +0100
>> 
>>> Thatʼs basically the same as my patch, except this potentially flushes things
>>> outside [start, end) if theyʼre not on 2^22-byte boundaries.
>> 
>> Oh yes, I see, thanks for pointing that out.
>> 
>> We have to take the index into account for the purposes of virtual
>> address comparison.
> 
> I donʼt quite follow what youʼre trying to say here? idx is only used to index the TSB.

It is also how bits "13-21" of the virtual address are matched.

Think about what happens when a TSB entry is looked up.

Since, by virtue being in TSB entry with index X the virtual address
bits 13-21 are implied, they don't need to be stored in the tag.

So the full virtual address comparison is something like:

	unsigned long compare = (tag >> 22) << 22; /* Clear CONTEXT bits */

	compare |= (tsb_index & (nentries - 1)) << 13;

	if (vaddr == compare)
		goto match;

The swapper TSB only stores PAGE_SIZE translations.

Reply to: