summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* qemu-option-trace.rst.inc: Don't use option:: markupPeter Maydell2020-11-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Sphinx 3.2 is pickier than earlier versions about the option:: markup, and complains about our usage in qemu-option-trace.rst: ../../docs/qemu-option-trace.rst.inc:4:Malformed option description '[enable=]PATTERN', should look like "opt", "-opt args", "--opt args", "/opt args" or "+opt args" In this file, we're really trying to document the different parts of the top-level --trace option, which qemu-nbd.rst and qemu-img.rst have already introduced with an option:: markup. So it's not right to use option:: here anyway. Switch to a different markup (definition lists) which gives about the same formatted output. (Unlike option::, this markup doesn't produce index entries; but at the moment we don't do anything much with indexes anyway, and in any case I think it doesn't make much sense to have individual index entries for the sub-parts of the --trace option.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20201030174700.7204-3-peter.maydell@linaro.org
* scripts/kerneldoc: For Sphinx 3 use c:macro for macros with argumentsPeter Maydell2020-11-021-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kerneldoc script currently emits Sphinx markup for a macro with arguments that uses the c:function directive. This is correct for Sphinx versions earlier than Sphinx 3, where c:macro doesn't allow documentation of macros with arguments and c:function is not picky about the syntax of what it is passed. However, in Sphinx 3 the c:macro directive was enhanced to support macros with arguments, and c:function was made more picky about what syntax it accepted. When kerneldoc is told that it needs to produce output for Sphinx 3 or later, make it emit c:function only for functions and c:macro for macros with arguments. We assume that anything with a return type is a function and anything without is a macro. This fixes the Sphinx error: /home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/qom/object.h:155:Error in declarator If declarator-id with parameters (e.g., 'void f(int arg)'): Invalid C declaration: Expected identifier in nested name. [error at 25] DECLARE_INSTANCE_CHECKER ( InstanceType, OBJ_NAME, TYPENAME) -------------------------^ If parenthesis in noptr-declarator (e.g., 'void (*f(int arg))(double)'): Error in declarator or parameters Invalid C declaration: Expecting "(" in parameters. [error at 39] DECLARE_INSTANCE_CHECKER ( InstanceType, OBJ_NAME, TYPENAME) ---------------------------------------^ Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20201030174700.7204-2-peter.maydell@linaro.org
* hw/intc/arm_gicv3_cpuif: Make GIC maintenance interrupts workPeter Maydell2020-11-022-4/+2Star
| | | | | | | | | | | | | | | | | | | | | In gicv3_init_cpuif() we copy the ARMCPU gicv3_maintenance_interrupt into the GICv3CPUState struct's maintenance_irq field. This will only work if the board happens to have already wired up the CPU maintenance IRQ before the GIC was realized. Unfortunately this is not the case for the 'virt' board, and so the value that gets copied is NULL (since a qemu_irq is really a pointer to an IRQState struct under the hood). The effect is that the CPU interface code never actually raises the maintenance interrupt line. Instead, since the GICv3CPUState has a pointer to the CPUState, make the dereference at the point where we want to raise the interrupt, to avoid an implicit requirement on board code to wire things up in a particular order. Reported-by: Jose Martins <josemartins90@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20201009153904.28529-1-peter.maydell@linaro.org Reviewed-by: Luc Michel <luc@lmichel.fr>
* configure: Test that gio libs from pkg-config workPeter Maydell2020-11-021-1/+9
| | | | | | | | | | | | | | | | On some hosts (eg Ubuntu Bionic) pkg-config returns a set of libraries for gio-2.0 which don't actually work when compiling statically. (Specifically, the returned library string includes -lmount, but not -lblkid which -lmount depends upon, so linking fails due to missing symbols.) Check that the libraries work, and don't enable gio if they don't, in the same way we do for gnutls. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200928160402.7961-1-peter.maydell@linaro.org
* target/arm: Get correct MMU index for other-security-statePeter Maydell2020-11-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | In arm_v7m_mmu_idx_for_secstate() we get the 'priv' level to pass to armv7m_mmu_idx_for_secstate_and_priv() by calling arm_current_el(). This is incorrect when the security state being queried is not the current one, because arm_current_el() uses the current security state to determine which of the banked CONTROL.nPRIV bits to look at. The effect was that if (for instance) Secure state was in privileged mode but Non-Secure was not then we would return the wrong MMU index. The only places where we are using this function in a way that could trigger this bug are for the stack loads during a v8M function-return and for the instruction fetch of a v8M SG insn. Fix the bug by expanding out the M-profile version of the arm_current_el() logic inline so it can use the passed in secstate rather than env->v7m.secure. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201022164408.13214-1-peter.maydell@linaro.org
* hw/display/exynos4210_fimd: Fix potential NULL pointer dereferenceAlexChen2020-11-021-1/+3
| | | | | | | | | | | | In exynos4210_fimd_update(), the pointer s is dereferinced before being check if it is valid, which may lead to NULL pointer dereference. So move the assignment to global_width after checking that the s is valid. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Alex Chen <alex.chen@huawei.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 5F9F8D88.9030102@huawei.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/display/omap_lcdc: Fix potential NULL pointer dereferenceAlexChen2020-11-021-3/+7
| | | | | | | | | | | | | In omap_lcd_interrupts(), the pointer omap_lcd is dereferinced before being check if it is valid, which may lead to NULL pointer dereference. So move the assignment to surface after checking that the omap_lcd is valid and move surface_bits_per_pixel(surface) to after the surface assignment. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: AlexChen <alex.chen@huawei.com> Message-id: 5F9CDB8A.9000001@huawei.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/arm/boot: fix SVE for EL3 direct kernel bootRémi Denis-Courmont2020-11-021-0/+3
| | | | | | | | | | When booting a CPU with EL3 using the -kernel flag, set up CPTR_EL3 so that SVE will not trap to EL3. Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030151541.11976-1-remi@remlab.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/arm/smmuv3: Fix potential integer overflow (CID 1432363)Philippe Mathieu-Daudé2020-11-021-1/+2
| | | | | | | | | | | | | | | | | | | Use the BIT_ULL() macro to ensure we use 64-bit arithmetic. This fixes the following Coverity issue (OVERFLOW_BEFORE_WIDEN): CID 1432363 (#1 of 1): Unintentional integer overflow: overflow_before_widen: Potentially overflowing expression 1 << scale with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type hwaddr (64 bits, unsigned). Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Eric Auger <eric.auger@redhat.com> Message-id: 20201030144617.1535064-1-philmd@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* disas/capstone: Fix monitor disassembly of >32 bytesPeter Maydell2020-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're using the capstone disassembler, disassembly of a run of instructions more than 32 bytes long disassembles the wrong data for instructions beyond the 32 byte mark: (qemu) xp /16x 0x100 0000000000000100: 0x00000005 0x54410001 0x00000001 0x00001000 0000000000000110: 0x00000000 0x00000004 0x54410002 0x3c000000 0000000000000120: 0x00000000 0x00000004 0x54410009 0x74736574 0000000000000130: 0x00000000 0x00000000 0x00000000 0x00000000 (qemu) xp /16i 0x100 0x00000100: 00000005 andeq r0, r0, r5 0x00000104: 54410001 strbpl r0, [r1], #-1 0x00000108: 00000001 andeq r0, r0, r1 0x0000010c: 00001000 andeq r1, r0, r0 0x00000110: 00000000 andeq r0, r0, r0 0x00000114: 00000004 andeq r0, r0, r4 0x00000118: 54410002 strbpl r0, [r1], #-2 0x0000011c: 3c000000 .byte 0x00, 0x00, 0x00, 0x3c 0x00000120: 54410001 strbpl r0, [r1], #-1 0x00000124: 00000001 andeq r0, r0, r1 0x00000128: 00001000 andeq r1, r0, r0 0x0000012c: 00000000 andeq r0, r0, r0 0x00000130: 00000004 andeq r0, r0, r4 0x00000134: 54410002 strbpl r0, [r1], #-2 0x00000138: 3c000000 .byte 0x00, 0x00, 0x00, 0x3c 0x0000013c: 00000000 andeq r0, r0, r0 Here the disassembly of 0x120..0x13f is using the data that is in 0x104..0x123. This is caused by passing the wrong value to the read_memory_func(). The intention is that at this point in the loop the 'cap_buf' buffer already contains 'csize' bytes of data for the instruction at guest addr 'pc', and we want to read in an extra 'tsize' bytes. Those extra bytes are therefore at 'pc + csize', not 'pc'. On the first time through the loop 'csize' happens to be zero, so the initial read of 32 bytes into cap_buf is correct and as long as the disassembly never needs to read more data we return the correct information. Use the correct guest address in the call to read_memory_func(). Cc: qemu-stable@nongnu.org Fixes: https://bugs.launchpad.net/qemu/+bug/1900779 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20201022132445.25039-1-peter.maydell@linaro.org
* target/arm: fix LORID_EL1 access checkRémi Denis-Courmont2020-11-021-14/+5Star
| | | | | | | | | Secure mode is not exempted from checking SCR_EL3.TLOR, and in the future HCR_EL2.TLOR when S-EL2 is enabled. Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: fix handling of HCR.FBRémi Denis-Courmont2020-11-021-3/+2Star
| | | | | | | | HCR should be applied when NS is set, not when it is cleared. Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Fix VUDOT/VSDOT (scalar) on big-endian hostsPeter Maydell2020-11-021-2/+2
| | | | | | | | | | | | | | | | | The helper functions for performing the udot/sdot operations against a scalar were not using an address-swizzling macro when converting the index of the scalar element into a pointer into the vm array. This had no effect on little-endian hosts but meant we generated incorrect results on big-endian hosts. For these insns, the index is indexing over group of 4 8-bit values, so 32 bits per indexed entity, and H4() is therefore what we want. (For Neon the only possible input indexes are 0 and 1.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20201028191712.4910-3-peter.maydell@linaro.org
* target/arm: Fix float16 pairwise Neon ops on big-endian hostsPeter Maydell2020-11-021-4/+4
| | | | | | | | | | | | | In the neon_padd/pmax/pmin helpers for float16, a cut-and-paste error meant we were using the H4() address swizzler macro rather than the H2() which is required for 2-byte data. This had no effect on little-endian hosts but meant we put the result data into the destination Dreg in the wrong order on big-endian hosts. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20201028191712.4910-2-peter.maydell@linaro.org
* target/arm: Improve do_prewiden_3dRichard Henderson2020-11-022-31/+45
| | | | | | | | | | We can use proper widening loads to extend 32-bit inputs, and skip the "widenfn" step. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-12-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Simplify do_long_3d and do_2scalar_longRichard Henderson2020-11-021-14/+9Star
| | | | | | | | | | In both cases, we can sink the write-back and perform the accumulate into the normal destination temps. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-11-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Rename neon_load_reg64 to vfp_load_reg64Richard Henderson2020-11-022-46/+46
| | | | | | | | | | The only uses of this function are for loading VFP double-precision values, and nothing to do with NEON. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-10-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Add read/write_neon_element64Richard Henderson2020-11-022-47/+73
| | | | | | | | | Replace all uses of neon_load/store_reg64 within translate-neon.c.inc. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-9-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Rename neon_load_reg32 to vfp_load_reg32Richard Henderson2020-11-022-94/+94
| | | | | | | | | | The only uses of this function are for loading VFP single-precision values, and nothing to do with NEON. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-8-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Expand read/write_neon_element32 to all MemOpRichard Henderson2020-11-022-84/+37Star
| | | | | | | | | | | | | | We can then use this to improve VMOV (scalar to gp) and VMOV (gp to scalar) so that we simply perform the memory operation that we wanted, rather than inserting or extracting from a 32-bit quantity. These were the last uses of neon_load/store_reg, so remove them. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-7-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Add read/write_neon_element32Richard Henderson2020-11-022-99/+183
| | | | | | | | | | | | Model these off the aa64 read/write_vec_element functions. Use it within translate-neon.c.inc. The new functions do not allocate or free temps, so this rearranges the calling code a bit. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-6-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Use neon_element_offset in vfp_reg_offsetRichard Henderson2020-11-021-9/+4Star
| | | | | | | | | This seems a bit more readable than using offsetof CPU_DoubleU. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-5-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Use neon_element_offset in neon_load/store_regRichard Henderson2020-11-021-12/+2Star
| | | | | | | | | These are the only users of neon_reg_offset, so remove that. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-4-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Move neon_element_offset to translate.cRichard Henderson2020-11-022-19/+20
| | | | | | | | | This will shortly have users outside of translate-neon.c.inc. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-3-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* target/arm: Introduce neon_full_reg_offsetRichard Henderson2020-11-023-23/+31
| | | | | | | | | | | This function makes it clear that we're talking about the whole register, and not the 32-bit piece at index 0. This fixes a bug when running on a big-endian host. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20201030022618.785675-2-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20201102' ↵Peter Maydell2020-11-023-48/+470
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging 9pfs: only test case changes this time * Fix occasional test failures with parallel tests. * Fix coverity error in test code. * Avoid error when auto removing test directory if it disappeared for some reason. * Refactor: Rename functions to make top-level test functions fs_*() easily distinguishable from utility test functions do_*(). * Refactor: Drop unnecessary function arguments in utility test functions. * More test cases using the 9pfs 'local' filesystem driver backend, namely for the following 9p requests: Tunlinkat, Tlcreate, Tsymlink and Tlink. # gpg: Signature made Mon 02 Nov 2020 09:31:35 GMT # gpg: using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395 # gpg: issuer "qemu_oss@crudebyte.com" # gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: ECAB 1A45 4014 1413 BA38 4926 30DB 47C3 A012 D5F4 # Subkey fingerprint: 96D8 D110 CF7A F808 4F88 5901 34C2 B587 65A4 7395 * remotes/cschoenebeck/tags/pull-9p-20201102: tests/9pfs: add local Tunlinkat hard link test tests/9pfs: add local Tlink test tests/9pfs: add local Tunlinkat symlink test tests/9pfs: add local Tsymlink test tests/9pfs: add local Tunlinkat file test tests/9pfs: add local Tlcreate test tests/9pfs: add local Tunlinkat directory test tests/9pfs: simplify do_mkdir() tests/9pfs: Turn fs_mkdir() into a helper tests/9pfs: Turn fs_readdir_split() into a helper tests/9pfs: Factor out do_attach() helper tests/9pfs: Set alloc in fs_create_dir() tests/9pfs: Factor out do_version() helper tests/9pfs: Force removing of local 9pfs test directory tests/9pfs: fix coverity error in create_local_test_dir() tests/9pfs: fix test dir for parallel tests tests/9pfs: make create/remove test dir public Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tests/9pfs: add local Tunlinkat hard link testChristian Schoenebeck2020-11-011-0/+30
| | | | | | | | | | | | | | | | | | | | This test case uses a Tunlinkat request to remove a previously hard linked file by using the 9pfs 'local' fs driver. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <9bec33a7d8f006ef8f80517985d0d6ac48650d53.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: add local Tlink testChristian Schoenebeck2020-11-011-0/+71
| | | | | | | | | | | | | | | | | | | | This test case uses a Tlink request to create a hard link to a regular file using the 9pfs 'local' fs driver. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <f0d869770ad23ee5ce10f7da90fdb742cadcad72.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: add local Tunlinkat symlink testChristian Schoenebeck2020-11-011-0/+28
| | | | | | | | | | | | | | | | | | | | This test case uses a Tunlinkat request to remove a symlink using the 9pfs 'local' fs driver. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <a23cd4d2ab6d8d3048addab8cbf0416fe5ead43e.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: add local Tsymlink testChristian Schoenebeck2020-11-011-0/+77
| | | | | | | | | | | | | | | | | | | | This test case uses a Tsymlink 9p request to create a symbolic link using the 9pfs 'local' fs driver. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <84ac76937855bf441242372cc3e62df42f0a3dc4.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: add local Tunlinkat file testChristian Schoenebeck2020-11-011-0/+24
| | | | | | | | | | | | | | | | | | | | This test case uses a Tunlinkat request to remove a regular file using the 9pfs 'local' fs driver. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <4eabeed7f662721dd5664cb77fe36ea0aa08b1ec.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: add local Tlcreate testChristian Schoenebeck2020-11-011-0/+77
| | | | | | | | | | | | | | | | | | | | This test case uses a Tlcreate 9p request to create a regular file inside host's test directory. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <269cae0c00af941a3a4ae78f1e319f93462a7eb4.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: add local Tunlinkat directory testChristian Schoenebeck2020-11-011-0/+71
| | | | | | | | | | | | | | | | | | | | This test case uses a Tunlinkat 9p request with flag AT_REMOVEDIR (see 'man 2 unlink') to remove a directory from host's test directory. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <3c7c65b476ba44bea6afd0b378b5287e1c671a32.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: simplify do_mkdir()Christian Schoenebeck2020-11-011-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out walking a directory path to a separate new utility function do_walk() and use that function in do_mkdir(). The code difference saved this way is not much, but we'll use that new do_walk() function in the upcoming patches, so it will avoid quite some code duplication after all. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <4d7275b2363f122438a443ce079cbb355285e9d6.1603285620.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: Turn fs_mkdir() into a helperGreg Kurz2020-11-011-5/+2Star
| | | | | | | | | | | | | | | | | | | | fs_mkdir() isn't a top level test function and thus shouldn't take the "void *obj, void *data, QGuestAllocator *t_alloc" arguments. Turn it into a helper to be used by test functions. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160321018148.266767.15959608711038504029.stgit@bahia.lan> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: Turn fs_readdir_split() into a helperGreg Kurz2020-11-011-7/+7
| | | | | | | | | | | | | | | | | | | | fs_readdir_split() isn't a top level test function and thus shouldn't take the "void *obj, void *data, QGuestAllocator *t_alloc" arguments. Turn it into a helper to be used by test functions. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160321016084.266767.9501523425012383531.stgit@bahia.lan> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: Factor out do_attach() helperGreg Kurz2020-11-011-12/+16
| | | | | | | | | | | | | | | | | | fs_attach() is a top level test function. Factor out the reusable code to a separate helper instead of hijacking it in other tests. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160321017450.266767.17377192504263871186.stgit@bahia.lan> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: Set alloc in fs_create_dir()Greg Kurz2020-11-011-0/+1
| | | | | | | | | | | | | | | | fs_create_dir() is a top level test function. It should set alloc. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160321016764.266767.3763279057643874020.stgit@bahia.lan> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: Factor out do_version() helperGreg Kurz2020-11-011-5/+9
| | | | | | | | | | | | | | | | | | fs_version() is a top level test function. Factor out the reusable code to a separate helper instead of hijacking it in other tests. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160321015403.266767.4533967728943968456.stgit@bahia.lan> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: Force removing of local 9pfs test directoryGreg Kurz2020-11-011-1/+1
| | | | | | | | | | | | | | | | | | No need to get a complaint from "rm" if some path disappeared for some reason. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <160406199444.312256.8319835906008559151.stgit@bahia.lan> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: fix coverity error in create_local_test_dir()Christian Schoenebeck2020-11-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity wants the return value of mkdir() to be checked: /qemu/tests/qtest/libqos/virtio-9p.c: 48 in create_local_test_dir() 42 /* Creates the directory for the 9pfs 'local' filesystem driver to access. */ 43 static void create_local_test_dir(void) 44 { 45 struct stat st; 46 47 g_assert(local_test_path != NULL); >>> CID 1435963: Error handling issues (CHECKED_RETURN) >>> Calling "mkdir(local_test_path, 511U)" without checking return value. This library function may fail and return an error code. 48 mkdir(local_test_path, 0777); 49 50 /* ensure test directory exists now ... */ 51 g_assert(stat(local_test_path, &st) == 0); 52 /* ... and is actually a directory */ 53 g_assert((st.st_mode & S_IFMT) == S_IFDIR); So let's just do that and log an info-level message at least, because we actually only care if the required directory exists and we do have an existence check for that in place already. Reported-by: Coverity (CID 1435963) Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <03f68c7ec08064e20f43797f4eb4305ad21e1e8e.1604061839.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: fix test dir for parallel testsChristian Schoenebeck2020-11-012-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use mkdtemp() to generate a unique directory for the 9p 'local' tests. This fixes occasional 9p test failures when running 'make check -jN' if QEMU was compiled for multiple target architectures, because the individual architecture's test suites would run in parallel and interfere with each other's data as the test directory was previously hard coded and hence the same directory was used by all of them simultaniously. This also requires a change how the test directory is created and deleted: As the test path is now randomized and virtio_9p_register_nodes() being called in a somewhat undeterministic way, that's no longer an appropriate place to create and remove the test directory. Use a constructor and destructor function for creating and removing the test directory instead. Unfortunately libqos currently does not support setup/teardown callbacks to handle this more cleanly. The constructor functions needs to be in virtio-9p-test.c, not in virtio-9p.c, because in the latter location it would cause all apps that link to libqos (i.e. entirely unrelated test suites) to create a 9pfs test directory as well, which would even break other test suites. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Tested-by: Greg Kurz <groug@kaod.org> Message-Id: <7746f42d8f557593898d3d9d8e57c46e872dfb4f.1604243521.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
| * tests/9pfs: make create/remove test dir publicChristian Schoenebeck2020-11-012-6/+14
| | | | | | | | | | | | | | | | | | | | Make functions create_local_test_dir() and remove_local_test_dir() public. They're going to be used in the next patch. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <ec90703cbc23d6b612b3672f946d7741f4a16080.1604243521.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
* | Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20201101.0' ↵Peter Maydell2020-11-0252-217/+2481
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging VFIO update 2020-11-01 * Migration support (Kirti Wankhede) * s390 DMA limiting (Matthew Rosato) * zPCI hardware info (Matthew Rosato) * Lock guard (Amey Narkhede) * Print fixes (Zhengui li) * Warning/build fixes # gpg: Signature made Sun 01 Nov 2020 20:38:10 GMT # gpg: using RSA key 239B9B6E3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full] # gpg: aka "Alex Williamson <alex@shazbot.org>" [full] # gpg: aka "Alex Williamson <alwillia@redhat.com>" [full] # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>" [full] # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B 8A90 239B 9B6E 3BB0 8B22 * remotes/awilliam/tags/vfio-update-20201101.0: (32 commits) vfio: fix incorrect print type hw/vfio: Use lock guard macros s390x/pci: get zPCI function info from host vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities s390x/pci: use a PCI Function structure s390x/pci: clean up s390 PCI groups s390x/pci: use a PCI Group structure s390x/pci: create a header dedicated to PCI CLP s390x/pci: Honor DMA limits set by vfio s390x/pci: Add routine to get the vfio dma available count vfio: Find DMA available capability vfio: Create shared routine for scanning info capabilities s390x/pci: Move header files to include/hw/s390x linux-headers: update against 5.10-rc1 update-linux-headers: Add vfio_zdev.h qapi: Add VFIO devices migration stats in Migration stats vfio: Make vfio-pci device migration capable vfio: Add ioctl to get dirty pages bitmap during dma unmap vfio: Dirty page tracking when vIOMMU is enabled vfio: Add vfio_listener_log_sync to mark dirty pages ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | vfio: fix incorrect print typeZhengui li2020-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The type of input variable is unsigned int while the printer type is int. So fix incorrect print type. Signed-off-by: Zhengui li <lizhengui@huawei.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | hw/vfio: Use lock guard macrosAmey Narkhede2020-11-011-5/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | Use qemu LOCK_GUARD macros in hw/vfio. Saves manual unlock calls Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | s390x/pci: get zPCI function info from hostMatthew Rosato2020-11-016-7/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use the capability chains of the VFIO_DEVICE_GET_INFO ioctl to retrieve the CLP information that the kernel exports. To be compatible with previous kernel versions we fall back on previous predefined values, same as the emulation values, when the ioctl is found to not support capability chains. If individual CLP capabilities are not found, we fall back on default values for only those capabilities missing from the chain. This patch is based on work previously done by Pierre Morel. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> [aw: non-Linux build fixes] Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilitiesMatthew Rosato2020-11-012-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that VFIO_DEVICE_GET_INFO supports capability chains, add a helper function to find specific capabilities in the chain. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | s390x/pci: use a PCI Function structurePierre Morel2020-11-013-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use a ClpRspQueryPci structure to hold the information related to a zPCI Function. This allows us to be ready to support different zPCI functions and to retrieve the zPCI function information from the host. Signed-off-by: Pierre Morel <pmorel@linux.ibm.com> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | s390x/pci: clean up s390 PCI groupsMatthew Rosato2020-11-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a step to remove all stashed PCI groups to avoid stale data between machine resets. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>