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

typofixes - v4

Signed-off-by: Veres Lajos <vlajos@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

authored by

Veres Lajos and committed by
Michael Tokarev
67cc32eb 33b23b4b

+47 -48
+1 -1
disas/i386.c
··· 357 357 #define Rd { OP_R, d_mode } 358 358 #define Rm { OP_R, m_mode } 359 359 #define Ib { OP_I, b_mode } 360 - #define sIb { OP_sI, b_mode } /* sign extened byte */ 360 + #define sIb { OP_sI, b_mode } /* sign extended byte */ 361 361 #define Iv { OP_I, v_mode } 362 362 #define Iq { OP_I, q_mode } 363 363 #define Iv64 { OP_I64, v_mode }
+2 -2
disas/s390.c
··· 613 613 names of the instruction format that you can find in the principals 614 614 of operation. 615 615 2) the last part of the definition (y in INSTR_x_y) gives you an idea 616 - which operands the binary represenation of the instruction has. 616 + which operands the binary representation of the instruction has. 617 617 The meanings of the letters in y are: 618 618 a - access register 619 619 c - control register ··· 627 627 m - mode field, 4 bit 628 628 0 - operand skipped. 629 629 The order of the letters reflects the layout of the format in 630 - storage and not the order of the paramaters of the instructions. 630 + storage and not the order of the parameters of the instructions. 631 631 The use of the letters is not a 100% match with the PoP but it is 632 632 quite close. 633 633
+2 -2
docs/specs/ppc-spapr-hcalls.txt
··· 41 41 with MMU disabled, ie guest effective == guest physical), it only 42 42 has access to a subset of memory and no IOs. 43 43 44 - PAPR provides a set of hypervisor calls to perform cachable or 45 - non-cachable accesses to any guest physical addresses that the 44 + PAPR provides a set of hypervisor calls to perform cacheable or 45 + non-cacheable accesses to any guest physical addresses that the 46 46 guest can use in order to access IO devices while in real mode. 47 47 48 48 This is typically used by the firmware running in the guest.
+1 -1
docs/writing-qmp-commands.txt
··· 122 122 Now a little hack is needed. As we're still using the old QMP server we need 123 123 to add the new command to its internal dispatch table. This step won't be 124 124 required in the near future. Open the qmp-commands.hx file and add the 125 - following in the botton: 125 + following at the bottom: 126 126 127 127 { 128 128 .name = "hello-world",
+1 -1
hw/audio/fmopl.c
··· 1177 1177 OPLWriteReg(OPL,0x03,0); /* Timer2 */ 1178 1178 OPLWriteReg(OPL,0x04,0); /* IRQ mask clear */ 1179 1179 for(i = 0xff ; i >= 0x20 ; i-- ) OPLWriteReg(OPL,i,0); 1180 - /* reset OPerator paramater */ 1180 + /* reset operator parameter */ 1181 1181 for( c = 0 ; c < OPL->max_ch ; c++ ) 1182 1182 { 1183 1183 OPL_CH *CH = &OPL->P_CH[c];
+1 -1
hw/core/qdev.c
··· 506 506 return ret; 507 507 } 508 508 509 - /* disconnect a GPIO ouput, returning the disconnected input (if any) */ 509 + /* disconnect a GPIO output, returning the disconnected input (if any) */ 510 510 511 511 static qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev, 512 512 const char *name, int n)
+1 -1
hw/cris/axis_dev88.c
··· 138 138 s->count = 16; 139 139 140 140 if ((s->regs[0] & 0xff) == 0) { 141 - /* 25 degrees celcius. */ 141 + /* 25 degrees celsius. */ 142 142 s->shiftreg = 0x0b9f; 143 143 } else if ((s->regs[0] & 0xff) == 0xff) { 144 144 /* Sensor ID, 0x8100 LM70. */
+1 -1
hw/display/qxl-render.c
··· 159 159 /* 160 160 * use ssd.lock to protect render_update_cookie_num. 161 161 * qxl_render_update is called by io thread or vcpu thread, and the completion 162 - * callbacks are called by spice_server thread, defering to bh called from the 162 + * callbacks are called by spice_server thread, deferring to bh called from the 163 163 * io thread. 164 164 */ 165 165 void qxl_render_update(PCIQXLDevice *qxl)
+1 -1
hw/dma/xilinx_axidma.c
··· 133 133 }; 134 134 135 135 /* 136 - * Helper calls to extract info from desriptors and other trivial 136 + * Helper calls to extract info from descriptors and other trivial 137 137 * state from regs. 138 138 */ 139 139 static inline int stream_desc_sof(struct SDesc *d)
+1 -1
hw/input/stellaris_input.c
··· 69 69 } 70 70 }; 71 71 72 - /* Returns an array 5 ouput slots. */ 72 + /* Returns an array of 5 output slots. */ 73 73 void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode) 74 74 { 75 75 gamepad_state *s;
+1 -1
hw/intc/xics.c
··· 739 739 } 740 740 741 741 /* 742 - * Allocate block of consequtive IRQs, returns a number of the first. 742 + * Allocate block of consecutive IRQs, and return the number of the first IRQ in the block. 743 743 * If align==true, aligns the first IRQ number to num. 744 744 */ 745 745 int xics_alloc_block(XICSState *icp, int src, int num, bool lsi, bool align)
+1 -1
hw/net/fsl_etsec/etsec.c
··· 353 353 etsec->need_flush = false; 354 354 ret = etsec_rx_ring_write(etsec, buf, size); 355 355 if (ret == 0) { 356 - /* The packet will be queued, let's flush it when buffer is avilable 356 + /* The packet will be queued, let's flush it when buffer is available 357 357 * again. */ 358 358 etsec->need_flush = true; 359 359 }
+1 -1
hw/sd/pl181.c
··· 46 46 int32_t fifo_pos; 47 47 int32_t fifo_len; 48 48 /* The linux 2.6.21 driver is buggy, and misbehaves if new data arrives 49 - while it is reading the FIFO. We hack around this be defering 49 + while it is reading the FIFO. We hack around this by deferring 50 50 subsequent transfers until after the driver polls the status word. 51 51 http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=4446/1 52 52 */
+1 -1
hw/vfio/pci.c
··· 3377 3377 uint32_t clk, pc_c; 3378 3378 3379 3379 /* 3380 - * Registers 200h and 204h are index and data registers for acessing 3380 + * Registers 200h and 204h are index and data registers for accessing 3381 3381 * indirect configuration registers within the device. 3382 3382 */ 3383 3383 vfio_region_write(&vdev->bars[5].region, 0x200, 0x80000004, 4);
+1 -1
hw/xen/xen-host-pci-device.c
··· 40 40 d->domain, d->bus, d->dev, d->func, name); 41 41 42 42 if (rc >= size || rc < 0) { 43 - /* The ouput is truncated or an other error is encountered */ 43 + /* The output is truncated, or some other error was encountered */ 44 44 return -ENODEV; 45 45 } 46 46 return 0;
+1 -1
include/block/scsi.h
··· 229 229 #define MODE_PAGE_TO_PROTECT 0x1d 230 230 #define MODE_PAGE_CAPABILITIES 0x2a 231 231 #define MODE_PAGE_ALLS 0x3f 232 - /* Not in Mt. Fuji, but in ATAPI 2.6 -- depricated now in favor 232 + /* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor 233 233 * of MODE_PAGE_SENSE_POWER */ 234 234 #define MODE_PAGE_CDROM 0x0d 235 235
+1 -1
include/exec/memory.h
··· 1146 1146 * address_space_init: initializes an address space 1147 1147 * 1148 1148 * @as: an uninitialized #AddressSpace 1149 - * @root: a #MemoryRegion that routes addesses for the address space 1149 + * @root: a #MemoryRegion that routes addresses for the address space 1150 1150 * @name: an address space name. The name is only used for debugging 1151 1151 * output. 1152 1152 */
+1 -1
libcacard/card_7816t.h
··· 57 57 unsigned char ah_p1; 58 58 unsigned char ah_p2; 59 59 unsigned char ah_Le; 60 - unsigned char ah_body[1]; /* indefinate length */ 60 + unsigned char ah_body[1]; /* indefinite length */ 61 61 }; 62 62 63 63 /*
+1 -1
libdecnumber/decContext.c
··· 186 186 /* newstatus is the source for the bits to be restored */ 187 187 /* mask indicates the bits to be restored (the status bit that */ 188 188 /* corresponds to each 1 bit in the mask is set to the value of */ 189 - /* the correspnding bit in newstatus) */ 189 + /* the corresponding bit in newstatus) */ 190 190 /* returns context */ 191 191 /* */ 192 192 /* No error is possible. */
+4 -4
libdecnumber/decNumber.c
··· 2238 2238 /* if a negative power the constant 1 is needed, and if not subset */ 2239 2239 /* invert the lhs now rather than inverting the result later */ 2240 2240 if (decNumberIsNegative(rhs)) { /* was a **-n [hence digits>0] */ 2241 - decNumber *inv=invbuff; /* asssume use fixed buffer */ 2241 + decNumber *inv=invbuff; /* assume use fixed buffer */ 2242 2242 decNumberCopy(&dnOne, dac); /* dnOne=1; [needed now or later] */ 2243 2243 #if DECSUBSET 2244 2244 if (set->extended) { /* need to calculate 1/lhs */ ··· 3849 3849 /* */ 3850 3850 /* Addition, especially x=x+1, is speed-critical. */ 3851 3851 /* The static buffer is larger than might be expected to allow for */ 3852 - /* calls from higher-level funtions (notable exp). */ 3852 + /* calls from higher-level functions (notably exp). */ 3853 3853 /* ------------------------------------------------------------------ */ 3854 3854 static decNumber * decAddOp(decNumber *res, const decNumber *lhs, 3855 3855 const decNumber *rhs, decContext *set, ··· 4263 4263 /* long subtractions. These are acc and var1 respectively. */ 4264 4264 /* var1 is a copy of the lhs coefficient, var2 is the rhs coefficient.*/ 4265 4265 /* The static buffers may be larger than might be expected to allow */ 4266 - /* for calls from higher-level funtions (notable exp). */ 4266 + /* for calls from higher-level functions (notably exp). */ 4267 4267 /* ------------------------------------------------------------------ */ 4268 4268 static decNumber * decDivideOp(decNumber *res, 4269 4269 const decNumber *lhs, const decNumber *rhs, ··· 5254 5254 /* exp(-x) where x can be the tiniest number (Ntiny). */ 5255 5255 /* */ 5256 5256 /* 2. Normalizing x to be <=0.1 (instead of <=1) reduces loop */ 5257 - /* iterations by appoximately a third with additional (although */ 5257 + /* iterations by approximately a third with additional (although */ 5258 5258 /* diminishing) returns as the range is reduced to even smaller */ 5259 5259 /* fractions. However, h (the power of 10 used to correct the */ 5260 5260 /* result at the end, see below) must be kept <=8 as otherwise */
-1
linux-user/syscall.c
··· 3939 3939 break; 3940 3940 case TYPE_PTRVOID: 3941 3941 case TYPE_INT: 3942 - /* int argment */ 3943 3942 ret = get_errno(ioctl(fd, ie->host_cmd, arg)); 3944 3943 break; 3945 3944 case TYPE_PTR:
+2 -2
linux-user/syscall_defs.h
··· 969 969 (struct cdrom_multisession) */ 970 970 #define TARGET_CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code" 971 971 if available (struct cdrom_mcn) */ 972 - #define TARGET_CDROM_GET_UPC TARGET_CDROM_GET_MCN /* This one is depricated, 972 + #define TARGET_CDROM_GET_UPC TARGET_CDROM_GET_MCN /* This one is deprecated, 973 973 but here anyway for compatibility */ 974 974 #define TARGET_CDROMRESET 0x5312 /* hard-reset the drive */ 975 975 #define TARGET_CDROMVOLREAD 0x5313 /* Get the drive's volume setting ··· 2289 2289 }; 2290 2290 2291 2291 /* soundcard defines */ 2292 - /* XXX: convert them all to arch indepedent entries */ 2292 + /* XXX: convert them all to arch independent entries */ 2293 2293 #define TARGET_SNDCTL_COPR_HALT TARGET_IOWR('C', 7, int); 2294 2294 #define TARGET_SNDCTL_COPR_LOAD 0xcfb04301 2295 2295 #define TARGET_SNDCTL_COPR_RCODE 0xc0144303
+1 -1
qga/commands-posix.c
··· 2158 2158 2159 2159 ga_read_sysfs_file(dirfd, "removable", &removable, 1, &local_err); 2160 2160 if (local_err) { 2161 - /* if no 'removable' file, it does't support offline mem blk */ 2161 + /* if no 'removable' file, it doesn't support offline mem blk */ 2162 2162 if (errno == ENOENT) { 2163 2163 error_free(local_err); 2164 2164 mem_blk->can_offline = false;
+1 -1
target-alpha/mem_helper.c
··· 132 132 env->error_code = 0; 133 133 134 134 /* ??? We should cpu_restore_state to the faulting insn, but this hook 135 - does not have access to the retaddr value from the orignal helper. 135 + does not have access to the retaddr value from the original helper. 136 136 It's all moot until the QEMU PALcode grows an MCHK handler. */ 137 137 138 138 cpu_loop_exit(cs);
+2 -2
target-arm/cpu.h
··· 224 224 }; 225 225 /* MMU translation table base control. */ 226 226 TCR tcr_el[4]; 227 - uint32_t c2_data; /* MPU data cachable bits. */ 228 - uint32_t c2_insn; /* MPU instruction cachable bits. */ 227 + uint32_t c2_data; /* MPU data cacheable bits. */ 228 + uint32_t c2_insn; /* MPU instruction cacheable bits. */ 229 229 union { /* MMU domain access control register 230 230 * MPU write buffer control. 231 231 */
+1 -1
target-cris/cpu.h
··· 151 151 uint32_t sregs[4][16]; 152 152 153 153 /* Linear feedback shift reg in the mmu. Used to provide pseudo 154 - randomness for the 'hint' the mmu gives to sw for chosing valid 154 + randomness for the 'hint' the mmu gives to sw for choosing valid 155 155 sets on TLB refills. */ 156 156 uint32_t mmu_rand_lfsr; 157 157
+3 -3
target-cris/translate.c
··· 102 102 103 103 int cc_size_uptodate; /* -1 invalid or last written value. */ 104 104 105 - int cc_x_uptodate; /* 1 - ccs, 2 - known | X_FLAG. 0 not uptodate. */ 106 - int flags_uptodate; /* Wether or not $ccs is uptodate. */ 107 - int flagx_known; /* Wether or not flags_x has the x flag known at 105 + int cc_x_uptodate; /* 1 - ccs, 2 - known | X_FLAG. 0 not up-to-date. */ 106 + int flags_uptodate; /* Whether or not $ccs is up-to-date. */ 107 + int flagx_known; /* Whether or not flags_x has the x flag known at 108 108 translation time. */ 109 109 int flags_x; 110 110
+1 -1
target-mips/helper.c
··· 692 692 goto set_EPC; 693 693 case EXCP_DWATCH: 694 694 cause = 23; 695 - /* XXX: TODO: manage defered watch exceptions */ 695 + /* XXX: TODO: manage deferred watch exceptions */ 696 696 goto set_EPC; 697 697 case EXCP_MCHECK: 698 698 cause = 24;
+2 -2
target-s390x/kvm.c
··· 588 588 * @addr: the logical start address in guest memory 589 589 * @ar: the access register number 590 590 * @hostbuf: buffer in host memory. NULL = do only checks w/o copying 591 - * @len: length that should be transfered 591 + * @len: length that should be transferred 592 592 * @is_write: true = write, false = read 593 - * Returns: 0 on success, non-zero if an exception or error occured 593 + * Returns: 0 on success, non-zero if an exception or error occurred 594 594 * 595 595 * Use KVM ioctl to read/write from/to guest memory. An access exception 596 596 * is injected into the vCPU in case of translation errors.
+3 -3
target-sh4/helper.c
··· 59 59 60 60 int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr) 61 61 { 62 - /* For user mode, only U0 area is cachable. */ 62 + /* For user mode, only U0 area is cacheable. */ 63 63 return !(addr & 0x80000000); 64 64 } 65 65 ··· 825 825 826 826 /* check area */ 827 827 if (env->sr & (1u << SR_MD)) { 828 - /* For previledged mode, P2 and P4 area is not cachable. */ 828 + /* For privileged mode, P2 and P4 area is not cacheable. */ 829 829 if ((0xA0000000 <= addr && addr < 0xC0000000) || 0xE0000000 <= addr) 830 830 return 0; 831 831 } else { 832 - /* For user mode, only U0 area is cachable. */ 832 + /* For user mode, only U0 area is cacheable. */ 833 833 if (0x80000000 <= addr) 834 834 return 0; 835 835 }
+1 -1
tcg/ia64/tcg-target.c
··· 1594 1594 /* The out-of-line thunks are all the same; load the return address 1595 1595 from B0, load the GP, and branch to the code. Note that we are 1596 1596 always post-call, so the register window has rolled, so we're 1597 - using incomming parameter register numbers, not outgoing. */ 1597 + using incoming parameter register numbers, not outgoing. */ 1598 1598 if (dest == NULL) { 1599 1599 uintptr_t *desc = (uintptr_t *)helpers[x]; 1600 1600 uintptr_t func = desc[0], gp = desc[1], disp;
+2 -2
tcg/tcg.c
··· 1396 1396 } 1397 1397 } 1398 1398 } 1399 - /* input arguments are live for preceeding opcodes */ 1399 + /* input arguments are live for preceding opcodes */ 1400 1400 for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { 1401 1401 arg = args[i]; 1402 1402 dead_temps[arg] = 0; ··· 1542 1542 dead_args |= (1 << i); 1543 1543 } 1544 1544 } 1545 - /* input arguments are live for preceeding opcodes */ 1545 + /* input arguments are live for preceding opcodes */ 1546 1546 for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { 1547 1547 arg = args[i]; 1548 1548 dead_temps[arg] = 0;
+1 -1
tests/image-fuzzer/runner.py
··· 301 301 JSON: 302 302 303 303 '--command' accepts a JSON array of commands. Each command presents 304 - an application under test with all its paramaters as a list of strings, 304 + an application under test with all its parameters as a list of strings, 305 305 e.g. ["qemu-io", "$test_img", "-c", "write $off $len"]. 306 306 307 307 Supported application aliases: 'qemu-img' and 'qemu-io'.
+1 -1
tests/qemu-iotests/041
··· 889 889 target=quorum_repair_img, format=iotests.imgfmt) 890 890 self.assert_qmp(result, 'error/class', 'GenericError') 891 891 892 - def test_unexistant_replaces(self): 892 + def test_nonexistent_replaces(self): 893 893 if not self.has_quorum(): 894 894 return 895 895
+1 -1
util/qemu-thread-posix.c
··· 389 389 /* 390 390 * Leave the event reset and tell qemu_event_set that there 391 391 * are waiters. No need to retry, because there cannot be 392 - * a concurent busy->free transition. After the CAS, the 392 + * a concurrent busy->free transition. After the CAS, the 393 393 * event will be either set or busy. 394 394 */ 395 395 if (atomic_cmpxchg(&ev->value, EV_FREE, EV_BUSY) == EV_SET) {