qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

ppc: use DIV_ROUND_UP

I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extra

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Richard Henderson <rth@twiddle.net>

+2 -2
+1 -1
target/ppc/mem_helper.c
··· 111 111 uint32_t ra, uint32_t rb) 112 112 { 113 113 if (likely(xer_bc != 0)) { 114 - int num_used_regs = (xer_bc + 3) / 4; 114 + int num_used_regs = DIV_ROUND_UP(xer_bc, 4); 115 115 if (unlikely((ra != 0 && lsw_reg_in_range(reg, num_used_regs, ra)) || 116 116 lsw_reg_in_range(reg, num_used_regs, rb))) { 117 117 raise_exception_err_ra(env, POWERPC_EXCP_PROGRAM,
+1 -1
target/ppc/translate.c
··· 2880 2880 } 2881 2881 if (nb == 0) 2882 2882 nb = 32; 2883 - nr = (nb + 3) / 4; 2883 + nr = DIV_ROUND_UP(nb, 4); 2884 2884 if (unlikely(lsw_reg_in_range(start, nr, ra))) { 2885 2885 gen_inval_exception(ctx, POWERPC_EXCP_INVAL_LSWX); 2886 2886 return;