Skip to content
Snippets Groups Projects
  1. May 20, 2021
    • Eric Farman's avatar
      vfio-ccw: Attempt to clean up all IRQs on error · dcc9cf38
      Eric Farman authored
      
      The vfio_ccw_unrealize() routine makes an unconditional attempt to
      unregister every IRQ notifier, though they may not have been registered
      in the first place (when running on an older kernel, for example).
      
      Let's mirror this behavior in the error cleanups in vfio_ccw_realize()
      so that if/when new IRQs are added, it is less confusing to recognize
      the necessary procedures. The worst case scenario would be some extra
      messages about an undefined IRQ, but since this is an error exit that
      won't be the only thing to worry about.
      
      And regarding those messages, let's change it to a warning instead of
      an error, to better reflect their severity. The existing code in both
      paths handles everything anyway.
      
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Acked-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Message-Id: <20210428143652.1571487-1-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      dcc9cf38
    • Philippe Mathieu-Daudé's avatar
      hw/s390x/ccw: Register qbus type in abstract TYPE_CCW_DEVICE parent · a6d8b731
      Philippe Mathieu-Daudé authored
      
      Instead of having all TYPE_CCW_DEVICE children set the bus type to
      TYPE_VIRTUAL_CSS_BUS, do it once in the abstract parent.
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Acked-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20210424145313.3287400-1-f4bug@amsat.org>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      a6d8b731
    • Eric Farman's avatar
      vfio-ccw: Permit missing IRQs · 6178d468
      Eric Farman authored
      
      Commit 690e29b9 ("vfio-ccw: Refactor ccw irq handler") changed
      one of the checks for the IRQ notifier registration from saying
      "the host needs to recognize the only IRQ that exists" to saying
      "the host needs to recognize ANY IRQ that exists."
      
      And this worked fine, because the subsequent change to support the
      CRW IRQ notifier doesn't get into this code when running on an older
      kernel, thanks to a guard by a capability region. The later addition
      of the REQ(uest) IRQ by commit b2f96f9e ("vfio-ccw: Connect the
      device request notifier") broke this assumption because there is no
      matching capability region. Thus, running new QEMU on an older
      kernel fails with:
      
        vfio: unexpected number of irqs 2
      
      Let's adapt the message here so that there's a better clue of what
      IRQ is missing.
      
      Furthermore, let's make the REQ(uest) IRQ not fail when attempting
      to register it, to permit running vfio-ccw on a newer QEMU with an
      older kernel.
      
      Fixes: b2f96f9e ("vfio-ccw: Connect the device request notifier")
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20210421152053.2379873-1-farman@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      6178d468
    • Ilya Leoshkevich's avatar
      accel/tcg: Assert that tb->size != 0 after translation · 0b00b0c1
      Ilya Leoshkevich authored
      
      If arch-specific code generates a translation block of size 0,
      tb_gen_code() may generate a spurious exception. Add an assertion in
      order to catch such situations early.
      
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20210416154939.32404-5-iii@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      0b00b0c1
    • Ilya Leoshkevich's avatar
      target/xtensa: Make sure that tb->size != 0 · f689befd
      Ilya Leoshkevich authored
      
      tb_gen_code() assumes that tb->size must never be zero, otherwise it
      may produce spurious exceptions. For xtensa this may happen when
      decoding an unknown instruction, when handling a write into the
      CCOUNT or CCOMPARE special register and when single-stepping the first
      instruction of an exception handler.
      
      Fix by pretending that the size of the respective translation block is
      1 in all these cases.
      
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Tested-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Message-Id: <20210416154939.32404-4-iii@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      f689befd
    • Ilya Leoshkevich's avatar
      target/arm: Make sure that commpage's tb->size != 0 · 48a13092
      Ilya Leoshkevich authored
      
      tb_gen_code() assumes that tb->size must never be zero, otherwise it
      may produce spurious exceptions. For ARM this may happen when creating
      a translation block for the commpage.
      
      Fix by pretending that commpage translation blocks have at least one
      instruction.
      
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20210416154939.32404-3-iii@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      48a13092
    • Ilya Leoshkevich's avatar
      target/s390x: Fix translation exception on illegal instruction · 86131c71
      Ilya Leoshkevich authored
      
      Hitting an uretprobe in a s390x TCG guest causes a SIGSEGV. What
      happens is:
      
      * uretprobe maps a userspace page containing an invalid instruction.
      * uretprobe replaces the target function's return address with the
        address of that page.
      * When tb_gen_code() is called on that page, tb->size ends up being 0
        (because the page starts with the invalid instruction), which causes
        virt_page2 to point to the previous page.
      * The previous page is not mapped, so this causes a spurious
        translation exception.
      
      tb->size must never be 0: even if there is an illegal instruction, the
      instruction bytes that have been looked at must count towards tb->size.
      So adjust s390x's translate_one() to act this way for both illegal
      instructions and instructions that are known to generate exceptions.
      
      Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20210416154939.32404-2-iii@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      86131c71
    • Peter Maydell's avatar
      Merge remote-tracking branch... · fea2ad71
      Peter Maydell authored
      Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-plugin-updates-180521-2' into staging
      
      testing and plugin updates:
      
        - various fixes for binfmt_misc docker images
        - add hexagon check-tcg support docker image
        - add tricore check-tcg support
        - refactor ppc docker images
        - add missing ppc64le tests
        - don't use host_cc for test fallback
        - check-tcg configure.sh tweaks for cross compile/clang
        - fix some memory leaks in plugins
      
      # gpg: Signature made Tue 18 May 2021 09:37:21 BST
      # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
      # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
      # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
      
      * remotes/stsquad/tags/pull-testing-and-plugin-updates-180521-2: (29 commits)
        configure: use cc, not host_cc to set cross_cc for build arch
        tests/tcg: don't allow clang as a cross compiler
        tests/tcg: fix missing return
        tests/tcg/ppc64le: tests for brh/brw/brd
        tests/docker: gcc-10 based images for ppc64{,le} tests
        tests/tcg/tricore: Add muls test
        tests/tcg/tricore: Add msub test
        tests/tcg/tricore: Add madd test
        tests/tcg/tricore: Add ftoi test
        tests/tcg/tricore: Add fmul test
        tests/tcg/tricore: Add fadd test
        tests/tcg/tricore: Add dvstep test
        tests/tcg/tricore: Add clz test
        tests/tcg/tricore: Add bmerge test
        tests/tcg/tricore: Add macros to create tests and first test 'abs'
        configure: Emit HOST_CC to config-host.mak
        tests/tcg/tricore: Add build infrastructure
        hw/tricore: Add testdevice for tests in tests/tcg/
        tests/tcg: Run timeout cmds using --foreground
        tests/tcg: Add docker_as and docker_ld cmds
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      fea2ad71
  2. May 19, 2021
Loading