Trivial patches for 6 to 12 April 2013
The following changes since commit 93b48c201eb6c0404d15550a0eaa3c0f7937e35e:
virtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge (2013-04-09 07:47:00 -0500)
are available in the git repository at:
git://github.com/stefanha/qemu.git trivial-patches
for you to fetch changes up to 31112d6187a1e704d3c8ae817ead3a1cb1bde05a:
cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC) (2013-04-12 13:46:34 +0200)
----------------------------------------------------------------
Petar Jovanovic (1):
linux-user: pass correct host flags to eventfd2 call
Peter Maydell (3):
target-moxie: Fix VMState registration
Typo, spelling and grammatical fixes
cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC)
configure | 3 --- cpu-exec.c | 15 ++++++--------- docs/bootindex.txt | 10 +++++----- docs/ccid.txt | 2 +- hw/block/virtio-blk.c | 4 ++-- hw/intc/armv7m_nvic.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/s390x/s390-virtio.c | 2 +- hw/sd/sd.c | 4 ++-- linux-user/syscall.c | 11 ++++++++++- target-microblaze/mmu.c | 2 +- target-moxie/cpu.c | 2 +- target-moxie/cpu.h | 2 -- target-moxie/machine.c | 12 +----------- target-s390x/mem_helper.c | 8 ++++---- 15 files changed, 36 insertions(+), 45 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 1/4 target-moxie: Fix VMState registration
From: Peter Maydell <[email protected]>
Register the CPU VMState in the correct way, via cpu_class_set_vmsd(), rather than doing it in two different wrong ways (once by providing cpu_save and cpu_load functions, and once by setting the vmsd field in DeviceClass).
--- target-moxie/cpu.c | 2 +- target-moxie/cpu.h | 2 -- target-moxie/machine.c | 12 +----------- 3 files changed, 2 insertions(+), 14 deletions(-)
target-moxie/cpu.c +1 -1
@@ -97,7 +97,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = moxie_cpu_class_by_name; - dc->vmsd = &vmstate_moxie_cpu; +cpu_class_set_vmsd (cc, &vmstate_moxie_cpu); cc->do_interrupt = moxie_cpu_do_interrupt; }
target-moxie/cpu.h +0 -2
@@ -28,8 +28,6 @@#define TARGET_HAS_ICE 1 -#define CPU_SAVE_VERSION 1 -#define ELF_MACHINE 0xFEED/* EM_MOXIE */ #define MOXIE_EX_DIV0 0
target-moxie/machine.c +1 -11
@@ -3,7 +3,7 @@const VMStateDescription vmstate_moxie_cpu = { .name ="cpu" , - .version_id =CPU_SAVE_VERSION , + .version_id =1 , .minimum_version_id =1 , .minimum_version_id_old =1 , .fields = (VMStateField []) {
@@ -16,13 +16,3 @@ const VMStateDescription vmstate_moxie_cpu = { VMSTATE_END_OF_LIST() } }; - -void cpu_save (QEMUFile *f,void *opaque) -{ -vmstate_save_state (f, &vmstate_moxie_cpu, opaque); -} - -int cpu_load (QEMUFile *f,void *opaque,int version_id) -{ -return vmstate_load_state (f, &vmstate_moxie_cpu, opaque, version_id); -}
Signature · 1 line
1.8.1.4
PATCH 2/4 linux-user: pass correct host flags to eventfd2 call
In reply to Stefan HajnocziFrom: Petar Jovanovic <[email protected]>
This change makes conversion of TARGET_O_NONBLOCK and TARGET_O_CLOEXEC flags to host flags before calling eventfd for TARGET_NR_eventfd2.
--- linux-user/syscall.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
linux-user/syscall.c +10 -1
@@ -8823,8 +8823,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,#endif #if defined(TARGET_NR_eventfd2)case TARGET_NR_eventfd2: - ret =get_errno (eventfd (arg1, arg2)); + { +int host_flags = arg2 & (~(TARGET_O_NONBLOCK |TARGET_O_CLOEXEC )); +if (arg2 &TARGET_O_NONBLOCK ) { + host_flags |=O_NONBLOCK ; + } +if (arg2 &TARGET_O_CLOEXEC ) { + host_flags |=O_CLOEXEC ; + } + ret =get_errno (eventfd (arg1, host_flags));break ; + }#endif #endif /* CONFIG_EVENTFD */ #if defined(CONFIG_FALLOCATE ) && defined(TARGET_NR_fallocate)
Signature · 1 line
1.8.1.4
PATCH 3/4 Typo, spelling and grammatical fixes
In reply to Stefan HajnocziFrom: Peter Maydell <[email protected]>
Minor fixes to documentation and code comments.
--- docs/bootindex.txt | 10 +++++----- docs/ccid.txt | 2 +- hw/block/virtio-blk.c | 4 ++-- hw/intc/armv7m_nvic.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/s390x/s390-virtio.c | 2 +- hw/sd/sd.c | 4 ++-- target-microblaze/mmu.c | 2 +- target-s390x/mem_helper.c | 8 ++++---- 9 files changed, 18 insertions(+), 18 deletions(-)
docs/bootindex.txt +5 -5
@@ -9,7 +9,7 @@ still be bootable. == Example == -Lets assume we have QEMU machine with two NICs (virtio, e1000) and two +Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two disks (IDE, virtio): qemu -drive file=disk1.img,if=none,id=disk1
@@ -20,7 +20,7 @@ qemu -drive file=disk1.img,if=none,id=disk1 -netdev type=user,id=net1 -device e1000,netdev=net1,bootindex=1 Given the command above, firmware should try to boot from the e1000 NIC -first. If this fails, it should try the virtio NIC next, if this fails +first. If this fails, it should try the virtio NIC next; if this fails too, it should try the virtio disk, and then the IDE disk. == Limitations ==
@@ -28,7 +28,7 @@ too, it should try the virtio disk, and then the IDE disk. 1. Some firmware has limitations on which devices can be considered for booting. For instance, the PC BIOS boot specification allows only one disk to be bootable. If boot from disk fails for some reason, the BIOS -won't retry booting from other disk. It still can try to boot from +won't retry booting from other disk. It can still try to boot from floppy or net, though. 2. Sometimes, firmware cannot map the device path QEMU wants firmware to
@@ -36,8 +36,8 @@ boot from to a boot method. It doesn't happen for devices the firmware can natively boot from, but if firmware relies on an option ROM for booting, and the same option ROM is used for booting from more then one device, the firmware may not be able to ask the option ROM to boot from -a particular device reliably. For instance with PC BIOS, if a SCSI HBA +a particular device reliably. For instance with the PC BIOS, if a SCSI HBA has three bootable devices target1, target3, target5 connected to it, the option ROM will have a boot method for each of them, but it is not possible to map from boot method back to a specific target. This is a -shortcoming of PC BIOS boot specification. +shortcoming of the PC BIOS boot specification.
docs/ccid.txt +1 -1
@@ -24,7 +24,7 @@ information see the specification: Revision 1.1 April 22rd, 2005 -Smartcard are used for authentication, single sign on, decryption in +Smartcards are used for authentication, single sign on, decryption in public/private schemes and digital signatures. A smartcard reader on the client cannot be used on a guest with simple usb passthrough since it will then not be available on the client, possibly locking the computer when it is "removed". On
hw/block/virtio-blk.c +2 -2
@@ -494,10 +494,10 @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config) blkcfg.heads = s->conf->heads;/* * We must ensure that the block device capacity is a multiple of -* the logical block size. If that is not the case, lets use +* the logical block size. If that is not the case, let's use * sector_mask to adopt the geometry to have a correct picture. * For those devices where the capacity is ok for the given geometry -* we dont touch the sector value of the geometry, since some devices +* we don't touch the sector value of the geometry, since some devices * (like s390 dasd) need a specific value. Here the capacity is already * cyls*heads*secs*blk_size and the sector value is not block size * divided by 512 - instead it is the amount of blk_size blocks
hw/intc/armv7m_nvic.c +1 -1
@@ -172,7 +172,7 @@ static uint32_t nvic_readl(nvic_state *s, uint32_t offset)return 10000 ;case 0xd00 :/* CPUID Base. */ return cpu_single_env->cp15.c0_cpuid; -case 0xd04 :/* Interrypt Control State. */ +case 0xd04 :/* Interrupt Control State. */ /* VECTACTIVE */ val = s->gic.running_irq[0 ];if (val ==1023 ) {
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -76,7 +76,7 @@ static void ccw_init(QEMUMachineInitArgs *args) } my_ram_size = my_ram_size >> (20 + shift) << (20 + shift); -/* lets propagate the changed ram size into the global variable. */ +/* let's propagate the changed ram size into the global variable. */ ram_size = my_ram_size;/* get a BUS */
hw/s390x/s390-virtio.c +1 -1
@@ -240,7 +240,7 @@ static void s390_init(QEMUMachineInitArgs *args) } my_ram_size = my_ram_size >> (20 + shift) << (20 + shift); -/* lets propagate the changed ram size into the global variable. */ +/* let's propagate the changed ram size into the global variable. */ ram_size = my_ram_size;/* get a BUS */
hw/sd/sd.c +2 -2
@@ -308,7 +308,7 @@ static void sd_set_csd(SDState *sd, uint64_t size) sd->csd[13 ] =0x40 ; sd->csd[14 ] =0x00 ; sd->csd[15 ] =0x00 ; - sd->ocr |=1 <<30 ;/* High Capacity SD Memort Card */ + sd->ocr |=1 <<30 ;/* High Capacity SD Memory Card */ } }
@@ -1541,7 +1541,7 @@ void sd_write_data(SDState *sd, uint8_t value)case 25 :/* CMD25: WRITE_MULTIPLE_BLOCK */ if (sd->data_offset ==0 ) { -/* Start of the block - lets check the address is valid */ +/* Start of the block - let's check the address is valid */ if (sd->data_start + sd->blk_len > sd->size) { sd->card_status |=ADDRESS_ERROR ;break ;
target-microblaze/mmu.c +1 -1
@@ -114,7 +114,7 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu, tlb_ex = d &TLB_EX ; tlb_wr = d &TLB_WR ; -/* Now lets see if there is a zone that overrides the protbits. */ +/* Now let's see if there is a zone that overrides the protbits. */ tlb_zsel = (d >>4 ) &0xf ; t0 = mmu->regs[MMU_R_ZPR ] >> (30 - (tlb_zsel *2 )); t0 &=0x3 ;
target-s390x/mem_helper.c +4 -4
@@ -344,7 +344,7 @@ uint64_t HELPER(srst)(CPUS390XState *env, uint64_t r0, uint64_t end, env->retxl = str;/* Lest we fail to service interrupts in a timely manner, limit the -amount of work we're willing to do. For now, lets cap at 8k. */ +amount of work we're willing to do. For now, let's cap at 8k. */ for (len =0 ; len <0x2000 ; ++len) {if (str + len == end) {/* Character not found. R1 & R2 are unmodified. */
@@ -375,7 +375,7 @@ uint64_t HELPER(clst)(CPUS390XState *env, uint64_t c, uint64_t s1, uint64_t s2) s2 =fix_address (env, s2);/* Lest we fail to service interrupts in a timely manner, limit the -amount of work we're willing to do. For now, lets cap at 8k. */ +amount of work we're willing to do. For now, let's cap at 8k. */ for (len =0 ; len <0x2000 ; ++len) {uint8_t v1 =cpu_ldub_data (env, s1 + len);uint8_t v2 =cpu_ldub_data (env, s2 + len);
@@ -424,7 +424,7 @@ uint64_t HELPER(mvst)(CPUS390XState *env, uint64_t c, uint64_t d, uint64_t s) s =fix_address (env, s);/* Lest we fail to service interrupts in a timely manner, limit the -amount of work we're willing to do. For now, lets cap at 8k. */ +amount of work we're willing to do. For now, let's cap at 8k. */ for (len =0 ; len <0x2000 ; ++len) {uint8_t v =cpu_ldub_data (env, s + len);cpu_stb_data (env, d + len, v);
@@ -708,7 +708,7 @@ uint64_t HELPER(cksm)(CPUS390XState *env, uint64_t r1,uint64_t cksm = (uint32_t )r1;/* Lest we fail to service interrupts in a timely manner, limit the -amount of work we're willing to do. For now, lets cap at 8k. */ +amount of work we're willing to do. For now, let's cap at 8k. */ max_len = (src_len >0x2000 ?0x2000 : src_len);/* Process full words as available. */
Signature · 1 line
1.8.1.4
PATCH 4/4 cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC)
In reply to Stefan HajnocziFrom: Peter Maydell <[email protected]>
The CONFIG_DEBUG_EXEC define compiles out a single qemu_log_mask() call, which is a pretty trivial cost even for something in the main cpu_exec() loop. Having this be conditionally defined means that '-d exec' on a non-debug build will silently do nothing. Drop the define and the configure machinery that sets it, in favour of just always allowing this log option to be enabled at runtime. As a concession to the mainloopiness, we use qemu_loglevel_mask()+qemu_log() rather than qemu_log_mask() to avoid the function call overhead.
Note that DEBUG_DISAS is always defined, so removing the '|| defined(CONFIG_DEBUG_EXEC)' from those conditionals makes no behavioural change for that logging.
--- configure | 3 --- cpu-exec.c | 15 ++++++--------- 2 files changed, 6 insertions(+), 12 deletions(-)
configure +0 -3
@@ -3471,9 +3471,6 @@ echo "ARCH=$ARCH" >> $config_host_mak if test "$debug_tcg" = "yes" ; then echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak fi -if test "$debug" = "yes" ; then - echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak -fi if test "$strip_opt" = "yes" ; then echo "STRIP=${strip}" >> $config_host_mak fi
cpu-exec.c +6 -9
@@ -23,8 +23,6 @@#include "qemu/atomic.h" #include "sysemu/qtest.h" -//#define CONFIG_DEBUG_EXEC -bool qemu_cpu_has_work (CPUState *cpu) {return cpu_has_work (cpu);
@@ -567,7 +565,7 @@ int cpu_exec(CPUArchState *env) env->exception_index =EXCP_INTERRUPT ;cpu_loop_exit (env); } -#if defined(DEBUG_DISAS ) || defined(CONFIG_DEBUG_EXEC ) +#if defined(DEBUG_DISAS )if (qemu_loglevel_mask (CPU_LOG_TB_CPU )) {/* restore flags in standard format */ #if defined(TARGET_I386 )
@@ -582,7 +580,7 @@ int cpu_exec(CPUArchState *env)log_cpu_state (env,0 ); #endif } -#endif /* DEBUG_DISAS || CONFIG_DEBUG_EXEC */ +#endif /* DEBUG_DISAS */ spin_lock (&tcg_ctx.tb_ctx.tb_lock); tb =tb_find_fast (env);/* Note: we do it here to avoid a gcc bug on Mac OS X when
@@ -594,11 +592,10 @@ int cpu_exec(CPUArchState *env) next_tb =0 ; tcg_ctx.tb_ctx.tb_invalidated_flag =0 ; } -#ifdef CONFIG_DEBUG_EXEC -qemu_log_mask (CPU_LOG_EXEC ,"Trace %p [" TARGET_FMT_lx"] %s\n" , - tb->tc_ptr, tb->pc, -lookup_symbol (tb->pc)); -#endif +if (qemu_loglevel_mask (CPU_LOG_EXEC )) { +qemu_log ("Trace %p [" TARGET_FMT_lx"] %s\n" , + tb->tc_ptr, tb->pc,lookup_symbol (tb->pc)); + }/* see if we can patch the calling TB. When the TB spans two pages, we cannot safely do a direct jump. */
Signature · 1 line
1.8.1.4
Quoted 11 lines · Stefan Hajnoczi
The following changes since commit
93b48c201eb6c0404d15550a0eaa3c0f7937e35e:virtio-9p: Fix virtio-9p no longer building after hw-dirs branch merge (2013-04-09 07:47:00 -0500)
are available in the git repository at:
git://github.com/stefanha/qemu.gittrivial-patchesfor you to fetch changes up to
31112d6187a1e704d3c8ae817ead3a1cb1bde05a:cpu-exec: Allow "-d exec" in non-debug builds (drop
CONFIG_DEBUG_EXEC) (2013-04-12 13:46:34 +0200)
Andreas Färber noticed my patch script has a unicode bug and his name is broken.
I'll send a v2 and try to fix the script.
Stefan