From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiQtY-0004Na-Fj for qemu-devel@nongnu.org; Thu, 08 May 2014 12:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiQtS-0006j2-7a for qemu-devel@nongnu.org; Thu, 08 May 2014 12:10:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiQtR-0006io-VW for qemu-devel@nongnu.org; Thu, 08 May 2014 12:09:58 -0400 From: Paolo Bonzini Date: Thu, 8 May 2014 18:09:40 +0200 Message-Id: <1399565391-27833-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [RFC PATCH 00/11] Cleanup load/store functions in headers and C files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, rth@twiddle.net This series is a prerequisite for improving the SMAP emulation in qemu-system-x86_64. SMAP is a Broadwell feature and testing it in the kernel is probably the #1 reason why people are using TCG x86 nowadays. In order to implement some of the SMAP checks correctly, I need to define a new set of ld/st functions, similar to ldl_data but with a different definition of cpu_mmu_index. This series lets me do that painlessly, by simplifying the set of macros expected by softmmu_header.h. This is done by patches 2 to 4. In addition, implementation of the MMU lookups are spread across all C files. There is no reason for this, it can be done in cputlb.c directly. This is done by patches 5 to 7. CPU load/store functions are also split around multiple headers: tcg/tcg.h, softmmu_header.h, cpu-all.h, exec-all.h. This series consolidates them all in a single header, cpu_ldst.h, in patches 8 to 11. The only reason why this is RFC is that it depends on TCG backends stopping their use of helper_ld*_mmu and using instead the new "return-address aware" helpers. With this conversion done, helper_ld*_mmu are not anymore TCG-related and it makes sense to move them to cpu_ldst.h. The only backends left to convert are S390, with patches on the list, and MIPS, which should also get done for 2.1. Paolo Paolo Bonzini (11): hw: use ld_p/st_p instead of ld_raw/st_raw softmmu: start introducing SOFTMMU_CODE_ACCESS in softmmu_header.h softmmu: move MMUSUFFIX under SOFTMMU_CODE_ACCESS softmmu: move definition of CPU_MMU_INDEX to inclusion site, drop ACCESS_TYPE softmmu: move ALIGNED_ONLY to cpu.h softmmu: commonize helper definitions softmmu: move softmmu_template.h out of include/ softmmu: make do_unaligned_access extern target-arm: move arm_*_code to a separate file softmmu: introduce cpu_ldst.h softmmu: move all load/store functions to cpu_ldst.h bsd-user/qemu.h | 1 + cputlb.c | 27 +- hw/9pfs/virtio-9p-device.c | 2 +- hw/arm/nseries.c | 236 ++++++------ hw/block/virtio-blk.c | 12 +- hw/display/omap_lcd_template.h | 10 +- hw/display/sm501_template.h | 6 +- hw/display/vga_template.h | 4 +- hw/mips/mips_fulong2e.c | 28 +- hw/mips/mips_malta.c | 176 ++++----- hw/scsi/vhost-scsi.c | 4 +- hw/scsi/virtio-scsi.c | 28 +- include/exec/cpu-all.h | 119 ------ include/exec/cpu_ldst.h | 400 +++++++++++++++++++++ .../exec/{softmmu_header.h => cpu_ldst_template.h} | 32 +- include/exec/exec-all.h | 23 -- include/exec/softmmu_exec.h | 216 ----------- linux-user/qemu.h | 1 + monitor.c | 1 + .../exec/softmmu_template.h => softmmu_template.h | 2 + target-alpha/cpu.h | 4 + target-alpha/mem_helper.c | 23 +- target-alpha/translate.c | 1 + target-arm/arm_ldst.h | 48 +++ target-arm/cpu.h | 22 -- target-arm/helper.c | 1 + target-arm/op_helper.c | 17 +- target-arm/translate-a64.c | 1 + target-arm/translate.c | 1 + target-cris/helper.c | 1 + target-cris/op_helper.c | 17 +- target-cris/translate.c | 1 + target-i386/fpu_helper.c | 5 +- target-i386/mem_helper.c | 23 +- target-i386/misc_helper.c | 5 +- target-i386/seg_helper.c | 5 +- target-i386/svm_helper.c | 5 +- target-i386/translate.c | 1 + target-lm32/op_helper.c | 12 +- target-lm32/translate.c | 1 + target-m68k/op_helper.c | 17 +- target-m68k/translate.c | 1 + target-microblaze/op_helper.c | 12 +- target-microblaze/translate.c | 1 + target-mips/cpu.h | 4 + target-mips/op_helper.c | 28 +- target-mips/translate.c | 1 + target-moxie/helper.c | 16 +- target-moxie/translate.c | 1 + target-openrisc/mmu_helper.c | 15 +- target-openrisc/translate.c | 1 + target-ppc/excp_helper.c | 1 + target-ppc/mem_helper.c | 5 +- target-ppc/mmu_helper.c | 17 +- target-ppc/translate.c | 1 + target-s390x/fpu_helper.c | 5 +- target-s390x/helper.c | 1 + target-s390x/mem_helper.c | 16 +- target-s390x/misc_helper.c | 2 +- target-s390x/translate.c | 1 + target-sh4/op_helper.c | 16 +- target-sh4/translate.c | 1 + target-sparc/cpu.h | 6 + target-sparc/ldst_helper.c | 28 +- target-sparc/translate.c | 1 + target-unicore32/op_helper.c | 17 +- target-unicore32/translate.c | 1 + target-xtensa/cpu.h | 4 + target-xtensa/op_helper.c | 23 +- target-xtensa/translate.c | 1 + tcg/tcg.h | 13 - tci.c | 1 + user-exec.c | 1 + 73 files changed, 806 insertions(+), 975 deletions(-) create mode 100644 include/exec/cpu_ldst.h rename include/exec/{softmmu_header.h => cpu_ldst_template.h} (89%) delete mode 100644 include/exec/softmmu_exec.h rename include/exec/softmmu_template.h => softmmu_template.h (99%) create mode 100644 target-arm/arm_ldst.h -- 1.8.3.1