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

Re: [PATCH] x86/svm: retry after unhandled NPT fault if gfn was marked for recalculation

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
  • Date: Fri, 22 May 2020 01:26:10 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: andrew.cooper3@xxxxxxxxxx, wl@xxxxxxx, jbeulich@xxxxxxxx, roger.pau@xxxxxxxxxx
  • Delivery-date: Fri, 22 May 2020 00:26:47 +0000
  • Ironport-sdr: rLk77qZTgtHcHA50Wf4zZehurxawrcI6a+T+LPFa5uROfHZGX4LZDRs4/5HRvGzPR6X96cNiIB ZaS5P2oikfTuTJ9kCDWjqB4c5kgU3VsowI6rqyykgDGHJDTRCsAVc3QCB7h+jcXX1/2tiVDMBl DdF4CtnefIWdzz6EomrC+OzstG6AHT1fNAZlhAXWfN04tzkFKt2LW+BbKNCz9/kwU6XPSJUeML Us1Q7/Novv8jgX9eCErCEbSpwuIBdXVTp0ksm/tzIXt4rNJ+66K7QcI4q9CFrTw27+gc3/fntI p0E=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21/05/2020 22:43, Igor Druzhinin wrote:
> If a recalculation NPT fault hasn't been handled explicitly in
> hvm_hap_nested_page_fault() then it's potentially safe to retry -
> US bit has been re-instated in PTE and any real fault would be correctly
> re-raised next time.
> This covers a specific case of migration with vGPU assigned on AMD:
> global log-dirty is enabled and causes immediate recalculation NPT
> fault in MMIO area upon access. This type of fault isn't described
> explicitly in hvm_hap_nested_page_fault (this isn't called on
> EPT misconfig exit on Intel) which results in domain crash.
> Signed-off-by: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
> ---

Alternatively, I can re-raise the fault immediately after recalculation is
done which is less efficient (will take one more VMEXIT) but safer IMO -
hvm_hap_nested_page_fault might potentially leave VM in inconsistent state
in case of a real failure and cause second page fault to conceal it.

Another alternative is to inject fall_through bool into 
to give it the idea of expected behavior in that case and avoid guessing in SVM
code. I think that's an improvement over suggestion in v1 and a candidate for 




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.