Skip to contentSkip to conversation

Internal error: Oops - BUG() / kvm boot race - arm64 kpti patchset related

DISCUSSION Paolo Pisati 5 participants 10 messages Feb 28, 2018

lore
Share & tools
lore
#0 lore raw

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

I bisected it down to this interval in linux-4.14.y:

2feb36e arm64: kpti: Add ->enable callback to remap swapper using nG mappings ee28fed arm64: mm: Permit transitioning from Global to Non-Global without BBM 6928820 arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0() c98c8c2 arm64: Turn on KPTI only on CPUs that need it

c98c8c2 is good, 2feb36e is bad - couldn't bisect in between, since it didn't boot there.
And yes, when i tested 2feb36e i applied the "el1 trashing fix" mentioned here:
https://www.spinics.net/lists/arm-kernel/msg636489.html

Anything else i can do to help debug this?

Signature · 2 lines
bye,
p.
#1 lore raw
Quoted 12 lines · Paolo Pisati

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

I bisected it down to this interval in linux-4.14.y:

2feb36e arm64: kpti: Add ->enable callback to remap swapper using nG mappings ee28fed arm64: mm: Permit transitioning from Global to Non-Global without BBM 6928820 arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0() c98c8c2 arm64: Turn on KPTI only on CPUs that need it

Quoted 6 lines

c98c8c2 is good, 2feb36e is bad - couldn't bisect in between, since it didn't boot there.
And yes, when i tested 2feb36e i applied the "el1 trashing fix" mentioned here:
https://www.spinics.net/lists/arm-kernel/msg636489.html

Anything else i can do to help debug this?

First of al, v4.4.20 ?!? How on earth could that have anything to do with KPTI?

In any case, you could try whether this patch helps at all, or at least makes your bisect less inconclusive.

https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=fixes/core&id=753e8abc36b2c966caea075db0c845563c8a19bf

#3 lore raw
In reply to Paolo Pisati

Paolo,

Quoted 12 lines · Paolo Pisati

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

I bisected it down to this interval in linux-4.14.y:

2feb36e arm64: kpti: Add ->enable callback to remap swapper using nG mappings ee28fed arm64: mm: Permit transitioning from Global to Non-Global without BBM 6928820 arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0() c98c8c2 arm64: Turn on KPTI only on CPUs that need it

Quoted 6 lines

c98c8c2 is good, 2feb36e is bad - couldn't bisect in between, since it didn't boot there.
And yes, when i tested 2feb36e i applied the "el1 trashing fix" mentioned here:
https://www.spinics.net/lists/arm-kernel/msg636489.html

Anything else i can do to help debug this?

What HW are you using? Your command line? Your configuration? How are you rebooting your guest (to EFI? directly to the kernel itself?)? How comes it didn't boot between these 4 commits? Does the failure affects the host or the guest?

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#4 lore raw
Quoted 5 lines · Marc Zyngier

What HW are you using? Your command line? Your configuration? How are you rebooting your guest (to EFI? directly to the kernel itself?)? How comes it didn't boot between these 4 commits? Does the failure affects the host or the guest?

I inadvertently cut out the crash log from the original email, hope this helps:

https://launchpadlibrarian.net/358687166/submission_2018-02-26T14.58.17.996524.html#9-1-log

Signature · 2 lines
bye,
p.
#5 lore raw
In reply to Paolo Pisati
Quoted 4 lines · Paolo Pisati

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

[...]

Quoted 1 line

Anything else i can do to help debug this?

If you could share the crash log, that would be helpful.

Cheers,

Will

#6 lore raw
Quoted 11 lines · Will Deacon
Quoted 4 lines · Paolo Pisati

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

[...]

Quoted 1 line

Anything else i can do to help debug this?

If you could share the crash log, that would be helpful.

Oops log here:
https://launchpadlibrarian.net/358687166/submission_2018-02-26T14.58.17.996524.html#9-1-log

I prepared the email, then when i was about to send it out i inadvertently cut out the crash...

Signature · 2 lines
bye,
p.
#7 lore raw
Quoted 7 lines · Paolo Pisati
Quoted 6 lines · Will Deacon
Quoted 4 lines · Paolo Pisati

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

Quoted 8 lines
Quoted 5 lines

[...]

Quoted 1 line

Anything else i can do to help debug this?

If you could share the crash log, that would be helpful.

Oops log here:
https://launchpadlibrarian.net/358687166/submission_2018-02-26T14.58.17.996524.html#9-1-log

The patch that Ard linked to should resolve that particular crash. I see this is a 4.13-based kernel. Is the source tree available anywhere?

Will

#8 lore raw
Quoted 6 lines · Will Deacon
Quoted 3 lines

Oops log here:
https://launchpadlibrarian.net/358687166/submission_2018-02-26T14.58.17.996524.html#9-1-log

The patch that Ard linked to should resolve that particular crash. I see this is a 4.13-based kernel. Is the source tree available anywhere?

https://git.launchpad.net/~p-pisati/ubuntu/+source/linux/log/?h=artful-master-next-arm64-kpti-414-backport

I'll try that patch, thanks.

Signature · 2 lines
bye,
p.
#9 lore raw
In reply to Paolo Pisati
Quoted 7 lines · Paolo Pisati
Quoted 6 lines · Will Deacon
Quoted 4 lines · Paolo Pisati

Reproducible on 4.16-rc3 and 4.4.20 using defconfig - the failure it's intermittent, but i could reproduce it 100% if i boot loop the kvm instance (it usually shows up in less than 10 iterations but i tested 32 boots before marking it good).

Quoted 8 lines
Quoted 5 lines

[...]

Quoted 1 line

Anything else i can do to help debug this?

If you could share the crash log, that would be helpful.

Oops log here:
https://launchpadlibrarian.net/358687166/submission_2018-02-26T14.58.17.996524.html#9-1-log

In your tree, does arch/arm64/mm/mmu.c line 142 look like:

BUG_ON(!pgattr_change_is_safe(...)) ?

If so, this looks like the issue Ard fixed in:

https://lkml.kernel.org/r/20180223180448.6006-1-ard.biesheuvel at linaro.org

Thanks,
Mark.