Skip to content

Commit 2e6ae66

Browse files
committed
Merge remote-tracking branch 'mjt/trivial-patches' into staging
# By Stefan Weil (8) and others # Via Michael Tokarev * mjt/trivial-patches: tests/.gitignore: ignore test-throttle exec: Fix broken build for MinGW (regression) kvm: Fix compiler warning (clang) tcg-sparc: Fix parenthesis warning Makefile: Remove some more files when cleaning target-i386: Fix segment cache dump iov: avoid "orig_len may be used unitialized" warning vscclient: remove unnecessary use of uninitialized variable trace-events: Clean up with scripts/cleanup-trace-events.pl again tci: Fix qemu-alpha on 32 bit hosts (wrong assertions) *-user: Improve documentation for lock_user function MAINTAINERS: Add missing entry to filelist for TCI target translate-all: Fix formatting of dump output *-user: Fix typo in comment (ulocking -> unlocking) docs: Fix IO port number for CPU present bitmap. q35: Fix typo in constant DEFUALT -> DEFAULT. configure: Undefine _FORTIFY_SOURCE prior using it Message-id: [email protected]
2 parents 3e4be9c + 7a1c0d2 commit 2e6ae66

File tree

18 files changed

+31
-38
lines changed

18 files changed

+31
-38
lines changed

MAINTAINERS

+1
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ TCI target
848848
M: Stefan Weil <[email protected]>
849849
S: Maintained
850850
F: tcg/tci/
851+
F: tci.c
851852

852853
Stable branches
853854
---------------

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ clean:
236236
find . -name '*.[oda]' -type f -exec rm -f {} +
237237
find . -name '*.l[oa]' -type f -exec rm -f {} +
238238
rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
239-
rm -Rf .libs
239+
rm -f fsdev/*.pod
240+
rm -rf .libs */.libs
240241
rm -f qemu-img-cmds.h
241242
@# May not be present in GENERATED_HEADERS
242243
rm -f trace/generated-tracers-dtrace.dtrace*
@@ -261,6 +262,7 @@ qemu-%.tar.bz2:
261262
distclean: clean
262263
rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
263264
rm -f config-all-devices.mak config-all-disas.mak
265+
rm -f po/*.mo
264266
rm -f roms/seabios/config.mak roms/vgabios/config.mak
265267
rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
266268
rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys

bsd-user/qemu.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ abi_long copy_from_user(void *hptr, abi_ulong gaddr, size_t len);
323323
abi_long copy_to_user(abi_ulong gaddr, void *hptr, size_t len);
324324

325325
/* Functions for accessing guest memory. The tget and tput functions
326-
read/write single values, byteswapping as necessary. The lock_user
326+
read/write single values, byteswapping as necessary. The lock_user function
327327
gets a pointer to a contiguous area of guest memory, but does not perform
328-
and byteswapping. lock_user may return either a pointer to the guest
328+
any byteswapping. lock_user may return either a pointer to the guest
329329
memory, or a temporary buffer. */
330330

331331
/* Lock an area of guest memory into the host. If copy is true then the
@@ -381,7 +381,7 @@ static inline void *lock_user_string(abi_ulong guest_addr)
381381
return lock_user(VERIFY_READ, guest_addr, (long)(len + 1), 1);
382382
}
383383

384-
/* Helper macros for locking/ulocking a target struct. */
384+
/* Helper macros for locking/unlocking a target struct. */
385385
#define lock_user_struct(type, host_ptr, guest_addr, copy) \
386386
(host_ptr = lock_user(type, guest_addr, sizeof(*host_ptr), copy))
387387
#define unlock_user_struct(host_ptr, guest_addr, copy) \

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -3515,7 +3515,7 @@ if test "$gcov" = "yes" ; then
35153515
CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
35163516
LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
35173517
elif test "$debug" = "no" ; then
3518-
CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
3518+
CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
35193519
fi
35203520

35213521

docs/specs/acpi_cpu_hotplug.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ACPI GPE block (IO ports 0xafe0-0xafe3, byte access):
1010
Generic ACPI GPE block. Bit 2 (GPE.2) used to notify CPU
1111
hot-add/remove event to ACPI BIOS, via SCI interrupt.
1212

13-
CPU present bitmap (IO port 0xaf00-0xae1f, 1-byte access):
13+
CPU present bitmap (IO port 0xaf00-0xaf1f, 1-byte access):
1414
---------------------------------------------------------------
1515
One bit per CPU. Bit position reflects corresponding CPU APIC ID.
1616
Read-only.

exec.c

+2
Original file line numberDiff line numberDiff line change
@@ -1230,9 +1230,11 @@ void qemu_ram_free(ram_addr_t addr)
12301230
;
12311231
} else if (xen_enabled()) {
12321232
xen_invalidate_map_cache_entry(block->host);
1233+
#ifndef _WIN32
12331234
} else if (block->fd >= 0) {
12341235
munmap(block->host, block->length);
12351236
close(block->fd);
1237+
#endif
12361238
} else {
12371239
qemu_anon_ram_free(block->host, block->length);
12381240
}

hw/i386/kvm/clock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static void kvmclock_vm_state_change(void *opaque, int running,
3939
RunState state)
4040
{
4141
KVMClockState *s = opaque;
42-
CPUState *cpu = first_cpu;
42+
CPUState *cpu;
4343
int cap_clock_ctrl = kvm_check_extension(kvm_state, KVM_CAP_KVMCLOCK_CTRL);
4444
int ret;
4545

hw/pci-host/q35.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static void mch_class_init(ObjectClass *klass, void *data)
372372
dc->vmsd = &vmstate_mch;
373373
k->vendor_id = PCI_VENDOR_ID_INTEL;
374374
k->device_id = PCI_DEVICE_ID_INTEL_Q35_MCH;
375-
k->revision = MCH_HOST_BRIDGE_REVISION_DEFUALT;
375+
k->revision = MCH_HOST_BRIDGE_REVISION_DEFAULT;
376376
k->class_id = PCI_CLASS_BRIDGE_HOST;
377377
}
378378

include/hw/pci-host/q35.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ typedef struct Q35PCIHost {
8585
#define MCH_HOST_BRIDGE_CONFIG_DATA 0xcfc
8686

8787
/* D0:F0 configuration space */
88-
#define MCH_HOST_BRIDGE_REVISION_DEFUALT 0x0
88+
#define MCH_HOST_BRIDGE_REVISION_DEFAULT 0x0
8989

9090
#define MCH_HOST_BRIDGE_PCIEXBAR 0x60 /* 64bit register */
9191
#define MCH_HOST_BRIDGE_PCIEXBAR_SIZE 8 /* 64bit register */

libcacard/vscclient.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ main(
645645
GIOChannel *channel_stdin;
646646
char *qemu_host;
647647
char *qemu_port;
648-
VSCMsgHeader mhHeader;
649648

650649
VCardEmulOptions *command_line_options = NULL;
651650

@@ -754,7 +753,7 @@ main(
754753
.magic = VSCARD_MAGIC,
755754
.capabilities = {0}
756755
};
757-
send_msg(VSC_Init, mhHeader.reader_id, &init, sizeof(init));
756+
send_msg(VSC_Init, 0, &init, sizeof(init));
758757

759758
g_main_loop_run(loop);
760759
g_main_loop_unref(loop);

linux-user/qemu.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ abi_long copy_from_user(void *hptr, abi_ulong gaddr, size_t len);
380380
abi_long copy_to_user(abi_ulong gaddr, void *hptr, size_t len);
381381

382382
/* Functions for accessing guest memory. The tget and tput functions
383-
read/write single values, byteswapping as necessary. The lock_user
383+
read/write single values, byteswapping as necessary. The lock_user function
384384
gets a pointer to a contiguous area of guest memory, but does not perform
385-
and byteswapping. lock_user may return either a pointer to the guest
385+
any byteswapping. lock_user may return either a pointer to the guest
386386
memory, or a temporary buffer. */
387387

388388
/* Lock an area of guest memory into the host. If copy is true then the
@@ -438,7 +438,7 @@ static inline void *lock_user_string(abi_ulong guest_addr)
438438
return lock_user(VERIFY_READ, guest_addr, (long)(len + 1), 1);
439439
}
440440

441-
/* Helper macros for locking/ulocking a target struct. */
441+
/* Helper macros for locking/unlocking a target struct. */
442442
#define lock_user_struct(type, host_ptr, guest_addr, copy) \
443443
(host_ptr = lock_user(type, guest_addr, sizeof(*host_ptr), copy))
444444
#define unlock_user_struct(host_ptr, guest_addr, copy) \

target-i386/helper.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ cpu_x86_dump_seg_cache(CPUX86State *env, FILE *f, fprintf_function cpu_fprintf,
147147
cpu_fprintf(f, " [%c%c", (sc->flags & DESC_C_MASK) ? 'C' : '-',
148148
(sc->flags & DESC_R_MASK) ? 'R' : '-');
149149
} else {
150-
cpu_fprintf(f, (sc->flags & DESC_B_MASK) ? "DS " : "DS16");
150+
cpu_fprintf(f,
151+
(sc->flags & DESC_B_MASK || env->hflags & HF_LMA_MASK)
152+
? "DS " : "DS16");
151153
cpu_fprintf(f, " [%c%c", (sc->flags & DESC_E_MASK) ? 'E' : '-',
152154
(sc->flags & DESC_W_MASK) ? 'W' : '-');
153155
}

tcg/sparc/tcg-target.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ typedef enum {
153153
static inline void flush_icache_range(uintptr_t start, uintptr_t stop)
154154
{
155155
uintptr_t p;
156-
for (p = start & -8; p < (stop + 7) & -8; p += 8) {
156+
for (p = start & -8; p < ((stop + 7) & -8); p += 8) {
157157
__asm__ __volatile__("flush\t%0" : : "r" (p));
158158
}
159159
}

tci.c

-12
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
10851085
tmp8 = helper_ldb_mmu(env, taddr, tci_read_i(&tb_ptr));
10861086
#else
10871087
host_addr = (tcg_target_ulong)taddr;
1088-
assert(taddr == host_addr);
10891088
tmp8 = *(uint8_t *)(host_addr + GUEST_BASE);
10901089
#endif
10911090
tci_write_reg8(t0, tmp8);
@@ -1097,7 +1096,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
10971096
tmp8 = helper_ldb_mmu(env, taddr, tci_read_i(&tb_ptr));
10981097
#else
10991098
host_addr = (tcg_target_ulong)taddr;
1100-
assert(taddr == host_addr);
11011099
tmp8 = *(uint8_t *)(host_addr + GUEST_BASE);
11021100
#endif
11031101
tci_write_reg8s(t0, tmp8);
@@ -1109,7 +1107,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11091107
tmp16 = helper_ldw_mmu(env, taddr, tci_read_i(&tb_ptr));
11101108
#else
11111109
host_addr = (tcg_target_ulong)taddr;
1112-
assert(taddr == host_addr);
11131110
tmp16 = tswap16(*(uint16_t *)(host_addr + GUEST_BASE));
11141111
#endif
11151112
tci_write_reg16(t0, tmp16);
@@ -1121,7 +1118,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11211118
tmp16 = helper_ldw_mmu(env, taddr, tci_read_i(&tb_ptr));
11221119
#else
11231120
host_addr = (tcg_target_ulong)taddr;
1124-
assert(taddr == host_addr);
11251121
tmp16 = tswap16(*(uint16_t *)(host_addr + GUEST_BASE));
11261122
#endif
11271123
tci_write_reg16s(t0, tmp16);
@@ -1134,7 +1130,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11341130
tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr));
11351131
#else
11361132
host_addr = (tcg_target_ulong)taddr;
1137-
assert(taddr == host_addr);
11381133
tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE));
11391134
#endif
11401135
tci_write_reg32(t0, tmp32);
@@ -1146,7 +1141,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11461141
tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr));
11471142
#else
11481143
host_addr = (tcg_target_ulong)taddr;
1149-
assert(taddr == host_addr);
11501144
tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE));
11511145
#endif
11521146
tci_write_reg32s(t0, tmp32);
@@ -1159,7 +1153,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11591153
tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr));
11601154
#else
11611155
host_addr = (tcg_target_ulong)taddr;
1162-
assert(taddr == host_addr);
11631156
tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE));
11641157
#endif
11651158
tci_write_reg32(t0, tmp32);
@@ -1174,7 +1167,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11741167
tmp64 = helper_ldq_mmu(env, taddr, tci_read_i(&tb_ptr));
11751168
#else
11761169
host_addr = (tcg_target_ulong)taddr;
1177-
assert(taddr == host_addr);
11781170
tmp64 = tswap64(*(uint64_t *)(host_addr + GUEST_BASE));
11791171
#endif
11801172
tci_write_reg(t0, tmp64);
@@ -1190,7 +1182,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
11901182
helper_stb_mmu(env, taddr, t0, t2);
11911183
#else
11921184
host_addr = (tcg_target_ulong)taddr;
1193-
assert(taddr == host_addr);
11941185
*(uint8_t *)(host_addr + GUEST_BASE) = t0;
11951186
#endif
11961187
break;
@@ -1202,7 +1193,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
12021193
helper_stw_mmu(env, taddr, t0, t2);
12031194
#else
12041195
host_addr = (tcg_target_ulong)taddr;
1205-
assert(taddr == host_addr);
12061196
*(uint16_t *)(host_addr + GUEST_BASE) = tswap16(t0);
12071197
#endif
12081198
break;
@@ -1214,7 +1204,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
12141204
helper_stl_mmu(env, taddr, t0, t2);
12151205
#else
12161206
host_addr = (tcg_target_ulong)taddr;
1217-
assert(taddr == host_addr);
12181207
*(uint32_t *)(host_addr + GUEST_BASE) = tswap32(t0);
12191208
#endif
12201209
break;
@@ -1226,7 +1215,6 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
12261215
helper_stq_mmu(env, taddr, tmp64, t2);
12271216
#else
12281217
host_addr = (tcg_target_ulong)taddr;
1229-
assert(taddr == host_addr);
12301218
*(uint64_t *)(host_addr + GUEST_BASE) = tswap64(tmp64);
12311219
#endif
12321220
break;

tests/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ check-qjson
55
check-qlist
66
check-qstring
77
test-aio
8+
test-throttle
89
test-cutils
910
test-hbitmap
1011
test-iov

trace-events

+1-2
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,6 @@ qemu_spice_wakeup(uint32_t qid) "%d"
11091109
qemu_spice_create_update(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) "lr %d -> %d, tb -> %d -> %d"
11101110

11111111
# hw/display/qxl-render.c
1112-
qxl_render_blit_guest_primary_initialized(void) ""
11131112
qxl_render_blit(int32_t stride, int32_t left, int32_t right, int32_t top, int32_t bottom) "stride=%d [%d, %d, %d, %d]"
11141113
qxl_render_guest_primary_resized(int32_t width, int32_t height, int32_t stride, int32_t bytes_pp, int32_t bits_pp) "%dx%d, stride %d, bpp %d, depth %d"
11151114
qxl_render_update_area_done(void *cookie) "%p"
@@ -1122,7 +1121,7 @@ spapr_pci_rtas_ibm_query_interrupt_source_number(unsigned ioa, unsigned intr) "q
11221121
spapr_pci_msi_write(uint64_t addr, uint64_t data, uint32_t dt_irq) "@%"PRIx64"<=%"PRIx64" IRQ %u"
11231122
spapr_pci_lsi_set(const char *busname, int pin, uint32_t irq) "%s PIN%d IRQ %u"
11241123

1125-
# hw/ppc/xics.c
1124+
# hw/intc/xics.c
11261125
xics_icp_check_ipi(int server, uint8_t mfrr) "CPU %d can take IPI mfrr=%#x"
11271126
xics_icp_accept(uint32_t old_xirr, uint32_t new_xirr) "icp_accept: XIRR %#"PRIx32"->%#"PRIx32
11281127
xics_icp_eoi(int server, uint32_t xirr, uint32_t new_xirr) "icp_eoi: server %d given XIRR %#"PRIx32" new XIRR %#"PRIx32

translate-all.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1679,8 +1679,9 @@ static int dump_region(void *priv, abi_ulong start,
16791679
/* dump memory mappings */
16801680
void page_dump(FILE *f)
16811681
{
1682-
(void) fprintf(f, "%-8s %-8s %-8s %s\n",
1683-
"start", "end", "size", "prot");
1682+
const int length = sizeof(abi_ulong) * 2;
1683+
(void) fprintf(f, "%-*s %-*s %-*s %s\n",
1684+
length, "start", length, "end", length, "size", "prot");
16841685
walk_memory_regions(f, dump_region);
16851686
}
16861687

util/iov.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,11 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt,
181181
assert(iov[niov].iov_len > tail);
182182
orig_len = iov[niov].iov_len;
183183
iov[niov++].iov_len = tail;
184-
}
185-
186-
ret = do_send_recv(sockfd, iov, niov, do_send);
187-
188-
/* Undo the changes above before checking for errors */
189-
if (tail) {
184+
ret = do_send_recv(sockfd, iov, niov, do_send);
185+
/* Undo the changes above before checking for errors */
190186
iov[niov-1].iov_len = orig_len;
187+
} else {
188+
ret = do_send_recv(sockfd, iov, niov, do_send);
191189
}
192190
if (offset) {
193191
iov[0].iov_base -= offset;

0 commit comments

Comments
 (0)