1. 31 3月, 2020 7 次提交
    • P
      hw/net/e1000e_core: Let e1000e_can_receive() return a boolean · 205ce567
      Philippe Mathieu-Daudé 提交于
      The e1000e_can_receive() function simply returns a boolean value.
      Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      205ce567
    • A
      Fixed integer overflow in e1000e · f22a57ac
      Andrew Melnychenko 提交于
      Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1737400
      Fixed setting max_queue_num if there are no peers in
      NICConf. qemu_new_nic() creates NICState with 1 NetClientState(index
      0) without peers, set max_queue_num to 0 - It prevents undefined
      behavior and possible crashes, especially during pcie hotplug.
      
      Fixes: 6f3fbe4e ("net: Introduce e1000e device emulation")
      Signed-off-by: NAndrew Melnychenko <andrew@daynix.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NDmitry Fleytman <dmitry.fleytman@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      f22a57ac
    • P
      hw/net/i82596.c: Avoid reading off end of buffer in i82596_receive() · a43790f2
      Peter Maydell 提交于
      The i82596_receive() function attempts to pass the guest a buffer
      which is effectively the concatenation of the data it is passed and a
      4 byte CRC value.  However, rather than implementing this as "write
      the data; then write the CRC" it instead bumps the length value of
      the data by 4, and writes 4 extra bytes from beyond the end of the
      buffer, which it then overwrites with the CRC.  It also assumed that
      we could always fit all four bytes of the CRC into the final receive
      buffer, which might not be true if the CRC needs to be split over two
      receive buffers.
      
      Calculate separately how many bytes we need to transfer into the
      guest's receive buffer from the source buffer, and how many we need
      to transfer from the CRC work.
      
      We add a count 'bufsz' of the number of bytes left in the source
      buffer, which we use purely to assert() that we don't overrun.
      
      Spotted by Coverity (CID 1419396) for the specific case when we end
      up using a local array as the source buffer.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      a43790f2
    • P
      hw/net/i82596: Correct command bitmask (CID 1419392) · baba731b
      Philippe Mathieu-Daudé 提交于
      The command is 32-bit, but we are loading the 16 upper bits with
      the 'get_uint16(s->scb + 2)' call.
      
      Once shifted by 16, the command bits match the status bits:
      
      - Command
        Bit 31 ACK-CX   Acknowledges that the CU completed an Action Command.
        Bit 30 ACK-FR   Acknowledges that the RU received a frame.
        Bit 29 ACK-CNA  Acknowledges that the Command Unit became not active.
        Bit 28 ACK-RNR  Acknowledges that the Receive Unit became not ready.
      
      - Status
        Bit 15 CX       The CU finished executing a command with its I(interrupt) bit set.
        Bit 14 FR       The RU finished receiving a frame.
        Bit 13 CNA      The Command Unit left the Active state.
        Bit 12 RNR      The Receive Unit left the Ready state.
      
      Add the SCB_COMMAND_ACK_MASK definition to simplify the code.
      
      This fixes Coverity 1419392 (CONSTANT_EXPRESSION_RESULT):
      
        /hw/net/i82596.c: 352 in examine_scb()
        346         cuc = (command >> 8) & 0x7;
        347         ruc = (command >> 4) & 0x7;
        348         DBG(printf("MAIN COMMAND %04x  cuc %02x ruc %02x\n", command, cuc, ruc));
        349         /* and clear the scb command word */
        350         set_uint16(s->scb + 2, 0);
        351
        >>>     CID 1419392:    (CONSTANT_EXPRESSION_RESULT)
        >>>     "command & (2147483648UL /* 1UL << 31 */)" is always 0 regardless of the values of its operands. This occurs as the logical operand of "if".
        352         if (command & BIT(31))      /* ACK-CX */
        353             s->scb_status &= ~SCB_STATUS_CX;
        >>>     CID 1419392:    (CONSTANT_EXPRESSION_RESULT)
        >>>     "command & (1073741824UL /* 1UL << 30 */)" is always 0 regardless of the values of its operands. This occurs as the logical operand of "if".
        354         if (command & BIT(30))      /*ACK-FR */
        355             s->scb_status &= ~SCB_STATUS_FR;
        >>>     CID 1419392:    (CONSTANT_EXPRESSION_RESULT)
        >>>     "command & (536870912UL /* 1UL << 29 */)" is always 0 regardless of the values of its operands. This occurs as the logical operand of "if".
        356         if (command & BIT(29))      /*ACK-CNA */
        357             s->scb_status &= ~SCB_STATUS_CNA;
        >>>     CID 1419392:    (CONSTANT_EXPRESSION_RESULT)
        >>>     "command & (268435456UL /* 1UL << 28 */)" is always 0 regardless of the values of its operands. This occurs as the logical operand of "if".
        358         if (command & BIT(28))      /*ACK-RNR */
        359             s->scb_status &= ~SCB_STATUS_RNR;
      
      Fixes: Covertiy CID 1419392 (commit 376b8519)
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      baba731b
    • P
      Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200330' into staging · 2a95551e
      Peter Maydell 提交于
      Improve PIE and other linkage
      Fix for decodetree vs Python3 floor division operator
      Fix i386 INDEX_op_dup2_vec expansion
      Fix loongson multimedia condition instructions
      
      # gpg: Signature made Tue 31 Mar 2020 04:50:15 BST
      # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
      # gpg:                issuer "richard.henderson@linaro.org"
      # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
      # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
      
      * remotes/rth/tags/pull-tcg-20200330:
        decodetree: Use Python3 floor division operator
        tcg/i386: Fix INDEX_op_dup2_vec
        target/mips: Fix loongson multimedia condition instructions
        configure: Support -static-pie if requested
        configure: Override the os default with --disable-pie
        configure: Unnest detection of -z,relro and -z,now
        configure: Always detect -no-pie toolchain support
        configure: Do not force pie=no for non-x86
        tcg: Remove softmmu code_gen_buffer fixed address
        configure: Drop adjustment of textseg
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2a95551e
    • P
      decodetree: Use Python3 floor division operator · b4123787
      Philippe Mathieu-Daudé 提交于
      This script started using Python2, where the 'classic' division
      operator returns the floor result. In commit 3d004a37 we started
      to use Python3, where the division operator returns the float
      result ('true division').
      To keep the same behavior, use the 'floor division' operator "//"
      which returns the floor result.
      
      Fixes: 3d004a37Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200330121345.14665-1-f4bug@amsat.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      b4123787
    • R
      tcg/i386: Fix INDEX_op_dup2_vec · e20cb81d
      Richard Henderson 提交于
      We were only constructing the 64-bit element, and not
      replicating the 64-bit element across the rest of the vector.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      e20cb81d
  2. 30 3月, 2020 9 次提交
  3. 29 3月, 2020 8 次提交
  4. 28 3月, 2020 8 次提交
  5. 27 3月, 2020 8 次提交