Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Nov 2019 15:15:40 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <roger.pau@citrix.com>
Cc:        freebsd-xen@FreeBSD.org
Subject:   Re: Xen (HVM) and NMI
Message-ID:  <760f4fe2-8a5b-87a7-f84f-f250bb4eb31c@FreeBSD.org>
In-Reply-To: <20191108095754.GV14005@Air-de-Roger>
References:  <e543673e-d55f-af0d-5aed-b00ad75de7cc@FreeBSD.org> <62c12d1e-658c-93fc-fad8-3d97d45b4dd1@FreeBSD.org> <a95f4a92-dc5f-35e2-9f81-b26c2b3d0369@FreeBSD.org> <20191108095754.GV14005@Air-de-Roger>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/11/2019 11:57, Roger Pau Monné wrote:
> On Fri, Nov 08, 2019 at 10:19:01AM +0200, Andriy Gapon wrote:
>>> I found this in Linux code:
>>>     HYPERVISOR_vcpu_op(VCPUOP_send_nmi, xen_vcpu_nr(cpu), NULL);
>>> It's in xen_send_IPI_one().
>>> I wonder if that's that or if there is more to this than meets the eye.
> 
> Yes, something along this lines should work, we could even use the
> native NMI signaling using the local APIC, but the hypercall shortcut
> should be faster in most cases.
> 
>> I also found this in an old post.
>> Ian Campbell wrote:
>>> You need to register a callback with CALLBACKOP_register
>>> CALLBACKTYPE_nmi. You also need to write the code in entry.S to receive
>>> that callback. IIRC you also need to arrange that returning from an NMI
>>> is always done with HYPERVISOR_iret and not optimised to a direct iret
>>> as it can be otherwise. This is to allow the hypervisor to implement NMI
>>> masking correctly.
> 
> That's AFAIK for PV guests which use a completely different mechanism
> in order to receive interrupts. None of this is needed for FreeBSD
> because there's no classic PV support.

Perhaps HYPERVISOR_iret is still needed even for us?
This is said with zero knowledge of the topic.

> Can you try the patch below?

I tried it and, unfortunately, it was not a success.  And I don't have much
diagnostic.
My test was:
- run a busy process, I used dd if=/dev/random of=/dev/null bs=16k
- run procstat -kk on that process
After this the test system locked up hard and I could not get anything out of
it.  It being an EC2 instance did not help either.
Unfortunately, I do not have any local Xen deployment.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?760f4fe2-8a5b-87a7-f84f-f250bb4eb31c>