On 15.02.2016 09:54, Andrew Jones wrote: > On Mon, Feb 15, 2016 at 10:29:54AM +1100, David Gibson wrote: >> On Sat, Feb 13, 2016 at 05:28:24PM +0100, Andrew Jones wrote: >>> +bool hcall_have_broken_sc1(void) >>> +{ >>> + register unsigned long r3 asm("r3") = H_SET_DABR; >>> + register unsigned long r4 asm("r4") = 0; >>> + >>> + asm volatile("sc 1" >>> + : "=r" (r3) >>> + : "r" (r3), "r" (r4) >>> + : "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); >>> + >>> + return !(r3 == H_SUCCESS || r3 == (unsigned long)H_HARDWARE); >> >> It might be safer to explicitly check for H_PRIVILEGE, which is what >> you'll get in the case of a broken sc 1 under nested virtualization. >> That way you won't get false positives if H_SET_DABR ever gets any new >> error codes it can return. > > Will do. Thanks. Should we consider a SLOF patch too? (As I stole this > condition from there, see check_broken_sc1 in lib/libhvcall/brokensc1.c) Yes, I think it should be fixed there, too. Thomas -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html