|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v7 2/4] x86/hvm: Treat non-instruction fetch nested page faults also as read violations
On 08/19/2014 06:39 AM, Tamas K Lengyel wrote: As pointed out by Jan Beulich in http://lists.xen.org/archives/html/xen-devel/2014-08/msg01269.html: "Read-modify-write instructions absolutely need to be treated as read accesses, yet hardware doesn't guarantee to tell us so (they may surface as just write accesses)." This patch addresses the issue in both the VMX and the SVM side. VMX: Treat all write data access violations also as read violations (in addition to those that were already reported as read violations). SVM: Refine the meaning of read data access violations to distinguish between read/write and instruction fetch access violations. With this patch both VMX and SVM specific nested page fault handling code reports violations the same way, thus abstracting the hardware specific behaviour from the layers above. Suggested-by: Jan Beulich <JBeulich@xxxxxxxx> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxxxxx> --- v7: - Add comment blocks describing the rationale behind the specific handling of violations. - Tweak the logic in the VMX code to better match the description in the manual. --- xen/arch/x86/hvm/svm/svm.c | 5 ++++- xen/arch/x86/hvm/vmx/vmx.c | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 1f72e19..880e2d5 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1403,8 +1403,11 @@ static void svm_do_nested_pgfault(struct vcpu *v, p2m_access_t p2ma; struct p2m_domain *p2m = NULL;+ /* While the hardware doesn't explicitely provide a read access bit+ * we deduce it from the instruction fetch bit, thus marking only + * read and/or write accesses as read accesses. */ This doesn't conform to Xen coding style and since this means you will need to resend this anyway ;-( I'd suggest something along the lines of /* * Since HW doesn't explicitly provide a read access bit and we need to * somehow describe read-modify-write instructions we will conservatively* set read_access for all memory accesses that are not instruction fetches.
*/
Since I will not be available after today until September and I assume Jan
will want an ack from SVM side for the series here is my
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
assuming the text above is updated to Jan's liking.
-boris
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |