From 724fc2e33fc7540daae83f04c4afe43ffc15e3b6 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 19 Aug 2008 19:45:27 +0100 Subject: [PATCH] x86 hvm: Another clarifying comment in the HVM address translation emulation. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/emulate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index 60a815c7e5..bb62155317 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -311,6 +311,10 @@ static int hvmemul_virtual_to_linear( if ( (hvmemul_ctxt->ctxt.regs->eflags & X86_EFLAGS_DF) && (*reps > 1) ) { + /* + * x86_emulate() clips the repetition count to ensure we don't wrap + * the effective-address index register. Hence this assertion holds. + */ ASSERT(offset >= ((*reps - 1) * bytes_per_rep)); okay = hvm_virtual_to_linear_addr( seg, reg, offset - (*reps - 1) * bytes_per_rep, -- 2.30.2