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

Re: [Xen-devel] [PATCH v2 2/3] x86/svm: Always intercept ICEBP


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
  • Date: Tue, 26 Nov 2019 12:28:33 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gAE3YYzL3j42CRekrltPoI+WMeM4gTVIoZmqVDB011k=; b=nCctaKOf1Sj1Z4AE3bKqWK6c579uSV0+K34ona5WQeMLbKpt+GP7aLyNSrMd00dRrYBVlh9yS56KMCycxaUS5i3Qf3/9E7ySS1rYQ/XRyytM38hI+utxZFbMY1VTMLkjFd/usotoPWygZ1mYPNEmaimbrFBz+4un8A/rvkZ4ttQSt9l0Yo0SADh7xgBiBEPVD+BBRK4bx+28PpqFeIzZetSaPvSPR0P+5+nmeeiIMnPXTAwEN3Krb2F7VnKHxBjWniDhLo97EdFM1gXcPvh77RKYCwEHQ4Y4OQzsxixz2727q1wvCvYWrEvCohgLUSVkAqtRhbfJCGS3vpu2URv8fg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HBU1NJRlhbdOqZ2Qwq1w7u3IUjQWhMR1vk3KbqMolWOuPKghSdfvOGKU2hkPMaO1yQjL4/8G6mCszusNcmxddVKLghosNZEjQ+SVe1lhBsDhKmppTHVPkJDiyp4S1tfdl0ARq5rvvT8ne9bs3w6LRL0w5hg8UUX2p/j5nzjJtZrszXFdHLMNN6WcAQ/ht8R9oMwSxAHtb8uCA/eneDOnJuOAWjZ9xsFHzpSO9VepbDsXYTdW0z5yvKIjLPFbR4er0pEOe7xvtYAMyilX1jWyzFICGRkTh5UdYM7CHHDFpWPYQh+hHA4z6LOooMwaU0gqsOSDcZvjwatCcaIiwwSqsA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
  • Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Razvan COJOCARU <rcojocaru@xxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 26 Nov 2019 12:28:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVpFGwuhKVZu8KoU+aySaku3gYIqedYWOA
  • Thread-topic: [PATCH v2 2/3] x86/svm: Always intercept ICEBP


On 26.11.2019 14:03, Andrew Cooper wrote:
> ICEBP isn't handled well by SVM.
> 
> The VMexit state for a #DB-vectored TASK_SWITCH has %rip pointing to the
> appropriate instruction boundary (fault or trap, as appropriate), except for
> an ICEBP-induced #DB TASK_SWITCH, where %rip points at the ICEBP instruction
> rather than after it.  As ICEBP isn't distinguished in the vectoring event
> type, the state is ambiguous.
> 
> To add to the confusion, an ICEBP which occurs due to Introspection
> intercepting the instruction, or from x86_emulate() will have %rip updated as
> a consequence of partial emulation required to inject an ICEBP event in the
> first place.
> 
> We could in principle spot the non-injected case in the TASK_SWITCH handler,
> but this still results in complexity if the ICEBP instruction also has an
> Instruction Breakpoint active on it (which genuinely has fault semantics).
> 
> Unconditionally intercept ICEBP.  This does have a trap semantics for the
> intercept, and allows us to move %rip forwards appropriately before the
> TASK_SWITCH intercept is hit.  This makes the behaviour of #DB-vectored
> switches consistent however the ICEBP #DB came about, and avoids special cases
> in the TASK_SWITCH intercept.
> 
> This in turn allows for the removal of the conditional
> hvm_set_icebp_interception() logic used by the monitor subsystem, as ICEBP's
> will now always be submitted for monitoring checks.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

LGTM.

Reviewed-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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