From: Keir Fraser Date: Tue, 19 Aug 2008 18:45:27 +0000 (+0100) Subject: x86 hvm: Another clarifying comment in the HVM address translation emulation. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14140 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=724fc2e33fc7540daae83f04c4afe43ffc15e3b6;p=xen.git x86 hvm: Another clarifying comment in the HVM address translation emulation. Signed-off-by: Keir Fraser --- 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,