>>> On 17.08.18 at 17:12, <wei.l...@citrix.com> wrote: > --- a/xen/arch/x86/mm/shadow/multi.c > +++ b/xen/arch/x86/mm/shadow/multi.c > @@ -2926,18 +2926,25 @@ static int sh_page_fault(struct vcpu *v, > } > else > { > +#if CONFIG_HVM > /* Magic MMIO marker: extract gfn for MMIO address */ > ASSERT(sh_l1e_is_mmio(sl1e)); > + ASSERT(is_hvm_vcpu(v)); > gpa = (((paddr_t)(gfn_x(sh_l1e_mmio_get_gfn(sl1e)))) > << PAGE_SHIFT) > | (va & ~PAGE_MASK); > + perfc_incr(shadow_fault_fast_mmio); > + SHADOW_PRINTK("fast path mmio %#"PRIpaddr"\n", gpa); > + sh_reset_early_unshadow(v); > + trace_shadow_gen(TRC_SHADOW_FAST_MMIO, va); > + return handle_mmio_with_translation(va, gpa >> PAGE_SHIFT, > + access) > + ? EXCRET_fault_fixed : 0; > +#else > + /* When HVM is not enabled, there shouldn't be MMIO marker */ > + BUG(); > +#endif > } > - perfc_incr(shadow_fault_fast_mmio); > - SHADOW_PRINTK("fast path mmio %#"PRIpaddr"\n", gpa); > - sh_reset_early_unshadow(v); > - trace_shadow_gen(TRC_SHADOW_FAST_MMIO, va); > - return (handle_mmio_with_translation(va, gpa >> PAGE_SHIFT, > access) > - ? EXCRET_fault_fixed : 0); > }
Actually, while I'm not the maintainer of this code, instead of moving the code up and increasing indentation, would you mind dropping the pointless "else" (and decrease indentation of the code in its body)? Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel