All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash()
@ 2018-08-01 12:07 Andrew Cooper
  2018-08-01 12:12 ` Razvan Cojocaru
  2018-08-02  7:14 ` Tian, Kevin
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Cooper @ 2018-08-01 12:07 UTC (permalink / raw)
  To: Xen-devel
  Cc: Kevin Tian, Tamas K Lengyel, Jan Beulich, Razvan Cojocaru,
	Andrew Cooper, Jun Nakajima

If the EPTP pointer can't be located in the altp2m list, the domain
is (legitimately) crashed.

Under those circumstances, execution will continue and guarentee to hit the
BUG_ON(idx >= MAX_ALTP2M) (unfortunately, just out of context).

Return from vmx_vmexit_handler() after the domain_crash(), which also has the
side effect of reentering the scheduler more promptly.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Jun Nakajima <jun.nakajima@intel.com>
CC: Kevin Tian <kevin.tian@intel.com>
CC: Razvan Cojocaru <rcojocaru@bitdefender.com>
CC: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bcf95f9..257efbe 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3666,6 +3666,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             {
                 gdprintk(XENLOG_ERR, "EPTP not found in alternate p2m list\n");
                 domain_crash(v->domain);
+
+                return;
             }
         }
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash()
  2018-08-01 12:07 [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash() Andrew Cooper
@ 2018-08-01 12:12 ` Razvan Cojocaru
  2018-08-02  7:14 ` Tian, Kevin
  1 sibling, 0 replies; 3+ messages in thread
From: Razvan Cojocaru @ 2018-08-01 12:12 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel
  Cc: Kevin Tian, Tamas K Lengyel, Jun Nakajima, Jan Beulich

On 08/01/2018 03:07 PM, Andrew Cooper wrote:
> If the EPTP pointer can't be located in the altp2m list, the domain
> is (legitimately) crashed.
> 
> Under those circumstances, execution will continue and guarentee to hit the
> BUG_ON(idx >= MAX_ALTP2M) (unfortunately, just out of context).
> 
> Return from vmx_vmexit_handler() after the domain_crash(), which also has the
> side effect of reentering the scheduler more promptly.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Razvan Cojocaru <rcojocaru@bitdefender.com>


Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash()
  2018-08-01 12:07 [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash() Andrew Cooper
  2018-08-01 12:12 ` Razvan Cojocaru
@ 2018-08-02  7:14 ` Tian, Kevin
  1 sibling, 0 replies; 3+ messages in thread
From: Tian, Kevin @ 2018-08-02  7:14 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel
  Cc: Tamas K Lengyel, Nakajima, Jun, Jan Beulich, Razvan Cojocaru

> From: Andrew Cooper [mailto:andrew.cooper3@citrix.com]
> Sent: Wednesday, August 1, 2018 8:08 PM
> 
> If the EPTP pointer can't be located in the altp2m list, the domain
> is (legitimately) crashed.
> 
> Under those circumstances, execution will continue and guarentee to hit
> the
> BUG_ON(idx >= MAX_ALTP2M) (unfortunately, just out of context).
> 
> Return from vmx_vmexit_handler() after the domain_crash(), which also
> has the
> side effect of reentering the scheduler more promptly.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Kevin Tian <kevin.tian@intel.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-02  7:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 12:07 [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash() Andrew Cooper
2018-08-01 12:12 ` Razvan Cojocaru
2018-08-02  7:14 ` Tian, Kevin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.