From patchwork Thu Sep 3 20:58:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hBD+bl9Z; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDRT10TRz9sSP for ; Fri, 4 Sep 2020 07:27:33 +1000 (AEST) Received: from localhost ([::1]:55688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwlX-0005PW-2d for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:27:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL4-0003Zx-6Z; Thu, 03 Sep 2020 17:00:10 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:34040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL2-0007Q5-8u; Thu, 03 Sep 2020 17:00:09 -0400 Received: by mail-ot1-x343.google.com with SMTP id h17so3207585otr.1; Thu, 03 Sep 2020 14:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jbZUzUuJIhTs9gFdFE43wolgbeVB484D+UVnVZjxmoY=; b=hBD+bl9ZoakJP/g1P3Lzv1o6HuvcT6OA0hbTBJwBg3+wGcfZ6Qq/dr8rxT6ZhLOdbx rX616KSvkR7Vag0Oji7ynTCHSaqWKXLaMO/I2l94ZLPpTlVOp7Shz3Tmn+2dnjks+9BA 8O8SWUBr5nxuwBUKlgIaP2kJS808JeOSIafTugP6S75/8qv6IuzkVIEduk6H8ccFaAhZ 8fOTwTOol7Vg3NH1QzU+5hX9S4R+yEPWs4+vva8glghAqKNy2NukdwR4aPte4BGk5RqP Ej4TdIfFAte4558f8FvCXcclaISqdWY2iWzoE3ac8Cxczpr8mrwoxrnefhnDfaegiXv0 A6hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jbZUzUuJIhTs9gFdFE43wolgbeVB484D+UVnVZjxmoY=; b=OAKc6WVS2AludjdNGqXKm8v3hhpjWiX2Udv+q4qnH/1dn+kpZt/lDJZ7JhXLW6u7DS Izo0dk0oENjcQBoJQY0khdHtSlzcX6O8pp2XBkYTK3oyPuJSpYDrSZInX59me6flYSJV 5iqGKmpQpogqVYeR1XXKvfL/9NcnGidXlcGEiYONb9mW/Dx4gZ8F6Tetg/Jip04fBmAx 0VNXbc5TzFmtzuifHb7Hbx40OJHlJkKfky69bzK0gfhHHwi3TX0hPJoItkoZH9hgvbUN BeUA9JABlVCkDe+tNKpdJb6gx7PMNsM0PAHIiEMO1d60WQUiEPgTJ5QOzEhbhbpIlYEl D6nA== X-Gm-Message-State: AOAM531EVrP3egDd0xBAGfFKLSIQKUc2H0PjgtYE6av1UMJBuGqRRWNC xMhfBnI3X8vCLhl6M7brmPA2+KWJ7ZI= X-Google-Smtp-Source: ABdhPJxOEa4HeMaORqyd/A/vpdsSgLJ/3XWzo3WDhX8/x+4TwWvZI+j9avwQEjG5BSLj9dNxInpENg== X-Received: by 2002:a9d:6b8b:: with SMTP id b11mr2777318otq.357.1599166806349; Thu, 03 Sep 2020 14:00:06 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id t84sm294132oif.32.2020.09.03.14.00.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:05 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 01/77] hostmem: don't use mbind() if host-nodes is empty Date: Thu, 3 Sep 2020 15:58:19 -0500 Message-Id: <20200903205935.27832-2-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , qemu-stable@nongnu.org, Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Since 5.0 QEMU uses hostmem backend for allocating main guest RAM. The backend however calls mbind() which is typically NOP in case of default policy/absent host-nodes bitmap. However when runing in container with black-listed mbind() syscall, QEMU fails to start with error "cannot bind memory to host NUMA nodes: Operation not permitted" even when user hasn't provided host-nodes to pin to explictly (which is the case with -m option) To fix issue, call mbind() only in case when user has provided host-nodes explicitly (i.e. host_nodes bitmap is not empty). That should allow to run QEMU in containers with black-listed mbind() without memory pinning. If QEMU provided memory-pinning is required user still has to white-list mbind() in container configuration. Reported-by: Manuel Hohmann Signed-off-by: Igor Mammedov Message-Id: <20200430154606.6421-1-imammedo@redhat.com> Tested-by: Philippe Mathieu-Daudé Cc: qemu-stable@nongnu.org Signed-off-by: Eduardo Habkost (cherry picked from commit 70b6d525dfb51d5e523d568d1139fc051bc223c5) Signed-off-by: Michael Roth --- backends/hostmem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 327f9eebc3..0efd7b7bd6 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -383,8 +383,10 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) assert(sizeof(backend->host_nodes) >= BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long)); assert(maxnode <= MAX_NODES); - if (mbind(ptr, sz, backend->policy, - maxnode ? backend->host_nodes : NULL, maxnode + 1, flags)) { + + if (maxnode && + mbind(ptr, sz, backend->policy, backend->host_nodes, maxnode + 1, + flags)) { if (backend->policy != MPOL_DEFAULT || errno != ENOSYS) { error_setg_errno(errp, errno, "cannot bind memory to host NUMA nodes"); From patchwork Thu Sep 3 20:58:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=F5lLuU86; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDVV1B7Jz9sPB for ; Fri, 4 Sep 2020 07:30:10 +1000 (AEST) Received: from localhost ([::1]:40192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwo3-0002Dq-W4 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:30:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLG-0003yT-RB; Thu, 03 Sep 2020 17:00:24 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:40762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLE-0007cz-SJ; Thu, 03 Sep 2020 17:00:22 -0400 Received: by mail-ot1-x341.google.com with SMTP id e23so4013768otk.7; Thu, 03 Sep 2020 14:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=qTh31Rf/r01rqa9kv/3Kv1y/l40RMHvXG4921rSK/Vs=; b=F5lLuU86NBNOJXSwTxkeLFpMXiJkG0hav4FZB3TnChTvRFMaQMraUSDoOu0x3F65Xj Lg++2yXEAnJ6KZI3mJq04c5eBdhVep9/iGGS3Ce5q9JfEd9UKtdM2Tx+twK8+p9lDQ3T 3pLdTUSduK26/IapUFMjYJRkQIzJ+d8TLHe+15byIkg7Fhx4Ff0MSHZ9YBuf4T1v5z3q jirXrV7PjOrNi3CT3fMTXF0JadcSqIos4s0WskEW9Gh85GilP1qRXp+hf0pUBQ68jAvm TZCekJIVWL/dkZe2y6l5goNG272KgGTQU+OdsppdTNL5axDHnFKJVksPhL7wEGs9jfTG FdMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=qTh31Rf/r01rqa9kv/3Kv1y/l40RMHvXG4921rSK/Vs=; b=lpwTHOd7S07XHyuZSXvO1evhcLA3aGsxCR2h/3l9FoRU8ibYCNrKx2oaWYcOdDlWEi octFBek+0AmcOG5v9HzWhUD0273bpvXWKW210O9HrNtzaSd4YI9vPNEzD/+yx1GCoW4S XjQiUg60ZTTZ/ht7zju36FrVQnj9MTEBFKQYS+/Oqw/c30aBPVt6Iph+zm+43qJCtAm7 U5tS4wakajz3rXKbYk+LDDYtI7Udpl0W7KxmiEkeXctiOvLPUve2shkNMdNR1DKSq/l2 0fBKXjuDexCFMFUPUyTUHIVpOlRye9am15FizbmGPEZ/9Hcr6AFdQpUZO/UfVSVyzV3N ORGQ== X-Gm-Message-State: AOAM532yTMXA2xEnBwfrdoc5L8EKZ5gf6a3gYeEgnzrenFK1UDBst99f ca9ka3BfjN8ec9yoPOEPK0O93KsJh3s= X-Google-Smtp-Source: ABdhPJwnXs/a36zSYU2IRuxKnj2zUGliKwnIAFe8ex8OxCKS+g75naWsnkm1hC5IJ17De+bmeNP/Gw== X-Received: by 2002:a9d:6e1:: with SMTP id 88mr3073463otx.178.1599166819269; Thu, 03 Sep 2020 14:00:19 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id n186sm831721oob.11.2020.09.03.14.00.18 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:18 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 02/77] target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_* Date: Thu, 3 Sep 2020 15:58:20 -0500 Message-Id: <20200903205935.27832-3-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=flukshun@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Must clear the tail for AdvSIMD when SVE is enabled. Fixes: ca40a6e6e39 Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20200513163245.17915-15-richard.henderson@linaro.org Signed-off-by: Peter Maydell (cherry picked from commit 525d9b6d42844e187211d25b69be8b378785bc24) Signed-off-by: Michael Roth --- target/arm/vec_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index 8017bd88c4..5ce111b286 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -737,6 +737,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \ d[i + j] = TYPE##_mul(n[i + j], mm, stat); \ } \ } \ + clear_tail(d, oprsz, simd_maxsz(desc)); \ } DO_MUL_IDX(gvec_fmul_idx_h, float16, H2) @@ -761,6 +762,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, \ mm, a[i + j], 0, stat); \ } \ } \ + clear_tail(d, oprsz, simd_maxsz(desc)); \ } DO_FMLA_IDX(gvec_fmla_idx_h, float16, H2) From patchwork Thu Sep 3 20:58:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=o2WB0332; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjD7y6JMXz9sPB for ; Fri, 4 Sep 2020 07:14:06 +1000 (AEST) Received: from localhost ([::1]:53778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwYW-0006I3-Qc for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:14:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLU-0004Au-Tk; Thu, 03 Sep 2020 17:00:36 -0400 Received: from mail-oo1-xc41.google.com ([2607:f8b0:4864:20::c41]:46892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLS-0007i5-UT; Thu, 03 Sep 2020 17:00:36 -0400 Received: by mail-oo1-xc41.google.com with SMTP id r6so1115659oon.13; Thu, 03 Sep 2020 14:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0LMgxbFODWFpBaUC7jVrX4CuO2pJP6IZde8nJ19Zvuo=; b=o2WB0332e2+ouLNHFWs8qrQ3/t2f+lmDJT2MAdiGBD7ag2Gx8HcDGTtGsyTp1GytlL Yupc2EKN+YmlCXgU43eUvh17WmeTU4vyyubcou1Opt9ORzB4N02hFfIytmBq43OXaLQf HWV4oTJIaL4HE8G22zxSwjd14vbZCkbyMwcyKLDxREXu+28BuUJrfM85CT+qBM4ZxbFV hXlqwcsw8qv6jgslPPlc0t3RM0zufewMaajGecy7psXqswcvZP4u5ivCCYrqls+Daem0 B/IcS2fxE1eqYQoDVGT6iiiVXoJ6Kqt8olgFGQpByFnTELWhs9WM7tmiXyJqNEfzyJ4T idBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=0LMgxbFODWFpBaUC7jVrX4CuO2pJP6IZde8nJ19Zvuo=; b=KKLVGUueAtByWDGzAte+7xJwmjtOgjsxrfUcIHzSoe+orIae7SotGpuOUoZlByULVh b1w0jCnpbmKfo1OpeFgIlv7URWiCGSwKqlyUr7q3sntbGLJb00Zc8x/GJU99KrNok3KR /s2ZVxXBhA0tafAWeEeoaF0cmxp+NnkfKxdQW17lBDEu3JjUTRAWNWHcEMr1klyVhP+R KdfnstnjuusfPwxPiTn2LQ/jOrpYywjgqmCwsA5rbioazxEKOxZEm262zOoD4Gbffa7I LBngmK3/j89tZaaTCZqwwQyu9JYA3r4YhW3EJmwI1JQV6j0iK42EuGQdV+y220U/I4v4 MmUg== X-Gm-Message-State: AOAM533WJTQ30mkVD/+WODib3ReQWeYuTYukwz7mnoSxs6bbo298cMdS hgH2eBXti6dP7QGid2ZiNnqqBtRqWLc= X-Google-Smtp-Source: ABdhPJyDdn4kiKWjUdAKxHyH9FK8TbJETKGPOTOnGSk/WbWecviuBQvvJ3iQLQkqaLZOcX4rgS/DCw== X-Received: by 2002:a4a:7241:: with SMTP id r1mr3344079ooe.48.1599166832885; Thu, 03 Sep 2020 14:00:32 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 40sm757020otj.76.2020.09.03.14.00.32 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:32 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 03/77] qemu-nbd: Close inherited stderr Date: Thu, 3 Sep 2020 15:58:21 -0500 Message-Id: <20200903205935.27832-4-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c41; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Raphael Pour Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Raphael Pour Close inherited stderr of the parent if fork_process is false. Otherwise no one will close it. (introduced by e6df58a5) This only affected 'qemu-nbd -c /dev/nbd0'. Signed-off-by: Raphael Pour Message-Id: Reviewed-by: Eric Blake [eblake: Enhance commit message] Signed-off-by: Eric Blake (cherry picked from commit 0eaf453ebf6788885fbb5d40426b154ef8805407) Signed-off-by: Michael Roth --- qemu-nbd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 4aa005004e..306e44fb0a 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -916,7 +916,11 @@ int main(int argc, char **argv) } else if (pid == 0) { close(stderr_fd[0]); - old_stderr = dup(STDERR_FILENO); + /* Remember parent's stderr if we will be restoring it. */ + if (fork_process) { + old_stderr = dup(STDERR_FILENO); + } + ret = qemu_daemon(1, 0); /* Temporarily redirect stderr to the parent's pipe... */ From patchwork Thu Sep 3 20:58:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=kT45kTez; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDnw71fgz9sTR for ; Fri, 4 Sep 2020 07:43:32 +1000 (AEST) Received: from localhost ([::1]:46290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx10-000341-TE for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:43:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLk-0004a2-K0; Thu, 03 Sep 2020 17:00:52 -0400 Received: from mail-oo1-xc43.google.com ([2607:f8b0:4864:20::c43]:41887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLi-0007md-GZ; Thu, 03 Sep 2020 17:00:52 -0400 Received: by mail-oo1-xc43.google.com with SMTP id t3so1129153ook.8; Thu, 03 Sep 2020 14:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bxWeFhlr2Nkz7Asmr51rIj2c32EFg7f8nnap9EUbZGc=; b=kT45kTezXOFjY1kIdOLpucs61FR/RPAJfX7isq+8hAJk4plBdlqs2kl5Bv7UNdC7EV StaJpRbM1QTTajuONhlFGKyVccrF1P8xqPMKXbT7ORd3M7xkrnIe0O0yC2lce6dFYM1U gZTZWDMrCMUhOAOd6cvc3lL6OMNyBtORtIaftYUshbjEL0V/yKIOKzBR62siGA0sRtow 2n55NGxJAVYD30evZ+kH8xSP/q4ix1ofe8N6io1wi/z+X6zJYmB0DqwSbOh4FbHsegCA UT4801Puv0YYXIITx4eiIq9Mp88776gDBw1L3gJx9wJH4mETofYsN76PdOcVA8CGwqA9 tEXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bxWeFhlr2Nkz7Asmr51rIj2c32EFg7f8nnap9EUbZGc=; b=MRoBNumSG6Xi7y7rwGyKq6DF2apcaviyCkaQWC043ZX3JTlN7P9nyzsjs/FdCOS3Al l/lu7dyTtyOpvREfz/qJJMVdPCvEI7omMq9KXi2K2ovw/Q7M6Nlp+DvXK/LHNWJNvrF3 PFa6sv0X+o7eCKDZtPSpi/ssmCQDhz1JtiCDqOdCnaR6LS6CyM8hMHbSmEMt2RxFdw4Z HIbfvDjExKSYOiAQyYtQ+2M7SfHI26q2Sb63yU4z7MZS3oq8Yg94d2zN+6BYT5aC+hw8 OiL/3K3i1KduXXHWjsxreqrOBn8hIKGDntgqUIXMUio1w+2VPIRnUpXA6o3ubXaJUu/g Q8CQ== X-Gm-Message-State: AOAM533/phTPD8oeG2u1Pi9Ad7kcrHf0DnrCBpS7OipY4rpWDDrUzlEB 1fICnF3N5lW1iCLYU+3sDI5qTNnEVjI= X-Google-Smtp-Source: ABdhPJyU/u8kUV0VF/KzCStoEHPeLSNKtOUe7Wrhekedl7Ea23lzleq/F+U2QatcX/qaLi6P+FEMiQ== X-Received: by 2002:a4a:d549:: with SMTP id q9mr3346616oos.74.1599166848839; Thu, 03 Sep 2020 14:00:48 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 22sm722522oin.26.2020.09.03.14.00.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:48 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 04/77] 9p: Lock directory streams with a CoMutex Date: Thu, 3 Sep 2020 15:58:22 -0500 Message-Id: <20200903205935.27832-5-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c43; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Greg Kurz Locking was introduced in QEMU 2.7 to address the deprecation of readdir_r(3) in glibc 2.24. It turns out that the frontend code is the worst place to handle a critical section with a pthread mutex: the code runs in a coroutine on behalf of the QEMU mainloop and then yields control, waiting for the fsdev backend to process the request in a worker thread. If the client resends another readdir request for the same fid before the previous one finally unlocked the mutex, we're deadlocked. This never bit us because the linux client serializes readdir requests for the same fid, but it is quite easy to demonstrate with a custom client. A good solution could be to narrow the critical section in the worker thread code and to return a copy of the dirent to the frontend, but this causes quite some changes in both 9p.c and codir.c. So, instead of that, in order for people to easily backport the fix to older QEMU versions, let's simply use a CoMutex since all the users for this sit in coroutines. Fixes: 7cde47d4a89d ("9p: add locking to V9fsDir") Reviewed-by: Christian Schoenebeck Message-Id: <158981894794.109297.3530035833368944254.stgit@bahia.lan> Signed-off-by: Greg Kurz (cherry picked from commit ed463454efd0ac3042ff772bfe1b1d846dc281a5) Signed-off-by: Michael Roth --- hw/9pfs/9p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index b8f72a3bd9..c381fe091a 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -197,22 +197,22 @@ typedef struct V9fsXattr typedef struct V9fsDir { DIR *stream; - QemuMutex readdir_mutex; + CoMutex readdir_mutex; } V9fsDir; static inline void v9fs_readdir_lock(V9fsDir *dir) { - qemu_mutex_lock(&dir->readdir_mutex); + qemu_co_mutex_lock(&dir->readdir_mutex); } static inline void v9fs_readdir_unlock(V9fsDir *dir) { - qemu_mutex_unlock(&dir->readdir_mutex); + qemu_co_mutex_unlock(&dir->readdir_mutex); } static inline void v9fs_readdir_init(V9fsDir *dir) { - qemu_mutex_init(&dir->readdir_mutex); + qemu_co_mutex_init(&dir->readdir_mutex); } /* From patchwork Thu Sep 3 20:58:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZhuZkyV7; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDfc0Q02z9sTK for ; Fri, 4 Sep 2020 07:37:12 +1000 (AEST) Received: from localhost ([::1]:42588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwus-0006ve-0D for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:37:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLy-0004zF-Nr; Thu, 03 Sep 2020 17:01:06 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:43302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLw-0007qv-LG; Thu, 03 Sep 2020 17:01:05 -0400 Received: by mail-oi1-x243.google.com with SMTP id i17so4498667oig.10; Thu, 03 Sep 2020 14:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RAtZibjRPRUwDnQzP5UjXu8eSd4RDr/MjWSFq1fE5u4=; b=ZhuZkyV74JC45mz5cwb0f3GH13dtUNdxELR+kqHiYgq5A/6yeSRps6GRPyCBkvkma+ r380bNZKG1zInRmRtcpJ9pvDyJD4Rfrrl2lXO7n2/HMLmMHpjWQkQL1YL0dSsVR7zsj7 1uxBJ2NPRZpjl/7fDGur57ukWIn0HXjmIzVk0OMZay9mxyXW3N1cPYem9mzGYelMxqXw Ccv1c0mU+aVcSlR2arIRl/FFYqupsS0uivsI0w0Mg+KEOeJZAHrC4pq/YsupI5JBGVWZ dNfekOwt8crLqPOoG9keNJ/R1gxee/JuFJdFF9dNYO+iOXEvKpxVbBRg30epetpAgQ13 OKqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RAtZibjRPRUwDnQzP5UjXu8eSd4RDr/MjWSFq1fE5u4=; b=cIxVcsvxNREeWOSwJNp1znUlmA0N+hx1i2yC3ceXxvPYonnugCDzd9v30cBN1SDkcl O9BOX7IfQ9Musgdj3bzpeRhbaLuqKnmwGcP9BKV4Bd08rV7dgd2/EXN8hsnnSOIz2CjU InRX56NttT/w30jNOtCfrFr4p7bLdYtsjs0lTxUVqmEncGibVEYaH5K3WRniBSDRVQgv jZKlaWJtQn+G/1776b1hKF33utfb44gtq/Q+v7/VsuaW94uKcYI+sIcAHbnKlHO8K9kb 54HrzCxVd5f8AbBqgIqgYXXmqQsUL85Yof1pAmZqKTy9b6pgJ2vI63wrEYtZU35BLhpd T3ow== X-Gm-Message-State: AOAM532vY6qDbOgV5ZobycEN8iXwQHqLwNjVoMlqApZFCef+BHFSX35i 0Rf/LQ6AdPcbt3ffH5b8O0KtTkUAcfsNHA== X-Google-Smtp-Source: ABdhPJwyMrA+NINQEC9TZehHF1vSHz8eEPFNC1egNQv+Tcf2Q/vkdfb9Av7VcGnlkppxB7vqN+vFpg== X-Received: by 2002:aca:4901:: with SMTP id w1mr3171952oia.160.1599166862698; Thu, 03 Sep 2020 14:01:02 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id x4sm724977oic.11.2020.09.03.14.01.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:01 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 05/77] net: Do not include a newline in the id of -nic devices Date: Thu, 3 Sep 2020 15:58:23 -0500 Message-Id: <20200903205935.27832-6-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::243; envelope-from=flukshun@gmail.com; helo=mail-oi1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , qemu-stable@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The '\n' sneaked in by accident here, an "id" string should really not contain a newline character at the end. Fixes: 78cd6f7bf6b ('net: Add a new convenience option "--nic" ...') Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200518074352.23125-1-thuth@redhat.com> Signed-off-by: Laurent Vivier (cherry picked from commit 0561dfac082becdd9e89110249a27b309b62aa9f) Signed-off-by: Michael Roth --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 38778e831d..cbeeeadff8 100644 --- a/net/net.c +++ b/net/net.c @@ -1506,7 +1506,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp) /* Create an ID if the user did not specify one */ nd_id = g_strdup(qemu_opts_id(opts)); if (!nd_id) { - nd_id = g_strdup_printf("__org.qemu.nic%i\n", idx); + nd_id = g_strdup_printf("__org.qemu.nic%i", idx); qemu_opts_set_id(opts, nd_id); } From patchwork Thu Sep 3 20:58:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tqrq/EX9; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF480K51z9sTK for ; Fri, 4 Sep 2020 07:55:52 +1000 (AEST) Received: from localhost ([::1]:37276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxCv-0006D7-VN for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMD-000570-AP; Thu, 03 Sep 2020 17:01:21 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:44012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMB-0007uN-9t; Thu, 03 Sep 2020 17:01:20 -0400 Received: by mail-ot1-x333.google.com with SMTP id v16so3996086otp.10; Thu, 03 Sep 2020 14:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z36mXy2WFBF5NBY+RBTjJ9WAglVt96yt/HKBybxipmc=; b=tqrq/EX93AgUny/nwg6QFR/ysHJWMEXT7xEsDAzeE03v7b1LpoJytVDxuH4MlUkpO+ UAv23RRpw+fKWhTomHu2TjqDjBA7TUNz1ZWpY+8/FCXb+m0uqCHdXOmGG61YpjqqJbtI mSyKBVRnu+lDl2oK57nFyAj1NFMsIEvVm+PO5evDWw02KYAdYkX3mn037fXqq7gnDzLg 2xSdnXBVIpfN2fzx1fW2RAT630vQHT8IJpHLjU16HwheYbSgEiKBjt9hgawb6AUe6QOy uT+MZDfZ6dSeaS8uUqDMrmjcS7bN8Ij5uq8ajvnGfvS+BGs6s8PnwHzHuf5YNK7KANZE Wa/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Z36mXy2WFBF5NBY+RBTjJ9WAglVt96yt/HKBybxipmc=; b=kzperAtt0DfNfn1FaVYHwgzQ4hgS4PZ9lbaT01/w7uqbOHpb05sRjRa1b9grN/aTIr +q7e7CKjEHMUilQRBPAq3G03gDinUDxiMq3P5Dlih8TwE61bXjkomFlQQyJ64t1BdgWB 497oUNgrTljESWflsXayAmYoVvUv7awAjHL977gUgKA9TJXn4edanYneyC4+1pCJOw1T lDa0vynxvnCEBp5nkwLGYgaEd8rldXHtsMAJP/CQav5tXENnkPoYJGQzycGS/DjsUCrS VT6gjZXWXk8uteq1pR3orUcZ3TXT19h0cm9XZMOQmN0FWJCBuPpqWkEspAGXKjUB46j1 T9nw== X-Gm-Message-State: AOAM530I5GHHYpjA9lc3y/7ETxOzAoUJIzsMJt7TFQLR/uNTeN6xkDh5 W0Imy34+rH8+a75e7cfhf1dvpktAUsbKkg== X-Google-Smtp-Source: ABdhPJxpMoKcMGqhfnLo9UAm0rAGuaMQTMP2Je1Sw63Bo3LcdoMNRofxG28N5ToEjte4Rbqz2eyNgA== X-Received: by 2002:a9d:21c4:: with SMTP id s62mr3086347otb.350.1599166877385; Thu, 03 Sep 2020 14:01:17 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id j20sm767305ots.5.2020.09.03.14.01.16 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:16 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 06/77] nbd/server: Avoid long error message assertions CVE-2020-10761 Date: Thu, 3 Sep 2020 15:58:24 -0500 Message-Id: <20200903205935.27832-7-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=flukshun@gmail.com; helo=mail-ot1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake Ever since commit 36683283 (v2.8), the server code asserts that error strings sent to the client are well-formed per the protocol by not exceeding the maximum string length of 4096. At the time the server first started sending error messages, the assertion could not be triggered, because messages were completely under our control. However, over the years, we have added latent scenarios where a client could trigger the server to attempt an error message that would include the client's information if it passed other checks first: - requesting NBD_OPT_INFO/GO on an export name that is not present (commit 0cfae925 in v2.12 echoes the name) - requesting NBD_OPT_LIST/SET_META_CONTEXT on an export name that is not present (commit e7b1948d in v2.12 echoes the name) At the time, those were still safe because we flagged names larger than 256 bytes with a different message; but that changed in commit 93676c88 (v4.2) when we raised the name limit to 4096 to match the NBD string limit. (That commit also failed to change the magic number 4096 in nbd_negotiate_send_rep_err to the just-introduced named constant.) So with that commit, long client names appended to server text can now trigger the assertion, and thus be used as a denial of service attack against a server. As a mitigating factor, if the server requires TLS, the client cannot trigger the problematic paths unless it first supplies TLS credentials, and such trusted clients are less likely to try to intentionally crash the server. We may later want to further sanitize the user-supplied strings we place into our error messages, such as scrubbing out control characters, but that is less important to the CVE fix, so it can be a later patch to the new nbd_sanitize_name. Consideration was given to changing the assertion in nbd_negotiate_send_rep_verr to instead merely log a server error and truncate the message, to avoid leaving a latent path that could trigger a future CVE DoS on any new error message. However, this merely complicates the code for something that is already (correctly) flagging coding errors, and now that we are aware of the long message pitfall, we are less likely to introduce such errors in the future, which would make such error handling dead code. Reported-by: Xueqiang Wei CC: qemu-stable@nongnu.org Fixes: https://bugzilla.redhat.com/1843684 CVE-2020-10761 Fixes: 93676c88d7 Signed-off-by: Eric Blake Message-Id: <20200610163741.3745251-2-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy (cherry picked from commit 5c4fe018c025740fef4a0a4421e8162db0c3eefd) Signed-off-by: Michael Roth --- nbd/server.c | 23 ++++++++++++++++++++--- tests/qemu-iotests/143 | 4 ++++ tests/qemu-iotests/143.out | 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 02b1ed0801..20754e9ebc 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -217,7 +217,7 @@ nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type, msg = g_strdup_vprintf(fmt, va); len = strlen(msg); - assert(len < 4096); + assert(len < NBD_MAX_STRING_SIZE); trace_nbd_negotiate_send_rep_err(msg); ret = nbd_negotiate_send_rep_len(client, type, len, errp); if (ret < 0) { @@ -231,6 +231,19 @@ nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type, return 0; } +/* + * Return a malloc'd copy of @name suitable for use in an error reply. + */ +static char * +nbd_sanitize_name(const char *name) +{ + if (strnlen(name, 80) < 80) { + return g_strdup(name); + } + /* XXX Should we also try to sanitize any control characters? */ + return g_strdup_printf("%.80s...", name); +} + /* Send an error reply. * Return -errno on error, 0 on success. */ static int GCC_FMT_ATTR(4, 5) @@ -595,9 +608,11 @@ static int nbd_negotiate_handle_info(NBDClient *client, Error **errp) exp = nbd_export_find(name); if (!exp) { + g_autofree char *sane_name = nbd_sanitize_name(name); + return nbd_negotiate_send_rep_err(client, NBD_REP_ERR_UNKNOWN, errp, "export '%s' not present", - name); + sane_name); } /* Don't bother sending NBD_INFO_NAME unless client requested it */ @@ -995,8 +1010,10 @@ static int nbd_negotiate_meta_queries(NBDClient *client, meta->exp = nbd_export_find(export_name); if (meta->exp == NULL) { + g_autofree char *sane_name = nbd_sanitize_name(export_name); + return nbd_opt_drop(client, NBD_REP_ERR_UNKNOWN, errp, - "export '%s' not present", export_name); + "export '%s' not present", sane_name); } ret = nbd_opt_read(client, &nb_queries, sizeof(nb_queries), errp); diff --git a/tests/qemu-iotests/143 b/tests/qemu-iotests/143 index f649b36195..d2349903b1 100755 --- a/tests/qemu-iotests/143 +++ b/tests/qemu-iotests/143 @@ -58,6 +58,10 @@ _send_qemu_cmd $QEMU_HANDLE \ $QEMU_IO_PROG -f raw -c quit \ "nbd+unix:///no_such_export?socket=$SOCK_DIR/nbd" 2>&1 \ | _filter_qemu_io | _filter_nbd +# Likewise, with longest possible name permitted in NBD protocol +$QEMU_IO_PROG -f raw -c quit \ + "nbd+unix:///$(printf %4096d 1 | tr ' ' a)?socket=$SOCK_DIR/nbd" 2>&1 \ + | _filter_qemu_io | _filter_nbd | sed 's/aaaa*aa/aa--aa/' _send_qemu_cmd $QEMU_HANDLE \ "{ 'execute': 'quit' }" \ diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out index 1f4001c601..fc9c0a761f 100644 --- a/tests/qemu-iotests/143.out +++ b/tests/qemu-iotests/143.out @@ -5,6 +5,8 @@ QA output created by 143 {"return": {}} qemu-io: can't open device nbd+unix:///no_such_export?socket=SOCK_DIR/nbd: Requested export not available server reported: export 'no_such_export' not present +qemu-io: can't open device nbd+unix:///aa--aa1?socket=SOCK_DIR/nbd: Requested export not available +server reported: export 'aa--aa...' not present { 'execute': 'quit' } {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} From patchwork Thu Sep 3 20:58:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KzMhNwT4; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF936PVsz9sTv for ; Fri, 4 Sep 2020 08:00:07 +1000 (AEST) Received: from localhost ([::1]:54612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxH3-0005JA-QT for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 18:00:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMN-0005WH-Ji; Thu, 03 Sep 2020 17:01:31 -0400 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:45462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwML-0007wP-Lo; Thu, 03 Sep 2020 17:01:31 -0400 Received: by mail-ot1-x32c.google.com with SMTP id g96so3978002otb.12; Thu, 03 Sep 2020 14:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=coJkuEmlNkx1jl3SxtGVceRHzmpSFAl/1O2kd9aGIEI=; b=KzMhNwT4SzFuMYvIrN0Mg77+M/x/o+/6ac1fx+nUDjDNbLdz19Bbh9RDVYMRi6M8zc DShKL5vIDPkK8SjqwLpfAGmO9G1OXekk+CPqrw4q7KTXKvnRgSR0CbtXgzPvRnRudRUQ ty49O53Js0dPbwVjPKDDYYHY0mRVmdR/hAGMEKcDrJLaFuv+b9TmGOkmkGzB5noAcwDn 8qWZgs3F2Iq+bkodsUzu/h92GWpH4P0aiwa2A4/uuBS27AUGIhJtN3zs+4m6BV6n9qT8 hcH1yY9pP2CxGs/35HhwYje17MvjpUNO8QtF7eaeCD+R+Ufu9Tr7+F7FQ4D7HYVcO54g 4TwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=coJkuEmlNkx1jl3SxtGVceRHzmpSFAl/1O2kd9aGIEI=; b=F4wg9R6iRzmmK8DrOQ0o85vvlOUmDj5wBKOF0piXjZ+g/8044bxGBeeifslO3cyLQT awDyFiBzphTY2Fk0PPYE1GMw5SdZHJDy+Mo8+5PUTKCZmnxNskDohNk9Fpf5nlgBi7Do Z49jW08nA8RAA0Ddg9XUpG3ixkQ1fBZP0k9/vmCjRhdUD5RTe3zN/xCr4p2K8j0K3soU Lfc/nd17Wh5+QJlpNvV1pIkGQLMyV5yM2JKJX426K/0gpCWTnU76R0LxilaYaCQM4f8c AaXhAsTFQ9v5kD6T9IQZp5V9z7CPAdmcIAY5LI58xoIwyIWwhYtdkn+5584R5tLmJYoi zzBw== X-Gm-Message-State: AOAM533Sjc/4fRPnNJwnY/Bv19bX07H+TezTXFQbQaMnP0zH12LhDFxo 2FjEtKzGkdxvinvlXyKY5ERJzI+k9r0OFw== X-Google-Smtp-Source: ABdhPJyO3MVr7dG/XxyIU4R+09TdGOCVn4IHZXGyOaFm3qDMMlCVmVACEkKslrleDL84AQ7Q0+O1WQ== X-Received: by 2002:a9d:eed:: with SMTP id 100mr3006912otj.20.1599166887891; Thu, 03 Sep 2020 14:01:27 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id f12sm822384ooi.42.2020.09.03.14.01.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:27 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 07/77] virtio-balloon: fix free page hinting without an iothread Date: Thu, 3 Sep 2020 15:58:25 -0500 Message-Id: <20200903205935.27832-8-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32c; envelope-from=flukshun@gmail.com; helo=mail-ot1-x32c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S . Tsirkin" , David Hildenbrand , qemu-stable@nongnu.org, Alexander Duyck , Wei Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand In case we don't have an iothread, we mark the feature as abscent but still add the queue. 'free_page_bh' remains set to NULL. qemu-system-i386 \ -M microvm \ -nographic \ -device virtio-balloon-device,free-page-hint=true \ -nographic \ -display none \ -monitor none \ -serial none \ -qtest stdio Doing a "write 0xc0000e30 0x24 0x030000000300000003000000030000000300000003000000030000000300000003000000" We will trigger a SEGFAULT. Let's move the check and bail out. While at it, move the static initializations to instance_init(). free_page_report_status and block_iothread are implicitly set to the right values (0/false) already, so drop the initialization. Reviewed-by: Alexander Duyck Reviewed-by: Philippe Mathieu-Daudé Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Reported-by: Alexander Bulekov Cc: qemu-stable@nongnu.org Cc: Wei Wang Cc: Michael S. Tsirkin Cc: Philippe Mathieu-Daudé Cc: Alexander Duyck Signed-off-by: David Hildenbrand Message-Id: <20200520100439.19872-2-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 12fc8903a8ee09fb5f642de82699a0b211e1b5a7) Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a4729f7fc9..ef499e1b3b 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -789,6 +789,13 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp) return; } + if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_FREE_PAGE_HINT) && + !s->iothread) { + error_setg(errp, "'free-page-hint' requires 'iothread' to be set"); + virtio_cleanup(vdev); + return; + } + s->ivq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output); s->dvq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output); s->svq = virtio_add_queue(vdev, 128, virtio_balloon_receive_stats); @@ -797,24 +804,11 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp) VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE, virtio_balloon_handle_free_page_vq); - s->free_page_report_status = FREE_PAGE_REPORT_S_STOP; - s->free_page_report_cmd_id = - VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; - s->free_page_report_notify.notify = - virtio_balloon_free_page_report_notify; precopy_add_notifier(&s->free_page_report_notify); - if (s->iothread) { - object_ref(OBJECT(s->iothread)); - s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread), - virtio_ballloon_get_free_page_hints, s); - qemu_mutex_init(&s->free_page_lock); - qemu_cond_init(&s->free_page_cond); - s->block_iothread = false; - } else { - /* Simply disable this feature if the iothread wasn't created. */ - s->host_features &= ~(1 << VIRTIO_BALLOON_F_FREE_PAGE_HINT); - virtio_error(vdev, "iothread is missing"); - } + + object_ref(OBJECT(s->iothread)); + s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread), + virtio_ballloon_get_free_page_hints, s); } reset_stats(s); } @@ -892,6 +886,11 @@ static void virtio_balloon_instance_init(Object *obj) { VirtIOBalloon *s = VIRTIO_BALLOON(obj); + qemu_mutex_init(&s->free_page_lock); + qemu_cond_init(&s->free_page_cond); + s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; + s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify; + object_property_add(obj, "guest-stats", "guest statistics", balloon_stats_get_all, NULL, NULL, s, NULL); From patchwork Thu Sep 3 20:58:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=p3pXJs7F; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDfw5FlBz9sSP for ; Fri, 4 Sep 2020 07:37:28 +1000 (AEST) Received: from localhost ([::1]:43060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwv8-00077Z-Mn for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:37:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMO-0005Z8-R0; Thu, 03 Sep 2020 17:01:32 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:35611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMN-0007xh-0E; Thu, 03 Sep 2020 17:01:32 -0400 Received: by mail-ot1-x332.google.com with SMTP id i4so4040025ota.2; Thu, 03 Sep 2020 14:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QR57nNbf5eNvk41+1C7VvpA6VmcUymk4wbFzEUFu1zg=; b=p3pXJs7FrDAE1Oz2N+61RF9BmW0fa8GnxsGi/m4hR9VNNURiQbAvfFBxRAeX5SyM+U YiU0v4Nu5WKxPuAQPAzArVL92qj6Z1v+m5CE8kiXc/d+hqXRCWd0TPYR4Luugo2+byQO v6ybHO8VE505RyffdTr9268YfA+8HRHAoR8JuJdrvzWemMqAOb8ifGO6BAyfKlo+B94E 4I3UlJswYjq/4C9uDFQOatgcoEezCF1Jv3ipltNt9qdQ2mKGb+BKdykC/VfjJ6k+qKsD 9qJs26uOMj35aTi8NVoqhSKa6e5RRm9/GlK9O7DzwUFnMiR6uvTAt2ZqfoTIJNQufMFw YGkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QR57nNbf5eNvk41+1C7VvpA6VmcUymk4wbFzEUFu1zg=; b=DA3unmZvO5X/s+bFE6Y+vn7A9HVGZWV4cuSxLk1vwGMVkfJwTy7h486raDU5iHBI6/ TC/uQifi4QVPOjAwoQZio7Zw1szFSlvLA1XLB1NR0DJ2mbKSKdzlSvJYbz6Ctr+3aHdZ WQx1oQvf9qVTwXWqS3iX9Dia8yGhkxFpJfU6CIgVcx1H6KAziCa/ggbD+rVfgLx1H9bS 8CfuuFGTb7/5a3Iq9hzCNQxHqe5eJrUClJfnVGG4aJhP57ydQo/oU9jA/cZmW2vuuJ2U rBiiylYvrxRCa0Rkg3yEFj/KvYIrpG6aFF09txM47eWPIQgwbsR2d98xkXDu2KfOkkWK cggg== X-Gm-Message-State: AOAM531AG1r0ica1EEV+Llu2T2cPMKZM+uHp+D0RljxUQ2NutGX/Wh2d 4lDhRljz01pXcLO2tmhEG9RJBhZP6nX5gg== X-Google-Smtp-Source: ABdhPJw74MLZYytGzCizOaNATDZund5++b/KtEEAfk/3BmsrG88QG63TxHMFFKs47dKreIeZ+cFEQw== X-Received: by 2002:a9d:4d0:: with SMTP id 74mr3171113otm.119.1599166889287; Thu, 03 Sep 2020 14:01:29 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id t4sm766376otc.24.2020.09.03.14.01.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:28 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 08/77] virtio-balloon: fix free page hinting check on unrealize Date: Thu, 3 Sep 2020 15:58:26 -0500 Message-Id: <20200903205935.27832-9-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=flukshun@gmail.com; helo=mail-ot1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S . Tsirkin" , David Hildenbrand , qemu-stable@nongnu.org, Alexander Duyck , Wei Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand Checking against guest features is wrong. We allocated data structures based on host features. We can rely on "free_page_bh" as an indicator whether to un-do stuff instead. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alexander Duyck Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Cc: qemu-stable@nongnu.org Cc: Wei Wang Cc: Michael S. Tsirkin Cc: Philippe Mathieu-Daudé Cc: Alexander Duyck Signed-off-by: David Hildenbrand Message-Id: <20200520100439.19872-3-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 49b01711b8eb3796c6904c7f85d2431572cfe54f) Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index ef499e1b3b..3e3b5ff0f8 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -818,7 +818,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp) VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIOBalloon *s = VIRTIO_BALLOON(dev); - if (virtio_balloon_free_page_support(s)) { + if (s->free_page_bh) { qemu_bh_delete(s->free_page_bh); virtio_balloon_free_page_stop(s); precopy_remove_notifier(&s->free_page_report_notify); From patchwork Thu Sep 3 20:58:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iddFmDJ7; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjD7g0S7gz9sPB for ; Fri, 4 Sep 2020 07:13:51 +1000 (AEST) Received: from localhost ([::1]:53124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwYG-00061L-VQ for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:13:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKq-00036s-LR; Thu, 03 Sep 2020 16:59:56 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:46518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKo-0007KO-In; Thu, 03 Sep 2020 16:59:56 -0400 Received: by mail-ot1-x342.google.com with SMTP id c10so3972639otm.13; Thu, 03 Sep 2020 13:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BVrfXN+PksS1+3mj7WHwrA4ngS6G5v4nICiHt9L9Kw0=; b=iddFmDJ7CDJcp+Rogo00I29oCuWilvK0P6QrQDBwBudPYwTF+439RQhUg96w2iT+4r 8Iygb6wE6XCluWQUGt37xA4XJoPTmAueXoDqxXMd6W5OeuZW7LXiW6056hgFvG/ctqmR CkqjJ7ju+zWqAO17iCRv6qHww9hR07GQgajGuC6OkxsjVl0Pxc2xu0j8TS365NaqIXxB EjxxovPIvGltgPwPtDfryDEssHES9ujnzleu6hl9srrX7oXgY1miypyA1p7MQ7iqufRz yy1EbBzWp8MplWGTwCbWGcAvjtAUvCDah3HG1m9cKiZhR8KEbKUCBBQ2T7R9lknKK/2O w7Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BVrfXN+PksS1+3mj7WHwrA4ngS6G5v4nICiHt9L9Kw0=; b=Eg4/O77+7wE+CW4NgchLzGTHD6Rs5qh7OWXrm47PmiAUqGzI8tYiHGfDtMKLqN5o57 qcs3x5kGsx5Buqp1i1ptT8L3k0qKKaESco6mkJU+VOk+gW4Djd7brp8sCXWrkoLYQsB1 SRWRode10/Phl9103gl5pUxZWoKfqvVci/6XSNzLnTzUMmRKsTJMqczWQkKQQCS7rGpf 0XZVbqfoTbGsNYuVET/MP8ugCGZD2+FalC9xcPV/Fx5qOKAWzL3qtT5luPgx3MKjTUY7 +gDAehEpA/t2eWfiVJyoYIjO9T0ovVZobNBl4wfSbLBTKvjeZ1vyDC+Obr5UnXn0hCFv CrGw== X-Gm-Message-State: AOAM532kB6kh3IjTzJc6GyN8NZHfWiT6jMKIxq6B9bx39oyp+by8R8tJ CGqQykQZF8/eEh06Ga9v6QVJFOLw6dg= X-Google-Smtp-Source: ABdhPJzzCAQrLgn1gBYGKy6Y/ZxgeEvC+GrMTtHJMrnpBCaDRcoQLJTdDeZ+djXZF9CYrSGEf/BoxQ== X-Received: by 2002:a9d:23c7:: with SMTP id t65mr2988703otb.275.1599166790542; Thu, 03 Sep 2020 13:59:50 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l63sm711386oia.56.2020.09.03.13.59.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:49 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 09/77] virtio-balloon: unref the iothread when unrealizing Date: Thu, 3 Sep 2020 15:58:27 -0500 Message-Id: <20200903205935.27832-10-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=flukshun@gmail.com; helo=mail-ot1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S . Tsirkin" , David Hildenbrand , qemu-stable@nongnu.org, Alexander Duyck , Wei Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand We took a reference when realizing, so let's drop that reference when unrealizing. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alexander Duyck Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Cc: qemu-stable@nongnu.org Cc: Wei Wang Cc: Alexander Duyck Cc: Michael S. Tsirkin Cc: Philippe Mathieu-Daudé Signed-off-by: David Hildenbrand Message-Id: <20200520100439.19872-4-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 105aef9c9479786d27c1c45c9b0b1fa03dc46be3) Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 3e3b5ff0f8..e20f90dad4 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -820,6 +820,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp) if (s->free_page_bh) { qemu_bh_delete(s->free_page_bh); + object_unref(OBJECT(s->iothread)); virtio_balloon_free_page_stop(s); precopy_remove_notifier(&s->free_page_report_notify); } From patchwork Thu Sep 3 20:58:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JQxVVthB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDHk6JL9z9sSP for ; Fri, 4 Sep 2020 07:20:50 +1000 (AEST) Received: from localhost ([::1]:54218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwf2-0001CE-P4 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:20:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKq-00036x-VV; Thu, 03 Sep 2020 16:59:56 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]:34055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKo-0007Kc-Is; Thu, 03 Sep 2020 16:59:56 -0400 Received: by mail-ot1-x32b.google.com with SMTP id h17so3206982otr.1; Thu, 03 Sep 2020 13:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ATS4oJGp1SnQFEtm6D13xyOuW3gjvEjZ49ChbnGmBj8=; b=JQxVVthBAM6VrGy8C3f9nic65DczEc46Cp9V5Mxu9hHcIaAzgf3RF8UyJWXRsOylti w52+X25sFLaBe1s5DDbW3LOQO/irfcvkIE5dfsIZsZDwyjqmXloET4xRdlRHORGOFGTA EsFZheMmslq1k5gtJZsgsQLWQUxuf9hoi0gwJBCwkEKjRyQQ+4GeLlCh1ZOV1lMnxILk fLQX2Gass9MS1jvGyp4JJcF7ZCwDaQv63/iuzJ9HDwP7b/+nzCQpcgbtKMRh3QLnJXST 9b1WS2smuJn++llMPS8eo0cue3R0UG9AZFrZlSUvi6bsBO3aunokKYZzVy7lkrH2ICeQ thRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ATS4oJGp1SnQFEtm6D13xyOuW3gjvEjZ49ChbnGmBj8=; b=jIc9G/4JgEhQudfXmf/8KiAmQyPiVjf4502W0q5kXbU+Lo0cZMUw3OXM8kOPohpfdv Sv+JmUlmNm3J++ASMygOfuSg2fLJ+bzhpjtTvovMOxeiWE15rtEIBDihqVq8X0ZOFplB 634b0vj8TrXtQyraaZcQpRXjQId23n3RHr43NelNLwLeb5ZkqB+nYNfb7/xnTGtwbkHB isSBbUDCE5hhMc/MfeaQDPJ7Zun6l32+06g7fiQOjoPBdOVC+ZnM8uyIqurlpzSiIK0e xGb6B524J9BGJzRVTB+TvPL9gTcnFHIkG8RCgiin0J3bk4mCDYRtg1Yf+zygBO/NiN8F fE8g== X-Gm-Message-State: AOAM533iOjQ0dt9PZKFxHumJ93dLY9rIGKFU/W6YnPPHvI0+fof9UVhY Wq9zFUgeAfdwHsA+1KBoOkAnZeEqE24= X-Google-Smtp-Source: ABdhPJz6clO8z8h2N8WRpMaGoGVhsHkrTNj3w8kjPgBbKmmcFKwMVlZrHox9qCdNgaGeF2EhAkUhZw== X-Received: by 2002:a05:6830:20d1:: with SMTP id z17mr3131709otq.179.1599166791772; Thu, 03 Sep 2020 13:59:51 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id r33sm828082ooi.48.2020.09.03.13.59.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:51 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 10/77] block: Call attention to truncation of long NBD exports Date: Thu, 3 Sep 2020 15:58:28 -0500 Message-Id: <20200903205935.27832-11-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::32b; envelope-from=flukshun@gmail.com; helo=mail-ot1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake Commit 93676c88 relaxed our NBD client code to request export names up to the NBD protocol maximum of 4096 bytes without NUL terminator, even though the block layer can't store anything longer than 4096 bytes including NUL terminator for display to the user. Since this means there are some export names where we have to truncate things, we can at least try to make the truncation a bit more obvious for the user. Note that in spite of the truncated display name, we can still communicate with an NBD server using such a long export name; this was deemed nicer than refusing to even connect to such a server (since the server may not be under our control, and since determining our actual length limits gets tricky when nbd://host:port/export and nbd+unix:///export?socket=/path are themselves variable-length expansions beyond the export name but count towards the block layer name length). Reported-by: Xueqiang Wei Fixes: https://bugzilla.redhat.com/1843684 Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200610163741.3745251-3-eblake@redhat.com> (cherry picked from commit 5c86bdf1208916ece0b87e1151c9b48ee54faa3e) Signed-off-by: Michael Roth --- block.c | 7 +++++-- block/nbd.c | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/block.c b/block.c index 2e3905c99e..e7e0a92536 100644 --- a/block.c +++ b/block.c @@ -6710,8 +6710,11 @@ void bdrv_refresh_filename(BlockDriverState *bs) pstrcpy(bs->filename, sizeof(bs->filename), bs->exact_filename); } else { QString *json = qobject_to_json(QOBJECT(bs->full_open_options)); - snprintf(bs->filename, sizeof(bs->filename), "json:%s", - qstring_get_str(json)); + if (snprintf(bs->filename, sizeof(bs->filename), "json:%s", + qstring_get_str(json)) >= sizeof(bs->filename)) { + /* Give user a hint if we truncated things. */ + strcpy(bs->filename + sizeof(bs->filename) - 4, "..."); + } qobject_unref(json); } } diff --git a/block/nbd.c b/block/nbd.c index 2160859f64..bfc0be6af6 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1986,6 +1986,7 @@ static void nbd_refresh_filename(BlockDriverState *bs) { BDRVNBDState *s = bs->opaque; const char *host = NULL, *port = NULL, *path = NULL; + size_t len = 0; if (s->saddr->type == SOCKET_ADDRESS_TYPE_INET) { const InetSocketAddress *inet = &s->saddr->u.inet; @@ -1998,17 +1999,21 @@ static void nbd_refresh_filename(BlockDriverState *bs) } /* else can't represent as pseudo-filename */ if (path && s->export) { - snprintf(bs->exact_filename, sizeof(bs->exact_filename), - "nbd+unix:///%s?socket=%s", s->export, path); + len = snprintf(bs->exact_filename, sizeof(bs->exact_filename), + "nbd+unix:///%s?socket=%s", s->export, path); } else if (path && !s->export) { - snprintf(bs->exact_filename, sizeof(bs->exact_filename), - "nbd+unix://?socket=%s", path); + len = snprintf(bs->exact_filename, sizeof(bs->exact_filename), + "nbd+unix://?socket=%s", path); } else if (host && s->export) { - snprintf(bs->exact_filename, sizeof(bs->exact_filename), - "nbd://%s:%s/%s", host, port, s->export); + len = snprintf(bs->exact_filename, sizeof(bs->exact_filename), + "nbd://%s:%s/%s", host, port, s->export); } else if (host && !s->export) { - snprintf(bs->exact_filename, sizeof(bs->exact_filename), - "nbd://%s:%s", host, port); + len = snprintf(bs->exact_filename, sizeof(bs->exact_filename), + "nbd://%s:%s", host, port); + } + if (len > sizeof(bs->exact_filename)) { + /* Name is too long to represent exactly, so leave it empty. */ + bs->exact_filename[0] = '\0'; } } From patchwork Thu Sep 3 20:58:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Ju8X7eDJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjCsG6yx4z9sTg for ; Fri, 4 Sep 2020 07:01:22 +1000 (AEST) Received: from localhost ([::1]:38210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwMC-0003fS-Jg for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:01:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKr-00038x-Sz; Thu, 03 Sep 2020 16:59:57 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:38595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKp-0007L4-R3; Thu, 03 Sep 2020 16:59:57 -0400 Received: by mail-oi1-x244.google.com with SMTP id y6so4511523oie.5; Thu, 03 Sep 2020 13:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=l6xlQJHOv7dE9T6NcBrhJXAaTtTntr3y7qC5ZPuIlyE=; b=Ju8X7eDJBDWIZ/ftmBP6PQKMZUrjC4yQDoSKIYEveB8PMZZBFgshceJXS7WdpQ3+og qTd6sKLqU22g630PezRVi+N/DZ60DXHULrTJvaf8iRpJNQH3IuVl1PJuaaWZ1wagydY9 RQ9PKwJPK5aHOS2xWXEEgwsccdjoU2w8li6//d2pesARyk6NYfl13Yex0zvevTJ1YwL7 8d34qTLt3FNnmcGmX1JMP0PhGqr1xSUKNuZ3tI+RtX+HXYoOS36Di+5eJ4lzgzkwrC6H BZ7MSkbPSltzkZyJhyheVwFF9hDAEYD46uLtIt0z7KBLGzKp1xp5rX3E08fLL/8sK5FL dh7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=l6xlQJHOv7dE9T6NcBrhJXAaTtTntr3y7qC5ZPuIlyE=; b=GctU440dxVDxwcPQUHlGCutCxaWlMap2UAeXJFTSDcNrsPbFoQQmURzX6eM3RZqqVt wrUYEapu/5qjwxnm9qH/0PryltYaDdxu9gg8cJhbYis7P3hqxLBNyBHeWbfdddyb6FnD aP5PfygT8nlE8jPPNRuRgqeuOs///6IEvkfyyoTisAwp85VATZVQUeWHHecpeap3LHhr OFkxFj4bTsZ8cL1UojxOp8IpVksACvu54np3ovDkThbvc/kT0vKuiSRzlMh/zvSXoxAR BjDhVD8oFKUxDk3IJhI6sOzG/9mZUQvDu7CsRCwVdtFpKiB7ei0A9UGTUIde22YXLYDS daAg== X-Gm-Message-State: AOAM531Typ1Yz57YnUl5cFShW5yBjiJUetuccgFZG80C2xu8/F++5shB 8p7+xCitSy73MNJFN46teG8YrD6+I0c= X-Google-Smtp-Source: ABdhPJyNvG8jRaAfFGH7RKA9jD7Gsv0p3mUYK68UHEjMR/K23SQsIynjcyrsLbM3aXTNw8Bd0hQLOw== X-Received: by 2002:aca:2b0c:: with SMTP id i12mr3392493oik.77.1599166794177; Thu, 03 Sep 2020 13:59:54 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id b79sm713535oii.33.2020.09.03.13.59.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:53 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 11/77] 9pfs: local: ignore O_NOATIME if we don't have permissions Date: Thu, 3 Sep 2020 15:58:29 -0500 Message-Id: <20200903205935.27832-12-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kurz , qemu-stable@nongnu.org, Omar Sandoval Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Omar Sandoval QEMU's local 9pfs server passes through O_NOATIME from the client. If the QEMU process doesn't have permissions to use O_NOATIME (namely, it does not own the file nor have the CAP_FOWNER capability), the open will fail. This causes issues when from the client's point of view, it believes it has permissions to use O_NOATIME (e.g., a process running as root in the virtual machine). Additionally, overlayfs on Linux opens files on the lower layer using O_NOATIME, so in this case a 9pfs mount can't be used as a lower layer for overlayfs (cf. https://github.com/osandov/drgn/blob/dabfe1971951701da13863dbe6d8a1d172ad9650/vmtest/onoatimehack.c and https://github.com/NixOS/nixpkgs/issues/54509). Luckily, O_NOATIME is effectively a hint, and is often ignored by, e.g., network filesystems. open(2) notes that O_NOATIME "may not be effective on all filesystems. One example is NFS, where the server maintains the access time." This means that we can honor it when possible but fall back to ignoring it. Acked-by: Christian Schoenebeck Signed-off-by: Omar Sandoval Message-Id: Signed-off-by: Greg Kurz (cherry picked from commit a5804fcf7b22fc7d1f9ec794dd284c7d504bd16b) Signed-off-by: Michael Roth --- hw/9pfs/9p-util.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 79ed6b233e..546f46dc7d 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -37,9 +37,22 @@ static inline int openat_file(int dirfd, const char *name, int flags, { int fd, serrno, ret; +again: fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK, mode); if (fd == -1) { + if (errno == EPERM && (flags & O_NOATIME)) { + /* + * The client passed O_NOATIME but we lack permissions to honor it. + * Rather than failing the open, fall back without O_NOATIME. This + * doesn't break the semantics on the client side, as the Linux + * open(2) man page notes that O_NOATIME "may not be effective on + * all filesystems". In particular, NFS and other network + * filesystems ignore it entirely. + */ + flags &= ~O_NOATIME; + goto again; + } return -1; } From patchwork Thu Sep 3 20:58:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=H81LRNwx; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjD676Gs5z9sPB for ; Fri, 4 Sep 2020 07:12:31 +1000 (AEST) Received: from localhost ([::1]:48406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwWz-00045I-QW for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:12:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKt-0003BI-17; Thu, 03 Sep 2020 16:59:59 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:42780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKr-0007LJ-Gy; Thu, 03 Sep 2020 16:59:58 -0400 Received: by mail-oi1-x242.google.com with SMTP id x14so4501047oic.9; Thu, 03 Sep 2020 13:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ScYD/f+N22CSsPzzfqJN1h5r0Ae2wuAguC3FgHuYGU4=; b=H81LRNwxF5ZdzSyNHD0JMolmorhhNMY/zX25y3OJmC0N+hjvvMYg66QD6qEZMBDiI4 GYoRd53qNsx8jpsAbksd3XBS1RRC9LDVMdia4h20vFbjMjIVOIwxTbxWGDChO/i4ihmk tAXz54E0kAI2dzJ1xxDEG2uYZERivDA56O37C2pO6T2ydemeVossktqPPvuREFANRTnN 2SBBAJKonHwjOfQqvrqqfcI0bfU9NqkTM5yNFVIhDZ/aWgyHouBTXYa35GA2u7+xZLlY Xl956Zk5fWcXl5iD3IfjrDRR8cNPMee5nxv1jiaMwXaGq6BrmvP3EHspIbyyIishEU3j H6/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ScYD/f+N22CSsPzzfqJN1h5r0Ae2wuAguC3FgHuYGU4=; b=cnvY9Vmw7w9MJWugGnn6i5KM0m/qH4FpmvoJoYdbCRQuaFP0IqIcsyYqTH1LO8EE4m krMtPSr8T/8Nz4eZf8lG+EA0kNrxiz/JWVGSPfiP7bs4Kw8hOYFLXFmjbVVds/E18wyq YhOmz5hF/uPqNBkZTXdUQTIP6OKNzjgIb6WwDMoK7RZHV8oDad0oIboY9FiZSE1YCYjL JbQfPC/CMLxHx4l8idjOuBGdPqkI0rQrZr2RUvI5pEyWE/atYuRE02rqDWkYMIkvxLQK DlFzrkd5AKNmxXimSqfDob1A8xhIIhiwv/zF2WulLHnupimTAKkCehSwIwvEeDsg11to K3+A== X-Gm-Message-State: AOAM530XnCPBvz6nBlU6QIXZ4nekvJ8c6/ZvGRmn9QEfy7YU/0W8PARA B/4UginHZ/KgFErVfN34Mv7W1RJFt4o= X-Google-Smtp-Source: ABdhPJzFOdVXcJHSy7wdAicgs4Y8QMW3EJELJIgXDervdAgWySE37ms9/4LeSCNFVc2SDLC4woIM0w== X-Received: by 2002:aca:fd95:: with SMTP id b143mr3224282oii.68.1599166795702; Thu, 03 Sep 2020 13:59:55 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id n186sm831477oob.11.2020.09.03.13.59.54 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:55 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 12/77] 9pfs: include linux/limits.h for XATTR_SIZE_MAX Date: Thu, 3 Sep 2020 15:58:30 -0500 Message-Id: <20200903205935.27832-13-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dan Robertson , qemu-stable@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Dan Robertson linux/limits.h should be included for the XATTR_SIZE_MAX definition used by v9fs_xattrcreate. Fixes: 3b79ef2cf488 ("9pfs: limit xattr size in xattrcreate") Signed-off-by: Dan Robertson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Message-Id: <20200515203015.7090-2-dan@dlrobertson.com> Signed-off-by: Greg Kurz (cherry picked from commit 03556ea920b23c466ce7c1283199033de33ee671) Signed-off-by: Michael Roth --- hw/9pfs/9p.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9e046f7acb..3301e82eb6 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -28,6 +28,7 @@ #include "sysemu/qtest.h" #include "qemu/xxhash.h" #include +#include int open_fd_hw; int total_open_fd; From patchwork Thu Sep 3 20:58:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Hcn7eNHB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDBC0ssgz9sPB for ; Fri, 4 Sep 2020 07:16:03 +1000 (AEST) Received: from localhost ([::1]:33052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwaO-0000vp-VY for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:16:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKu-0003Dy-2X; Thu, 03 Sep 2020 17:00:00 -0400 Received: from mail-oo1-xc44.google.com ([2607:f8b0:4864:20::c44]:42322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKs-0007Lp-Hw; Thu, 03 Sep 2020 16:59:59 -0400 Received: by mail-oo1-xc44.google.com with SMTP id a6so1118160oog.9; Thu, 03 Sep 2020 13:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zVupKeo5/zqUAABc2CM+FsEj1GwOQJfGqOqabRjhG30=; b=Hcn7eNHBIiehSOo6bfbV493jwPmim39jLTz7GrONUFC/MiYDkQ9V4Qb+6rFMCX1nZ9 8OSh7AbxpaF28pQLftSLBGTZ9nB3OsuVcIHaHhsKwP8MIkggfoOc4omz2YCfQCZ67NQp ljslfVp7Yf+0ibjCCFf114zKF4ZnCrPlIIXNevSFQiZCAzyglZI5r2SxTsTrKYctCS49 JkTeSo2WBvMacSAStkHlyLoXmHs40h1yQRtCpffytsM20rfh2bSAJ5b+7UN+7GvY51ZS AXhq2QbRWkFV2Ly0k/dMNauR60M8H/IwBdjY0ZwpmIZFCNQTBkJa275OdL411PaKFJnx 0+Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=zVupKeo5/zqUAABc2CM+FsEj1GwOQJfGqOqabRjhG30=; b=JQpEO1NCdz/gTgur6R02KTpyGKeTBuTGeLut1yeawzoo0sQAfBe6ZqHXadg+ypmQnn gY03E07aMoORuG04gmmDdzMlHrf/Q1FfT1kFWRI0pGRbdGeBurCPSskrEtIkfi0dbJcy 6KdRfGmxbUtMsEpirBi6JwbvRX75vaDl/EXkgOct/PBy773opdKuj2YTr+BSWMaccuJZ g46VdNiLvnBSxPtc/M6LpfK2C4ShBuboXojR16w3+QNFV79D+ROKg+83TF5EdVXv/xwy 0cNsJa6ZUjjwXFlCUGulGC0LRlo1o/cQE2TQWUU+7gYMpz6BXufvedXLEZI8KD6X9aUm qYcg== X-Gm-Message-State: AOAM533+mAYyLqu4/gBJE8vOuE0us0aAU8COqUXxh11jsaJLJJwal3Dp g8q6v0GefNVhpi/N3ZDkMCjElbLf7n4= X-Google-Smtp-Source: ABdhPJz9ZzS8tMAS+z2qImnTBI5O4SEi/MYsm7zWyok79/VsoSi8xfFyc5DLQ2KH1NBtvIDAF9Sw6g== X-Received: by 2002:a4a:9cd6:: with SMTP id d22mr3435323ook.0.1599166796879; Thu, 03 Sep 2020 13:59:56 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id y83sm713971oiy.35.2020.09.03.13.59.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:56 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 13/77] xen-9pfs: Fix log messages of reply errors Date: Thu, 3 Sep 2020 15:58:31 -0500 Message-Id: <20200903205935.27832-14-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c44; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Schoenebeck , qemu-stable@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Christian Schoenebeck If delivery of some 9pfs response fails for some reason, log the error message by mentioning the 9P protocol reply type, not by client's request type. The latter could be misleading that the error occurred already when handling the request input. Signed-off-by: Christian Schoenebeck Acked-by: Stefano Stabellini Message-Id: Signed-off-by: Greg Kurz (cherry picked from commit 9bbb7e0fe081efff2e41f8517c256b72a284fe9b) *prereq for cf45183b718 Signed-off-by: Michael Roth --- hw/9pfs/xen-9p-backend.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index 18fe5b7c92..f04caabfe5 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -137,7 +137,8 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu, ret = v9fs_iov_vmarshal(in_sg, num, offset, 0, fmt, ap); if (ret < 0) { xen_pv_printf(&xen_9pfs->xendev, 0, - "Failed to encode VirtFS request type %d\n", pdu->id + 1); + "Failed to encode VirtFS reply type %d\n", + pdu->id + 1); xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing); xen_9pfs_disconnect(&xen_9pfs->xendev); } @@ -201,9 +202,9 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu, buf_size = iov_size(ring->sg, num); if (buf_size < P9_IOHDRSZ) { - xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d" - "needs %zu bytes, buffer has %zu, less than minimum\n", - pdu->id, *size, buf_size); + xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs " + "%zu bytes, buffer has %zu, less than minimum\n", + pdu->id + 1, *size, buf_size); xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing); xen_9pfs_disconnect(&xen_9pfs->xendev); } From patchwork Thu Sep 3 20:58:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=K41zXm3y; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDDf0Jndz9sSP for ; Fri, 4 Sep 2020 07:18:09 +1000 (AEST) Received: from localhost ([::1]:41516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwcR-0004La-0B for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:18:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKv-0003Ib-Ta; Thu, 03 Sep 2020 17:00:01 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:45185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKt-0007M9-LA; Thu, 03 Sep 2020 17:00:01 -0400 Received: by mail-oi1-x244.google.com with SMTP id d189so4477635oig.12; Thu, 03 Sep 2020 13:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=toeoNpfYSl/ElO5L5zgrTHQpTRhSexoIT3AHev1/A18=; b=K41zXm3yPtZh66GpNio+YEWXfx2h3USDuminp96CCGrnPTsjJPH7Mv+Q+v2ily4vrR VD600XticEOJmBhV7mSZUM/JdpjMuAxDZkZi6viR1glwHyrdTAbtn6uYnUeMZ5S+dgdu f9zmQGcYRr7eVMeeFncJmTFN0HIx6gLcBX7AyeKc9Imi3e0/qOsOyn4wln818Fzo/08O 2vm9fffAyKAiEPJMH1rp7PGxXbbHgHyuw/Ti8lP9H/30HmV8U3tBuQqjKPcCEQ7uzNPE WUVlx3xU+vPutCFclczIL2gCsyIRdPhwkex9KFb1gQuGn23WkaAtLQhg3R3Gqdaikivk /3RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=toeoNpfYSl/ElO5L5zgrTHQpTRhSexoIT3AHev1/A18=; b=IocqSO2O7rRe9UiEv/pGu5jPQU7n8mglw+QA2DX5jUss599pBlGAQi6GzAeC428mru hznzUCKNyubQC3/ia4W8cQ/lEvSUOiAZ1uaXimKL/UFAlmuEbQOj1KcjkRCiYYtnzXXW OUHkDs8kcwfIQTyquvepyMtjWVU5YVyPnSR8D5e5zdIgXTCqWLZqmLpziCZQfivdVQOO rLHEJIiGLqLGXJ0pjHAeFf2021500qBDdaA2/Qc4/PTAxw8T2bVgVy9/T7iINApEvV1W XvcuwZS3xljjotgVo4WpevEVW3HYLRF6APLiKEf/5I9u7TODoiS5yVTwI7Q1IY66wfso KvPA== X-Gm-Message-State: AOAM533DPtdRygmtkn8XBGciVVxW2OWWWpW1N+x204y9MsdU6LqcR43d gEDXUE2WZlqylUvXRmaa1TGCcXdgSEs= X-Google-Smtp-Source: ABdhPJw49Z3GJLeQk1dhBFzMfFm9GkJSIRfSrfwMwKoSukVDGPeuLP2DD7WhDOO/2VzeQpBrasWvCQ== X-Received: by 2002:a05:6808:2d7:: with SMTP id a23mr3225672oid.51.1599166797905; Thu, 03 Sep 2020 13:59:57 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id u19sm729310oic.10.2020.09.03.13.59.57 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:57 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 14/77] Revert "9p: init_in_iov_from_pdu can truncate the size" Date: Thu, 3 Sep 2020 15:58:32 -0500 Message-Id: <20200903205935.27832-15-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , qemu-stable@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefano Stabellini This reverts commit 16724a173049ac29c7b5ade741da93a0f46edff7. It causes https://bugs.launchpad.net/bugs/1877688. Signed-off-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck Message-Id: <20200521192627.15259-1-sstabellini@kernel.org> Signed-off-by: Greg Kurz (cherry picked from commit cf45183b718f02b1369e18c795dc51bc1821245d) Signed-off-by: Michael Roth --- hw/9pfs/9p.c | 33 +++++++++++---------------------- hw/9pfs/9p.h | 2 +- hw/9pfs/virtio-9p-device.c | 11 ++++------- hw/9pfs/xen-9p-backend.c | 15 ++++++--------- 4 files changed, 22 insertions(+), 39 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 3301e82eb6..1b729af6e8 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -2103,29 +2103,22 @@ out_nofid: * with qemu_iovec_destroy(). */ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu, - size_t skip, size_t *size, + size_t skip, size_t size, bool is_write) { QEMUIOVector elem; struct iovec *iov; unsigned int niov; - size_t alloc_size = *size + skip; if (is_write) { - pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, alloc_size); + pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, size + skip); } else { - pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, &alloc_size); - } - - if (alloc_size < skip) { - *size = 0; - } else { - *size = alloc_size - skip; + pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, size + skip); } qemu_iovec_init_external(&elem, iov, niov); qemu_iovec_init(qiov, niov); - qemu_iovec_concat(qiov, &elem, skip, *size); + qemu_iovec_concat(qiov, &elem, skip, size); } static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, @@ -2133,14 +2126,15 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, { ssize_t err; size_t offset = 7; - size_t read_count; + uint64_t read_count; QEMUIOVector qiov_full; if (fidp->fs.xattr.len < off) { read_count = 0; - } else if (fidp->fs.xattr.len - off < max_count) { - read_count = fidp->fs.xattr.len - off; } else { + read_count = fidp->fs.xattr.len - off; + } + if (read_count > max_count) { read_count = max_count; } err = pdu_marshal(pdu, offset, "d", read_count); @@ -2149,7 +2143,7 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, } offset += err; - v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &read_count, false); + v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, read_count, false); err = v9fs_pack(qiov_full.iov, qiov_full.niov, 0, ((char *)fidp->fs.xattr.value) + off, read_count); @@ -2278,11 +2272,9 @@ static void coroutine_fn v9fs_read(void *opaque) QEMUIOVector qiov_full; QEMUIOVector qiov; int32_t len; - size_t size = max_count; - v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, &size, false); + v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, max_count, false); qemu_iovec_init(&qiov, qiov_full.niov); - max_count = size; do { qemu_iovec_reset(&qiov); qemu_iovec_concat(&qiov, &qiov_full, count, qiov_full.size - count); @@ -2533,7 +2525,6 @@ static void coroutine_fn v9fs_write(void *opaque) int32_t len = 0; int32_t total = 0; size_t offset = 7; - size_t size; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; @@ -2546,9 +2537,7 @@ static void coroutine_fn v9fs_write(void *opaque) return; } offset += err; - size = count; - v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &size, true); - count = size; + v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true); trace_v9fs_write(pdu->tag, pdu->id, fid, off, count, qiov_full.niov); fidp = get_fid(pdu, fid); diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index c381fe091a..656527beb9 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -436,7 +436,7 @@ struct V9fsTransport { ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap); void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov, - unsigned int *pniov, size_t *size); + unsigned int *pniov, size_t size); void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov, unsigned int *pniov, size_t size); void (*push_and_notify)(V9fsPDU *pdu); diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 536447a355..f821236356 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -147,22 +147,19 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, } static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, - unsigned int *pniov, size_t *size) + unsigned int *pniov, size_t size) { V9fsState *s = pdu->s; V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); VirtQueueElement *elem = v->elems[pdu->idx]; size_t buf_size = iov_size(elem->in_sg, elem->in_num); - if (buf_size < P9_IOHDRSZ) { + if (buf_size < size) { VirtIODevice *vdev = VIRTIO_DEVICE(v); virtio_error(vdev, - "VirtFS reply type %d needs %zu bytes, buffer has %zu, less than minimum", - pdu->id + 1, *size, buf_size); - } - if (buf_size < *size) { - *size = buf_size; + "VirtFS reply type %d needs %zu bytes, buffer has %zu", + pdu->id + 1, size, buf_size); } *piov = elem->in_sg; diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index f04caabfe5..fc197f6c8a 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -188,7 +188,7 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu, static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, unsigned int *pniov, - size_t *size) + size_t size) { Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state); Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings]; @@ -198,19 +198,16 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu, g_free(ring->sg); ring->sg = g_new0(struct iovec, 2); - xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, *size); + xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size); buf_size = iov_size(ring->sg, num); - if (buf_size < P9_IOHDRSZ) { - xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs " - "%zu bytes, buffer has %zu, less than minimum\n", - pdu->id + 1, *size, buf_size); + if (buf_size < size) { + xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d" + "needs %zu bytes, buffer has %zu\n", pdu->id, size, + buf_size); xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing); xen_9pfs_disconnect(&xen_9pfs->xendev); } - if (buf_size < *size) { - *size = buf_size; - } *piov = ring->sg; *pniov = num; From patchwork Thu Sep 3 20:58:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IvmswsPY; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDGr6Sqhz9sPB for ; Fri, 4 Sep 2020 07:20:04 +1000 (AEST) Received: from localhost ([::1]:49714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDweI-0007j2-JW for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:20:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKx-0003Kj-5O; Thu, 03 Sep 2020 17:00:03 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:35788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKu-0007ML-UO; Thu, 03 Sep 2020 17:00:02 -0400 Received: by mail-oi1-x241.google.com with SMTP id w16so4535214oia.2; Thu, 03 Sep 2020 14:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WbB6VAhtrBT4SG9Vr6ej0HJWL2xXc11PC/dJaX/FHdI=; b=IvmswsPYXOQ5wSszAzBpxdaKmcOafWtZkUB74WnlL4Fa0nuwnoFdyZaPq8NW5lQ7ik Z9ib/HyJN2+dB0GsWkEFOW/G6EDyPi85j3pqG+/aYJn8SMCY157Q+X7k/5mrh0FTfoN2 G02ecmiRMCLnEbLKbsBdVoTzSDJj6/Mmd0t/ietrmXi+SMccieyFiqOl35rghu2Lrb3m D6ExOd7aQdfXI04MJ6fLvIVB1pqRRQddDe+N78MMOOdGLRXy3u50SVvk1sTuL1pf4QkY mIbnxCnFbtGHQvF4RYxU0bo/GkoX3X762w+QdTECEsfhKN0vOzjuF6WYT8ka7Q1RHwPh qCTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=WbB6VAhtrBT4SG9Vr6ej0HJWL2xXc11PC/dJaX/FHdI=; b=BlK9Jt68MqTccY1e54l8ABmOUs/CTJmv+TpGO4zWOHaGflwuRZkpupspyLthEEsDQO 0UcOFvsNCF/B1ACJW3wb5BzcJjaSghXkgBy71R5sCIZsertHAKT/AMrenGvXPWdXIDEw +tnOuqd493lf02I290XHAKpO32jmLduQJSLkODS1WXkNYpDJ9CFSRBRxbJ8sJY2gYXy+ F1P9PIfySGfV5cOHzzQeaa7tT4alodclRDybUmU5uZ0i5GNk8hJetxXgF4V2aWR7KhwH WfwNMNRTKYJktBD1qgYRPHAhWsE+/4ewSChxdAHe22Og5/JjcYVDNb5TVSboczPcIQrV 2ByA== X-Gm-Message-State: AOAM530nwNmm/XDDjkKfH1k6SDMUJ1y7/q39Xc3EOF118cyCYKV5YQ6Y oY0bDUaEMZNOe8u3FRrW2tCZEs/+0dA= X-Google-Smtp-Source: ABdhPJxor51/r4+wQK9BhGxTVJ/eSzH8MFU+af+VMR1muKggmi7rEH80t5SiRO8rdssLEYicpL2X5w== X-Received: by 2002:aca:bc57:: with SMTP id m84mr3224034oif.14.1599166799088; Thu, 03 Sep 2020 13:59:59 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id x38sm776992ota.72.2020.09.03.13.59.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:58 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 15/77] xen/9pfs: yield when there isn't enough room on the ring Date: Thu, 3 Sep 2020 15:58:33 -0500 Message-Id: <20200903205935.27832-16-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::241; envelope-from=flukshun@gmail.com; helo=mail-oi1-x241.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , qemu-stable@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefano Stabellini Instead of truncating replies, which is problematic, wait until the client reads more data and frees bytes on the reply ring. Do that by calling qemu_coroutine_yield(). The corresponding qemu_coroutine_enter_if_inactive() is called from xen_9pfs_bh upon receiving the next notification from the client. We need to be careful to avoid races in case xen_9pfs_bh and the coroutine are both active at the same time. In xen_9pfs_bh, wait until either the critical section is over (ring->co == NULL) or until the coroutine becomes inactive (qemu_coroutine_yield() was called) before continuing. Then, simply wake up the coroutine if it is inactive. Signed-off-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck Message-Id: <20200521192627.15259-2-sstabellini@kernel.org> Signed-off-by: Greg Kurz (cherry picked from commit a4c4d462729466c4756bac8a0a8d77eb63b21ef7) Signed-off-by: Michael Roth --- hw/9pfs/xen-9p-backend.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index fc197f6c8a..3c84c86ab8 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -37,6 +37,7 @@ typedef struct Xen9pfsRing { struct iovec *sg; QEMUBH *bh; + Coroutine *co; /* local copies, so that we can read/write PDU data directly from * the ring */ @@ -198,16 +199,20 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu, g_free(ring->sg); ring->sg = g_new0(struct iovec, 2); - xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size); + ring->co = qemu_coroutine_self(); + /* make sure other threads see ring->co changes before continuing */ + smp_wmb(); +again: + xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size); buf_size = iov_size(ring->sg, num); if (buf_size < size) { - xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d" - "needs %zu bytes, buffer has %zu\n", pdu->id, size, - buf_size); - xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing); - xen_9pfs_disconnect(&xen_9pfs->xendev); + qemu_coroutine_yield(); + goto again; } + ring->co = NULL; + /* make sure other threads see ring->co changes before continuing */ + smp_wmb(); *piov = ring->sg; *pniov = num; @@ -292,6 +297,20 @@ static int xen_9pfs_receive(Xen9pfsRing *ring) static void xen_9pfs_bh(void *opaque) { Xen9pfsRing *ring = opaque; + bool wait; + +again: + wait = ring->co != NULL && qemu_coroutine_entered(ring->co); + /* paired with the smb_wmb barriers in xen_9pfs_init_in_iov_from_pdu */ + smp_rmb(); + if (wait) { + cpu_relax(); + goto again; + } + + if (ring->co != NULL) { + qemu_coroutine_enter_if_inactive(ring->co); + } xen_9pfs_receive(ring); } From patchwork Thu Sep 3 20:58:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356980 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=U1A+Ihoq; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjD8j0XDCz9sPB for ; Fri, 4 Sep 2020 07:14:45 +1000 (AEST) Received: from localhost ([::1]:56858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwZ8-0007Xy-UB for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:14:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKy-0003Nn-IL; Thu, 03 Sep 2020 17:00:04 -0400 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:39211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKw-0007MX-BY; Thu, 03 Sep 2020 17:00:04 -0400 Received: by mail-ot1-x32c.google.com with SMTP id u25so4008283otq.6; Thu, 03 Sep 2020 14:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rlfytk/HxGcRvQ43QKeVZDlvKaRhllUNtWQbE6mYVCc=; b=U1A+Ihoqs14Ap+tzZ9MDJuzdSwiT12iqB4x2y0I/xN1lTnml1p4BCBFQd0pPbb9isl Rk0yhQKklzGWQkJSUCNiVbAv4tPs6Yr47szSYmeCX5azHT7g4iaRdFcfPSKa6PwASEZ0 Oj5aIuJ9NNWef0vc9MLu1lioL8WLNdr5w0fdiI0ZVDGILDovtByHD1f2arJmd47Dabgt Wb8uX9rXtLfIWSsHXT/35BwIVlt37NkMQS36HENFUpAoyg2ZlzbKXM8SJeWxs2UbG68W NhDW4WzDTTd53Vyax1PzGP2tZlyBryMUeCJrqPq1uAF7eZCITv3UqPYt1DyWgaWIPnlA tFnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rlfytk/HxGcRvQ43QKeVZDlvKaRhllUNtWQbE6mYVCc=; b=X8HaUSj6IJHCThV0YZoK8R0P6O6wuZZaOcD2ncsAtvULiPgzB0RISLRjgWXoyQh3Ng kvmAKylSIxclR3iFRsC8xdUYC2AqQa1wuGo9EIOiNWmWGJe13k9HUmrAu+ZiCPqk1B5k cun6vNW20SDOz+lYLqmBraJs4X7sfHPyvpWIHMBD3CjoxEvMyNSXm7xFXDuqPFc7DKGP VBQ9nHu2JoR+8YxRfOZ8b2/WM7GPEzO1H7CyAYS6wCotSHDuqvVwiicXYKmzByM7nnmH YktI6CO91stxGTeCN3hgnJT8fJCYxtrLMWuRJIRdQMW4o5kne4TntAKbl9wEs8GklIPi 00Mw== X-Gm-Message-State: AOAM530sAm8yLsA84mTbaXhHifLRFcUsFS2uM5TBh/imOajAXDQ9Mgu/ kBvCjjDyhU2IICBxnECTBwSdwlCWZUc= X-Google-Smtp-Source: ABdhPJzICnhV8rm0nVYYCpfU/wU6GQn/BMzRcIWxPt8YB0OMN0wG6kI5jsAd5BMBN+0kfd+d5W27eA== X-Received: by 2002:a9d:7f84:: with SMTP id t4mr3163361otp.192.1599166800161; Thu, 03 Sep 2020 14:00:00 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id a75sm709467oii.55.2020.09.03.13.59.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 13:59:59 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 16/77] ati-vga: check mm_index before recursive call (CVE-2020-13800) Date: Thu, 3 Sep 2020 15:58:34 -0500 Message-Id: <20200903205935.27832-17-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32c; envelope-from=flukshun@gmail.com; helo=mail-ot1-x32c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , qemu-stable@nongnu.org, Prasad J Pandit Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit While accessing VGA registers via ati_mm_read/write routines, a guest may set 's->regs.mm_index' such that it leads to infinite recursion. Check mm_index value to avoid such recursion. Log an error message for wrong values. Reported-by: Ren Ding Reported-by: Hanqing Zhao Reported-by: Yi Ren Message-id: 20200604090830.33885-1-ppandit@redhat.com Suggested-by: BALATON Zoltan Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Prasad J Pandit Signed-off-by: Gerd Hoffmann (cherry picked from commit a98610c429d52db0937c1e48659428929835c455) Signed-off-by: Michael Roth --- hw/display/ati.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/display/ati.c b/hw/display/ati.c index 58ec8291d4..9228f1b242 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -285,8 +285,11 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) if (idx <= s->vga.vram_size - size) { val = ldn_le_p(s->vga.vram_ptr + idx, size); } - } else { + } else if (s->regs.mm_index > MM_DATA + 3) { val = ati_mm_read(s, s->regs.mm_index + addr - MM_DATA, size); + } else { + qemu_log_mask(LOG_GUEST_ERROR, + "ati_mm_read: mm_index too small: %u\n", s->regs.mm_index); } break; case BIOS_0_SCRATCH ... BUS_CNTL - 1: @@ -520,8 +523,11 @@ static void ati_mm_write(void *opaque, hwaddr addr, if (idx <= s->vga.vram_size - size) { stn_le_p(s->vga.vram_ptr + idx, size, data); } - } else { + } else if (s->regs.mm_index > MM_DATA + 3) { ati_mm_write(s, s->regs.mm_index + addr - MM_DATA, data, size); + } else { + qemu_log_mask(LOG_GUEST_ERROR, + "ati_mm_write: mm_index too small: %u\n", s->regs.mm_index); } break; case BIOS_0_SCRATCH ... BUS_CNTL - 1: From patchwork Thu Sep 3 20:58:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ORoJUkCP; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDNs2ZWkz9sPB for ; Fri, 4 Sep 2020 07:25:17 +1000 (AEST) Received: from localhost ([::1]:46382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwjL-0001UM-9r for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:25:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwKz-0003QG-Qz; Thu, 03 Sep 2020 17:00:05 -0400 Received: from mail-oo1-xc42.google.com ([2607:f8b0:4864:20::c42]:39605) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKx-0007Nh-Lu; Thu, 03 Sep 2020 17:00:05 -0400 Received: by mail-oo1-xc42.google.com with SMTP id m4so1126893oos.6; Thu, 03 Sep 2020 14:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lEZNnKO9GNhaKz9yEgVcPyYgxdyKZQb+4Kbbi2ont1w=; b=ORoJUkCP18n5CA8qn/xcmNJ4nPw8c7zyG2zl3XQzYyhQWgSTcAZ36spSzTfoiCFi3U fkhzIKYRVPVdVnTG2OfqkOiMa3rNwyIwI9ykCet+BRFiiZp+FcDctdmMa14FfZ6VJJXg WvRfTA9W7JloRmRpH/Ro0YDyfTr5AU47UdQfOvGR7cSDftXFfhq611O8v53tcqGg2YOI XeuGf1oLBDxg+fp9oljuB+Yjaig/AzTs1o8hni6wSII57KyOPvUhs0TKmEQ0ic8SuDhg bh8obQGi6V8ZXzyAb8uKvlqwiEYF+0Cl/LfFntxFInjlGG3HE4QTIsFUTiDniD0IZhTv 17vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lEZNnKO9GNhaKz9yEgVcPyYgxdyKZQb+4Kbbi2ont1w=; b=bocVLuA8PBl80QHMOwjFfutI1kB/Ch6JaeRyaVasOoG0SQrPgy72ndRHHBwtZ7lex1 L+aPwdi8oTGCo1c1HAsF95hvSEyCFAQq0woAE3uYmVBogLy8jIfZ1pcVxveMiCnJiCKd KpUARHkJKw4ElkpxQjL2oSzyOcyKlDQLlupiVPBCcwirQ8hLB7FfpqheToI3vb/YqChI 8I3zPGMsSvt0lhNdAnObn6KJ2BO3asiu7Nu3nkM7/gI3nMupZTIL5emVAbhVtopOb5fs Mw+YCNtSobFUdzPLWa9C6YOedssqEpQlFif7npb3FvQsVjrSAMOs7II/CRoRU25C2hKF Cd1A== X-Gm-Message-State: AOAM532zaN7vyZduFUGLRFStjSjCCdXCxGIRh9C+xTXjCoUN2CwPy7OT EAiIBO477Es3p8vpJMjpTlsgC1qkMeg= X-Google-Smtp-Source: ABdhPJzuuAdkGdnNqY/27WYME5ji4tDb2hojvGZMo5k1rgYqPxMR2ZhtHSY+GoqKNMfj4+meLm5Wdw== X-Received: by 2002:a4a:bb05:: with SMTP id f5mr3353415oop.5.1599166801381; Thu, 03 Sep 2020 14:00:01 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id g21sm829342oos.36.2020.09.03.14.00.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:00 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 17/77] es1370: check total frame count against current frame Date: Thu, 3 Sep 2020 15:58:35 -0500 Message-Id: <20200903205935.27832-18-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c42; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , qemu-stable@nongnu.org, Prasad J Pandit Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit A guest user may set channel frame count via es1370_write() such that, in es1370_transfer_audio(), total frame count 'size' is lesser than the number of frames that are processed 'cnt'. int cnt = d->frame_cnt >> 16; int size = d->frame_cnt & 0xffff; if (size < cnt), it results in incorrect calculations leading to OOB access issue(s). Add check to avoid it. Reported-by: Ren Ding Reported-by: Hanqing Zhao Signed-off-by: Prasad J Pandit Message-id: 20200514200608.1744203-1-ppandit@redhat.com Signed-off-by: Gerd Hoffmann (cherry picked from commit 369ff955a8497988d079c4e3fa1e93c2570c1c69) Signed-off-by: Michael Roth --- hw/audio/es1370.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 89c4dabcd4..5f8a83ff56 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -643,6 +643,9 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, int csc_bytes = (csc + 1) << d->shift; int cnt = d->frame_cnt >> 16; int size = d->frame_cnt & 0xffff; + if (size < cnt) { + return; + } int left = ((size - cnt + 1) << 2) + d->leftover; int transferred = 0; int temp = MIN (max, MIN (left, csc_bytes)); @@ -651,7 +654,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, addr += (cnt << 2) + d->leftover; if (index == ADC_CHANNEL) { - while (temp) { + while (temp > 0) { int acquired, to_copy; to_copy = MIN ((size_t) temp, sizeof (tmpbuf)); @@ -669,7 +672,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, else { SWVoiceOut *voice = s->dac_voice[index]; - while (temp) { + while (temp > 0) { int copied, to_copy; to_copy = MIN ((size_t) temp, sizeof (tmpbuf)); From patchwork Thu Sep 3 20:58:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UPQNpOEu; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDJt2T4Rz9sPB for ; Fri, 4 Sep 2020 07:21:50 +1000 (AEST) Received: from localhost ([::1]:58954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwg0-000372-7s for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:21:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL0-0003Rn-O1; Thu, 03 Sep 2020 17:00:06 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:41867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKy-0007OM-MC; Thu, 03 Sep 2020 17:00:06 -0400 Received: by mail-ot1-x344.google.com with SMTP id a65so3999855otc.8; Thu, 03 Sep 2020 14:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=DnoLtc59NarnPTasZCly4q1/2ffMi+9W8GNcCg5WkuI=; b=UPQNpOEuzla8r0L7AyY5MczaFSat1A446PzeEO/TRqNE4LF8/4oQ+2srzALnhy+BHR qvO+5OPglTWvpkh85Nvfd4xwtvMkWy1/YHiO4CXoTGBidDFmCJuzH9DMDslBWCXk7ZvZ Xxv75cLW033W8FAZAWr5MLO9pqChKsNkunNDbojK9mn2v9xY7VYvR/zk/QmHKxE5hmLP I8DK6YzZQo5kplnucdF9vslEXrsQwS5OWJw/gBtaiKi4Rt0L6TVeokoV3J5NHbw4g4G4 nv/MaaBIVW4B4UwurqvJEt0cipBaNmwGd0oAccS+eJja9jtr/yMheEas4lXyrl7hdT4t RJYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=DnoLtc59NarnPTasZCly4q1/2ffMi+9W8GNcCg5WkuI=; b=Dx6o2cfy4MgQk3vueKEAbvscQyjB7jGtzdeqnxNu1gN3KlECErT3Iogn24YM+rihP2 YEZP3tGvw5zeWgJk4eO9JcmHRHMrk1UKV4xJ2T2mcR73hASMQn8sd5OaVTmHH9kPA3Zo nmtyXNO1ROhKrbG6hE78xluLAe27cIGqy/DBXxhTUS9O9l5YcMBhWVlcRb+/Zm+FF75g bsme+4TkvqCYvcnSvALTgvo4pc8Jg8y/9qSvVkrhFQ6kaUVhLJ/Fq8r1YBzBaAPsP+4S 2owz6yjyw8fKlVgxBp5Q+ak1VSAqess6lep1aWHVfHQM6CKT4jOQdE8Tu7s8arvoB1xb G8eA== X-Gm-Message-State: AOAM530id3KpFXKpXLdMW53fZKNMgcEjM834PoprkJ0t8Y8UnzOi2Ae3 QsoWIgVtQ0TRKOOZP92uVaA90i2CMZY= X-Google-Smtp-Source: ABdhPJyde/+tNfRJ3SeIhbX+MNu9dZC6NZHTJ7EcMqaFtXs1RkFocV91elsja5/9USme1ZEI52lPcg== X-Received: by 2002:a05:6830:2141:: with SMTP id r1mr2963428otd.314.1599166802781; Thu, 03 Sep 2020 14:00:02 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id a2sm820168ooo.26.2020.09.03.14.00.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:02 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 18/77] Fix tulip breakage Date: Thu, 3 Sep 2020 15:58:36 -0500 Message-Id: <20200903205935.27832-19-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=flukshun@gmail.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Helge Deller , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller The tulip network driver in a qemu-system-hppa emulation is broken in the sense that bigger network packages aren't received any longer and thus even running e.g. "apt update" inside the VM fails. The breakage was introduced by commit 8ffb7265af ("check frame size and r/w data length") which added checks to prevent accesses outside of the rx/tx buffers. But the new checks were implemented wrong. The variable rx_frame_len counts backwards, from rx_frame_size down to zero, and the variable len is never bigger than rx_frame_len, so accesses just can't happen and the checks are unnecessary. On the contrary the checks now prevented bigger packages to be moved into the rx buffers. This patch reverts the wrong checks and were sucessfully tested with a qemu-system-hppa emulation. Fixes: 8ffb7265af ("check frame size and r/w data length") Buglink: https://bugs.launchpad.net/bugs/1874539 Signed-off-by: Helge Deller Signed-off-by: Jason Wang (cherry picked from commit d9b69640391618045949f7c500b87fc129f862ed) Signed-off-by: Michael Roth --- hw/net/tulip.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/net/tulip.c b/hw/net/tulip.c index 1295f51d07..44db56447c 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -171,9 +171,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc) len = s->rx_frame_len; } - if (s->rx_frame_len + len > sizeof(s->rx_frame)) { - return; - } pci_dma_write(&s->dev, desc->buf_addr1, s->rx_frame + (s->rx_frame_size - s->rx_frame_len), len); s->rx_frame_len -= len; @@ -186,9 +183,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc) len = s->rx_frame_len; } - if (s->rx_frame_len + len > sizeof(s->rx_frame)) { - return; - } pci_dma_write(&s->dev, desc->buf_addr2, s->rx_frame + (s->rx_frame_size - s->rx_frame_len), len); s->rx_frame_len -= len; From patchwork Thu Sep 3 20:58:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tEioXK8P; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjCxB5RPFz9sRK for ; Fri, 4 Sep 2020 07:04:46 +1000 (AEST) Received: from localhost ([::1]:49648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwPU-0000mN-Nb for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:04:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL1-0003U2-J5; Thu, 03 Sep 2020 17:00:07 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:42690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwKz-0007PS-Qf; Thu, 03 Sep 2020 17:00:07 -0400 Received: by mail-oi1-x235.google.com with SMTP id x14so4501482oic.9; Thu, 03 Sep 2020 14:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=D++uhEYw+d3KQcavq6f/g9akX1hQgOj/ppCWcFXbXE0=; b=tEioXK8PcEKWmWlZq6SMEoBFp32xOy7HNKitz9kQZhX9Hl4bHE232eErZc0H9TTyf2 k0dDfEF9R6jS6dNraWcZaMoPdMgrSEt57xl8xkzxcYPDd4XEuqcUgAq86cfQCIe2Fsmr KMuvgYvCai3kKkzHvY4tCsB6rqCSOErgj9+Xb6S60fFIMzDLaCLQTGLQNLcZ9M4zBdtR xk7d3k86F+8DvWTydwMmzVQKvT/E6A9au2bME1TTy1D4jotNNVXPBa2ndXKT6BqzSsEE HRuVtwuPcod52+ld+fFIbqQ4euIGa9Xx7WYQFow6CIRmpBxD0orq14/zoVtr9hH0f5JZ 2yYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=D++uhEYw+d3KQcavq6f/g9akX1hQgOj/ppCWcFXbXE0=; b=jAZGBzjiua1+A057HMStpEtTOUpi/SlC5kaCo3JgHRZiRPtUKy1TLwuvy6tWZog9k7 qT3P1Wq2N9t7zUro4CQJpZkDzY8UhxF5CB3q6oVikjbSsADUMTS0iATA+1AwG3TyZnQp +dLOQRSiJW5vKqRZ/QInyfak3K8q2jwleB1i4iSMj2jd/RWMeY1j7uQYnfgSi5S6YJLj BlUcj4+kYQdujEjKmQrXHLYzt0UZcFu18+2cwoPDKTQIE5024JI1CCh12Lt9dYEnDChC 6dteRSNXnQMEk2h2s+yfjKNctHxY8WYsyiXsAOlfEMmaKZM6mX+XBY4r3jx+FOux+Dn4 Y95w== X-Gm-Message-State: AOAM530vXvtjG/XwdB/uPYqRLzUYa2AeQDQzz/7amiTPAN1zs6kP7FPs zHdLngApypmaxHfLYRjxgG5+N9f7TSY= X-Google-Smtp-Source: ABdhPJzHHlvnzQofJnh1MA2OabWvcu6UShqEGNSjCQmpzuMSaPQyKTrxPXbcQv66nXRFjABwRz0nxw== X-Received: by 2002:aca:ed0a:: with SMTP id l10mr3403819oih.9.1599166803887; Thu, 03 Sep 2020 14:00:03 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id d83sm703620oib.43.2020.09.03.14.00.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:03 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 19/77] iotests/283: Use consistent size for source and target Date: Thu, 3 Sep 2020 15:58:37 -0500 Message-Id: <20200903205935.27832-20-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::235; envelope-from=flukshun@gmail.com; helo=mail-oi1-x235.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Kevin Wolf The test case forgot to specify the null-co size for the target node. When adding a check to backup that both sizes match, this would fail because of the size mismatch and not the behaviour that the test really wanted to test. Fixes: a541fcc27c98b96da187c7d4573f3270f3ddd283 Signed-off-by: Kevin Wolf Message-Id: <20200430142755.315494-2-kwolf@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf (cherry picked from commit 813cc2545b82409fd504509f0ba2e96fab6edb9e) Signed-off-by: Michael Roth --- tests/qemu-iotests/283 | 6 +++++- tests/qemu-iotests/283.out | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/283 b/tests/qemu-iotests/283 index 55b7cff953..44de76effe 100644 --- a/tests/qemu-iotests/283 +++ b/tests/qemu-iotests/283 @@ -72,7 +72,11 @@ to check that crash is fixed :) vm = iotests.VM() vm.launch() -vm.qmp_log('blockdev-add', **{'node-name': 'target', 'driver': 'null-co'}) +vm.qmp_log('blockdev-add', **{ + 'node-name': 'target', + 'driver': 'null-co', + 'size': size, +}) vm.qmp_log('blockdev-add', **{ 'node-name': 'source', diff --git a/tests/qemu-iotests/283.out b/tests/qemu-iotests/283.out index daaf5828c1..d8cff22cc1 100644 --- a/tests/qemu-iotests/283.out +++ b/tests/qemu-iotests/283.out @@ -1,4 +1,4 @@ -{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "target"}} +{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "target", "size": 1048576}} {"return": {}} {"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": {"driver": "null-co", "node-name": "base", "size": 1048576}, "node-name": "source"}} {"return": {}} From patchwork Thu Sep 3 20:58:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=H6HgUhoH; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDC93HTSz9sPB for ; Fri, 4 Sep 2020 07:16:53 +1000 (AEST) Received: from localhost ([::1]:36916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwbD-0002Xs-7a for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:16:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL3-0003X5-2s; Thu, 03 Sep 2020 17:00:09 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:45784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL1-0007Pl-1Y; Thu, 03 Sep 2020 17:00:08 -0400 Received: by mail-oi1-x235.google.com with SMTP id d189so4477963oig.12; Thu, 03 Sep 2020 14:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=OIsdyV2PRysNfY7ypO8eiajhFecOTZcFODPU4qiwxp8=; b=H6HgUhoHtv7MNe8tt7gWCEWnsJ1mX23d3zM819/uHRaWj0MguMhnTp+FzcwsiZAb6I 3i4F0yjUdkPcsLgb+ahksZd1o2U2OOWVCnpFvOdzsfjhGbhnFv8oe+cs/D3RVD7oM79B NLuAzBVU7nXj9yZQ0QPtCUjaAW7PtQM03+CJd1zoFXd/hTRaZ4a7UDyqA+GiI3t3b7C6 JCHXf6AqKsNR9QWIIc4R6xYtJovbHFFC0hhxysFDgGLOP65YGtYes4tE/WcQByN9sOxA auvI4gBkqvxGyActzKeIYh0itCvz3yJDiJn2EQWs5w+odLHyweRL7W2G4UHWOhxm3XYi uTUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=OIsdyV2PRysNfY7ypO8eiajhFecOTZcFODPU4qiwxp8=; b=qFdt8Fmrl2tYpB4m2oCA0VHbu4KKEwJ3WSBP0AFR6M6T3mr6/jIeJTHYbWmZ4f6Vzv PxiqFPBy0qPrQLk6704uc3I+71fNLPLUQyQzSrjc6NF9npwyQtEHJGn1pWetG6eQwbgk etPJziTqELeTvj9vJtVTpGpt1TZqZdfPyCyoNpPzHyS3IllFKlKZNbzVUm1TtlKWlM3a cTig2d50qF4gPYym4Q2qcxVdA3nmYm/3yPLoJxZ48unN+Z4JhIKunGWYXCv7O/lrAcGC tIKqBBv2RSDiGMMdggHdxmsGgqtbgFfSI3vf0tOr4MeoEZrYzF03azNlxrToVlyahhx+ hL6w== X-Gm-Message-State: AOAM531xGgJIANXfzeHvkCgteR52JbFWvPvwyh3n4kFXLIpsGO428hQU EkV6O6e1d5EkML0UdIacsk7yTLY30CI= X-Google-Smtp-Source: ABdhPJzs7wuKr4APG+r+H6rf/qU3oa+gQO+n5Pc1FoKe7AieBIacr4qorEJZx0imRNUMkvHMjqZ9zA== X-Received: by 2002:aca:bc57:: with SMTP id m84mr3224265oif.14.1599166805140; Thu, 03 Sep 2020 14:00:05 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l136sm733495oig.7.2020.09.03.14.00.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:04 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 20/77] virtiofsd: add --rlimit-nofile=NUM option Date: Thu, 3 Sep 2020 15:58:38 -0500 Message-Id: <20200903205935.27832-21-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::235; envelope-from=flukshun@gmail.com; helo=mail-oi1-x235.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Stefan Hajnoczi , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Hajnoczi Make it possible to specify the RLIMIT_NOFILE on the command-line. Users running multiple virtiofsd processes should allocate a certain number to each process so that the system-wide limit can never be exhausted. When this option is set to 0 the rlimit is left at its current value. This is useful when a management tool wants to configure the rlimit itself. The default behavior remains unchanged: try to set the limit to 1,000,000 file descriptors if the current rlimit is lower. Signed-off-by: Stefan Hajnoczi Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200501140644.220940-2-stefanha@redhat.com> Signed-off-by: Dr. David Alan Gilbert (cherry picked from commit 6dbb716877728ce4eb51619885ef6ef4ada9565f) Signed-off-by: Michael Roth --- tools/virtiofsd/fuse_lowlevel.h | 1 + tools/virtiofsd/helper.c | 23 +++++++++++++++++++++++ tools/virtiofsd/passthrough_ll.c | 22 ++++++++-------------- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h index 8f6d705b5c..562fd5241e 100644 --- a/tools/virtiofsd/fuse_lowlevel.h +++ b/tools/virtiofsd/fuse_lowlevel.h @@ -1777,6 +1777,7 @@ struct fuse_cmdline_opts { int syslog; int log_level; unsigned int max_idle_threads; + unsigned long rlimit_nofile; }; /** diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c index 819c2bc13c..dc59f38af0 100644 --- a/tools/virtiofsd/helper.c +++ b/tools/virtiofsd/helper.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #define FUSE_HELPER_OPT(t, p) \ @@ -53,6 +55,7 @@ static const struct fuse_opt fuse_helper_opts[] = { FUSE_HELPER_OPT("subtype=", nodefault_subtype), FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP), FUSE_HELPER_OPT("max_idle_threads=%u", max_idle_threads), + FUSE_HELPER_OPT("--rlimit-nofile=%lu", rlimit_nofile), FUSE_HELPER_OPT("--syslog", syslog), FUSE_HELPER_OPT_VALUE("log_level=debug", log_level, FUSE_LOG_DEBUG), FUSE_HELPER_OPT_VALUE("log_level=info", log_level, FUSE_LOG_INFO), @@ -171,6 +174,9 @@ void fuse_cmdline_help(void) " default: no_writeback\n" " -o xattr|no_xattr enable/disable xattr\n" " default: no_xattr\n" + " --rlimit-nofile= set maximum number of file descriptors\n" + " (0 leaves rlimit unchanged)\n" + " default: 1,000,000 if the current rlimit is lower\n" ); } @@ -191,11 +197,28 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key, } } +static unsigned long get_default_rlimit_nofile(void) +{ + rlim_t max_fds = 1000000; /* our default RLIMIT_NOFILE target */ + struct rlimit rlim; + + if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) { + fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n"); + exit(1); + } + + if (rlim.rlim_cur >= max_fds) { + return 0; /* we have more fds available than required! */ + } + return max_fds; +} + int fuse_parse_cmdline(struct fuse_args *args, struct fuse_cmdline_opts *opts) { memset(opts, 0, sizeof(struct fuse_cmdline_opts)); opts->max_idle_threads = 10; + opts->rlimit_nofile = get_default_rlimit_nofile(); opts->foreground = 1; if (fuse_opt_parse(args, opts, fuse_helper_opts, fuse_helper_opt_proc) == diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 4c35c95b25..f7b9c1d20c 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -2707,24 +2707,18 @@ static void setup_sandbox(struct lo_data *lo, struct fuse_session *se, setup_seccomp(enable_syslog); } -/* Raise the maximum number of open file descriptors */ -static void setup_nofile_rlimit(void) +/* Set the maximum number of open file descriptors */ +static void setup_nofile_rlimit(unsigned long rlimit_nofile) { - const rlim_t max_fds = 1000000; - struct rlimit rlim; - - if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) { - fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n"); - exit(1); - } + struct rlimit rlim = { + .rlim_cur = rlimit_nofile, + .rlim_max = rlimit_nofile, + }; - if (rlim.rlim_cur >= max_fds) { + if (rlimit_nofile == 0) { return; /* nothing to do */ } - rlim.rlim_cur = max_fds; - rlim.rlim_max = max_fds; - if (setrlimit(RLIMIT_NOFILE, &rlim) < 0) { /* Ignore SELinux denials */ if (errno == EPERM) { @@ -2977,7 +2971,7 @@ int main(int argc, char *argv[]) fuse_daemonize(opts.foreground); - setup_nofile_rlimit(); + setup_nofile_rlimit(opts.rlimit_nofile); /* Must be before sandbox since it wants /proc */ setup_capng(); From patchwork Thu Sep 3 20:58:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357002 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JEFRu2sZ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDMb6SBRz9sTg for ; Fri, 4 Sep 2020 07:24:11 +1000 (AEST) Received: from localhost ([::1]:40496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwiH-00072F-PQ for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:24:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL5-0003cs-CE; Thu, 03 Sep 2020 17:00:11 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:42526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL3-0007QS-N4; Thu, 03 Sep 2020 17:00:11 -0400 Received: by mail-ot1-x342.google.com with SMTP id g10so3992228otq.9; Thu, 03 Sep 2020 14:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7UAh7dZ1laqTWozprEx5nPTnEIvgRC8w7jofjPe6YO0=; b=JEFRu2sZFq3ja9z7tLWV1F/iRzHEOhN+mJp2K/M4VyNy9Ya/o2b8xs+zUTC1dKTNq+ QbNrqJ4N81lzx2T2JIgnyFvZ+nCu+e+R9Jpof3jm7w7P6+VeOOyGoYnBv2s1+IzbFL2F 9ACTJz5UcR70gr8jQRxwN/P60TfI5QArFF4nAoAo//PO4Mg+fVoedRG1jLSPkOMItJYK tH26av25n5DRo0xa45YWR0PzUO/bYfMAjmjJm4GgM956ZjhgnvnjBGyJacvFrs1400Yg RxscifyoN586y12TImKH1K9PX0QFsVbd+DUm9UeqZGc+dDanlekEAMPBb1kr21F67zhE 6N5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7UAh7dZ1laqTWozprEx5nPTnEIvgRC8w7jofjPe6YO0=; b=c+nXz972wB0M9XHsU8roJo74SsSq5hbfL8LRGqyweoVwmm8vJN99OjLUdNx/Yvl+9r krsS8N6AULO53yjlyxZslvbjLhgQ7Lu8n3sPEn9wvF9kpprvbL3qcbx+Luz0zQ1cJssR Vkwrow0WUzoJY5sEfU4UqihgIJ2G0wAP7JKxr2kxHgAx+xElc/u+w1LBmpxDjdVxlgHW W9TlsD8cWY6o8lCwV0h3lszM8au5IfLShqzLQkU9w5dg1cSGLeT/15YJtNkozDhY10ZG xeq/XJ379485b5+N391f4JkUF2hW1vNFe9K5J+lgC4pVumPa/O3Hk4T2T+t3vWFtYzZN idaQ== X-Gm-Message-State: AOAM5306zbHjaDfKc2mbT6iXP9Q81JnNXkSRU3IDxUNcrUvj5YJNXK/0 y6ElLMEyKrJEgXJy+UoYcuD39aIAqZo= X-Google-Smtp-Source: ABdhPJyBsoRhRW17F6C3WGXhJPxBz3NBPS6Kun7Evf0ssvarkOsFHbeWdNIzgtD/aXzc//7rI8eQWQ== X-Received: by 2002:a9d:1c8a:: with SMTP id l10mr3220047ota.230.1599166807842; Thu, 03 Sep 2020 14:00:07 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q184sm828224ooq.40.2020.09.03.14.00.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:07 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 21/77] virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717) Date: Thu, 3 Sep 2020 15:58:39 -0500 Message-Id: <20200903205935.27832-22-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=flukshun@gmail.com; helo=mail-ot1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Stefan Hajnoczi , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Hajnoczi The system-wide fs.file-max sysctl value determines how many files can be open. It defaults to a value calculated based on the machine's RAM size. Previously virtiofsd would try to set RLIMIT_NOFILE to 1,000,000 and this allowed the FUSE client to exhaust the number of open files system-wide on Linux hosts with less than 10 GB of RAM! Take fs.file-max into account when choosing the default RLIMIT_NOFILE value. Fixes: CVE-2020-10717 Reported-by: Yuval Avrahami Signed-off-by: Stefan Hajnoczi Reviewed-by: Dr. David Alan Gilbert Message-Id: <20200501140644.220940-3-stefanha@redhat.com> Signed-off-by: Dr. David Alan Gilbert (cherry picked from commit 8c1d353d107b4fc344e27f2f08ea7fa25de2eea2) Signed-off-by: Michael Roth --- tools/virtiofsd/helper.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c index dc59f38af0..00a1ef666a 100644 --- a/tools/virtiofsd/helper.c +++ b/tools/virtiofsd/helper.c @@ -176,7 +176,8 @@ void fuse_cmdline_help(void) " default: no_xattr\n" " --rlimit-nofile= set maximum number of file descriptors\n" " (0 leaves rlimit unchanged)\n" - " default: 1,000,000 if the current rlimit is lower\n" + " default: min(1000000, fs.file-max - 16384)\n" + " if the current rlimit is lower\n" ); } @@ -199,9 +200,32 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key, static unsigned long get_default_rlimit_nofile(void) { + g_autofree gchar *file_max_str = NULL; + const rlim_t reserved_fds = 16384; /* leave at least this many fds free */ rlim_t max_fds = 1000000; /* our default RLIMIT_NOFILE target */ + rlim_t file_max; struct rlimit rlim; + /* + * Reduce max_fds below the system-wide maximum, if necessary. This + * ensures there are fds available for other processes so we don't + * cause resource exhaustion. + */ + if (!g_file_get_contents("/proc/sys/fs/file-max", &file_max_str, + NULL, NULL)) { + fuse_log(FUSE_LOG_ERR, "can't read /proc/sys/fs/file-max\n"); + exit(1); + } + file_max = g_ascii_strtoull(file_max_str, NULL, 10); + if (file_max < 2 * reserved_fds) { + fuse_log(FUSE_LOG_ERR, + "The fs.file-max sysctl is too low (%lu) to allow a " + "reasonable number of open files.\n", + (unsigned long)file_max); + exit(1); + } + max_fds = MIN(file_max - reserved_fds, max_fds); + if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) { fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n"); exit(1); From patchwork Thu Sep 3 20:58:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=YVmjv4JT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDGD4SLTz9sPB for ; Fri, 4 Sep 2020 07:19:32 +1000 (AEST) Received: from localhost ([::1]:46408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwdm-0006NE-AH for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:19:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL6-0003fV-Hi; Thu, 03 Sep 2020 17:00:12 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:33048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL4-0007Qq-PH; Thu, 03 Sep 2020 17:00:12 -0400 Received: by mail-oi1-x242.google.com with SMTP id 3so4556972oih.0; Thu, 03 Sep 2020 14:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ao54A2l3sEDR87eadYmmagGboLEhBAQddrGqeoropng=; b=YVmjv4JTEGL/h+upO6IEHC9LgSD2LGBd3A+olh3cyamWjlDE/gYCRbuyeH9dIJE22y BwmX18z/mn886P3Zlmx+69kQmLy7DQHSassAx59XW1DJkAnkYRzj/23w2QpOqO9emK0K 7DdAX7ZPV/q/OmXDH+on4+fVTqZx0nWsVucEc4RFa4HyAAQQV0XaIzNXAVpFfK11vb3v Je/aQkTK1gossZzcNAs34dLnxBrAagjO6wtkSQlfgYbR1sTxXy98OZcdTzOsj1xNeKGL IVL+rpxn8vjsoYLG+DO5JiyxUCM4u4f9dBqdtAQQYnANhnb6MI5A2zAwCMajmeRd6JAw Nv6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Ao54A2l3sEDR87eadYmmagGboLEhBAQddrGqeoropng=; b=rnIYxOrUo/HqHbCM/0lArYQzNsDOVfEUnXxKrW53G3bfx5QQfiSGE17RJuVc5HXf5T Id3JNpXWOSgg0UFBe2L2S18c7LDS4DfC0xSDu8tj7jUUcQJGQmDCjUN6+3lUwURo2Tzd QX92xamv2mH33HvuBTENCbbpUXS3HkP06dxUIaNQ3tUN63x66d6toKMRgEEHff6SFUV+ fUdQoKWIf7j4d33wH+QX4WRIgTOU1AYcnMo6HKKrrvKThfzm/Xj7sQ1PL1rTXqAsAV3s gmOwusmPLyluX3t4tFejQSUx4Hr6ei7hZYp7pX+TqUQVbkP580xnQCK0HMj1ZTjCJ36h aFxA== X-Gm-Message-State: AOAM530fN2YzK0pviU+fTIfPlCg6a3lKksjsgH4LWJkaM24UnXkGule8 FkmIw3HFs6tyk9YW0qW1jyztHme/pHY= X-Google-Smtp-Source: ABdhPJxERucEeDRW5rSOp26hNeioQKx56W85NQY1JaYp/plQk11AdrrsPd+5n2lpZwdrrdxchp0tEQ== X-Received: by 2002:aca:5e82:: with SMTP id s124mr3171775oib.168.1599166809004; Thu, 03 Sep 2020 14:00:09 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id d26sm601073otl.10.2020.09.03.14.00.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:08 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 22/77] net: use peer when purging queue in qemu_flush_or_purge_queue_packets() Date: Thu, 3 Sep 2020 15:58:40 -0500 Message-Id: <20200903205935.27832-23-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jason Wang The sender of packet will be checked in the qemu_net_queue_purge() but we use NetClientState not its peer when trying to purge the incoming queue in qemu_flush_or_purge_packets(). This will trigger the assert in virtio_net_reset since we can't pass the sender check: hw/net/virtio-net.c:533: void virtio_net_reset(VirtIODevice *): Assertion `!virtio_net_get_subqueue(nc)->async_tx.elem' failed. #9 0x55a33fa31b78 in virtio_net_reset hw/net/virtio-net.c:533:13 #10 0x55a33fc88412 in virtio_reset hw/virtio/virtio.c:1919:9 #11 0x55a341d82764 in virtio_bus_reset hw/virtio/virtio-bus.c:95:9 #12 0x55a341dba2de in virtio_pci_reset hw/virtio/virtio-pci.c:1824:5 #13 0x55a341db3e02 in virtio_pci_common_write hw/virtio/virtio-pci.c:1252:13 #14 0x55a33f62117b in memory_region_write_accessor memory.c:496:5 #15 0x55a33f6205e4 in access_with_adjusted_size memory.c:557:18 #16 0x55a33f61e177 in memory_region_dispatch_write memory.c:1488:16 Reproducer: https://www.mail-archive.com/qemu-devel@nongnu.org/msg701914.html Fix by using the peer. Reported-by: "Alexander Bulekov" Acked-by: Alexander Bulekov Fixes: ca77d85e1dbf9 ("net: complete all queued packets on VM stop") Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang (cherry picked from commit 5fe19fb81839ea42b592b409f725349cf3c73551) Signed-off-by: Michael Roth --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index cbeeeadff8..4c62b10acd 100644 --- a/net/net.c +++ b/net/net.c @@ -610,7 +610,7 @@ void qemu_flush_or_purge_queued_packets(NetClientState *nc, bool purge) qemu_notify_event(); } else if (purge) { /* Unable to empty the queue, purge remaining packets */ - qemu_net_queue_purge(nc->incoming_queue, nc); + qemu_net_queue_purge(nc->incoming_queue, nc->peer); } } From patchwork Thu Sep 3 20:58:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Xh5MWP8M; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjCzc6Srfz9sRK for ; Fri, 4 Sep 2020 07:06:52 +1000 (AEST) Received: from localhost ([::1]:58420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwRW-0004Vp-SZ for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:06:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL8-0003jY-EQ; Thu, 03 Sep 2020 17:00:14 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:46522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL6-0007RB-IP; Thu, 03 Sep 2020 17:00:13 -0400 Received: by mail-ot1-x343.google.com with SMTP id c10so3973471otm.13; Thu, 03 Sep 2020 14:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Zl94h+JEwFYHtOa8NK8LtKSrwdxSjFyOtdM3NqVIwV8=; b=Xh5MWP8MW/HvNcD9TwlDOk51UAS4Jt/YKgfbXABNKvIGkaXmcRqJs5LmOPKDWMW+Mb gwdk8EAtEvcjC9xNqwOUp8h7Xz0e206cbmd7gH3gKOMfTfphwaWjqk68U5tjuNL4Sr3x QgqlubfkZ7KT1CgsJdVIa41A+6UvZDU9EmQ0Imm8/p8APBXLdukRxG+SOba3su/MlY3a qYqokwsKeXZgIUKsIiAOki3rsz6rGZeDPrEyNw+trATuDYyWSnr2Zt1zT5/gwaO1aNul B3cX7D+xVHs8mHt9NUeTUkqoXXCCaf/GGnGczE72xqejEGOrnuJAZfnMTfShmEullInq /z8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Zl94h+JEwFYHtOa8NK8LtKSrwdxSjFyOtdM3NqVIwV8=; b=ELW+xjt8P8Utycc0T3m+Jok9PI/2BVOXrd3b8heeOyiaC8XFHs2qsF0Z06BrUb16So R6VRmgbbvRscqbi3YqLdGY2qg9Lx5pu45Z3NePGun8fEtPgkhRSgnPZp1vRdX7Q3B/ea 6gqCr7bTT8nu7ggrDIbRTQFyC3grMn3oXtJlXNWIR7ejSoKPbrWJZuy7AkhSrqy1rOWQ JZx51t4up2eVBLoV58LKiXlC9CQHkXU7rlMc4boPz2JHfbEOYElvTpqY3rUHtjl45yu9 uK1KcJiTb3wP1aGkRmlGsQkgLOkOTp3G9NMkV7RilduLaxfo1TpLTcCImZnwdxLoxhj8 K61w== X-Gm-Message-State: AOAM531atdUa4tElEgVqjudVw485xeO8Qit2aB9/iUpghpLqDi9ezCWn m9P6VzfEsJeZF09PTrz/7l//JFzUNro= X-Google-Smtp-Source: ABdhPJxDTnOLfoq67xc1VrZXc9OEErwBbHmUTOeU0jbI5ygkWlfbHXRnq0EVOBHcdTJsHHzIIdi23g== X-Received: by 2002:a05:6830:19ee:: with SMTP id t14mr3082333ott.171.1599166810293; Thu, 03 Sep 2020 14:00:10 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id w125sm710943oia.57.2020.09.03.14.00.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:09 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 23/77] KVM: x86: believe what KVM says about WAITPKG Date: Thu, 3 Sep 2020 15:58:41 -0500 Message-Id: <20200903205935.27832-24-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Currently, QEMU is overriding KVM_GET_SUPPORTED_CPUID's answer for the WAITPKG bit depending on the "-overcommit cpu-pm" setting. This is a bad idea because it does not even check if the host supports it, but it can be done in x86_cpu_realizefn just like we do for the MONITOR bit. This patch moves it there, while making it conditional on host support for the related UMWAIT MSR. Cc: qemu-stable@nongnu.org Reported-by: Maxim Levitsky Signed-off-by: Paolo Bonzini (cherry picked from commit e1e43813e7908b063938a3d01f172f88f6190c80) Signed-off-by: Michael Roth --- target/i386/cpu.c | 3 +++ target/i386/kvm.c | 11 +++++------ target/i386/kvm_i386.h | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 90ffc5f3b1..471db0724f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6491,6 +6491,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx, &cpu->mwait.ecx, &cpu->mwait.edx); env->features[FEAT_1_ECX] |= CPUID_EXT_MONITOR; + if (kvm_enabled() && kvm_has_waitpkg()) { + env->features[FEAT_7_0_ECX] |= CPUID_7_0_ECX_WAITPKG; + } } if (kvm_enabled() && cpu->ucode_rev == 0) { cpu->ucode_rev = kvm_arch_get_supported_msr_feature(kvm_state, diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 4901c6dd74..f9c873bcad 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -407,12 +407,6 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, if (host_tsx_blacklisted()) { ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE); } - } else if (function == 7 && index == 0 && reg == R_ECX) { - if (enable_cpu_pm) { - ret |= CPUID_7_0_ECX_WAITPKG; - } else { - ret &= ~CPUID_7_0_ECX_WAITPKG; - } } else if (function == 7 && index == 0 && reg == R_EDX) { /* * Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM hosts. @@ -4678,3 +4672,8 @@ int kvm_arch_msi_data_to_gsi(uint32_t data) { abort(); } + +bool kvm_has_waitpkg(void) +{ + return has_msr_umwait; +} diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index 00bde7acaf..064b8798a2 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -44,6 +44,7 @@ void kvm_put_apicbase(X86CPU *cpu, uint64_t value); bool kvm_enable_x2apic(void); bool kvm_has_x2apic_api(void); +bool kvm_has_waitpkg(void); bool kvm_hv_vpindex_settable(void); From patchwork Thu Sep 3 20:58:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tDCvC9jp; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDTw1SK1z9sPB for ; Fri, 4 Sep 2020 07:29:38 +1000 (AEST) Received: from localhost ([::1]:36962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwnY-0000tR-0u for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:29:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwL9-0003nF-RX; Thu, 03 Sep 2020 17:00:15 -0400 Received: from mail-oo1-xc43.google.com ([2607:f8b0:4864:20::c43]:34286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL7-0007RQ-9M; Thu, 03 Sep 2020 17:00:15 -0400 Received: by mail-oo1-xc43.google.com with SMTP id k63so1134591oob.1; Thu, 03 Sep 2020 14:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=G4FtznJiI3bIZt9XXorrUG/m7EUVyV0wnG1XwMDDxC8=; b=tDCvC9jpTzxhbzzF3UA4RaxA2NnpMC9rhgAdfeUV9aIeNNUWhhXBm8DiMY+OGsZwQl KQHfh+IwV+5DJ7o92Al0B5n5x8z5I4uFqlu+6AbmthVS486gV1jBcv6PtXsCKS/Qr6rp U1olNh6pBi5xH/6zfT8MpI2Sb/yv11NkAwrzCASrzE00oKplfFDe0zvC0hwwKCIepmc6 SmjdbbhMl2YEEG1CDrrOOewKR652KoF2d8n4t7ije+Hg++X9AR3eij+7lGpR4jWeupeV bSj+C9Vq6JYREN8eBTaXTYjP7/udt/XX7DS59eKPNqqsHSpYl8md7t3077+gQNYlFCxw EL8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=G4FtznJiI3bIZt9XXorrUG/m7EUVyV0wnG1XwMDDxC8=; b=ZczYajC1InT7At7m3Xw6r28fyVYSQ3T5YFSzyvS5MWas0TruwdHIEYnC+7NhXJPAza y0oKaodOUknQj3Plbd2G858modWmMkD/DTE2vEt2i8q6TTXFIAd6CQl4ehQnFQ9XYDbO Ggu0C85IcR8+yxMTwwln6C+WSLzDwZbURP59/dUQgk2yIFyCMC3nltpCzbabPaqLkANg qxY1PwNYVdKFsvs5z5D8ePAN519d13P2HOHtsvt0RRU9oxxJQN5M51dP0S+/rdtP7IVB kNdJFTeHhNyTIMSunzdcKeu6iQrD6KFNba8apBLxNJ87w9MlsJDre5xS0SOD9SyflGJ0 kirA== X-Gm-Message-State: AOAM530GMHPYIUu1GHAfJQuHyOWR6XPidx7mIs77i3RYt/HUNXbwRbwG Nf+eK9cwKYk0UsiSdatziHCaMuj8kio= X-Google-Smtp-Source: ABdhPJz3XtAG4yS2UyPAD2NPlOM3Exkq9aY9AfN0Rsrnfwa3uFU3uEicz0IPBkPaaPHqvxqqprHEZQ== X-Received: by 2002:a4a:bb05:: with SMTP id f5mr3354000oop.5.1599166811194; Thu, 03 Sep 2020 14:00:11 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id k18sm766595otj.55.2020.09.03.14.00.10 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:10 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 24/77] aio-posix: don't duplicate fd handler deletion in fdmon_io_uring_destroy() Date: Thu, 3 Sep 2020 15:58:42 -0500 Message-Id: <20200903205935.27832-25-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c43; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Hajnoczi The io_uring file descriptor monitoring implementation has an internal list of fd handlers that are pending submission to io_uring. fdmon_io_uring_destroy() deletes all fd handlers on the list. Don't delete fd handlers directly in fdmon_io_uring_destroy() for two reasons: 1. This duplicates the aio-posix.c AioHandler deletion code and could become outdated if the struct changes. 2. Only handlers with the FDMON_IO_URING_REMOVE flag set are safe to remove. If the flag is not set then something still has a pointer to the fd handler. Let aio-posix.c and its user worry about that. In practice this isn't an issue because fdmon_io_uring_destroy() is only called when shutting down so all users have removed their fd handlers, but the next patch will need this! Signed-off-by: Stefan Hajnoczi Tested-by: Oleksandr Natalenko Message-id: 20200511183630.279750-2-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi (cherry picked from commit de137e44f75d9868f5b548638081850f6ac771f2) Signed-off-by: Michael Roth --- util/aio-posix.c | 1 + util/fdmon-io_uring.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/util/aio-posix.c b/util/aio-posix.c index c3613d299e..8af334ab19 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -679,6 +679,7 @@ void aio_context_destroy(AioContext *ctx) { fdmon_io_uring_destroy(ctx); fdmon_epoll_disable(ctx); + aio_free_deleted_handlers(ctx); } void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c index d5a80ed6fb..1d14177df0 100644 --- a/util/fdmon-io_uring.c +++ b/util/fdmon-io_uring.c @@ -342,11 +342,18 @@ void fdmon_io_uring_destroy(AioContext *ctx) io_uring_queue_exit(&ctx->fdmon_io_uring); - /* No need to submit these anymore, just free them. */ + /* Move handlers due to be removed onto the deleted list */ while ((node = QSLIST_FIRST_RCU(&ctx->submit_list))) { + unsigned flags = atomic_fetch_and(&node->flags, + ~(FDMON_IO_URING_PENDING | + FDMON_IO_URING_ADD | + FDMON_IO_URING_REMOVE)); + + if (flags & FDMON_IO_URING_REMOVE) { + QLIST_INSERT_HEAD_RCU(&ctx->deleted_aio_handlers, node, node_deleted); + } + QSLIST_REMOVE_HEAD_RCU(&ctx->submit_list, node_submitted); - QLIST_REMOVE(node, node); - g_free(node); } ctx->fdmon_ops = &fdmon_poll_ops; From patchwork Thu Sep 3 20:58:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jeC5bky8; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDQ01Z3Sz9sSP for ; Fri, 4 Sep 2020 07:26:16 +1000 (AEST) Received: from localhost ([::1]:49840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwkI-000310-5B for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:26:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLA-0003pR-EB; Thu, 03 Sep 2020 17:00:16 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:34043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL8-0007Sj-CI; Thu, 03 Sep 2020 17:00:15 -0400 Received: by mail-ot1-x344.google.com with SMTP id h17so3207875otr.1; Thu, 03 Sep 2020 14:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3SuwZW28eAjJ3YWBTzrGv938b6MDi9p5c1iamVmgVTs=; b=jeC5bky8i6iuk9jTkRdmcsM7MPX4//PdxWYf0UrMhtLcNDBFofCqLrGeeYfb4nlRd/ VHWa+QAiJdFXz6V5HnQdM/XHSGbM60QV4Y0f4cp/aLdmGJNovsrgFChTHQ94cpxu+lAS qVQJkq/a/LdkKx1JCeoTIME6ovIph3nxrokvtwxnAJhk14wChuuy9PWAur1MHQgHXIWS lE6B0o405c9R2j4bVwKKl1WpbSdEchokLpZrbTqyxtW1CK+ecTNu/uZ/EPjVp8DEDE5U ixwwwVJLx76lohrOhoKQprWSm0szhlD0Cbiiaii3k43KoIob3oPLU62OZE5oHmx0gpql 5PXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3SuwZW28eAjJ3YWBTzrGv938b6MDi9p5c1iamVmgVTs=; b=i3fMOhjMEHRxjjQ3UQ3RACN7wYpxW7htsmAh9TpeAUUOOsfbojv1E2QKi9G5c4lJa4 CCSHJpBG+V3ZeDf/xzGAGWzdVuJgLNBVoc4xq0WizMUMIOQ6sl610L5sFI3Dt9WpdC5L wIfwXaQp99wyExd00sNU4+lcvlKSdAXaS7EH/hw3BQ0nHx1dDYLhwsFqmJfJ1KhGLptW JSygj1pBErPgHsrMIe9UangT7EieQsqx4TGsKsx2eEDTcbVmX9XF8o8IJn7J03/BSB/5 sd0S0nBai2px98d9VcstrcROvE56Xqjsf90u7R+c32D/E3zruDXFJRWTqrQxn897jEAd mc1g== X-Gm-Message-State: AOAM533ie7ivFLw48qdy8TLoZGz0z/zRX7qeTzHCplUgyvTPFY3ksZIk /wjT13c4mVcxmU83yIe3m19RI8zhtnE= X-Google-Smtp-Source: ABdhPJxlBge35zxuhUGxEOkO3ktrro7su289ePXOBdgPTNUFvl6IpxX3+XvnnjyYTb+P3tex3KfC4g== X-Received: by 2002:a9d:6c98:: with SMTP id c24mr3097488otr.208.1599166812398; Thu, 03 Sep 2020 14:00:12 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id z17sm836651oop.15.2020.09.03.14.00.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:11 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 25/77] aio-posix: disable fdmon-io_uring when GSource is used Date: Thu, 3 Sep 2020 15:58:43 -0500 Message-Id: <20200903205935.27832-26-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=flukshun@gmail.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Hajnoczi The glib event loop does not call fdmon_io_uring_wait() so fd handlers waiting to be submitted build up in the list. There is no benefit is using io_uring when the glib GSource is being used, so disable it instead of implementing a more complex fix. This fixes a memory leak where AioHandlers would build up and increasing amounts of CPU time were spent iterating them in aio_pending(). The symptom is that guests become slow when QEMU is built with io_uring support. Buglink: https://bugs.launchpad.net/qemu/+bug/1877716 Fixes: 73fd282e7b6dd4e4ea1c3bbb3d302c8db51e4ccf ("aio-posix: add io_uring fd monitoring implementation") Signed-off-by: Stefan Hajnoczi Tested-by: Oleksandr Natalenko Message-id: 20200511183630.279750-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi (cherry picked from commit ba607ca8bff4d2c2062902f8355657c865ac7c29) Signed-off-by: Michael Roth --- include/block/aio.h | 3 +++ util/aio-posix.c | 12 ++++++++++++ util/aio-win32.c | 4 ++++ util/async.c | 1 + 4 files changed, 20 insertions(+) diff --git a/include/block/aio.h b/include/block/aio.h index 62ed954344..b2f703fa3f 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -701,6 +701,9 @@ void aio_context_setup(AioContext *ctx); */ void aio_context_destroy(AioContext *ctx); +/* Used internally, do not call outside AioContext code */ +void aio_context_use_g_source(AioContext *ctx); + /** * aio_context_set_poll_params: * @ctx: the aio context diff --git a/util/aio-posix.c b/util/aio-posix.c index 8af334ab19..1b2a3af65b 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -682,6 +682,18 @@ void aio_context_destroy(AioContext *ctx) aio_free_deleted_handlers(ctx); } +void aio_context_use_g_source(AioContext *ctx) +{ + /* + * Disable io_uring when the glib main loop is used because it doesn't + * support mixed glib/aio_poll() usage. It relies on aio_poll() being + * called regularly so that changes to the monitored file descriptors are + * submitted, otherwise a list of pending fd handlers builds up. + */ + fdmon_io_uring_destroy(ctx); + aio_free_deleted_handlers(ctx); +} + void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, int64_t grow, int64_t shrink, Error **errp) { diff --git a/util/aio-win32.c b/util/aio-win32.c index 729d533faf..953c56ab48 100644 --- a/util/aio-win32.c +++ b/util/aio-win32.c @@ -414,6 +414,10 @@ void aio_context_destroy(AioContext *ctx) { } +void aio_context_use_g_source(AioContext *ctx) +{ +} + void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, int64_t grow, int64_t shrink, Error **errp) { diff --git a/util/async.c b/util/async.c index 3165a28f2f..1319eee3bc 100644 --- a/util/async.c +++ b/util/async.c @@ -362,6 +362,7 @@ static GSourceFuncs aio_source_funcs = { GSource *aio_get_g_source(AioContext *ctx) { + aio_context_use_g_source(ctx); g_source_ref(&ctx->source); return &ctx->source; } From patchwork Thu Sep 3 20:58:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CeOl9TTu; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDSC4sDCz9sPB for ; Fri, 4 Sep 2020 07:28:11 +1000 (AEST) Received: from localhost ([::1]:58108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwm9-0006OD-HT for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:28:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLB-0003ry-Dg; Thu, 03 Sep 2020 17:00:17 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:44047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwL9-0007Ui-KI; Thu, 03 Sep 2020 17:00:17 -0400 Received: by mail-ot1-x343.google.com with SMTP id a2so3980736otr.11; Thu, 03 Sep 2020 14:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RtiowuAQkv312A5ys7+EMqL5vJk41pvA+ri5Ve8MLsg=; b=CeOl9TTuwTND8XKf4EXTnn841voh1MBgCRSGyn0h4uom/ihjf+XoLYcAyE3kV8uejO swgrw8Y7eJyHc+3+hh8N5AVWI7DXvPYApjSYrmHMiJRuFqyoxzj8IUMl8xKx8fGDMCBi sg7UvA11lE9hh+W2jiiWSYgF7scl0cbaDrpNeKqThOnap4knvhqF/Q5gpIyzxfrkAPxt BiizcxGi9UBmdqN02jWW67MLjhZdYY/nsAcrL4aGyBRtmjJosHwM2Oriz9on0eM8XtSu xRzzXKnr/EOHaOGEItgT2dF15QPnZyEmdopI7DYu+lfmNc0jKQDRPALkcdX4tFPZ2jnT E0CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RtiowuAQkv312A5ys7+EMqL5vJk41pvA+ri5Ve8MLsg=; b=SoedIv8Nx5bQ6bh5n1Hsf1n9hEo9DUQjVFCrszG1vKcm0YsM+tZp54J8Vp1xaOE6+v 0mHEBRX+1OJGOGPJNka9kwZHMs841JLcoR5gt+VkKs1hep1PXtPPz7U8FixRG6VqJxpy GpTUYCjuaAnG6v/bLo/kXJWBh1cTud+nC2Xv3a8qLrMXHiMdPxT8heb+3MsiuFvp/U+L Fqn1oJxDTbwwsbsQxLaVYSe0mTi759dEIeZ0mwnC+tu49sC+OI31XUo7UAFG/ezFZEqU wFLuz2Uckse7ehrRQR2DibFZA6COdDvGm+Hb2lUZBMPE+qgOorPc1lmmfv18eVv+d1mS 1SXA== X-Gm-Message-State: AOAM533tXXisIv/NTBXZp13ztf3bsGOqWPQk7z9zzI6b/6WfQax//i+C Qt5+zo8CeCybQM+z06DM+6WocN33hME= X-Google-Smtp-Source: ABdhPJwzgt4QElx5SjNbrbNMMksX+d1txIE1M3j60cpnbNpIrvEOjs/sRCUGVM5LwAYhfw+oQU/lyg== X-Received: by 2002:a9d:6d95:: with SMTP id x21mr3138157otp.339.1599166813759; Thu, 03 Sep 2020 14:00:13 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id e7sm205748otk.59.2020.09.03.14.00.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:13 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 26/77] linux-user/strace.list: fix epoll_create{, 1} -strace output Date: Thu, 3 Sep 2020 15:58:44 -0500 Message-Id: <20200903205935.27832-27-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , qemu-stable@nongnu.org, Sergei Trofimovich , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Sergei Trofimovich Fix syscall name and parameters priinter. Before the change: ``` $ alpha-linux-user/qemu-alpha -strace -L /usr/alpha-unknown-linux-gnu/ /tmp/a ... 1274697 %s(%d)(2097152,274903156744,274903156760,274905840712,274877908880,274903235616) = 3 1274697 exit_group(0) ``` After the change: ``` $ alpha-linux-user/qemu-alpha -strace -L /usr/alpha-unknown-linux-gnu/ /tmp/a ... 1273719 epoll_create1(2097152) = 3 1273719 exit_group(0) ``` Fixes: 9cbc0578cb6 ("Improve output of various syscalls") Signed-off-by: Sergei Trofimovich CC: Riku Voipio CC: Laurent Vivier Cc: qemu-stable@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200416175957.1274882-1-slyfox@gentoo.org> Signed-off-by: Laurent Vivier (cherry picked from commit fd568660b7ae9b9e45cbb616acc91ae4c065c32d) Signed-off-by: Michael Roth --- linux-user/strace.list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index d49a1e92a8..9281c0a758 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -125,10 +125,10 @@ { TARGET_NR_dup3, "dup3" , "%s(%d,%d,%d)", NULL, NULL }, #endif #ifdef TARGET_NR_epoll_create -{ TARGET_NR_epoll_create, "%s(%d)", NULL, NULL, NULL }, +{ TARGET_NR_epoll_create, "epoll_create", "%s(%d)", NULL, NULL }, #endif #ifdef TARGET_NR_epoll_create1 -{ TARGET_NR_epoll_create1, "%s(%d)", NULL, NULL, NULL }, +{ TARGET_NR_epoll_create1, "epoll_create1", "%s(%d)", NULL, NULL }, #endif #ifdef TARGET_NR_epoll_ctl { TARGET_NR_epoll_ctl, "epoll_ctl" , NULL, NULL, NULL }, From patchwork Thu Sep 3 20:58:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=eUBuaUQ4; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDXZ3MNFz9sTg for ; Fri, 4 Sep 2020 07:31:58 +1000 (AEST) Received: from localhost ([::1]:46838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwpo-00054A-Cw for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLC-0003tt-7f; Thu, 03 Sep 2020 17:00:18 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:35795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLA-0007X5-JY; Thu, 03 Sep 2020 17:00:17 -0400 Received: by mail-oi1-x242.google.com with SMTP id w16so4535978oia.2; Thu, 03 Sep 2020 14:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=LtPU/nN6c9RiqgRTDpf9K4Svqu3AQC8vbJJ7asRl6KM=; b=eUBuaUQ4ES92C0W8OsgW0STGVdEb5kXK6SXRNGJywTCk6hM2RcJh6ei1VO52wh49ou YmKKnL+AWFhzFy2AeY5VOZxSsM/GF6l/YeBRm8DL4tYcYg/YwdNgZhgTOcsxTDYLh5QG 7R0/WJu7xGNUH3a6e6GiszTPL6uFE/66EzGjqeA/as4FDtUCxGFCvlrnTs5pusXOV24V 1YUnl0NXNP7FNH+18WLcBtBphK7gNw13y84PH7N4YdVOdcB0VVwGKPX9thewZaxLPgoz 5CaN2W7LVgHk/IL4EbTsGb5kc4z9fxVWj/2GaMytL7BakqHxl0Ra9NnD/s7C5Se3169I 7t2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=LtPU/nN6c9RiqgRTDpf9K4Svqu3AQC8vbJJ7asRl6KM=; b=rGgBHSHE0GWBNwZCXwnW2HkzmOO0YuDKRElN/uMTilsQMkz7Xq2P0J4o3Br3yINLnL JPaEpjU/rG/pJHXgcypisgOW2MvNRnloCacY4HG5JmDkz+6nw6wpNK1cNMyE8hdEVOjn yvWqPFtRgXIborVnA9MuOAYdovxVW/JAuRWQsgeSv/KwMvJdGlHz1UjvUVDWf1pvizCp KPbeRC+a6ISSruG8/rZFbUCEWAMrizOTZu+d+vdg6xJUY6AgXAimi0QpWZ1OUVSJE1uu C4yHmJVqqYHmadYvYE2r8KYNgxk+x193yL88jyu9V9tCU6F9f1eTjAb2pn5/bp+w5HWe Nwxg== X-Gm-Message-State: AOAM530ARn9aGgw3XusZj/49L1PBSFtrtVv58qJ3a30kAYAwqXULs4XZ lXNEDykVZRgk/clee59OD70R740kAtw= X-Google-Smtp-Source: ABdhPJwtlCZWf9x5sxWZHDVmVDI0++NbnrC3/5hquFSzgWe/SKJ+n3PQLM3wd/5pg06xeqAW466f6g== X-Received: by 2002:aca:f103:: with SMTP id p3mr3367677oih.45.1599166814856; Thu, 03 Sep 2020 14:00:14 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id o204sm719770oib.34.2020.09.03.14.00.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:14 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 27/77] libqos: usb-hcd-ehci: use 32-bit write for config register Date: Thu, 3 Sep 2020 15:58:45 -0500 Message-Id: <20200903205935.27832-28-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini The memory region ops have min_access_size == 4 so obey it. Tested-by: Thomas Huth Signed-off-by: Paolo Bonzini (cherry picked from commit 89ed83d8b23c11d250c290593cad3ca839d5b053) Signed-off-by: Michael Roth --- tests/qtest/usb-hcd-ehci-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/usb-hcd-ehci-test.c b/tests/qtest/usb-hcd-ehci-test.c index 5251d539e9..c51e8bb223 100644 --- a/tests/qtest/usb-hcd-ehci-test.c +++ b/tests/qtest/usb-hcd-ehci-test.c @@ -96,7 +96,7 @@ static void pci_ehci_port_1(void) static void pci_ehci_config(void) { /* hands over all ports from companion uhci to ehci */ - qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1); + qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1); } static void pci_uhci_port_2(void) From patchwork Thu Sep 3 20:58:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=SiVmbdyJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDZN4yZ4z9sTK for ; Fri, 4 Sep 2020 07:33:32 +1000 (AEST) Received: from localhost ([::1]:54996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwrK-0008Rh-G3 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLE-0003x1-1U; Thu, 03 Sep 2020 17:00:20 -0400 Received: from mail-oo1-xc41.google.com ([2607:f8b0:4864:20::c41]:45655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLB-0007Yp-QV; Thu, 03 Sep 2020 17:00:18 -0400 Received: by mail-oo1-xc41.google.com with SMTP id u28so1121631ooe.12; Thu, 03 Sep 2020 14:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=D8aV+SuTlrxPWeHJfsFhm4DwE+6NojdwAEJTWEzO0A0=; b=SiVmbdyJCkYwEnqKlOkKlofmyUmNpBwRV+8sI/tp1iCMcE1QLrGoUlBSonJMW5kmge FUMlWCazFVqHDdnemiN3nzAU4xDI9p/ffSxDEtlq42E+ttUOZ0dWZAV13XjjERkkCF3j U8KDeb4AdSYGC93HrpF0UiSsUtEmlt4k2m+Kh/H+SvvgVP4wlhZqQeNPzQQxmCCgsP2h LtrbIji8IPUHaymkRxLiajJEXSzjuzCOrRgZl+I1vtyUV9dLuxwy/K1ursyUc0QdlER3 R2NX4wuac27bLNRm5tNv2okc1824Ebn9pWldVCR/4wBCKCPi1nRH0dtOBmZBlAyvwXIZ l75w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=D8aV+SuTlrxPWeHJfsFhm4DwE+6NojdwAEJTWEzO0A0=; b=H/pPPhs+6d6mYhhu3Pc1y18BS4lvBkDtG8scBeV4IwKiSyQ2Yx4G3dkGcDLODTJYs4 x+bd94Ud1/CaaAy5lPda2j63uAwzQ631YqJOTCB41SHB/lbO46hOENAcKzae7ASHgj24 ARpLSSTZdnvDQsHDIBfOnk2IFPBIaXII84m1xKq1Y9RMiPpM7so+Op8Y37lDZFCiF9/t bnyCN5TYYVzcLd5zN6PlDraK/prCHvva84aasLMWSujb0/Nd2RkGkpAcuQe/dynNtU0p 0l+qf1tgZvEiWRunDWwBJVLAlVeV1CjrANpWLpMWDfNprFOa1aJ4Hqtqc1yE5qlXjG6x ogIQ== X-Gm-Message-State: AOAM530vLcbqfRyuyfncQ9oQXXtToc7I6IrTrCkTwLAVmxFeSjAmt64w 3TAxIDg5CHgjM+xlREJuYunUihByFGw= X-Google-Smtp-Source: ABdhPJwqM43KFDWLqHXcy+anFG9U/WavwYDpAHIJ/emuYFoKHpw0km50yaM2V0T5zOWmvci/y8jFsw== X-Received: by 2002:a4a:aa0e:: with SMTP id x14mr3282896oom.27.1599166815905; Thu, 03 Sep 2020 14:00:15 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l63sm711626oia.56.2020.09.03.14.00.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:15 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 28/77] libqos: pci-pc: use 32-bit write for EJ register Date: Thu, 3 Sep 2020 15:58:46 -0500 Message-Id: <20200903205935.27832-29-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c41; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini The memory region ops have min_access_size == 4 so obey it. Tested-by: Thomas Huth Signed-off-by: Paolo Bonzini (cherry picked from commit 4b7c06837ae0b1ff56473202a42e7e386f53d6db) Signed-off-by: Michael Roth --- tests/qtest/libqos/pci-pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/libqos/pci-pc.c b/tests/qtest/libqos/pci-pc.c index 0bc591d1da..3bb2eb3ba8 100644 --- a/tests/qtest/libqos/pci-pc.c +++ b/tests/qtest/libqos/pci-pc.c @@ -186,7 +186,7 @@ void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t slot) g_assert(!qdict_haskey(response, "error")); qobject_unref(response); - qtest_outb(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); + qtest_outl(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); qtest_qmp_eventwait(qts, "DEVICE_DELETED"); } From patchwork Thu Sep 3 20:58:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356972 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nLPz1M+b; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjD1t5gyqz9sRK for ; Fri, 4 Sep 2020 07:08:50 +1000 (AEST) Received: from localhost ([::1]:38752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwTQ-0008OD-Og for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:08:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLG-0003yR-P0; Thu, 03 Sep 2020 17:00:24 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:35038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLC-0007Zf-Pl; Thu, 03 Sep 2020 17:00:21 -0400 Received: by mail-ot1-x341.google.com with SMTP id i4so4036940ota.2; Thu, 03 Sep 2020 14:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=I5YcjEc0mYbCjhyXYUDK76xwxAk1fFbjDKhJ0jp6vus=; b=nLPz1M+bXftucc7WA0xXBzmflqfoMKy7Yu4FNYrIFWx20+DTO4Gboyy9yRQvnNA/Lq obrw/vcK+8CbJ7Xzi8gICDeL8zAqXzqnZGJvCaOGK0Se6J9ZNSL2q5R+cefSa3Dacmut 2juUm7JAl2u+N0Xlc+555Ou4MRbISF0yhxYumhyKhdtpJU522dwkBSMczJB/NqhoJYdW N7JNchpCTJToBPn8gGnTFWv7+WqkRwTEz5fDrLAo8XmQaOiXrvyaRDEnj5cmbLcGJNJT T/2yj4Kw0UN+u0FZEVPOr5mz3MZmHQ0mArKM4uUmsv7B36BmJN6q9GgzXbM7Zay2CDKD rlGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=I5YcjEc0mYbCjhyXYUDK76xwxAk1fFbjDKhJ0jp6vus=; b=XhqivyrBB2q5mOhfJoYUAjlEqbaX16RUqDmenTJDD7QawW/66sW5mDJAar+JN03H1H l2Zn/GCvm7O7vGXLf5KFja0UC8sk/PitSOgNjSw48z1ZWINLCf31JDs8FmOVnlu61VmG Her9E2ynnDnO3KO+cfON7cygSgcK682jMEE1ouKFz6E9EBaSrRpiZ3qx76rV7mgZk5wE BckjmyYEmjiLZlrWuc1oXz75bpoIVvqVpn3m9LvYl3D0m66/86eDCiOqx0VsJ/udtTfz gaPv1uWbuHVGhrzbVcnamMOD4dmafYwZr2g/46sy9ylUkzYi8ElxaJwjGUe1kGHo3KNB Ij9Q== X-Gm-Message-State: AOAM531hJp+rKG3Uj63IBbZ85kp5jV3xWOPogH0pGFcibe/p/MR+VCY7 cBe5WwnkBdauSEGLj1dRE+yXVuL6YPs= X-Google-Smtp-Source: ABdhPJwJKMhr3VktPGcVQa/Ad4uBsZ7hDB3ZtYenDazGEDA94jfU0X0y/2lpLYwqycDIvaRg7X/X7g== X-Received: by 2002:a9d:4e90:: with SMTP id v16mr3048185otk.363.1599166817059; Thu, 03 Sep 2020 14:00:17 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id f50sm767889otf.47.2020.09.03.14.00.16 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:16 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 29/77] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid" Date: Thu, 3 Sep 2020 15:58:47 -0500 Message-Id: <20200903205935.27832-30-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=flukshun@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , qemu-stable@nongnu.org, "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Michael S. Tsirkin" Memory API documentation documents valid .min_access_size and .max_access_size fields and explains that any access outside these boundaries is blocked. This is what devices seem to assume. However this is not what the implementation does: it simply ignores the boundaries unless there's an "accepts" callback. Naturally, this breaks a bunch of devices. Revert to the documented behaviour. Devices that want to allow any access can just drop the valid field, or add the impl field to have accesses converted to appropriate length. Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Fixes: CVE-2020-13754 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1842363 Fixes: a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid") Signed-off-by: Michael S. Tsirkin Message-Id: <20200610134731.1514409-1-mst@redhat.com> Signed-off-by: Paolo Bonzini (cherry picked from commit 5d971f9e672507210e77d020d89e0e89165c8fc9) Signed-off-by: Michael Roth --- memory.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/memory.c b/memory.c index 601b749906..e31aed6446 100644 --- a/memory.c +++ b/memory.c @@ -1352,35 +1352,24 @@ bool memory_region_access_valid(MemoryRegion *mr, bool is_write, MemTxAttrs attrs) { - int access_size_min, access_size_max; - int access_size, i; - - if (!mr->ops->valid.unaligned && (addr & (size - 1))) { + if (mr->ops->valid.accepts + && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) { return false; } - if (!mr->ops->valid.accepts) { - return true; - } - - access_size_min = mr->ops->valid.min_access_size; - if (!mr->ops->valid.min_access_size) { - access_size_min = 1; + if (!mr->ops->valid.unaligned && (addr & (size - 1))) { + return false; } - access_size_max = mr->ops->valid.max_access_size; + /* Treat zero as compatibility all valid */ if (!mr->ops->valid.max_access_size) { - access_size_max = 4; + return true; } - access_size = MAX(MIN(size, access_size_max), access_size_min); - for (i = 0; i < size; i += access_size) { - if (!mr->ops->valid.accepts(mr->opaque, addr + i, access_size, - is_write, attrs)) { - return false; - } + if (size > mr->ops->valid.max_access_size + || size < mr->ops->valid.min_access_size) { + return false; } - return true; } From patchwork Thu Sep 3 20:58:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IMg9yE2n; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDY43g2Tz9sSP for ; Fri, 4 Sep 2020 07:32:24 +1000 (AEST) Received: from localhost ([::1]:48476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwqE-0005lK-CC for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:32:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLG-0003yS-QU; Thu, 03 Sep 2020 17:00:24 -0400 Received: from mail-oo1-xc43.google.com ([2607:f8b0:4864:20::c43]:42322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLE-0007bB-48; Thu, 03 Sep 2020 17:00:21 -0400 Received: by mail-oo1-xc43.google.com with SMTP id a6so1118408oog.9; Thu, 03 Sep 2020 14:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=b3KQN/Kte9yOknsbzt0CDZ4AvatyRKhckS3n3Zf19Fo=; b=IMg9yE2nza1NjXHuqgj8vpy0D5pb/EbUf38oh7UHpghM3PT/FWDzjNoekuQ7w9ky4G vnITpKkUzzzHziDyo3VPs0pu4BMtzKbeUiKFDb9/wdakeaYsrdcyMlYIynEuFMRCE+S1 qNsx3a60qks/ilXWS0gTnnrPmhBXO9taWp/3vp7eoQd2kVWp29O8CZhf6ryoKBRtkgCP TW3/vr5MYcbL3QmP4/H7zPIDrRelyoS381HLAlnfJ6iU2QV1cdcQgMXwEgGfTjrLByAu WqftyLlTDTIXyMUXJS3/9Pdd8CfU1S5/b1lAeevwNgyUjLS6r5Hlr7gMFKhg5qT7Z9hl 8BzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=b3KQN/Kte9yOknsbzt0CDZ4AvatyRKhckS3n3Zf19Fo=; b=fMWXMGqCPOXs7MaPwtT434NAHjucAK0tenVT+niZluPKnfXDYUBnW1vZDb3jRsYNlT VMhfU/IDrodGsRhvTF6MfU3SyXlgpjI7zG+VZFzqs2rbgMUkPDbtMwHDdPP1aKoOwiGz cKeI41XtNlIxtwtrms+5U7j7yTb4FjeWeCyiUbQDRsxe1uXLd9/4B2xNLpYN3azJzFj/ q+o44Kle+4f12c1DPd57isK0yPawKuwoi7EF645lvEOCQJlHW+TYR+Syg15e+qfLPBjf MPsbjuL60YmVy9+wfVKEvXd/ato+ypqHkHoZdSC/0oPrZwLYnZOCZU2MnsFNK53ijg3j 7NzA== X-Gm-Message-State: AOAM530Jp248s9m6xRFJ11Y9fQ8iVXNT7R5CHSOjzxhPGhkkE/w2CW42 /k40QSG4cSmGO/gK3Y8SgGn0z9Iizh8= X-Google-Smtp-Source: ABdhPJxMIaneA/FtV97r7S/vzL2QCYXzkK5Gu0x6tPm+WGdLfqAqXBBcogQAMJo2J5EUXsF52XS3zw== X-Received: by 2002:a4a:a648:: with SMTP id j8mr3362294oom.44.1599166818155; Thu, 03 Sep 2020 14:00:18 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id t84sm294237oif.32.2020.09.03.14.00.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:17 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 30/77] hw/riscv: Allow 64 bit access to SiFive CLINT Date: Thu, 3 Sep 2020 15:58:48 -0500 Message-Id: <20200903205935.27832-31-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c43; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc43.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis Commit 5d971f9e672507210e77d020d89e0e89165c8fc9 "memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"" broke most RISC-V boards as they do 64 bit accesses to the CLINT and QEMU would trigger a fault. Fix this failure by allowing 8 byte accesses. Signed-off-by: Alistair Francis Reviewed-by: LIU Zhiwei Message-Id: <122b78825b077e4dfd39b444d3a46fe894a7804c.1593547870.git.alistair.francis@wdc.com> (cherry picked from commit 70b78d4e71494c90d2ccb40381336bc9b9a22f79) Signed-off-by: Michael Roth --- hw/riscv/sifive_clint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/sifive_clint.c b/hw/riscv/sifive_clint.c index e933d35092..a2a4b7d752 100644 --- a/hw/riscv/sifive_clint.c +++ b/hw/riscv/sifive_clint.c @@ -180,7 +180,7 @@ static const MemoryRegionOps sifive_clint_ops = { .endianness = DEVICE_LITTLE_ENDIAN, .valid = { .min_access_size = 4, - .max_access_size = 4 + .max_access_size = 8 } }; From patchwork Thu Sep 3 20:58:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aeQO4TV8; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDd80rc5z9sTv for ; Fri, 4 Sep 2020 07:35:56 +1000 (AEST) Received: from localhost ([::1]:36064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwte-0003ya-0e for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:35:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLQ-00041t-9M; Thu, 03 Sep 2020 17:00:32 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:35796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLI-0007e4-IK; Thu, 03 Sep 2020 17:00:28 -0400 Received: by mail-oi1-x242.google.com with SMTP id w16so4536242oia.2; Thu, 03 Sep 2020 14:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RzeduguMkjJ25jQpgkKJueFeI/WMC3SutpUz7EZNeBA=; b=aeQO4TV8bN1PkAZJSM9mKjt8QIm1131tI00Up90H0yNKutKUFPYyhR5pZt64+QKVnO UqpEdTOJ7oiBPkkDsFitCSeSRMeBKnGst/GFOhQnc9puZo+lxVyaCpKAdGVknhDMQUtU nyZdDoFb1Oz4bLk+9pWUw790CKSt3OCFiyZNYFL0hdjWs/SUmIsRgGql0Qype+BNH7KA R/r6EhvMSDW+bozssylUuzOiSoSSI/p1xlY1zSUERpTlxuHleYPqRIKo6ot/YDNAAWZU s94/jNj7E3e8yveQEmJN1jGGzmulrTWPZDAuqBcxxg5VEamUBPg9WLYOM+Qc+f/8f1V8 JeCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RzeduguMkjJ25jQpgkKJueFeI/WMC3SutpUz7EZNeBA=; b=VRhX2HyWB4Kf1jgI3ID+ckw14AyBMPgR3CTUvWt7rKwAbdfb51d9QZ1diF8cMVk2Km DymYFZcFmRrgbMTUhLXE3TM/8jhSF09XHhiJjIyFYSMs4RTYC0nS8NcETztpUssEjjMG u046Obd0bZKfLjypxEfk3N8T0ElUPK5X0ebpHKo2JDHQ7XUMhWOAVUhEUbMFL3rHXuUl wqgwA94NDzzgo+JcFiUZCjPlhIP5WR7W808Nutp5Wpi8NDMErW/yxAPtAhQ047NrEVhp m1pPc0Bi+L3oMxWsMVNJZdUVXcn/CD26v3rJoaKjIBCAX2lae6U3eIG4CZ8JnDytDUbA TVjA== X-Gm-Message-State: AOAM532S5/X9ovZ8EXTHdA17U6MIkWJZCsXf8BGmk6OR29AULoHqeB3g EoDgFGs4NqWpAcLWd36AdnPlK/q/B9Q= X-Google-Smtp-Source: ABdhPJxE2iGtbT04/YrSqCZV4NB951udik43UfKfeFEIoNqXmz2FAPwMV5hH/A2BkwkQISbIcG0ayA== X-Received: by 2002:a05:6808:8e4:: with SMTP id d4mr3193629oic.132.1599166820386; Thu, 03 Sep 2020 14:00:20 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id t84sm294254oif.32.2020.09.03.14.00.19 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:19 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 31/77] xhci: fix valid.max_access_size to access address registers Date: Thu, 3 Sep 2020 15:58:49 -0500 Message-Id: <20200903205935.27832-32-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , qemu-stable@nongnu.org, Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow 64-bit mode access in "runtime" and "operational" MemoryRegionOps. Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set. XHCI specs: "If the xHC supports 64-bit addressing (AC64 = ‘1’), then software should write 64-bit registers using only Qword accesses. If a system is incapable of issuing Qword accesses, then writes to the 64-bit address fields shall be performed using 2 Dword accesses; low Dword-first, high-Dword second. If the xHC supports 32-bit addressing (AC64 = ‘0’), then the high Dword of registers containing 64-bit address fields are unused and software should write addresses using only Dword accesses" The problem has been detected with SLOF, as linux kernel always accesses registers using 32-bit access even if AC64 is set and revealed by 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"") Suggested-by: Alexey Kardashevskiy Signed-off-by: Laurent Vivier Message-id: 20200721083322.90651-1-lvivier@redhat.com Signed-off-by: Gerd Hoffmann (cherry picked from commit 8e67fda2dd6202ccec093fda561107ba14830a17) Signed-off-by: Michael Roth --- hw/usb/hcd-xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index b330e36fe6..67a18fe2b6 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3184,7 +3184,7 @@ static const MemoryRegionOps xhci_oper_ops = { .read = xhci_oper_read, .write = xhci_oper_write, .valid.min_access_size = 4, - .valid.max_access_size = 4, + .valid.max_access_size = sizeof(dma_addr_t), .endianness = DEVICE_LITTLE_ENDIAN, }; @@ -3200,7 +3200,7 @@ static const MemoryRegionOps xhci_runtime_ops = { .read = xhci_runtime_read, .write = xhci_runtime_write, .valid.min_access_size = 4, - .valid.max_access_size = 4, + .valid.max_access_size = sizeof(dma_addr_t), .endianness = DEVICE_LITTLE_ENDIAN, }; From patchwork Thu Sep 3 20:58:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356995 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jtR+DsnK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDK149SRz9sSP for ; Fri, 4 Sep 2020 07:21:57 +1000 (AEST) Received: from localhost ([::1]:59606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwg7-0003NM-Ht for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLQ-00041s-9A; Thu, 03 Sep 2020 17:00:32 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:40102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLI-0007eN-Q8; Thu, 03 Sep 2020 17:00:28 -0400 Received: by mail-oi1-x242.google.com with SMTP id t76so4498753oif.7; Thu, 03 Sep 2020 14:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8SgwdOy9TwvppyJLuavJtnAY1UT8MfcLqFjl3hAfheE=; b=jtR+DsnKOXbw7HYmPgw/LCA9u5flrRRuKZI+D3AGFyf6IMJ5EmaHIY2vrnQ1tafp7U h122r/JJ7dM2R1DlYEQcWGYxNT7jB63moP5iqXwnxJQCCTI4tPJL/BeLvFOAU/Se/NfC 0xeEGYnI6SUkxhn2z9z0fRdMhpU5uqn7wYQmGqk1T45x4QjWasU/4KIqOm+ae8kE3RSF tp5ugjsZ2G8IhiwWymQbfC1VD4ZqsDfGtOURXzJDtRcyMhZd1I+TmEG0Hye3xYBeHPBI V/2p0JI1SZfjvrhYdyTnfeL/ay9B0pY8Y80fr5BHV4eMMN70ALE3ARoRy3mZVHJ2I+0H 8oUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8SgwdOy9TwvppyJLuavJtnAY1UT8MfcLqFjl3hAfheE=; b=Sc6hrkRMhdtH1fA8BHOkXbKm9A6P4p2p1fADvDwUk62Ah5kaz4GlMWlKKlDVj5cpBe ZxDHXnAFNcUsVBDUDIk4ZfqGcyz8hCOaNEsf6F40W2jKl099mKoHEKWwKkqcHC2gfhFV TV0B5/MS9YQFtpZU7ScbZoAdZgcxaq58kbTr6DvtQSDK4Yg6O1u5J+DCW3g1eVdvV6/X eunBv62cwVKQ1wHIuPKqNR9Vxe8LzOAvaexoxrdg9JlwykkfdDMFyyVERTwqLY38uYLm QsagFUliBdjV537D4AjcqiFoYJ+21XZ/2i8Bmwz3LydErdebSP6lLdbhPzH9BCNyAnDd EaOA== X-Gm-Message-State: AOAM530ycTQGQEsJj/nLr6GFSgVl8fMIaVnPuzbt1gRf+BbJGCd0lbdk +BbiVkSZQFOmTi+zB+KNufc7jwzLA6g= X-Google-Smtp-Source: ABdhPJwZ5cIu4iVoHE7fuxkAlz0CmRduev7XP90zHcvdRve34Dv00ENhoeNm7IpRvo5asLwe7YAocQ== X-Received: by 2002:aca:db0b:: with SMTP id s11mr3290990oig.161.1599166821506; Thu, 03 Sep 2020 14:00:21 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 91sm792953otn.18.2020.09.03.14.00.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:20 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 32/77] acpi: accept byte and word access to core ACPI registers Date: Thu, 3 Sep 2020 15:58:50 -0500 Message-Id: <20200903205935.27832-33-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tokarev , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michael Tokarev All ISA registers should be accessible as bytes, words or dwords (if wide enough). Fix the access constraints for acpi-pm-evt, acpi-pm-tmr & acpi-cnt registers. Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid") Fixes: afafe4bbe0 (apci: switch cnt to memory api) Fixes: 77d58b1e47 (apci: switch timer to memory api) Fixes: b5a7c024d2 (apci: switch evt to memory api) Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/ Buglink: https://bugs.debian.org/964793 BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247 BugLink: https://bugs.launchpad.net/bugs/1886318 Reported-By: Simon John Signed-off-by: Michael Tokarev Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit dba04c3488c4699f5afe96f66e448b1d447cf3fb) Signed-off-by: Michael Roth --- hw/acpi/core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 45cbed49ab..d85052c34a 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -461,7 +461,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val, static const MemoryRegionOps acpi_pm_evt_ops = { .read = acpi_pm_evt_read, .write = acpi_pm_evt_write, - .valid.min_access_size = 2, + .impl.min_access_size = 2, + .valid.min_access_size = 1, .valid.max_access_size = 2, .endianness = DEVICE_LITTLE_ENDIAN, }; @@ -530,7 +531,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val, static const MemoryRegionOps acpi_pm_tmr_ops = { .read = acpi_pm_tmr_read, .write = acpi_pm_tmr_write, - .valid.min_access_size = 4, + .impl.min_access_size = 4, + .valid.min_access_size = 1, .valid.max_access_size = 4, .endianness = DEVICE_LITTLE_ENDIAN, }; @@ -602,7 +604,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val, static const MemoryRegionOps acpi_pm_cnt_ops = { .read = acpi_pm_cnt_read, .write = acpi_pm_cnt_write, - .valid.min_access_size = 2, + .impl.min_access_size = 2, + .valid.min_access_size = 1, .valid.max_access_size = 2, .endianness = DEVICE_LITTLE_ENDIAN, }; From patchwork Thu Sep 3 20:58:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KWXFWA8h; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDZr2NRDz9sTK for ; Fri, 4 Sep 2020 07:33:56 +1000 (AEST) Received: from localhost ([::1]:56770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwri-0000mJ-6r for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:33:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLM-00040K-Cu; Thu, 03 Sep 2020 17:00:30 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:37566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLI-0007eh-Qc; Thu, 03 Sep 2020 17:00:27 -0400 Received: by mail-oi1-x244.google.com with SMTP id e6so4528173oii.4; Thu, 03 Sep 2020 14:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6r9u0nklxBNegI6NxrGJn+A8hZD/QGA53VvgRXsDcyg=; b=KWXFWA8hj94/SWqn/xbLuHS1H9UAOa+m7lre17CIgN8saTbSwxAw3Yas7iMEWF26s/ 0CZxC5QDw4DZvc1MmeH/o8p6eDm28iJR5Zooz2/G2VBzZy+uCgWtMbKHv1WhLs1ZJs/4 uhQIzyrlBStx+jMvZirgwgfxeGQW8wfsrL1J8+z9yvoRyAsnjkYKmeeDOKqzGu7k8EHI KGGwgConXzb9hbaaZJEMX+gjEJlgE9Vz4VrF+1A5BA7w5iuAEYts1vLCyqYKLN19vajX edkQre34dloPQcQBqy4fVnmAZgWY2bg9ZHqPwVv/6cnolONvlqs6tIHPa5OQ5YXwvoJL jFfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=6r9u0nklxBNegI6NxrGJn+A8hZD/QGA53VvgRXsDcyg=; b=majznx8yco2ZDnDkL0TiIoHef9OCp0Zt19ESRMY5HNXY0FmA8h28Sk2BsrkUlb5L2Z 9OokvRyOKZAC5wUNMzmjB2d3lwg6Mz94KMMJSrxYUY+xe/qH9HKeIKzfW5obI5XWTZXC R38IPicZO6NMaKOZZaNp6Weaer+Ydc9YdSnxFVmJ+d6kJ2XozVqQj8YtoSsnOI9GqpY4 poRfH4mpRDtQN/e27gcxJclcNsXx0xkt/93ShLjLUGcLQkUDZdD0BzIb+HpQDYGzsd4R WLHwxVgSmbYvQhDqHwxu4foT1m66EJ1u3dQsaX+rdEdfuxELa1htNzaYAZqQ8IEFRNEq cVkg== X-Gm-Message-State: AOAM533+nEXmu+8bFewjqEQ8HabNKaxp/JYs6sdIS9YSENVpCuDb2qgC ptytdM+QYkJbxbIgqqQGSiZ3v/kaLyY= X-Google-Smtp-Source: ABdhPJykNqvtwFfgk7fq7JGgjho3xrw+T0BCycsxkMlAa5tFID4os47Q4XalaeEpGLqWbi1AQluqSQ== X-Received: by 2002:a54:4704:: with SMTP id k4mr2708157oik.78.1599166822706; Thu, 03 Sep 2020 14:00:22 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id p9sm759437oti.22.2020.09.03.14.00.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:22 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 33/77] hw/display/artist: Unbreak size mismatch memory accesses Date: Thu, 3 Sep 2020 15:58:51 -0500 Message-Id: <20200903205935.27832-34-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Helge Deller , Sven Schnelle , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Commit 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid") broke the artist driver in a way that the dtwm window manager on HP-UX rendered wrong. Fixes: 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid") Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller (cherry picked from commit e0cf02ce680f11893aca9642e76d6ae68b9375af) Signed-off-by: Michael Roth --- hw/display/artist.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/display/artist.c b/hw/display/artist.c index 753dbb9a77..d7bce918b8 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -1199,20 +1199,16 @@ static const MemoryRegionOps artist_reg_ops = { .read = artist_reg_read, .write = artist_reg_write, .endianness = DEVICE_NATIVE_ENDIAN, - .valid = { - .min_access_size = 1, - .max_access_size = 4, - }, + .impl.min_access_size = 1, + .impl.max_access_size = 4, }; static const MemoryRegionOps artist_vram_ops = { .read = artist_vram_read, .write = artist_vram_write, .endianness = DEVICE_NATIVE_ENDIAN, - .valid = { - .min_access_size = 1, - .max_access_size = 4, - }, + .impl.min_access_size = 1, + .impl.max_access_size = 4, }; static void artist_draw_cursor(ARTISTState *s) From patchwork Thu Sep 3 20:58:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MKRgVDgj; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjD5J0RKqz9sPB for ; Fri, 4 Sep 2020 07:11:48 +1000 (AEST) Received: from localhost ([::1]:46784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwWH-0003Ou-VZ for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:11:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLR-00042h-8V; Thu, 03 Sep 2020 17:00:33 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:36666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLK-0007eq-CQ; Thu, 03 Sep 2020 17:00:29 -0400 Received: by mail-oi1-x242.google.com with SMTP id x19so4533844oix.3; Thu, 03 Sep 2020 14:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OV98AiSKpkunegu+hWzJKS6snwZunhiA7NZUV3WFBUk=; b=MKRgVDgj2FZNdNzR+l+hsU/YG+JXwYGnJxNinGOdCu438kHwACj9iqt+VGSUhPPmRn tgyOz5scd5zlNxDCVH7ACf/zz+KxwCMdmtjE6YSK5k6SSWbUu3A/JwhmqUBBdzMII+xC mKbReXFYWz06tvx1ak3nvs3PVS53QtiTT+e8vOGKAU9GJjJwb+0dleXE52X2fvlmAB/Y U6hLfbLQgXIPV++5+xcPHhFhgWkPrVxEQ2EeVYuCVnSQDaRWmvURzI5mGOrWY/rmEkap JcCX330WkrRg54ydFStTc1HwuyOeKUdzcU6WiMHBSqF/pyQpkpPex6biakuTVAbloCdF y4Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OV98AiSKpkunegu+hWzJKS6snwZunhiA7NZUV3WFBUk=; b=NVKHOIYhU+GPDe+YO77Mo+aQUuC/UjPQR57uTZ6jtdbgUWayQfjGxIUZNQ9HqfCyF5 1kfT7X7n+Fmsn3Z4jlFEz89t+0gTL5UojKhQsJ/1lDGQoG5/ybG+b0HZ9p6fOm7mJM/6 Df0I9lM/e1SkNsWVv3SDkSaYZU5JREA80vz1eRrLJYOcypxnotNtKsfmfiaO0nmo7+Ci fcapP//Hf/aTjVOUjMKoVqRazfSv9Y7haEM0E/PhH/wKZbpERfDwHlz/gg3vZxlM2Htn RgPlWGPQPVnaht38OFaFKSA8GGePs+tw8MmJg6UnAbBNk9yCz/GwE/0Ds/gImvkzF2cS hx7w== X-Gm-Message-State: AOAM530mqYQXp1MMvmNUceE/5Yo97rT/ucifIQxpeHiBsMmjMidxMLhG wKoSdPCxYwPSBqm46VtZv9VjjHd7yEQ= X-Google-Smtp-Source: ABdhPJzuSw7aM2YMePGtWdBFOfx8GyNKtieQT+gVhgdxaUptLiMmE3z5ELUFaRcSRDkMciZ/JDGfOw== X-Received: by 2002:aca:4b12:: with SMTP id y18mr3253674oia.28.1599166823736; Thu, 03 Sep 2020 14:00:23 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id y83sm714235oiy.35.2020.09.03.14.00.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:23 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 34/77] hw/net/e1000e: Do not abort() on invalid PSRCTL register value Date: Thu, 3 Sep 2020 15:58:52 -0500 Message-Id: <20200903205935.27832-35-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , qemu-stable@nongnu.org, =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé libFuzzer found using 'qemu-system-i386 -M q35': qemu: hardware error: e1000e: PSRCTL.BSIZE0 cannot be zero CPU #0: EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000663 ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000 EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0000 00000000 0000ffff 00009300 CS =f000 ffff0000 0000ffff 00009b00 SS =0000 00000000 0000ffff 00009300 DS =0000 00000000 0000ffff 00009300 FS =0000 00000000 0000ffff 00009300 GS =0000 00000000 0000ffff 00009300 LDT=0000 00000000 0000ffff 00008200 TR =0000 00000000 0000ffff 00008b00 GDT= 00000000 0000ffff IDT= 00000000 0000ffff CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000 DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000 DR6=ffff0ff0 DR7=00000400 EFER=0000000000000000 FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80 FPR0=0000000000000000 0000 FPR1=0000000000000000 0000 FPR2=0000000000000000 0000 FPR3=0000000000000000 0000 FPR4=0000000000000000 0000 FPR5=0000000000000000 0000 FPR6=0000000000000000 0000 FPR7=0000000000000000 0000 XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000 XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000 XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000 XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000 ==1988== ERROR: libFuzzer: deadly signal #6 0x7fae4d3ea894 in __GI_abort (/lib64/libc.so.6+0x22894) #7 0x563f4cc59a1d in hw_error (qemu-fuzz-i386+0xe8ca1d) #8 0x563f4d7c93f2 in e1000e_set_psrctl (qemu-fuzz-i386+0x19fc3f2) #9 0x563f4d7b798f in e1000e_core_write (qemu-fuzz-i386+0x19ea98f) #10 0x563f4d7afc46 in e1000e_mmio_write (qemu-fuzz-i386+0x19e2c46) #11 0x563f4cc9a0a7 in memory_region_write_accessor (qemu-fuzz-i386+0xecd0a7) #12 0x563f4cc99c13 in access_with_adjusted_size (qemu-fuzz-i386+0xeccc13) #13 0x563f4cc987b4 in memory_region_dispatch_write (qemu-fuzz-i386+0xecb7b4) It simply sent the following 2 I/O command to the e1000e PCI BAR #2 I/O region: writew 0x0100 0x0c00 # RCTL = E1000_RCTL_DTYP_MASK writeb 0x2170 0x00 # PSRCTL = 0 2813 static void 2814 e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val) 2815 { 2816 if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) { 2817 2818 if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) { 2819 hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero"); 2820 } Instead of calling hw_error() which abort the process (it is meant for CPU fatal error condition, not for device logging), log the invalid request with qemu_log_mask(LOG_GUEST_ERROR) and return, ignoring the request. Cc: qemu-stable@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Jason Wang (cherry picked from commit fda43b1204aecd1db158b3255c591d227fbdd629) Signed-off-by: Michael Roth --- hw/net/e1000e_core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index d5676871fa..bcd186cac5 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -34,9 +34,9 @@ */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "net/net.h" #include "net/tap.h" -#include "hw/hw.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "sysemu/runstate.h" @@ -2816,11 +2816,15 @@ e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val) if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) { if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) { - hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero"); + qemu_log_mask(LOG_GUEST_ERROR, + "e1000e: PSRCTL.BSIZE0 cannot be zero"); + return; } if ((val & E1000_PSRCTL_BSIZE1_MASK) == 0) { - hw_error("e1000e: PSRCTL.BSIZE1 cannot be zero"); + qemu_log_mask(LOG_GUEST_ERROR, + "e1000e: PSRCTL.BSIZE1 cannot be zero"); + return; } } From patchwork Thu Sep 3 20:58:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=gl+8yXAY; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDgL0X2Fz9sSP for ; Fri, 4 Sep 2020 07:37:50 +1000 (AEST) Received: from localhost ([::1]:45430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwvT-00083d-Ei for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:37:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLR-00042w-D6; Thu, 03 Sep 2020 17:00:33 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:44661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLK-0007f2-JX; Thu, 03 Sep 2020 17:00:30 -0400 Received: by mail-ot1-x32a.google.com with SMTP id a2so3981328otr.11; Thu, 03 Sep 2020 14:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bZwBA4peLRyGs8ohtkAt1JRxKXRjQb8BlHQpeJ+7qBM=; b=gl+8yXAY9Qy03h4KXWVLSI715zYwZY0Y6cZA0UPXXUtkLR3g2WvW1/MMdvl+1c72a/ C7R0MeSVJ12nC2t0ra0abC4LcKnIzBmJlQgQXDuCGgK015s/uXDSauguW+edMLLU5/YI VS9TZk+vwOtrJKO/cOzwmjXGtzSuQGCqVUZFXNz5laW85CTcQbswMhPam4zAsTeQfdYR 5HexfJ/mLMOg/CWqxqyR0Z8V6NH00zNUmwBQB2eWKtEGQl5yWZ3NwItV+oNMag3C7f5E 1xtN+z/viOcqPKnM1bbuwTPFa0FzGih7KOfVIZYIsiSqd9aJQKrb7J0+fGtSG/cLshit LNgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bZwBA4peLRyGs8ohtkAt1JRxKXRjQb8BlHQpeJ+7qBM=; b=uFvgiFcGaXL0ovqdl6TsoMbes9JbpwK/zctjYpCIbGOOq90EjqjUf61nvAoPR0+Rz1 g55+7IvQfdgu4qaRMmicZzi5FSTaz9V/DSuEHFC6TMCsba3JIPtL5hMPBND7fbS47kvD ouKZBaoGx4a/ouP/hxBKP5EzII54+Dm2g9qGwSzYxfVSVIjVqC0GOA5wSXFC/uJ8Z7R1 O79jmFsL7i2SQ/jC8NGYAPnNTJ2R9GVEcSZvScf6gaMi5B7gaJknQvfwzDJznzmyacuZ WVKJ2t86IuLxEQ2juYnAlBWspJYYI4s4jtiC5/75/YO9TbRmD4cYGIUIC6612QY5A1W2 wQRQ== X-Gm-Message-State: AOAM532W8M/4JQ7hrZ8rpWN2bxyBcidPfDOIPMLhQ/jv88RpVHPbLiCk obzBYNjWaOW/4nEwOKAQzbxjGxArV4U= X-Google-Smtp-Source: ABdhPJy99SGG5AIzkQH1kFBC0VKy93XlH+nU5+TdBGgzjffCfQ/LCf4OWtpQQaulynD/0A0muud7Vg== X-Received: by 2002:a9d:170e:: with SMTP id i14mr3217027ota.170.1599166824814; Thu, 03 Sep 2020 14:00:24 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 92sm764752ota.38.2020.09.03.14.00.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:24 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 35/77] virtiofsd: Whitelist fchmod Date: Thu, 3 Sep 2020 15:58:53 -0500 Message-Id: <20200903205935.27832-36-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=flukshun@gmail.com; helo=mail-ot1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, "Dr . David Alan Gilbert" , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Max Reitz lo_setattr() invokes fchmod() in a rarely used code path, so it should be whitelisted or virtiofsd will crash with EBADSYS. Said code path can be triggered for example as follows: On the host, in the shared directory, create a file with the sticky bit set and a security.capability xattr: (1) # touch foo (2) # chmod u+s foo (3) # setcap '' foo Then in the guest let some process truncate that file after it has dropped all of its capabilities (at least CAP_FSETID): int main(int argc, char *argv[]) { capng_setpid(getpid()); capng_clear(CAPNG_SELECT_BOTH); capng_updatev(CAPNG_ADD, CAPNG_PERMITTED | CAPNG_EFFECTIVE, 0); capng_apply(CAPNG_SELECT_BOTH); ftruncate(open(argv[1], O_RDWR), 0); } This will cause the guest kernel to drop the sticky bit (i.e. perform a mode change) as part of the truncate (where FATTR_FH is set), and that will cause virtiofsd to invoke fchmod() instead of fchmodat(). (A similar configuration exists further below with futimens() vs. utimensat(), but the former is not a syscall but just a wrapper for the latter, so no further whitelisting is required.) Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1842667 Reported-by: Qian Cai Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Message-Id: <20200608093111.14942-1-mreitz@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Vivek Goyal Signed-off-by: Dr. David Alan Gilbert (cherry picked from commit 63659fe74e76f5c5285466f0c5cfbdca65b3688e) Signed-off-by: Michael Roth --- tools/virtiofsd/seccomp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virtiofsd/seccomp.c b/tools/virtiofsd/seccomp.c index bd9e7b083c..3b1522acdd 100644 --- a/tools/virtiofsd/seccomp.c +++ b/tools/virtiofsd/seccomp.c @@ -42,6 +42,7 @@ static const int syscall_whitelist[] = { SCMP_SYS(exit_group), SCMP_SYS(fallocate), SCMP_SYS(fchdir), + SCMP_SYS(fchmod), SCMP_SYS(fchmodat), SCMP_SYS(fchownat), SCMP_SYS(fcntl), From patchwork Thu Sep 3 20:58:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ogiOM/vc; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDdk3w9bz9sSP for ; Fri, 4 Sep 2020 07:36:26 +1000 (AEST) Received: from localhost ([::1]:37930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwu8-0004qY-EU for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:36:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLS-00043y-0L; Thu, 03 Sep 2020 17:00:34 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:45643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLM-0007fN-FL; Thu, 03 Sep 2020 17:00:33 -0400 Received: by mail-ot1-x341.google.com with SMTP id g96so3975221otb.12; Thu, 03 Sep 2020 14:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uQPncV/jLImjoch26Nuy7gV8hNnslJV64x5ayj1AopA=; b=ogiOM/vcOw+4h5KxOuXCl3M24eZzMDtvLTnvk240oGhaurTjvHHY0jXrg6Gq1Pj+x9 xZhKIpHO4Fq6at1l6n/LUcFijBx+DSFdbzvsv/WRrv4Kt2LO8C6lb4SRXhTpH6qukVoY HZxVOnpSTANhsBZ3My0lqAafSR8GF1IydyhRbBaKbuM4JcCpwA+SUcPBIQFkZIoTdAiM 2xgZCvY+QNSYs3lVxJHGpQsKT5XtKgBsNLXyABVeD4ql2TWnbGsZp0YrdO8Sg1ZaP34b 08tsMDBz/caYx3zed9sKSzi8wIlhHQHNQR9+U5NmfKrjQklA1OsGQW53cLYQej06myfE uIWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uQPncV/jLImjoch26Nuy7gV8hNnslJV64x5ayj1AopA=; b=k2X1+JB2ZuIIhjM9AvtwlZpJJVp1o1zW708eN5ZoHMW+ZzxbZEUyz69joLVtTxxkC5 UMXVsjbVfXoz1G09IBA8uArchdr9zx1aGvqweKNpCCEz1RrN26WVU0R2I+WJeHpESYO2 ixF7KTzDLKY5rMCNCdsOamCeKHEWOCgbuxfXDHW1YYNM8QDNP6StMYjEp0JXGoDjSm2V KK/4netHMzjIaheNsIdQpyhNdTF9er7VbcSJKTBHoghhzuSMqp4UCTw8kqJsLWJMd6gm ODdIU7HLtVOGPf7dBAIQ2iGHRTqIjKPpbEnkkci8+LmAc2xKMQkvcE7WBoZR+R4UDebo L0hQ== X-Gm-Message-State: AOAM530utpCO196olzRXfhYRM+URsoSUPtIfEVsEIH/yrDDcwEARUpIp gD7Gp1yqU5aLykHdQ3n/412yM2puwmc= X-Google-Smtp-Source: ABdhPJzJlnG9NKW9NqggbCOnxGkTeY2euLyTy91CRCKuT6nVtP1neWk+P/hPjGtSFob1HzF1P+ZtTQ== X-Received: by 2002:a9d:6f86:: with SMTP id h6mr3113277otq.285.1599166826509; Thu, 03 Sep 2020 14:00:26 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id r33sm828425ooi.48.2020.09.03.14.00.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:26 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 36/77] hw/audio/gus: Fix registers 32-bit access Date: Thu, 3 Sep 2020 15:58:54 -0500 Message-Id: <20200903205935.27832-37-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=flukshun@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Allan Peramaki , qemu-stable@nongnu.org, Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Allan Peramaki Fix audio on software that accesses DRAM above 64k via register peek/poke and some cases when more than 16 voices are used. Cc: qemu-stable@nongnu.org Fixes: 135f5ae1974c ("audio: GUSsample is int16_t") Signed-off-by: Allan Peramaki Tested-by: Volker Rümelin Reviewed-by: Volker Rümelin Reviewed-by: Thomas Huth Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Message-id: 20200618103623.6031-1-philmd@redhat.com Message-Id: <20200615201757.16868-1-aperamak@pp1.inet.fi> [PMD: Removed unrelated style changes] Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Gerd Hoffmann (cherry picked from commit 586803455b3fa44d949ecd42cd9c87e5a6287aef) Signed-off-by: Michael Roth --- hw/audio/gusemu_hal.c | 2 +- hw/audio/gusemu_mixer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/gusemu_hal.c b/hw/audio/gusemu_hal.c index ae40ca341c..5b9a14ee21 100644 --- a/hw/audio/gusemu_hal.c +++ b/hw/audio/gusemu_hal.c @@ -32,7 +32,7 @@ #define GUSregb(position) (* (gusptr+(position))) #define GUSregw(position) (*(uint16_t *) (gusptr+(position))) -#define GUSregd(position) (*(uint16_t *)(gusptr+(position))) +#define GUSregd(position) (*(uint32_t *)(gusptr + (position))) /* size given in bytes */ unsigned int gus_read(GUSEmuState * state, int port, int size) diff --git a/hw/audio/gusemu_mixer.c b/hw/audio/gusemu_mixer.c index 00b9861b92..56300de77e 100644 --- a/hw/audio/gusemu_mixer.c +++ b/hw/audio/gusemu_mixer.c @@ -28,7 +28,7 @@ #define GUSregb(position) (* (gusptr+(position))) #define GUSregw(position) (*(uint16_t *) (gusptr+(position))) -#define GUSregd(position) (*(uint16_t *)(gusptr+(position))) +#define GUSregd(position) (*(uint32_t *)(gusptr + (position))) #define GUSvoice(position) (*(uint16_t *)(voiceptr+(position))) From patchwork Thu Sep 3 20:58:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357038 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=a1aKQANe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDjV6FcJz9sTK for ; Fri, 4 Sep 2020 07:39:42 +1000 (AEST) Received: from localhost ([::1]:55764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwxI-0003lA-RY for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:39:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLT-00047T-H5; Thu, 03 Sep 2020 17:00:35 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:46478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLR-0007fc-GX; Thu, 03 Sep 2020 17:00:35 -0400 Received: by mail-ot1-x32a.google.com with SMTP id c10so3974252otm.13; Thu, 03 Sep 2020 14:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=WPTghg1JdY/T9Chd/wvCDZJhQbF7QTuk1z+gP+1I088=; b=a1aKQANe0qgPOb94YAlu0JVQWZJ9x/BCoP0gG3D/OdBG9/+rU3L23STY47d9xMI5Cp IT/G7juy/pISK7II74iJ64MBzHsyjytaa9M2E4IT3W8GEHriGrm2kmWd0PtnadF23fT7 VtBTj4qlTv8+5Mmqypo6zLjjyH+e+XvaRSMrMs7pSN1CgfMpEF+pej4etaK6dik1dWUR gImJOLbJXvIKgEJQq/kgbjQyCuaw5Lb1SxSsDNcAriFCXqndMmRf5eEk09CvrjpgXqip 9ZffXf6LmGE+fR20nLkTYKvHeo2U5dBNuCmJSF+6qlNxt7TelOgYchtkAO7G90Gx2rYa uzzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=WPTghg1JdY/T9Chd/wvCDZJhQbF7QTuk1z+gP+1I088=; b=oaZBUiy5DOBYl4fPckK8LlXCnCAnKjaE9lHpeDQ4qBSuJ30tnvOUu9+tzYSSgqMi5B UXBd88VF/rMhqp/AMfrczZstak1R09hwdipo4DhdEyqTk3qGudeLWgBcHuA3m/aJ9k90 z80N1a5yobJmC8NZG66kMt+ofrJmYqHQo0OsuC0ihiTisxjad4yzN0HFKJtr18+JRTeJ p0vnvF+PJ3BifXf5Wa6KRxsV+zufZ3EvMvilA53WV19gbQbQv2nh/oxwjAhd+MALAeQw OFC9uvV8JDm+zvyvMW0AVNQZ+rAAE/l+M1ZDEjneXbQsJHliA+YQZQ3SKAqNuJN0volI OkFw== X-Gm-Message-State: AOAM531iZmA0URwktUmS+MkcSRJMB/z4ZppV4f6NH9gbofvUt0izg/r+ Pd5Jh1qNZaNMQObAkdBdPbwXktvIUmE= X-Google-Smtp-Source: ABdhPJzT/UvyJ6V7XgHu5FGN79WqCUAdGQEFsx/cGblV3zmS/s6aiDmvMQqbigm1YBtwqFllS6evRA== X-Received: by 2002:a05:6830:13:: with SMTP id c19mr3138247otp.65.1599166827608; Thu, 03 Sep 2020 14:00:27 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id f194sm718215oib.44.2020.09.03.14.00.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:27 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 37/77] net/virtio: Fix failover_replug_primary() return value regression Date: Thu, 3 Sep 2020 15:58:55 -0500 Message-Id: <20200903205935.27832-38-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=flukshun@gmail.com; helo=mail-ot1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Freimann , "Michael S . Tsirkin" , qemu-stable@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Markus Armbruster Commit 150ab54aa6 "net/virtio: fix re-plugging of primary device" fixed failover_replug_primary() to return false on failure. Commit 5a0948d36c "net/virtio: Fix failover error handling crash bugs" broke it again for hotplug_handler_plug() failure. Unbreak it. Commit 5a0948d36c4cbc1c5534afac6fee99de55245d12 Fixes: 5a0948d36c4cbc1c5534afac6fee99de55245d12 Cc: Jens Freimann Cc: Michael S. Tsirkin Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Jens Freimann Reviewed-by: Michael S. Tsirkin Message-Id: <20200630090351.1247703-2-armbru@redhat.com> (cherry picked from commit ca72efccbe33373810341a0d8a10f5698b8fbc87) Signed-off-by: Michael Roth --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index a46e3b37a7..e7e2c2acdb 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2828,7 +2828,7 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp) if (err) { goto out; } - hotplug_handler_plug(hotplug_ctrl, n->primary_dev, errp); + hotplug_handler_plug(hotplug_ctrl, n->primary_dev, &err); } out: From patchwork Thu Sep 3 20:58:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=r+Bw11oB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDgd42lMz9sTK for ; Fri, 4 Sep 2020 07:38:05 +1000 (AEST) Received: from localhost ([::1]:47292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwvj-0000NW-Dg for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:38:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLT-00047Y-IH; Thu, 03 Sep 2020 17:00:35 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:37569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLR-0007fx-Ax; Thu, 03 Sep 2020 17:00:35 -0400 Received: by mail-oi1-x244.google.com with SMTP id e6so4528435oii.4; Thu, 03 Sep 2020 14:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HbS47WUaBPPEuio8+cvg8pxNjw1ZKqWkDcR3X6WFFTw=; b=r+Bw11oB7WI5MhRV+Z5dEdiKCXNlWcc+dC/9HH/7jaDsOVwLTuGQU2KLHgqdgqzwxN kpVHwkGzeZql599jVO1ughlAX3IPQ/5IaKEqmbIN/oQ1MXFESGwfVZww+6SL+XdSJlez /jKqOZa/V6K2wjWDWyoT9HY2wky4j6YK9zoMiL2amwpSAenSfMsDKQ2QMdrsoMSHw7ct udSGeCQMTy0EZXbpc3LYjl7HtKg3KJBwgFyfan6SMvmoEAoyz27NTMkrhrDzpz1rP9qh Lqs3hugFEv2s9bobvIepIuGuUI9f/9CligwyBDfqeJmADaXRt03NPj0A6xp4k/EBUBBS b51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HbS47WUaBPPEuio8+cvg8pxNjw1ZKqWkDcR3X6WFFTw=; b=IQKleItYMAh4tJ1AUzl2emP3lhJRppBUceOk+j1inc2/fmHlAohC2qMWGSDxIjPaao rIKqXZynOyoOEz5AeSHpJ8FN9uMEMocFqbyY7FYb+dJywaKg/rONKK5Znr+4UpZFeGpA oIXgJiTY0K72CnfDHfVl54kbCXk0Rq8HCdTLBrmNCGRAaFayBXE6v9MbUcdrcIWfvsWP etetSbczZ34LCNUiS3l+4MAFzJS7V2O4XoFIGrhcbLlDFo/LYOgW4x7Hjxzo6m2CUNPY venRCmzSwlN8JZUcys+jniKk48vjNYAe0oXOS9+110mxf+Nt6Yi0wxXUejXJtBvSJLp0 mxrw== X-Gm-Message-State: AOAM531TVguPIXGNvn/YgAvRVcY+gTJK19MkA4WCZ6d0D6+ebi13Z4TK UvaoldQSpCyGcdeZGlwMTbIWkhQOFLw= X-Google-Smtp-Source: ABdhPJwmI0ezm+PloNz/xyzsTTmPzD2K527tKEou5niUMlTIg83L6wmUXk3eYAyo0jWY9CoCMt3dIw== X-Received: by 2002:aca:1716:: with SMTP id j22mr3442432oii.44.1599166828689; Thu, 03 Sep 2020 14:00:28 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id v35sm763455otb.32.2020.09.03.14.00.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:28 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 38/77] error: Use error_reportf_err() where appropriate Date: Thu, 3 Sep 2020 15:58:56 -0500 Message-Id: <20200903205935.27832-39-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Markus Armbruster Replace error_report("...: %s", ..., error_get_pretty(err)); by error_reportf_err(err, "...: ", ...); One of the replaced messages lacked a colon. Add it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200505101908.6207-6-armbru@redhat.com> (cherry picked from commit 5217f1887a8041c51495fbd5d3f767d96a242000) Signed-off-by: Michael Roth --- chardev/char-socket.c | 5 +++-- hw/sd/pxa2xx_mmci.c | 4 ++-- hw/sd/sd.c | 4 ++-- hw/usb/dev-mtp.c | 9 +++++---- qemu-nbd.c | 7 +++---- scsi/qemu-pr-helper.c | 4 ++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 185fe38dda..e5ee685f8c 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -138,8 +138,9 @@ static void check_report_connect_error(Chardev *chr, SocketChardev *s = SOCKET_CHARDEV(chr); if (!s->connect_err_reported) { - error_report("Unable to connect character device %s: %s", - chr->label, error_get_pretty(err)); + error_reportf_err(err, + "Unable to connect character device %s: ", + chr->label); s->connect_err_reported = true; } qemu_chr_socket_restart_timer(chr); diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 8f9ab0ec16..f9c50ddda5 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -497,12 +497,12 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, carddev = qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CARD); qdev_prop_set_drive(carddev, "drive", blk, &err); if (err) { - error_report("failed to init SD card: %s", error_get_pretty(err)); + error_reportf_err(err, "failed to init SD card: "); return NULL; } object_property_set_bool(OBJECT(carddev), true, "realized", &err); if (err) { - error_report("failed to init SD card: %s", error_get_pretty(err)); + error_reportf_err(err, "failed to init SD card: "); return NULL; } diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 71a9af09ab..3c06a0ac6d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -703,13 +703,13 @@ SDState *sd_init(BlockBackend *blk, bool is_spi) dev = DEVICE(obj); qdev_prop_set_drive(dev, "drive", blk, &err); if (err) { - error_report("sd_init failed: %s", error_get_pretty(err)); + error_reportf_err(err, "sd_init failed: "); return NULL; } qdev_prop_set_bit(dev, "spi", is_spi); object_property_set_bool(obj, true, "realized", &err); if (err) { - error_report("sd_init failed: %s", error_get_pretty(err)); + error_reportf_err(err, "sd_init failed: "); return NULL; } diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 20717f026b..168428156b 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -631,8 +631,9 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o) int64_t id = qemu_file_monitor_add_watch(s->file_monitor, o->path, NULL, file_monitor_event, s, &err); if (id == -1) { - error_report("usb-mtp: failed to add watch for %s: %s", o->path, - error_get_pretty(err)); + error_reportf_err(err, + "usb-mtp: failed to add watch for %s: ", + o->path); error_free(err); } else { trace_usb_mtp_file_monitor_event(s->dev.addr, o->path, @@ -1276,8 +1277,8 @@ static void usb_mtp_command(MTPState *s, MTPControl *c) s->file_monitor = qemu_file_monitor_new(&err); if (err) { - error_report("usb-mtp: file monitoring init failed: %s", - error_get_pretty(err)); + error_reportf_err(err, + "usb-mtp: file monitoring init failed: "); error_free(err); } else { QTAILQ_INIT(&s->events); diff --git a/qemu-nbd.c b/qemu-nbd.c index 306e44fb0a..d2657b8db5 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -856,8 +856,7 @@ int main(int argc, char **argv) } tlscreds = nbd_get_tls_creds(tlscredsid, list, &local_err); if (local_err) { - error_report("Failed to get TLS creds %s", - error_get_pretty(local_err)); + error_reportf_err(local_err, "Failed to get TLS creds: "); exit(EXIT_FAILURE); } } else { @@ -983,8 +982,8 @@ int main(int argc, char **argv) &local_err); if (sioc == NULL) { object_unref(OBJECT(server)); - error_report("Failed to use socket activation: %s", - error_get_pretty(local_err)); + error_reportf_err(local_err, + "Failed to use socket activation: "); exit(EXIT_FAILURE); } qio_net_listener_add(server, sioc); diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 181ed4a186..57ad830d54 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -1030,8 +1030,8 @@ int main(int argc, char **argv) server_ioc = qio_channel_socket_new_fd(FIRST_SOCKET_ACTIVATION_FD, &local_err); if (server_ioc == NULL) { - error_report("Failed to use socket activation: %s", - error_get_pretty(local_err)); + error_reportf_err(local_err, + "Failed to use socket activation: "); exit(EXIT_FAILURE); } } From patchwork Thu Sep 3 20:58:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=q9V7cdok; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDld5n3bz9sTK for ; Fri, 4 Sep 2020 07:41:33 +1000 (AEST) Received: from localhost ([::1]:34932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwz5-0006rU-N6 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:41:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLU-00048i-3a; Thu, 03 Sep 2020 17:00:36 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:41872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLR-0007h8-HR; Thu, 03 Sep 2020 17:00:35 -0400 Received: by mail-ot1-x344.google.com with SMTP id a65so4001163otc.8; Thu, 03 Sep 2020 14:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8VEH4Dp3c4FP61LHXzVX3wMEuap/BOtd0QFnCK48Al0=; b=q9V7cdok4+jvmBw6p74YUFba00TvHAIPCkKrjI93a7obPFS+oypdU42wf8bH0ihvta jUrehUO7Y9mLttKP2JAa/eNRAy62AkwFipNRbCTRst6/aSqRw0pNt5v6h5Mijr0olDnG C7zwt3YZ9+1P9BcU8sPGCG6J6Up6qdu3OmI+/DMqQsOMGw0R3vs0vBqaEY+PzHW2Zn9Q CJBs09HVRoYDSqHVJkQmwVLdx8jQOwHjoqQlc0vHq16q5cnGxrbRuR6eBY/Fcwb3Dw5+ b6LuvfD39zkpsrjgA3JZrcNMna7NlAL7KsrlhbjBHfHJlvRVEd3xjguAD60+rLaTcdxD O8QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8VEH4Dp3c4FP61LHXzVX3wMEuap/BOtd0QFnCK48Al0=; b=Weplk1e+GKFE0IiDUlSzzRq908wTjEFtQmAssSPf3I7i/agC+htT/PMKhKvotcE50k HS6Ewz6eE+/zaevUUlehVaQlMi39iDJ4BSW93wK5/1kZJdIXyI+xCaBN5RlASrec5nuC 8JrChxzvVhiBX3P54U2fj7L5vKKYlPumT8SIxUp5B/+bhQ/JzG0Yulp5pEyO629iTjjy 6F2eCcUP+WQynVolFb4ZV9k1T8oAKWB0zgNwRaj+zW7MQoyIVmqa+8cK6Tb8bu0nx/qq 5PPU4i75S0P6Tf+Wx4yaVzFurQnlN40OUx64VUjkDQ9dzLAmACnVayWKRnFHxFOMTrs5 6jlg== X-Gm-Message-State: AOAM530Jf4SCpRUk7hJlZ62mGwdDp0IN1JjDfaDX5B2ipFndZidQtfaY wPdWsULJqHR2Sg47kksiKba0yQipyps= X-Google-Smtp-Source: ABdhPJyhKwYIlVPhJa6OKmpPFj8E2qEVFynhQoagjVfkQIELeK3COGKLbkooDuZG9MGQfuIKG1tq6g== X-Received: by 2002:a9d:7854:: with SMTP id c20mr3028823otm.123.1599166830005; Thu, 03 Sep 2020 14:00:30 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q15sm761135otl.65.2020.09.03.14.00.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:29 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 39/77] usb/dev-mtp: Fix Error double free after inotify failure Date: Thu, 3 Sep 2020 15:58:57 -0500 Message-Id: <20200903205935.27832-40-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=flukshun@gmail.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Gerd Hoffmann , qemu-stable@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Markus Armbruster error_report_err() frees its first argument. Freeing it again is wrong. Don't. Fixes: 47287c27d0c367a89f7b2851e23a7f8b2d499dd6 Cc: Gerd Hoffmann Cc: Daniel P. Berrangé Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster Message-Id: <20200630090351.1247703-7-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé (cherry picked from commit 562a558647be6fe43e60f8bf3601e5b6122c0599) Signed-off-by: Michael Roth --- hw/usb/dev-mtp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 168428156b..15a2243101 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -634,7 +634,6 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o) error_reportf_err(err, "usb-mtp: failed to add watch for %s: ", o->path); - error_free(err); } else { trace_usb_mtp_file_monitor_event(s->dev.addr, o->path, "Watch Added"); @@ -1279,7 +1278,6 @@ static void usb_mtp_command(MTPState *s, MTPControl *c) if (err) { error_reportf_err(err, "usb-mtp: file monitoring init failed: "); - error_free(err); } else { QTAILQ_INIT(&s->events); } From patchwork Thu Sep 3 20:58:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=QBgHxt0S; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDNG5H2kz9sPB for ; Fri, 4 Sep 2020 07:24:46 +1000 (AEST) Received: from localhost ([::1]:43222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwiq-0008Iy-KG for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:24:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLU-000496-4G; Thu, 03 Sep 2020 17:00:36 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:45196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLR-0007hM-I3; Thu, 03 Sep 2020 17:00:35 -0400 Received: by mail-oi1-x244.google.com with SMTP id d189so4479274oig.12; Thu, 03 Sep 2020 14:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=qqO0q4PuTgIHgmO4BpcbGdGSE0v/V3QX2HSz7/NQHAc=; b=QBgHxt0SENiRPU4IfFatZ/taoMjuFG2MVBKHGhSgZqndtCiIP33d5lETEbz2H9UZ3h 9lk1B9uc3Zg/6bls7qeNidcFOw/hRA5ydEM+j+SMKYrWKCveMqc4M5OqCXOpj996rDe2 2U/dEIJaLblSG0M9ybqmvz332W8f99SXMKeGQLNFejzBcS3PmbqTpHU+f39oAi3oXm8E FDdk9GV5H5YzndLxrbN61dyIEOuRCHpvoqUrgBFdUJjKS1RfVYLyFqnIXIFzy27tiXGU 1/Iszd9+6L/WR2cr4pkkaV3fHmCuSGM+Ge8Ru8G4q0sizzVTlTD7veUuJNKOkVZ5j5HB mPZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=qqO0q4PuTgIHgmO4BpcbGdGSE0v/V3QX2HSz7/NQHAc=; b=jgVphdahdGhA69pH7xpwsn0ood1ab8Ca2jOaFB1ue9XuHKducJd/ACu8rP7kh6f1gy bFbkDGouhdkgkrnm8AR5Ujh8hrSO3sQ7a/O5BtZuFngNRhPsdRDPoX44FOzJQjwccxx4 W0MDC7EmurYAtLet8zkRl7D8ExzPhGWmORlVafPbIfCIiKvl6zOj3noCxWeNGWTeJa+c IHDkCo7wZCuC8q/iZyRDZlu8xFpYt+6V8pe0zoMULMhnoDVtkg4bB4AX/dCh/GcFvDx6 LWaO0JeHOvo8glKTNAhCcZETof/rncUgKVsk0Pex8KagwZi8YPOReklzHcLmchRrTnQv wa+Q== X-Gm-Message-State: AOAM531uXlRaUYzOLCRWWF8qpv/9Vvo7Gq3m1nE29ub0veYaNIlIQwrK t4Immt7B05D/bCBYU4CGwrwTDx7Jwtg= X-Google-Smtp-Source: ABdhPJwysubC3KWwQhGbppCyE3FDbdcV/xaohyynjtrIcBJB2TP6F94NIpqguL9tObaqtNXRh5XVIQ== X-Received: by 2002:aca:ed0a:: with SMTP id l10mr3405235oih.9.1599166831704; Thu, 03 Sep 2020 14:00:31 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id z17sm836821oop.15.2020.09.03.14.00.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:31 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 40/77] nbd: Avoid off-by-one in long export name truncation Date: Thu, 3 Sep 2020 15:58:58 -0500 Message-Id: <20200903205935.27832-41-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake When snprintf returns the same value as the buffer size, the final byte was truncated to ensure a NUL terminator. Fortunately, such long export names are unusual enough, with no real impact other than what is displayed to the user. Fixes: 5c86bdf12089 Reported-by: Max Reitz Signed-off-by: Eric Blake Message-Id: <20200622210355.414941-1-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy (cherry picked from commit 00d69986da83a74f6f5731c80f8dd09fde95d19a) Signed-off-by: Michael Roth --- block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nbd.c b/block/nbd.c index bfc0be6af6..bf3fbebfa0 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -2011,7 +2011,7 @@ static void nbd_refresh_filename(BlockDriverState *bs) len = snprintf(bs->exact_filename, sizeof(bs->exact_filename), "nbd://%s:%s", host, port); } - if (len > sizeof(bs->exact_filename)) { + if (len >= sizeof(bs->exact_filename)) { /* Name is too long to represent exactly, so leave it empty. */ bs->exact_filename[0] = '\0'; } From patchwork Thu Sep 3 20:58:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=pqg7KMIG; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDk22N5Dz9sTK for ; Fri, 4 Sep 2020 07:40:10 +1000 (AEST) Received: from localhost ([::1]:58166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwxk-0004js-8t for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:40:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLW-0004Dl-Cq; Thu, 03 Sep 2020 17:00:38 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:43221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLU-0007ib-Ky; Thu, 03 Sep 2020 17:00:37 -0400 Received: by mail-ot1-x344.google.com with SMTP id v16so3994049otp.10; Thu, 03 Sep 2020 14:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8v8cuelUN4GNnzF59rwkxhYKTzREPiqFMDPQs9yKMw0=; b=pqg7KMIGJN9NCyskp9TxALEebbe2hnxOeBp3wDMrF0amNBxJCYXxUtMbYtJH2bH+Jk /cFzgUNPC2ebnNUSg3RCbwKH1RhcpeAIWCTfhz0OFNqRKaNLX9/gI2K/uysvDqNtD4Xk zvt0UNYOjngrUoTgXz254s4ClzdQTp8mifyJXbqypMR1gLv6JOcTWU/GUyw8SuYKUqFb DkvKWPtVyZyRUbqRlg/CWfJbjQypLvDYgRdo99oiU8PFpQBASzowhyyLBCKAila3RS0o GB0AtkJ273Pfzxn8YTUfCjUwFVzrsKNWB5MMN6FM/27bxVlY5dKEwEdabSTgB2hmD20J 4K9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8v8cuelUN4GNnzF59rwkxhYKTzREPiqFMDPQs9yKMw0=; b=QUJ7kH+R2cBPfKf7bof3XFyynMK4gM6G90JxpC/nZCJOpfNicSnd5OL3SPVWgxd8lg Y7qExqi4j3VPgmzQLBZeelurhrEECAmZnfWfmpOM8rIJTiwnF2ZTvXywuv5oEiHsZ7lY FTZg4/+Z8NCw0mHaYvYr1vWhN/N6tTGrcnKviwBkCW12KcFue6tcAo+M8XWYLGWcMuoB d3KXpSjDn3aoSuCZqc+yc+OeTmdYwlNUG1JXCobbu5DlD959ELpJg220HKcCa0X9W97c Qw3+SGptOiegUgp9st22d1sqxRcSDlPneymc5m67qN+45/N1qoFaCT3a6rrwAHnxCgOs IPTQ== X-Gm-Message-State: AOAM530n4M2xk7AfLu8Y3KMQftCBN75FB06rRO1Ng5RNJdTVGOdelJAj EAJDuN3LvTs1vOIZET9Dk94aW79d3oQ= X-Google-Smtp-Source: ABdhPJyPCW6QRlx6jtQmUeoHq2d4RKVAnO8JJyumEjJidIygoWugUOcTaffMWyByF+VeoyjuaECHhw== X-Received: by 2002:a9d:2667:: with SMTP id a94mr2869390otb.45.1599166834423; Thu, 03 Sep 2020 14:00:34 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id i6sm718571oib.17.2020.09.03.14.00.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:33 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 41/77] chardev/tcp: Fix error message double free error Date: Thu, 3 Sep 2020 15:58:59 -0500 Message-Id: <20200903205935.27832-42-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=flukshun@gmail.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lichun , qemu-stable@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: lichun Errors are already freed by error_report_err, so we only need to call error_free when that function is not called. Cc: qemu-stable@nongnu.org Signed-off-by: lichun Message-Id: <20200621213017.17978-1-lichun@ruijie.com.cn> Reviewed-by: Markus Armbruster [Commit message improved, cc: qemu-stable] Signed-off-by: Markus Armbruster (cherry picked from commit ed4e0d2ef140aef255d67eec30767e5fcd949f58) Signed-off-by: Michael Roth --- chardev/char-socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index e5ee685f8c..58917870cd 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -142,6 +142,8 @@ static void check_report_connect_error(Chardev *chr, "Unable to connect character device %s: ", chr->label); s->connect_err_reported = true; + } else { + error_free(err); } qemu_chr_socket_restart_timer(chr); } @@ -1083,7 +1085,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque) if (qio_task_propagate_error(task, &err)) { tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED); check_report_connect_error(chr, err); - error_free(err); goto cleanup; } From patchwork Thu Sep 3 20:59:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NytrLzEv; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDm46hLNz9sTK for ; Fri, 4 Sep 2020 07:41:56 +1000 (AEST) Received: from localhost ([::1]:36762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwzS-0007de-QY for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:41:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLX-0004H8-LS; Thu, 03 Sep 2020 17:00:39 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:34043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLV-0007j6-Q4; Thu, 03 Sep 2020 17:00:39 -0400 Received: by mail-ot1-x341.google.com with SMTP id h17so3208928otr.1; Thu, 03 Sep 2020 14:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oq3rmsSk19eLVuEsf+6dlcXRckj5zxSI8+Z4QSek0vY=; b=NytrLzEvZr5suz5KCF8Sr8zpgeUvW9nKWqe1oDnIcXMiempLk16DQdgW5Ox3FRHUWa 6ZFxjbaDqBKZ8aCg2pU3floklNA7GfoSjXYCDjSKmLj5PTD/AfrTs8Bc7KtjvFhUncB9 yeLXsWmlJRx02utc0MUbZRWqwIm1dZ707kXw2mt6QhzVR3DmW2mEBOTF9oumgYdsDT1V 9OU61FYTK+LB0ijyeC2X5CUisf6y2p+/MvWw3EG6yEve6TKkqdTSSf/lPP8xBgZTk2Kl 2hHd1Jz4OL6h5PpbkZKK5V+P/wL4S7u3xuMVtnl6QEIcjx6X1J5NfQasQrIko3wY+L5F lGeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oq3rmsSk19eLVuEsf+6dlcXRckj5zxSI8+Z4QSek0vY=; b=WnLj0Gm/eX2DBqNv1dJFgcBT7+u13la3xwEiooBGlqrP9Y/qlOW/SbBlk5uvKVUIVT FU4FvZ34zeqwcAwXEWCHSzOaVh8nt1O73GfEsgKRg7PYRbfkuXPwM4OkilheEhZZUOOw yYAQOKEgyrbA6MpORlW7V8Fi7MhJrXFjQDEOk+j9mrc5rJSmsSE4jebssgAP0f/fHrqe XcVITCqYnDBvpR5r7EtBe+E6bkOOwopNfb1gT5vxoeJSwmx8Ox4M6En8Mm8YZv3K9whj fLCtWn3h9By9TKgBDPOto6kkF87ri17kQlWuS8G3jxBcerMC0cvTDO+hZNKsm0O8d42g fK7Q== X-Gm-Message-State: AOAM532zfnaMj+JULz3O4ORfxxtJiSj1gXFnfMrLKlc4Ml1kGuUfkMF1 ahbKXBaghGxbBICEFzciVLrY4ltgRTY= X-Google-Smtp-Source: ABdhPJxMbaKF221BCEUMmGDIG9PgxnO3mN2NQLXNWT8unBeRfmIT/cOMKHxDkxsIB65AAdwI0qXgmg== X-Received: by 2002:a9d:6e19:: with SMTP id e25mr2935901otr.219.1599166836076; Thu, 03 Sep 2020 14:00:36 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id c26sm767254otr.50.2020.09.03.14.00.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:35 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 42/77] qga: fix assert regression on guest-shutdown Date: Thu, 3 Sep 2020 15:59:00 -0500 Message-Id: <20200903205935.27832-43-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=flukshun@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Since commit 781f2b3d1e ("qga: process_event() simplification"), send_response() is called unconditionally, but will assert when "rsp" is NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as "guest-shutdown". Fixes: 781f2b3d1e5ef389b44016a897fd55e7a780bf35 Cc: Michael Roth Reported-by: Christian Ehrhardt Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Ehrhardt Tested-by: Christian Ehrhardt Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth (cherry picked from commit 844bd70b5652f30bbace89499f513e3fbbb6457a) Signed-off-by: Michael Roth --- qga/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qga/main.c b/qga/main.c index f0e454f28d..3febf3b0fd 100644 --- a/qga/main.c +++ b/qga/main.c @@ -531,7 +531,11 @@ static int send_response(GAState *s, const QDict *rsp) QString *payload_qstr, *response_qstr; GIOStatus status; - g_assert(rsp && s->channel); + g_assert(s->channel); + + if (!rsp) { + return 0; + } payload_qstr = qobject_to_json(QOBJECT(rsp)); if (!payload_qstr) { From patchwork Thu Sep 3 20:59:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=X8KhjgAb; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDBm1kPfz9sRK for ; Fri, 4 Sep 2020 07:16:32 +1000 (AEST) Received: from localhost ([::1]:34780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwas-0001hv-08 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:16:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLa-0004Mz-41; Thu, 03 Sep 2020 17:00:42 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:46659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLY-0007jb-6c; Thu, 03 Sep 2020 17:00:41 -0400 Received: by mail-oi1-x242.google.com with SMTP id u126so4474601oif.13; Thu, 03 Sep 2020 14:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OpNReXfR7oEtNGXMqeGl3rFAqgl3SKXekjVzKbcaap8=; b=X8KhjgAbb4mcyWsWM15dzaDEfKZHO8Exg1yGbftCeOLnjppv6RkKEHg3Fq0Ng8GuXw HkfVdc0WcYo2DBcJ81JEfqA9Hy5zopID/K1WIoQiT+YcybKTT6UWtI4H8vuS8Pu4utSh mwUtd68qWL7dO8U8+lZOED0Nk21KgniqcSbb1PTqOTV3ansddAwortYzzyeiJBhVDtEP Grl7/r0fLgf++bY8ZZDSp1kLesJtKdBiawBAzFM+Spb//1qNYxxDX4XkjbLY46Y+VAZB 7hnI7rxkhfe55/eX6sI07EMk/IN2zLuLcPYC8PgCSdi2ZAcxi5a/4mK3+o4P0UNYHsX3 s/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OpNReXfR7oEtNGXMqeGl3rFAqgl3SKXekjVzKbcaap8=; b=FkM3uN+dIGYXrZ4Ie1AO8f1vuszOvmFoKtxIpMfm5XKsiuQpRolq6ZsS6hCs6AqIZN iIpXY9j4km1sB3cDZ9O8kQgZGHxW+vfc5Uvr1UG6O/vgo7e3WGPgS+EHXLp4a/zwlicY XScgxfMbj31QOC1xU4uVGYYkaLwqt+PFY1Kh2koZmGt4k84uOTQsgoBWpZadaIdpiB4+ FU139nenaqWYaNqjtEmyYX/N38AkKUDNJPMsd+tB3cilarKODq6PuH6kVlq6lIwcM667 f6U6Bi+F7tYPxq5Jqcc8JpR7vsaJF5yDmvdBkbbZ2Gd3J/vixA2qPWjeHOztcd7Mm7w2 sTGw== X-Gm-Message-State: AOAM53181gkhxwUcu8wazE9DLlvQG5gQsL9S7gsjOhse1MAHsOUGkNQ+ JcenrhwY95NTCEGiWmnoTVdVFXYMmBs= X-Google-Smtp-Source: ABdhPJzk9sJOMiX65whUn5idLaP3rbh3WnjTOymLIAZO6JUDSHEHKQ8xYXyrBz1vN4DDokgF7FEJaA== X-Received: by 2002:aca:c4cb:: with SMTP id u194mr3216387oif.106.1599166838308; Thu, 03 Sep 2020 14:00:38 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id g22sm777201ots.35.2020.09.03.14.00.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:37 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 43/77] util: Introduce qemu_get_host_name() Date: Thu, 3 Sep 2020 15:59:01 -0500 Message-Id: <20200903205935.27832-44-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Privoznik , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michal Privoznik This function offers operating system agnostic way to fetch host name. It is implemented for both POSIX-like and Windows systems. Signed-off-by: Michal Privoznik Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth (cherry picked from commit e47f4765afcab2b78dfa5b0115abf64d1d49a5d3) Signed-off-by: Michael Roth --- include/qemu/osdep.h | 10 ++++++++++ util/oslib-posix.c | 35 +++++++++++++++++++++++++++++++++++ util/oslib-win32.c | 13 +++++++++++++ 3 files changed, 58 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 20f5c5f197..1866cab3c5 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -607,4 +607,14 @@ static inline void qemu_reset_optind(void) #endif } +/** + * qemu_get_host_name: + * @errp: Error object + * + * Operating system agnostic way of querying host name. + * + * Returns allocated hostname (caller should free), NULL on failure. + */ +char *qemu_get_host_name(Error **errp); + #endif diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 062236a1ab..e58fbc8e00 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -752,3 +752,38 @@ void sigaction_invoke(struct sigaction *action, } action->sa_sigaction(info->ssi_signo, &si, NULL); } + +#ifndef HOST_NAME_MAX +# ifdef _POSIX_HOST_NAME_MAX +# define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +# else +# define HOST_NAME_MAX 255 +# endif +#endif + +char *qemu_get_host_name(Error **errp) +{ + long len = -1; + g_autofree char *hostname = NULL; + +#ifdef _SC_HOST_NAME_MAX + len = sysconf(_SC_HOST_NAME_MAX); +#endif /* _SC_HOST_NAME_MAX */ + + if (len < 0) { + len = HOST_NAME_MAX; + } + + /* Unfortunately, gethostname() below does not guarantee a + * NULL terminated string. Therefore, allocate one byte more + * to be sure. */ + hostname = g_new0(char, len + 1); + + if (gethostname(hostname, len) < 0) { + error_setg_errno(errp, errno, + "cannot get hostname"); + return NULL; + } + + return g_steal_pointer(&hostname); +} diff --git a/util/oslib-win32.c b/util/oslib-win32.c index e9b14ab178..3b49d27297 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -808,3 +808,16 @@ bool qemu_write_pidfile(const char *filename, Error **errp) } return true; } + +char *qemu_get_host_name(Error **errp) +{ + wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD size = G_N_ELEMENTS(tmp); + + if (GetComputerNameW(tmp, &size) == 0) { + error_setg_win32(errp, GetLastError(), "failed close handle"); + return NULL; + } + + return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL); +} From patchwork Thu Sep 3 20:59:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WctLj0Tz; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDF72RkCz9sPB for ; Fri, 4 Sep 2020 07:18:35 +1000 (AEST) Received: from localhost ([::1]:43494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwcr-0005AR-8q for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:18:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLb-0004Q8-FZ; Thu, 03 Sep 2020 17:00:43 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:35982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLZ-0007jt-Fb; Thu, 03 Sep 2020 17:00:42 -0400 Received: by mail-ot1-x343.google.com with SMTP id 109so4028038otv.3; Thu, 03 Sep 2020 14:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w38XkoSgsQCl7EMizVOYfGqy/RlUpRR6kLGOQ4mK540=; b=WctLj0Tzmm7OSN6rFyOOc08/0rtC0gkGyYOYq/7Lkjowvog6BRvqwxHO/wrzr43UD0 0BUtlihlHOrbJyURvAsDkTsFcVv+FIlkKnhi46AsWHd7I3LDwiDtz8bheBDA5r3gVpuV 4QXyRWei/TGZhyKlYnmK26B+Hpe/i1MoDdZXVAA9SCTAkeP03dapcUq8iTMVxQt0oLEH 5j3POIKhIZsmBklCTU827VRyxQ+6oGTE4DziPVVJJ+RFXyG/eH4Snh9sHEDdAtHs2/3w t+EFCKRL1nuCf75zfhMJZyrA3QLJxzd7j6bkzSMCC+VrrHCBIFn8UxM5q2GkD5r3sYlc IR6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=w38XkoSgsQCl7EMizVOYfGqy/RlUpRR6kLGOQ4mK540=; b=aMK9HUlNoJ/nX4qHbJl7bSCz2zleEGsu007oJ/t/ViG9HUQm1entZGQfl9Jsc7UcON TPAM3dTH2JRNElZDvB3JSxHagMB8m+NpE1XzVHAJtzjYSyy4fWYRdNHiS7ot0CRr0nLu l4cxe7hOhEdS2PWq6xPQttwQIPOs3lzEPuEURwQ27GFLegbUDkzKPrcyQor/1zZ3d9M3 x7ATUH+jJBEuPBfrVxr2OcA0cR/aAzWXkXVCp57XP55lrHXwHdi/4WM94RUtn1R+FRDW jz9roqI1DkHm6j5p3mrrH0ZbUTtOng76HYUbdI40oWUQQbyK9HGCpwS3pvPEwLtYLF3P SsXA== X-Gm-Message-State: AOAM532nwhGIJ8T6YjbIzLsTnnsQuNgOKqyp4AEjSoR0zt9mHGky8wIZ YYRQKcsusoy+Ikb3luZwCwc7MRWabQ4= X-Google-Smtp-Source: ABdhPJzROkcKW7j6E4/CwBa/8Vw6+TmqoRbTrkljvPDFaaPKFXJLBF9dxYHVi+tpDrFY2eepmyCDGA== X-Received: by 2002:a05:6830:1242:: with SMTP id s2mr2940375otp.167.1599166839691; Thu, 03 Sep 2020 14:00:39 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id g26sm775467otn.77.2020.09.03.14.00.38 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:39 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 44/77] qga: Use qemu_get_host_name() instead of g_get_host_name() Date: Thu, 3 Sep 2020 15:59:02 -0500 Message-Id: <20200903205935.27832-45-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Privoznik , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michal Privoznik Problem with g_get_host_name() is that on the first call it saves the hostname into a global variable and from then on, every subsequent call returns the saved hostname. Even if the hostname changes. This doesn't play nicely with guest agent, because if the hostname is acquired before the guest is set up (e.g. on the first boot, or before DHCP) we will report old, invalid hostname. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1845127 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrangé Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth (cherry picked from commit 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf) Signed-off-by: Michael Roth --- qga/commands.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/qga/commands.c b/qga/commands.c index efc8b90281..d3fec807c1 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -515,11 +515,20 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp) GuestHostName *qmp_guest_get_host_name(Error **errp) { GuestHostName *result = NULL; - gchar const *hostname = g_get_host_name(); - if (hostname != NULL) { - result = g_new0(GuestHostName, 1); - result->host_name = g_strdup(hostname); + g_autofree char *hostname = qemu_get_host_name(errp); + + /* + * We want to avoid using g_get_host_name() because that + * caches the result and we wouldn't reflect changes in the + * host name. + */ + + if (!hostname) { + hostname = g_strdup("localhost"); } + + result = g_new0(GuestHostName, 1); + result->host_name = g_steal_pointer(&hostname); return result; } From patchwork Thu Sep 3 20:59:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Nm7RClVB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDHD2Bsnz9sPB for ; Fri, 4 Sep 2020 07:20:24 +1000 (AEST) Received: from localhost ([::1]:51626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwec-0008UI-6Q for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLc-0004TB-OL; Thu, 03 Sep 2020 17:00:44 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:43289) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLa-0007kB-O3; Thu, 03 Sep 2020 17:00:44 -0400 Received: by mail-oi1-x241.google.com with SMTP id i17so4497639oig.10; Thu, 03 Sep 2020 14:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aFXlKroXX9PZfDrZJYi+g7t/+H6Gi17j+AWN8w9Ef+w=; b=Nm7RClVBy0aE0za/FeXkR32oswAuJoDh6+tPXlgPu48N13ZGdeixiNLNApnnZZ81VW xZt/RhLysbsjE49kKDNGKrID7thKLFlp5K/qSFQ9tDZXnVWB2/s4X2bdBvPi0jHBURs+ 0F1Ci93ZLiyYTPU1KWBlIIKU279d5kmWDjp0JU4v2aeg7LIY0QSm0C38zcikEVrDEsfJ e6BzOtNGH8oUimgvFU+1VHEV9KQUw6I6dMRAA2SmrlT6LqCsT/RtnQ8tMCVvCkWfM2Ct uFq+NRz4qOHipRoOKnkSwuxhAqymrQehIezkH/qJT01/8gDxoX39RBheCN9pqDjVcGrz O7vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aFXlKroXX9PZfDrZJYi+g7t/+H6Gi17j+AWN8w9Ef+w=; b=TIpzGlO+A/iR3TnkMbRkF1drjX/D9RwHMSwJ0o+I9rlhsXqNn9LR2ygxODE5vppbjf m5oVM9YPVHmAnP5+Te4ppjopNBpK6kQ9gBWwwmfGHSL6TVby25BOzBXKOhiUmW2VZNZ/ wTB2QqAgkd2Oqbt+mR1KXMALlh8KcItZ8h2M2aSMRYmV85KhgWQ2XxSj6l4ylHPkrd8/ dQQcsTHpvMVmjce3O7cVadS1N8QCJkZmXH/2vf1STXCVQHdxWKnyzXR7QEFH634z7Mzz 9T3Us/Xnp000wSqkL4d2W5Y9dwUkCxl3LJzhxKcmVuOa5T/wvQZVjZ0/8KRFtJtpx5V+ 0z/g== X-Gm-Message-State: AOAM5325ZXCzeMbgZXgeUhrql3QYIj2dPJgV16ZDtwQ7UJbARmPeoqwf BHqw9apYp+BpC5vZFqKqzPeaR/z9Xic= X-Google-Smtp-Source: ABdhPJwbNxC9B5yMu5eeSA4PVYpgTPmk2aSAdUOx9z0QLgP9MDB80u/73FtACuwPmrbv6rmzQW8bDw== X-Received: by 2002:aca:413:: with SMTP id 19mr3405785oie.149.1599166840933; Thu, 03 Sep 2020 14:00:40 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id r6sm798219otc.0.2020.09.03.14.00.40 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:40 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 45/77] docs/orangepi: Add instructions for resizing SD image to power of two Date: Thu, 3 Sep 2020 15:59:03 -0500 Message-Id: <20200903205935.27832-46-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::241; envelope-from=flukshun@gmail.com; helo=mail-oi1-x241.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Niek Linnenbank , qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Niek Linnenbank SD cards need to have a size of a power of two. Update the Orange Pi machine documentation to include instructions for resizing downloaded images using the qemu-img command. Signed-off-by: Niek Linnenbank Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200712183708.15450-1-nieklinnenbank@gmail.com> Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit 1c2329b5d644bad16e888d095e2021ad682201d9) Signed-off-by: Michael Roth --- docs/system/arm/orangepi.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst index c41adad488..6f23907fb6 100644 --- a/docs/system/arm/orangepi.rst +++ b/docs/system/arm/orangepi.rst @@ -127,6 +127,16 @@ can be downloaded from: Alternatively, you can also choose to build you own image with buildroot using the orangepi_pc_defconfig. Also see https://buildroot.org for more information. +When using an image as an SD card, it must be resized to a power of two. This can be +done with the qemu-img command. It is recommended to only increase the image size +instead of shrinking it to a power of two, to avoid loss of data. For example, +to prepare a downloaded Armbian image, first extract it and then increase +its size to one gigabyte as follows: + +.. code-block:: bash + + $ qemu-img resize Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img 1G + You can choose to attach the selected image either as an SD card or as USB mass storage. For example, to boot using the Orange Pi PC Debian image on SD card, simply add the -sd argument and provide the proper root= kernel parameter: @@ -213,12 +223,12 @@ Next, unzip the NetBSD image and write the U-Boot binary including SPL using: $ dd if=/path/to/u-boot-sunxi-with-spl.bin of=armv7.img bs=1024 seek=8 conv=notrunc Finally, before starting the machine the SD image must be extended such -that the NetBSD kernel will not conclude the NetBSD partition is larger than -the emulated SD card: +that the size of the SD image is a power of two and that the NetBSD kernel +will not conclude the NetBSD partition is larger than the emulated SD card: .. code-block:: bash - $ dd if=/dev/zero bs=1M count=64 >> armv7.img + $ qemu-img resize armv7.img 2G Start the machine using the following command: From patchwork Thu Sep 3 20:59:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357007 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lMu5vpeO; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDQm4Yjqz9sPB for ; Fri, 4 Sep 2020 07:26:56 +1000 (AEST) Received: from localhost ([::1]:53382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwkw-0004SB-G9 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:26:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLe-0004Vz-2h; Thu, 03 Sep 2020 17:00:46 -0400 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]:41601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLc-0007kY-39; Thu, 03 Sep 2020 17:00:45 -0400 Received: by mail-oi1-x22e.google.com with SMTP id x69so1542249oia.8; Thu, 03 Sep 2020 14:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YlRR9CLu8pLCxrGm4VFmO7pbcuXORptj+5WioQ7RYAg=; b=lMu5vpeOPhsnDJFIOWNy5i66L9lUm78uyEphlubxdhVerVljO+MyKdeqfLbKI+68Q8 5UUiNjGcYgCDaKpVCLo2DcgErFwFyXrClqZz42O1mfmgbsmbfe2P46xn5XFZAVuQdB/Z +t2YcLuFfrdA1UH86TsLhCoflAkADZum7mUCvgF/Va6gNMU6nm3xilUpEs2Q9+TQ/y9T qPLHGg9mXWUJEBND4wbAa/+Cr0+LnoTlOgVVIyK4BMNFcgbhxXleRjmNdEg84qPJFaBj GF6aeAEIBlB3z3RgTzn+nqOhHruDwl2rKHwtP2q8nlh8tHHl++hPxFQFcL2xyULhSIzZ 40dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=YlRR9CLu8pLCxrGm4VFmO7pbcuXORptj+5WioQ7RYAg=; b=rg9D2WyMmFrHRzzXecc1vk6vqtoK4XhjDCXLSohwAe3P1Nt7Rng3FudGeh9A6Ny/8+ 1C4s2SBG7J/DJ+Ri9de5nnlRlFpDatwVmKGFWl4mupfUSTGmH83lGpdpRacqj460fyTk neH3UQhVLwze3J93GkGRQievd0ynM1qs6NF/EkoMKH+5FWAteJzl07NQJzGHaNYCJTgA Cr5Qixi3r3bMAk1qhFsneELYWoD/9H0/RYFkPIVAq0zgL0ZOYf30prsMKmXk36HhL3dG fRAX2YV6VVDOBvAwrjFO0VDdjfGQxbmveqV+e2YEic7yVCLYMDC+svM+oAcvoPzbYs3b Q06Q== X-Gm-Message-State: AOAM533PXYz4bmVluuBbuGZJlrbiTFW0nNBCfQyVf1dz2iUmEUtUVJoi 6yk0fkzCdgMMoZNYaZi6M2h0BpIDQIQ= X-Google-Smtp-Source: ABdhPJxPJYagNytP/LA0l4fON6ARdmNJNQPAiYzdc10gqSKN4LkJKr49j0JjAqnfpc/W7Fsv9vcMCw== X-Received: by 2002:aca:f109:: with SMTP id p9mr3162838oih.84.1599166842222; Thu, 03 Sep 2020 14:00:42 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id e9sm814722oog.10.2020.09.03.14.00.41 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:41 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 46/77] tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd' Date: Thu, 3 Sep 2020 15:59:04 -0500 Message-Id: <20200903205935.27832-47-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=flukshun@gmail.com; helo=mail-oi1-x22e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Avocado tags are handy to automatically select tests matching the tags. Since these tests use a SD card, tag them. We can run all the tests using a SD card at once with: $ avocado --show=app run -t u-boot tests/acceptance/ $ AVOCADO_ALLOW_LARGE_STORAGE=ok \ avocado --show=app \ run -t device:sd tests/acceptance/ Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9 (1/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd: PASS (19.56 s) (2/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic: PASS (49.97 s) (3/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: PASS (20.06 s) RESULTS : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 90.02 s Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Message-Id: <20200713183209.26308-4-f4bug@amsat.org> (cherry picked from commit b7dcbf1395da960ec3c313300dc0030674de8cd1) Signed-off-by: Michael Roth --- tests/acceptance/boot_linux_console.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index f825cd9ef5..d864d22ca8 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -583,6 +583,7 @@ class BootLinuxConsole(Test): """ :avocado: tags=arch:arm :avocado: tags=machine:orangepi-pc + :avocado: tags=device:sd """ deb_url = ('https://apt.armbian.com/pool/main/l/' 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb') @@ -632,6 +633,7 @@ class BootLinuxConsole(Test): """ :avocado: tags=arch:arm :avocado: tags=machine:orangepi-pc + :avocado: tags=device:sd """ # This test download a 196MB compressed image and expand it to 932MB... @@ -673,6 +675,7 @@ class BootLinuxConsole(Test): """ :avocado: tags=arch:arm :avocado: tags=machine:orangepi-pc + :avocado: tags=device:sd """ # This test download a 304MB compressed image and expand it to 1.3GB... deb_url = ('http://snapshot.debian.org/archive/debian/' From patchwork Thu Sep 3 20:59:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=eMitENwg; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDMW3yjnz9sTv for ; Fri, 4 Sep 2020 07:24:07 +1000 (AEST) Received: from localhost ([::1]:39932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwiD-0006oJ-F9 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLf-0004Z3-QO; Thu, 03 Sep 2020 17:00:49 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:42899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLd-0007kv-QI; Thu, 03 Sep 2020 17:00:47 -0400 Received: by mail-ot1-x32e.google.com with SMTP id g10so3993933otq.9; Thu, 03 Sep 2020 14:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ux/8hJOIk7YJVgmu1a1t9+FNPCZkfsFV76/cqQ5+uRo=; b=eMitENwgwj05y27bwjJ2t3LSkA6V65hwme7MdoCdCgk5tSR+OMt0ci9AijpSLtKL1J y4bW1XioUX1czvUZd/JGJW640pxQfY5xBz+DP46DODwad5TJWD6olLRePtgIu8GkMBZs hAJN74g0RpiO1loAMFmYDgmwXLCjv05C765Ei4WNypHDuqnXkN3x0m4Jn83empegIlvd 1hiG3oM/ayK5tGKN5NJfFBh3isQRJrxx5okOafSce5kHxeHpfuic6Xa9Q7W7eSzvJATp 9kgBws783kNpiMudB5sbuZFlrW8LHqY+riQTbDO3WwaPooMKcIPlEzwIzvrhBIreQOy4 ziLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ux/8hJOIk7YJVgmu1a1t9+FNPCZkfsFV76/cqQ5+uRo=; b=JucXsMzbVrJZDiCOKt2us3t6MO7z0NB8lXUc7x/A0cYtNmCPAQ9ZI2sVV3UuRhDmve Pmo6gAPHRZjtpOPX9deFKgha5GOiCI+sWh+xcss3AwGOsMREf/EMtrc8zif8ILSYfcoY nQlPnbScyIQRrxD+dfE4H+tybZ2uXd+LdMmV5a5ModPEHU+ISSkL8icbhnFqhPeB5rG0 p8hUwiBC6Rk7EeBjMUojfFmk0mzChHb/aJQPoTN8SFzA8Uf9LmrE3A0Kk7ywNTHlTDKr c9tfhL6S5SEOKguW13AD0doJN38MA+vMBzfy0xSksSt47AhPnrjxOhvtzgx2Q01BEXsO Kh9Q== X-Gm-Message-State: AOAM531cIRZseX1wiwZcudJ0RDIA/ePncxHc/ewxVHJZyaQ5QlTGr+H9 zYANkotUMToou0a2i88qUuVRJ4HIbykdDw== X-Google-Smtp-Source: ABdhPJyfJ6zCvTVTdZun6x1TJhInxj5REkyBXn1pB0GBkQ02qjzxeg2PJeQnuUMl9Iso+WbtMFmYLA== X-Received: by 2002:a05:6830:48:: with SMTP id d8mr2967894otp.272.1599166843910; Thu, 03 Sep 2020 14:00:43 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id x4sm724813oic.11.2020.09.03.14.00.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:43 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 47/77] tests/acceptance: allow console interaction with specific VMs Date: Thu, 3 Sep 2020 15:59:05 -0500 Message-Id: <20200903205935.27832-48-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=flukshun@gmail.com; helo=mail-ot1-x32e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Dovgalyuk , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , qemu-stable@nongnu.org, Pavel Dovgalyuk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk Console interaction in avocado scripts was possible only with single default VM. This patch modifies the function parameters to allow passing a specific VM as a parameter to interact with it. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Willian Rampazzo Reviewed-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Message-Id: <159073587933.20809.5122618715976660635.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit a5ba86d423c2b071894d86c60487f2317c7ffb60) Signed-off-by: Michael Roth --- tests/acceptance/avocado_qemu/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 59e7b4f763..77d1c1d9ff 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -69,13 +69,15 @@ def pick_default_qemu_bin(arch=None): def _console_interaction(test, success_message, failure_message, - send_string, keep_sending=False): + send_string, keep_sending=False, vm=None): assert not keep_sending or send_string - console = test.vm.console_socket.makefile() + if vm is None: + vm = test.vm + console = vm.console_socket.makefile() console_logger = logging.getLogger('console') while True: if send_string: - test.vm.console_socket.sendall(send_string.encode()) + vm.console_socket.sendall(send_string.encode()) if not keep_sending: send_string = None # send only once msg = console.readline().strip() @@ -115,7 +117,8 @@ def interrupt_interactive_console_until_pattern(test, success_message, _console_interaction(test, success_message, failure_message, interrupt_string, True) -def wait_for_console_pattern(test, success_message, failure_message=None): +def wait_for_console_pattern(test, success_message, failure_message=None, + vm=None): """ Waits for messages to appear on the console, while logging the content @@ -125,7 +128,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None): :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails """ - _console_interaction(test, success_message, failure_message, None) + _console_interaction(test, success_message, failure_message, None, vm=vm) def exec_command_and_wait_for_pattern(test, command, success_message, failure_message=None): From patchwork Thu Sep 3 20:59:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=me8UnZwy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDTB01Qkz9sPB for ; Fri, 4 Sep 2020 07:29:01 +1000 (AEST) Received: from localhost ([::1]:33492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwmx-0007sW-Q5 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:28:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLg-0004Zh-IV; Thu, 03 Sep 2020 17:00:52 -0400 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:43223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLe-0007lG-Vv; Thu, 03 Sep 2020 17:00:48 -0400 Received: by mail-oi1-x22a.google.com with SMTP id i17so4497863oig.10; Thu, 03 Sep 2020 14:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U3kLnDJsPOvbeGSaO4+ay3+JWfM5GJq3iPIdpdJdTMY=; b=me8UnZwyLchAouob20O7i4g3EaPf04MgoHN+HgY/AQ/xAvxYgI5bJpA1tT+BE0cnSX UOQTl0pUgF7V3h935m0UQ4lnPP2GrzzPE3f+3wqxlnIS7J0ASy5gerkJbaD1kIOiAz5z CjfkHvpEzLpEIRzKUBuFvn5QpxUdyW8f4o5geIoTkibOgRXyJ8ttM3JjMrlN/k85N7uV 0V1VpFFVQ8YGw+1yTXV+iUxdwDR27s4s9VlKDoqNEmZmxoZCaXhoQ/Ob9xv3DPl8Bn0N cvQ2v+SxDAsKvSG63ACRtqKmQfVO2/cvnjQbN7mAQRtk88SGkRKP2DTTCoZDPQ9OKqHY 2V4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=U3kLnDJsPOvbeGSaO4+ay3+JWfM5GJq3iPIdpdJdTMY=; b=mI597YaD/vKXWXRkEzGyfAtw/hDYw5BWgVJghO3j1C/dgLlrSJlbEzXQOOSyh0zuw0 DqyGaZVoKQfVJ7QvLVHx/dyWQL9dy25VCDrMbwYmmRDUfGzNyeoJtBR48fh0KKfErcr3 bVCpce4DLQtJGbIPj6VTl9CMp56fGAem+G409THHrFUJLhFVE3pu+AGTrTB0aQSM8IH3 lr/z4DwU4OHKDVC9/tUYciPobn4g71YF2Toh/X5zT9jMeyzWQcRIOlJBmlZRlVRMqy8d 74sonbA0yQeP0TR/GgThSng2kfmgz+OCGr2ZWMFvocrYjNpnpf5Spk3CQjkEyHHFqrU2 SLbg== X-Gm-Message-State: AOAM530HbUugU4Qgfl3d1OGJ5+XTLkzBFX8+meIiXLojEcnARl7ZylZG gsgS4J++PbfEAGiYfyrUZoWui2kHfCTXIg== X-Google-Smtp-Source: ABdhPJzSxQeRHsdEaC8JNxIr0SQIlzhHbcL1pWsS0dflGGPBcU6uzAG6uvCBeCPS9A9znjhS4yZPQw== X-Received: by 2002:a05:6808:3bb:: with SMTP id n27mr3256076oie.130.1599166845094; Thu, 03 Sep 2020 14:00:45 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id n37sm766978ota.20.2020.09.03.14.00.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:44 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 48/77] tests/acceptance: refactor boot_linux to allow code reuse Date: Thu, 3 Sep 2020 15:59:06 -0500 Message-Id: <20200903205935.27832-49-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=flukshun@gmail.com; helo=mail-oi1-x22a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Dovgalyuk , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , qemu-stable@nongnu.org, Pavel Dovgalyuk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk This patch moves image downloading functions to the separate class to allow reusing them from record/replay tests. Signed-off-by: Pavel Dovgalyuk Tested-by: Philippe Mathieu-Daudé Message-Id: <159073593167.20809.17582679291556188984.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit 1c80c87c8c2489e4318c93c844aa29bc1d014146) Signed-off-by: Michael Roth --- tests/acceptance/boot_linux.py | 49 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 075a386300..3aa57e88b0 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -26,22 +26,8 @@ KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM" TCG_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "TCG" -class BootLinux(Test): - """ - Boots a Linux system, checking for a successful initialization - """ - - timeout = 900 - chksum = None - - def setUp(self): - super(BootLinux, self).setUp() - self.vm.add_args('-smp', '2') - self.vm.add_args('-m', '1024') - self.prepare_boot() - self.prepare_cloudinit() - - def prepare_boot(self): +class BootLinuxBase(Test): + def download_boot(self): self.log.debug('Looking for and selecting a qemu-img binary to be ' 'used to create the bootable snapshot image') # If qemu-img has been built, use it, otherwise the system wide one @@ -60,17 +46,17 @@ class BootLinux(Test): if image_arch == 'ppc64': image_arch = 'ppc64le' try: - self.boot = vmimage.get( + boot = vmimage.get( 'fedora', arch=image_arch, version='31', checksum=self.chksum, algorithm='sha256', cache_dir=self.cache_dirs[0], snapshot_dir=self.workdir) - self.vm.add_args('-drive', 'file=%s' % self.boot.path) except: self.cancel('Failed to download/prepare boot image') + return boot.path - def prepare_cloudinit(self): + def download_cloudinit(self): self.log.info('Preparing cloudinit image') try: cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso') @@ -81,9 +67,32 @@ class BootLinux(Test): # QEMU's hard coded usermode router address phone_home_host='10.0.2.2', phone_home_port=self.phone_home_port) - self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso) except Exception: self.cancel('Failed to prepared cloudinit image') + return cloudinit_iso + +class BootLinux(BootLinuxBase): + """ + Boots a Linux system, checking for a successful initialization + """ + + timeout = 900 + chksum = None + + def setUp(self): + super(BootLinux, self).setUp() + self.vm.add_args('-smp', '2') + self.vm.add_args('-m', '1024') + self.prepare_boot() + self.prepare_cloudinit() + + def prepare_boot(self): + path = self.download_boot() + self.vm.add_args('-drive', 'file=%s' % path) + + def prepare_cloudinit(self): + cloudinit_iso = self.download_cloudinit() + self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso) def launch_and_wait(self): self.vm.set_console() From patchwork Thu Sep 3 20:59:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1356996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Q7YXVtjV; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDK34ZwJz9sSP for ; Fri, 4 Sep 2020 07:21:59 +1000 (AEST) Received: from localhost ([::1]:59872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwg9-0003VW-HX for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLh-0004Zm-Iu; Thu, 03 Sep 2020 17:00:52 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:41877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLg-0007le-3J; Thu, 03 Sep 2020 17:00:49 -0400 Received: by mail-ot1-x343.google.com with SMTP id a65so4001887otc.8; Thu, 03 Sep 2020 14:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nd9Ud5qwe+YYQ0q+uyzFJ7HGCJCNwB347EpetEguZ38=; b=Q7YXVtjV08PkuXoPal29fKq1rGAjHbOQyUSXkOWgVKqLdY339NfDytdc4dfto1Szvc NwUAqvtWdTlfMwsc1Ku6QdDi4ws6gFHqgmECzkYtRxy37/98kEiVOJkJPierJeKJtBrk gxMsNjDauY9xM6Gpfwr+AMN/rkQKplDi40Z+Fl7tzyeweeFVciGrss9x7yh7gUWZUBTg I9UUDvABxoWGdWziGAbP32Y0EzMnQIIQaxcsR33clCdN4F96VLO3sCod9O3Td6MaHaNQ hB12O6UtrH1vlTJL+YKkNkKxsTQBQw7JG4AQlERdto7ZHxnvc2A5P8pW0NG26J9t16iH zgjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nd9Ud5qwe+YYQ0q+uyzFJ7HGCJCNwB347EpetEguZ38=; b=jQ5ElctZ2EY3fOoImmuV0nMyYUb+VKGnSsz0JW9J9B8UWUtu1BVp5sQxUV6frz6HC8 XnAcpuh5Q0dtekodW780SjUwevVk1ZbgBNBYw5k0ZPzqCoidy5s/KetREV1it6W5btb1 sfNrGKGgMRrFZ58s8dMXVr1t5XByBCMVTX/47Kxblbyoaj4kOO4eUXzrgdZnjNE2ziVo UtLmhDNxb0uIJ3m2mSifQAcY1Ndas33GWysVQ7soBRubp4XJeSDRlC1J3wLN3YhbTmHC Mm3RhsHFD3dUneHMg3U3i/DNvc1312a7+9E07KffWwkyz8Prm7bRgQ2KXtumTGutbVjd jI/A== X-Gm-Message-State: AOAM530Y8ZaSOdTjfA5VEMkS0v1xCpjCy4J2Y4CbonIFyii5Lrc6YJLR qMfjoQWEriZUiTeutfnfn67toWXcvQofyw== X-Google-Smtp-Source: ABdhPJwNe3F7a0p4wQIZ06EGu2v/ssbcYaWdWIL8AR2YCYHvh5EwBprN0RW0b3XBUzRvYXF+LS5tfg== X-Received: by 2002:a9d:eed:: with SMTP id 100mr3004606otj.20.1599166846385; Thu, 03 Sep 2020 14:00:46 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q15sm761296otl.65.2020.09.03.14.00.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:45 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 49/77] tests/acceptance: refactor boot_linux_console test to allow code reuse Date: Thu, 3 Sep 2020 15:59:07 -0500 Message-Id: <20200903205935.27832-50-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Dovgalyuk , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , qemu-stable@nongnu.org, Pavel Dovgalyuk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk This patch splits code in BootLinuxConsole class into two different classes to allow reusing it by record/replay tests. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Message-Id: <159073588490.20809.13942096070255577558.stgit@pasha-ThinkPad-X280> Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit 12121c496fcc609e23033c4a36399b54f98bcd56) Signed-off-by: Michael Roth --- tests/acceptance/boot_linux_console.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index d864d22ca8..e4204d8f09 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -28,19 +28,13 @@ try: except CmdNotFoundError: P7ZIP_AVAILABLE = False -class BootLinuxConsole(Test): - """ - Boots a Linux kernel and checks that the console is operational and the - kernel command line is properly passed from QEMU to the kernel - """ - - timeout = 90 - +class LinuxKernelTest(Test): KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' - def wait_for_console_pattern(self, success_message): + def wait_for_console_pattern(self, success_message, vm=None): wait_for_console_pattern(self, success_message, - failure_message='Kernel panic - not syncing') + failure_message='Kernel panic - not syncing', + vm=vm) def extract_from_deb(self, deb, path): """ @@ -79,6 +73,13 @@ class BootLinuxConsole(Test): os.chdir(cwd) return os.path.normpath(os.path.join(self.workdir, path)) +class BootLinuxConsole(LinuxKernelTest): + """ + Boots a Linux kernel and checks that the console is operational and the + kernel command line is properly passed from QEMU to the kernel + """ + timeout = 90 + def test_x86_64_pc(self): """ :avocado: tags=arch:x86_64 From patchwork Thu Sep 3 20:59:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=egGKumQM; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDpj086mz9sTR for ; Fri, 4 Sep 2020 07:44:13 +1000 (AEST) Received: from localhost ([::1]:50378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx1f-0004jU-0M for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:44:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLj-0004Zt-GL; Thu, 03 Sep 2020 17:00:52 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:39855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLh-0007mL-LT; Thu, 03 Sep 2020 17:00:51 -0400 Received: by mail-oi1-x241.google.com with SMTP id r64so4523234oib.6; Thu, 03 Sep 2020 14:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4/widhycmlff/G5xPs8XzJrOIKkwzYT0jr445QWuLTo=; b=egGKumQMv/pwMM8PYIs9wKNjFEWrcsQ22M2UjU6ql1giFI0ifC3FasfBnzkaiGuh7J yj57uT21Zyg/HMXDkcgE0TJqjMgTh4F4eDwuvVYlFlq82RXtLv+b0OXXDO1vMeRo+98O lJnjuDoWahtvrK7R79Yawq6fyPgcvmhQ4e6Uou6fy2iqsVBuVhQBYiQDoSNG/RL+VSob gCBoMQKfJWSQ2uC+dHtPOAwS12MUTViNAjX7ILl0eB49jmfB9D93te7lfT51asnuNbHu SNNzAln1y4JuDQq+QtUIjqS9d/BLTBLHAH6eWlAxo93dtdqDKVgnH0YSCiBxRpYopgFs 84og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4/widhycmlff/G5xPs8XzJrOIKkwzYT0jr445QWuLTo=; b=JgYzj2fS5nzPlIbRhi2liazGYrYljiyTY2P+9UxmYCuSxLjzvZoslXqVy0pm3i06gt 6GQ/4zvCcNKUtApPKPrYc55o6mUNJLNSlqGiwIT61LN8Ct7X/d8GdXSJcLShaQbNBP4x ajd+297YMgmaKS5M+RHcTZQcn2uKFiE6raHQm4nXuJNzPqRdQ0fhuOQg7qw5xtGQRFLE Vm/0NPdU+rjZ8hqE964OJQVZXPw+JlM2LEtdJv2jxBm8uPNtq9ZbNRZHA0IQCkzunvyn j5iZQhDw+tQjMC5Jj2sU5R38pjqGKp2uigF51s2Q47smRmD1ttmzu86yA41uDuR8lSLV O5EA== X-Gm-Message-State: AOAM531gwcwcWBj7Ik0BktTL8BSXPGmqVy5eTf6tGc8hNyztof9yEgrv 47T5VgHWTntwAUtSObUSwdF3O7flmbTtSg== X-Google-Smtp-Source: ABdhPJzSOzyd3+UKrbITiyHPC4b0UoL3XNgzbNmUvfZJltpixxPNepSVJgsz/dj5l848S7pOarLXTg== X-Received: by 2002:aca:bb07:: with SMTP id l7mr3406165oif.98.1599166847684; Thu, 03 Sep 2020 14:00:47 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id f12sm822017ooi.42.2020.09.03.14.00.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:47 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 50/77] tests/acceptance/boot_linux: Expand SD card image to power of 2 Date: Thu, 3 Sep 2020 15:59:08 -0500 Message-Id: <20200903205935.27832-51-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::241; envelope-from=flukshun@gmail.com; helo=mail-oi1-x241.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé In few commits we won't allow SD card images with invalid size (not aligned to a power of 2). Prepare the tests: add the pow2ceil() and image_pow2ceil_expand() methods and resize the images (expanding) of the tests using SD cards. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Cleber Rosa Message-Id: <20200713183209.26308-5-f4bug@amsat.org> (cherry picked from commit 6a289a5ba3383e17fb47029720425bef42e424d7) Signed-off-by: Michael Roth --- tests/acceptance/boot_linux_console.py | 31 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index e4204d8f09..db901c1348 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -28,6 +28,22 @@ try: except CmdNotFoundError: P7ZIP_AVAILABLE = False +""" +Round up to next power of 2 +""" +def pow2ceil(x): + return 1 if x == 0 else 2**(x - 1).bit_length() + +""" +Expand file size to next power of 2 +""" +def image_pow2ceil_expand(path): + size = os.path.getsize(path) + size_aligned = pow2ceil(size) + if size != size_aligned: + with open(path, 'ab+') as fd: + fd.truncate(size_aligned) + class LinuxKernelTest(Test): KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' @@ -600,6 +616,7 @@ class BootLinuxConsole(LinuxKernelTest): rootfs_path_xz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash) rootfs_path = os.path.join(self.workdir, 'rootfs.cpio') archive.lzma_uncompress(rootfs_path_xz, rootfs_path) + image_pow2ceil_expand(rootfs_path) self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + @@ -637,7 +654,7 @@ class BootLinuxConsole(LinuxKernelTest): :avocado: tags=device:sd """ - # This test download a 196MB compressed image and expand it to 932MB... + # This test download a 196MB compressed image and expand it to 1GB image_url = ('https://dl.armbian.com/orangepipc/archive/' 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z') image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e' @@ -645,6 +662,7 @@ class BootLinuxConsole(LinuxKernelTest): image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img' image_path = os.path.join(self.workdir, image_name) process.run("7z e -o%s %s" % (self.workdir, image_path_7z)) + image_pow2ceil_expand(image_path) self.vm.set_console() self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw', @@ -678,7 +696,7 @@ class BootLinuxConsole(LinuxKernelTest): :avocado: tags=machine:orangepi-pc :avocado: tags=device:sd """ - # This test download a 304MB compressed image and expand it to 1.3GB... + # This test download a 304MB compressed image and expand it to 2GB deb_url = ('http://snapshot.debian.org/archive/debian/' '20200108T145233Z/pool/main/u/u-boot/' 'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb') @@ -695,8 +713,9 @@ class BootLinuxConsole(LinuxKernelTest): image_hash = '2babb29d36d8360adcb39c09e31060945259917a' image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash) image_path = os.path.join(self.workdir, 'armv7.img') - image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path archive.gzip_uncompress(image_path_gz, image_path) + image_pow2ceil_expand(image_path) + image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc with open(uboot_path, 'rb') as f_in: @@ -704,12 +723,6 @@ class BootLinuxConsole(LinuxKernelTest): f_out.seek(8 * 1024) shutil.copyfileobj(f_in, f_out) - # Extend image, to avoid that NetBSD thinks the partition - # inside the image is larger than device size itself - f_out.seek(0, 2) - f_out.seek(64 * 1024 * 1024, 1) - f_out.write(bytearray([0x00])) - self.vm.set_console() self.vm.add_args('-nic', 'user', '-drive', image_drive_args, From patchwork Thu Sep 3 20:59:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lXC9ZYGU; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDQ96nN0z9sPB for ; Fri, 4 Sep 2020 07:26:25 +1000 (AEST) Received: from localhost ([::1]:50366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwkR-0003EG-Pr for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:26:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLl-0004cC-SU; Thu, 03 Sep 2020 17:00:54 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:44057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLj-0007mx-Qo; Thu, 03 Sep 2020 17:00:53 -0400 Received: by mail-ot1-x344.google.com with SMTP id a2so3982573otr.11; Thu, 03 Sep 2020 14:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jToX5f8+EsTioWIIknUwq5OunQEZrWHXCk2GLVSldj8=; b=lXC9ZYGUoZ4KJA2vN/7SvDU0yg5UUTgbCJd1R7y3Cp7ezrlzbg8V9M/PIXkdZPNKM4 yiCRIKI4cHACzyLPcdD8sXAWlEYhrBjPmZyHovdaIrSbbFyoKr59+tE5c43YK613g0Ax GpLdGCkFOlTj+SMvUY3OpBlEcbYRBW3O42uHzsp3EYtcg+CwG6osmhFewlySjnp1YAFk sFDbYQ6h16h6aRckxk7LvR4c9IV6F2RUXns9yqEAM5Qz82U3AwCQRPN/eSfvw6JZ26x0 VmTYrruMSBzvIID/mD9HcTXknwrMbWa23YM2FTQWMu3cMGzzLJV5Hmj0xqQEcEIrT0YV C8RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jToX5f8+EsTioWIIknUwq5OunQEZrWHXCk2GLVSldj8=; b=JtBEmGMTK+HQ06WazCt4h5VLPjc9xpbnZZFhWOX5rEhdy9mvjirtE5gKZfw1kHaibo 7qCkqEM3gOqVUEylHI40oOQZ/swsV2Kzkg+YlTJE926fVVfwkjC/c1e8Wns/SRvdkQeZ m+SLW4jOgpLIOL/ILaSJARMHBn25xI7GvW57OIrRFQSc/VyRAiRjb0a6aGuefo+Zi7rS kHSNhYJ2zQeUIkMQEg8n37b/99OUKg3EWldRMuvDdOKDDCHYa5XsgjhY/DUHbRP/B3Hq esyMdcHupOgWV7URQ8FrMpOgRXRf2SEd9ztewqU0V6U2kzzxe3onD7g1ypgkheTK3YIh gZKA== X-Gm-Message-State: AOAM530PLymmY8W2zntctqRiySDewRuiamBAlbEZ6fMaG4VbdI9mvxlr DaQpRgLuT6wtXslujofRY1Nn0Vlniqs= X-Google-Smtp-Source: ABdhPJxyDxvVBQ8RnzNkokerKNl28JlrqJh77pW/7JQNFNrfBP0/iNHT4+PyEthWYnnEVPxmWZ/pFg== X-Received: by 2002:a05:6830:48:: with SMTP id d8mr2968196otp.272.1599166850192; Thu, 03 Sep 2020 14:00:50 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id m8sm767319otn.66.2020.09.03.14.00.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:49 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 51/77] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards Date: Thu, 3 Sep 2020 15:59:09 -0500 Message-Id: <20200903205935.27832-52-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=flukshun@gmail.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Only SCSD cards support Class 6 (Block Oriented Write Protection) commands. "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01" 4.3.14 Command Functional Difference in Card Capacity Types * Write Protected Group SDHC and SDXC do not support write-protected groups. Issuing CMD28, CMD29 and CMD30 generates the ILLEGAL_COMMAND error. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200630133912.9428-7-f4bug@amsat.org> (cherry picked from commit 9157dd597d293ab7f599f4d96c3fe8a6e07c633d) Signed-off-by: Michael Roth --- hw/sd/sd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 3c06a0ac6d..da39590f58 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -905,6 +905,11 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->multi_blk_cnt = 0; } + if (sd_cmd_class[req.cmd] == 6 && FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) { + /* Only Standard Capacity cards support class 6 commands */ + return sd_illegal; + } + switch (req.cmd) { /* Basic commands (Class 0 and Class 1) */ case 0: /* CMD0: GO_IDLE_STATE */ From patchwork Thu Sep 3 20:59:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=II1RWNGE; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDSN3lgMz9sPB for ; Fri, 4 Sep 2020 07:28:20 +1000 (AEST) Received: from localhost ([::1]:58630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwmI-0006dL-CM for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:28:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLm-0004cG-J9; Thu, 03 Sep 2020 17:00:54 -0400 Received: from mail-oo1-xc44.google.com ([2607:f8b0:4864:20::c44]:45660) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLl-0007nN-1y; Thu, 03 Sep 2020 17:00:54 -0400 Received: by mail-oo1-xc44.google.com with SMTP id u28so1122121ooe.12; Thu, 03 Sep 2020 14:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+vCCI2xx9GVvmEfubwpcsIW6FrRaSKZ9xWlva5k5xWQ=; b=II1RWNGE5KaeU8hFLd78cQ2fOlhwfXb0Rf5ycQath3mMC8TSEY1ZFo6VEFQpVkSEog qzqjUeLQK4gR0ju65GIOWY5zZviYLFWmojydKRD1x1DwA8jzqcWyfGdNEkl/n70vF6wg ZK4MkAfTDQVuxoh8DURknqtaQQ3l/b0K1efeIYYdke6y/+V1WRNVcgQePb+pfqBXlV1D 5un/DOB4gn55Fap9F9t9HazrNhIea8uSyctZ/VIKfLXj9F+RZioJyCawuFzdrsIh/rzR Y/p/YgbJ8Oh2XQulNiy5muxPwE4RjHiew2CpZT7L+IagNhSG5O0gvC2LqLKHWBDBDNZu AnsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+vCCI2xx9GVvmEfubwpcsIW6FrRaSKZ9xWlva5k5xWQ=; b=snvOXD4zqoOEc4HZVUIdhjBqplNF8mEHK1TJK3KDSkdxAbZGP3pO5GbJdo+TzzOKjA DzoLg+B2WKOP+GJan2NEi4r/sMifDYYBOncLuuglqj2wTXglEjg38W2GFvSmqZxitFVg Zrn0guqq7UevL11ogSDsAaFm0L9hXYFpAnl/QypJ0HgyOqckTDvRC2WMiF1G0d3XCjDC GeHpc/s2SE20vuq3wPeUHsLz3Glw/2e7hcMWCxYVZWIQ813CVSiI2qsTabtN8brg4EA4 g6sEQIzrChsKtOcONQw8v64scStriddY4ad+aRlqfn9v/FdVMrB2x595aI/ddDFvveS4 ePRQ== X-Gm-Message-State: AOAM531ZBMT0r+RymPhlrx2LuSVnQ9Cda5yGY6oxoj6MfuSP/yceAVYo vm/srQp+Lul7AkBS6ye9K1b9bf0T86w= X-Google-Smtp-Source: ABdhPJwOU7dDRvZsAVANagrnVEa2H0Eksz5BhR8KsWAeU298YxcApWj9dCzBd1WMADGMMJjpx1GFjQ== X-Received: by 2002:a4a:4910:: with SMTP id z16mr3327291ooa.41.1599166851303; Thu, 03 Sep 2020 14:00:51 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l3sm842779oom.18.2020.09.03.14.00.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:50 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 52/77] hw/sd/sdcard: Simplify realize() a bit Date: Thu, 3 Sep 2020 15:59:10 -0500 Message-Id: <20200903205935.27832-53-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c44; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc44.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We don't need to check if sd->blk is set twice. Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200630133912.9428-18-f4bug@amsat.org> (cherry picked from commit 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d) Signed-off-by: Michael Roth --- hw/sd/sd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index da39590f58..04258f1816 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2090,12 +2090,12 @@ static void sd_realize(DeviceState *dev, Error **errp) return; } - if (sd->blk && blk_is_read_only(sd->blk)) { - error_setg(errp, "Cannot use read-only drive as SD card"); - return; - } - if (sd->blk) { + if (blk_is_read_only(sd->blk)) { + error_setg(errp, "Cannot use read-only drive as SD card"); + return; + } + ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE, BLK_PERM_ALL, errp); if (ret < 0) { From patchwork Thu Sep 3 20:59:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Clv9uVjf; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDWm2LQ7z9sTK for ; Fri, 4 Sep 2020 07:31:16 +1000 (AEST) Received: from localhost ([::1]:43918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwp8-0003qk-44 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:31:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLo-0004fL-IG; Thu, 03 Sep 2020 17:00:56 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:35052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLm-0007no-La; Thu, 03 Sep 2020 17:00:56 -0400 Received: by mail-ot1-x342.google.com with SMTP id i4so4038592ota.2; Thu, 03 Sep 2020 14:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZILyJy1nBWpJrZHi1uzFvLmVU4Jp6kAKnyaWcu8nswA=; b=Clv9uVjffYFXUVLDfiEodN/TslU59h5Bg0WaWJSGDP198TnWg4/n44x3g5v9q/zw8I y1WlFu9igpVmSqrrxY58ZgKqrTscD2IrAt6R8QjhuvaFTajW9C12soRHUGNmcWiY9k3E D396CSb6hrIqBMIejNhuArSlpI2sNXGQbFmH2ljCxlk2JxbWTfNjmdzGGqyNR61OMY5Q tgujt45eKn7kW5vR+niV4/oqYsL9kEUIe471rx+4AM6DP3UEbYJFlBu4lX2nFVGIFFMp Nprm5qXKd1pIN8lawHCxmC9Hzyl0GWeB18g6LIoJ/WlepxNnBVtnUXzmb0ZkcfKwl7Tn X/kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZILyJy1nBWpJrZHi1uzFvLmVU4Jp6kAKnyaWcu8nswA=; b=erPDFTM9Ai4o8PTmH4nl5e94k7nRCZ5LLT96ayu5b7bdrjH/UhS3nhb9JPDKrfBzv7 X9omx41Eav37qqzLaJu3KmqL0kc6H0jNHaxW9tvRFG6FHYJryY8Xr8f8tsNTo6fV4Su3 dSxTKeOS/f6S3E2Ko1yrX2/4/7o7LdgCmtVnDTqzIrJJSRvAyhCRuB/yP2h7WmLPJt/l p4Piq+pp0UsxLho24u0K7SbtkGuPkjm+8gbEioGrdhVHl3qc2E2xEYce4aZyLJZSw2m/ RhMLVWZTwq4MdACZn5QEEN5DnUlWV69pjZ/299zN8a0ObUN3+SvEUBE7Iuou1WAQlW/J 78XQ== X-Gm-Message-State: AOAM532yGiRSMzOtxNI1/Oj8TG3bP4xxANvBStndYTXiawCP3zAVXQwF QaQQDCFo2DS8WEmMIwyt+RxC+4mR8sM= X-Google-Smtp-Source: ABdhPJwM++6LzX4HTR1xyk+ivDuvEvim/0s7nyID5EMvqQE3qxi/bnz+TKqOHMosXyv2bY23ET6bcA== X-Received: by 2002:a9d:37b5:: with SMTP id x50mr2906344otb.57.1599166852742; Thu, 03 Sep 2020 14:00:52 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id y10sm849793ooh.9.2020.09.03.14.00.51 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:52 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 53/77] hw/sd/sdcard: Do not allow invalid SD card sizes Date: Thu, 3 Sep 2020 15:59:11 -0500 Message-Id: <20200903205935.27832-54-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=flukshun@gmail.com; helo=mail-ot1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé QEMU allows to create SD card with unrealistic sizes. This could work, but some guests (at least Linux) consider sizes that are not a power of 2 as a firmware bug and fix the card size to the next power of 2. While the possibility to use small SD card images has been seen as a feature, it became a bug with CVE-2020-13253, where the guest is able to do OOB read/write accesses past the image size end. In a pair of commits we will fix CVE-2020-13253 as: Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR occurred and no data transfer is performed. Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR occurred and no data transfer is performed. WP_VIOLATION errors are not modified: the error bit is set, we stay in receive-data state, wait for a stop command. All further data transfer is ignored. See the check on sd->card_status at the beginning of sd_read_data() and sd_write_data(). While this is the correct behavior, in case QEMU create smaller SD cards, guests still try to access past the image size end, and QEMU considers this is an invalid address, thus "all further data transfer is ignored". This is wrong and make the guest looping until eventually timeouts. Fix by not allowing invalid SD card sizes (suggesting the expected size as a hint): $ qemu-system-arm -M orangepi-pc -drive file=rootfs.ext2,if=sd,format=raw qemu-system-arm: Invalid SD card size: 60 MiB SD card size has to be a power of 2, e.g. 64 MiB. You can resize disk images with 'qemu-img resize ' (note that this will lose data if you make the image smaller than it currently is). Cc: qemu-stable@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Message-Id: <20200713183209.26308-8-f4bug@amsat.org> (cherry picked from commit a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36) Signed-off-by: Michael Roth --- hw/sd/sd.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 04258f1816..c34435ede4 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -32,6 +32,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/cutils.h" #include "hw/irq.h" #include "hw/registerfields.h" #include "sysemu/block-backend.h" @@ -2091,11 +2092,35 @@ static void sd_realize(DeviceState *dev, Error **errp) } if (sd->blk) { + int64_t blk_size; + if (blk_is_read_only(sd->blk)) { error_setg(errp, "Cannot use read-only drive as SD card"); return; } + blk_size = blk_getlength(sd->blk); + if (blk_size > 0 && !is_power_of_2(blk_size)) { + int64_t blk_size_aligned = pow2ceil(blk_size); + char *blk_size_str; + + blk_size_str = size_to_str(blk_size); + error_setg(errp, "Invalid SD card size: %s", blk_size_str); + g_free(blk_size_str); + + blk_size_str = size_to_str(blk_size_aligned); + error_append_hint(errp, + "SD card size has to be a power of 2, e.g. %s.\n" + "You can resize disk images with" + " 'qemu-img resize '\n" + "(note that this will lose data if you make the" + " image smaller than it currently is).\n", + blk_size_str); + g_free(blk_size_str); + + return; + } + ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE, BLK_PERM_ALL, errp); if (ret < 0) { From patchwork Thu Sep 3 20:59:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=b0JRqocK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDsd5sFqz9sTg for ; Fri, 4 Sep 2020 07:46:45 +1000 (AEST) Received: from localhost ([::1]:58782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx47-0008Ff-OD for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:46:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLp-0004ie-Q7; Thu, 03 Sep 2020 17:00:57 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:35988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLn-0007o6-UX; Thu, 03 Sep 2020 17:00:57 -0400 Received: by mail-ot1-x342.google.com with SMTP id 109so4028785otv.3; Thu, 03 Sep 2020 14:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HoXMwJ6jL8idPvXw+qvTHpg54S9w/O8tNTCV84dfgYM=; b=b0JRqocK7EDtDSG09dqWAJm6fybhUrz8wMy3oOQXWBJW70aXXiBeg4VJJtpFDaDqOm BhyJblnWclBDnenefmAm18UFt9TGKkqnYAFI1X3SNwaHgkoYZrEEZAcBAxqqNZZtvrmg ZauK2qR0CCK5G2wOhVEf58VOdNWj38hbDwh/NZKRSi1OzZalU0YX941XweOcA4+vPQ0F OLZC/sNzRKxKE1taNK4k8DAgFMAVxxozXp1+6rY9alhbxnPlYnkw7U2Gq9jYAAOmgzZh GRt56E9mxsQyLWME4udye6+wqPfLRVzrmm/CKh/u2KLaApvV1sZuIWmYhp5MYuQZVQew tGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HoXMwJ6jL8idPvXw+qvTHpg54S9w/O8tNTCV84dfgYM=; b=Ris8jzcOd+3hS8iJhPZ82joKC6WgaIF8SKMHps8u14ogdSc7vosaey07TmxktGgsZZ R6IDVs8DU/8BJeRlJaOdnghXFtMFbjuoUuly9cWrJDnaEhxL1gZY74YyDJPTmkAdO1YD bJcRe+zQsWpCgMAQ9LH/4UJor5Fwrq0I+uaFLdpMJO9UsemjiGKrpQF7qHIAHDcBZ02H Gx3Ywc2HaORcudnhPdoMOs3apnabguw2WT8CM9snlC1+MomNeEyRXVGrjv42oiE1IXYF /EqZE+0u2a2FnA5idOitiqsfKpALp/cFGNbgZ67M2tJ8Ma5elltbEUAkbn65bkES/i4l z4lQ== X-Gm-Message-State: AOAM5300CGhszzf68D5adcz4p+0DT0FqBI5GUA/ZqnF2Gwo9o+hALlxN ZxaqOiQAdkrI8VKNXz6meoH9SVdZgHs= X-Google-Smtp-Source: ABdhPJxkB/6NybeUL8fCrkagp8muImqa+wg8bUBdvjcfapkmjFV5xZsyGRgxSO9lVZAx6NE/WURgYw== X-Received: by 2002:a9d:3bb7:: with SMTP id k52mr3031468otc.242.1599166854163; Thu, 03 Sep 2020 14:00:54 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id g23sm869321ooh.45.2020.09.03.14.00.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:53 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 54/77] hw/sd/sdcard: Update coding style to make checkpatch.pl happy Date: Thu, 3 Sep 2020 15:59:12 -0500 Message-Id: <20200903205935.27832-55-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=flukshun@gmail.com; helo=mail-ot1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé To make the next commit easier to review, clean this code first. Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Alexander Bulekov Message-Id: <20200630133912.9428-3-f4bug@amsat.org> (cherry picked from commit 794d68de2f021a6d3874df41d6bbe8590ec05207) Signed-off-by: Michael Roth --- hw/sd/sd.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index c34435ede4..b927f7966d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1160,8 +1160,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->data_start = addr; sd->data_offset = 0; - if (sd->data_start + sd->blk_len > sd->size) + if (sd->data_start + sd->blk_len > sd->size) { sd->card_status |= ADDRESS_ERROR; + } return sd_r1; default: @@ -1176,8 +1177,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->data_start = addr; sd->data_offset = 0; - if (sd->data_start + sd->blk_len > sd->size) + if (sd->data_start + sd->blk_len > sd->size) { sd->card_status |= ADDRESS_ERROR; + } return sd_r1; default: @@ -1222,12 +1224,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->data_offset = 0; sd->blk_written = 0; - if (sd->data_start + sd->blk_len > sd->size) + if (sd->data_start + sd->blk_len > sd->size) { sd->card_status |= ADDRESS_ERROR; - if (sd_wp_addr(sd, sd->data_start)) + } + if (sd_wp_addr(sd, sd->data_start)) { sd->card_status |= WP_VIOLATION; - if (sd->csd[14] & 0x30) + } + if (sd->csd[14] & 0x30) { sd->card_status |= WP_VIOLATION; + } return sd_r1; default: @@ -1246,12 +1251,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) sd->data_offset = 0; sd->blk_written = 0; - if (sd->data_start + sd->blk_len > sd->size) + if (sd->data_start + sd->blk_len > sd->size) { sd->card_status |= ADDRESS_ERROR; - if (sd_wp_addr(sd, sd->data_start)) + } + if (sd_wp_addr(sd, sd->data_start)) { sd->card_status |= WP_VIOLATION; - if (sd->csd[14] & 0x30) + } + if (sd->csd[14] & 0x30) { sd->card_status |= WP_VIOLATION; + } return sd_r1; default: From patchwork Thu Sep 3 20:59:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=LbCA72sb; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDZ43xyzz9sPB for ; Fri, 4 Sep 2020 07:33:16 +1000 (AEST) Received: from localhost ([::1]:53252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwr4-0007j7-EE for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:33:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLr-0004lE-1V; Thu, 03 Sep 2020 17:00:59 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:38021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLp-0007oK-2p; Thu, 03 Sep 2020 17:00:58 -0400 Received: by mail-ot1-x341.google.com with SMTP id y5so4017464otg.5; Thu, 03 Sep 2020 14:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c/XJ4cq89jTidCJNmUTRkTTxQKsiT4FwBhQY5tAah/0=; b=LbCA72sb0bW2BOnLqpeCgCYTIX0V7dPXWccAVW1OylGFmSc64t0d+brN8UkODmKVFk KuGEyMaXy498WdQB1g9OI/+3mQ7nNFe4+QhAubD2O1PzKZeaNqLyuVvCdLJbGidjICSw /wg+KvXrm6zG9tqux+mgsVFttt0TxZSD3xsevW2gNjpMnnKULAv1g9ngz56Ht/0UojIv 09ZWH8T2WCsxtW9W9C6vwgSe2p53v3XeEIhOr4BHn8qwaFue5o3CG48Ij4uSbPmIfsLL GJNEPx/ohRD8U5scxHB42b0Qkl2A6iAj8t6poRtXN/Vie099ciiszlfNQsr7yW2hfpD1 GyLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=c/XJ4cq89jTidCJNmUTRkTTxQKsiT4FwBhQY5tAah/0=; b=KG8kUILphz3Z5/hg7UNZ8HsVaTvrMttD3uOi4vvTuLf7QH1t2epr3Km4xtnwZ2fLgk zRlC5LskJzeGrpFPeulpizZ9/skn4ksot9wEN0yz2OZrneE+tHGZQ0fQkdXvghOLa2wa 6kyRLkMqL2mqlz027cAmAXqJmJoYDVkTMb5IpAUvXHf7pBZnz6Vy7ZGSpA1NnjF/EKYw v58hHuoigwogqaadS30NMuw13bmsnureK15fDPRcHTntJjT7P4KWjo+0iall1IwtDxqz joYU5RRv+M2fFVlQ/90DtkdUlEULt/ZV/MFYnZN0UtLykOe96e8FeXQvyGhE160DS1Fl sstg== X-Gm-Message-State: AOAM531wUUwv29sNaOuIx3ETUuHkogmrsC3y5dMPvOQFb+ewXQABkcmC p1Q8+jeohwj+ZnPEt3br2LJMGHFNDuQ= X-Google-Smtp-Source: ABdhPJz6LNJZd6F8S0FPtauEwH+iTHJPRz5DFMyEmgcUOKWYgpc2KiegdJl3AM+2Kq12xxkVLCzHaQ== X-Received: by 2002:a05:6830:1d8a:: with SMTP id y10mr3186967oti.92.1599166855226; Thu, 03 Sep 2020 14:00:55 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id g62sm761424otg.56.2020.09.03.14.00.54 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:54 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 55/77] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid Date: Thu, 3 Sep 2020 15:59:13 -0500 Message-Id: <20200903205935.27832-56-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=flukshun@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Only move the state machine to ReceivingData if there is no pending error. This avoids later OOB access while processing commands queued. "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01" 4.3.3 Data Read Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR occurred and no data transfer is performed. 4.3.4 Data Write Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR occurred and no data transfer is performed. WP_VIOLATION errors are not modified: the error bit is set, we stay in receive-data state, wait for a stop command. All further data transfer is ignored. See the check on sd->card_status at the beginning of sd_read_data() and sd_write_data(). Fixes: CVE-2020-13253 Cc: qemu-stable@nongnu.org Reported-by: Alexander Bulekov Buglink: https://bugs.launchpad.net/qemu/+bug/1880822 Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200630133912.9428-6-f4bug@amsat.org> (cherry picked from commit 790762e5487114341cccc5bffcec4cb3c022c3cd) Signed-off-by: Michael Roth --- hw/sd/sd.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b927f7966d..837fe9053d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1156,13 +1156,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) case 17: /* CMD17: READ_SINGLE_BLOCK */ switch (sd->state) { case sd_transfer_state: - sd->state = sd_sendingdata_state; - sd->data_start = addr; - sd->data_offset = 0; - if (sd->data_start + sd->blk_len > sd->size) { + if (addr + sd->blk_len > sd->size) { sd->card_status |= ADDRESS_ERROR; + return sd_r1; } + + sd->state = sd_sendingdata_state; + sd->data_start = addr; + sd->data_offset = 0; return sd_r1; default: @@ -1173,13 +1175,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) case 18: /* CMD18: READ_MULTIPLE_BLOCK */ switch (sd->state) { case sd_transfer_state: - sd->state = sd_sendingdata_state; - sd->data_start = addr; - sd->data_offset = 0; - if (sd->data_start + sd->blk_len > sd->size) { + if (addr + sd->blk_len > sd->size) { sd->card_status |= ADDRESS_ERROR; + return sd_r1; } + + sd->state = sd_sendingdata_state; + sd->data_start = addr; + sd->data_offset = 0; return sd_r1; default: @@ -1219,14 +1223,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) /* Writing in SPI mode not implemented. */ if (sd->spi) break; + + if (addr + sd->blk_len > sd->size) { + sd->card_status |= ADDRESS_ERROR; + return sd_r1; + } + sd->state = sd_receivingdata_state; sd->data_start = addr; sd->data_offset = 0; sd->blk_written = 0; - if (sd->data_start + sd->blk_len > sd->size) { - sd->card_status |= ADDRESS_ERROR; - } if (sd_wp_addr(sd, sd->data_start)) { sd->card_status |= WP_VIOLATION; } @@ -1246,14 +1253,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) /* Writing in SPI mode not implemented. */ if (sd->spi) break; + + if (addr + sd->blk_len > sd->size) { + sd->card_status |= ADDRESS_ERROR; + return sd_r1; + } + sd->state = sd_receivingdata_state; sd->data_start = addr; sd->data_offset = 0; sd->blk_written = 0; - if (sd->data_start + sd->blk_len > sd->size) { - sd->card_status |= ADDRESS_ERROR; - } if (sd_wp_addr(sd, sd->data_start)) { sd->card_status |= WP_VIOLATION; } From patchwork Thu Sep 3 20:59:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KTm9I81M; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDvX0fbmz9sTr for ; Fri, 4 Sep 2020 07:48:24 +1000 (AEST) Received: from localhost ([::1]:36566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx5h-0002IF-Ta for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:48:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLr-0004nW-Vc; Thu, 03 Sep 2020 17:01:00 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:39860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLq-0007ol-2p; Thu, 03 Sep 2020 17:00:59 -0400 Received: by mail-oi1-x244.google.com with SMTP id r64so4523757oib.6; Thu, 03 Sep 2020 14:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hBv/652Zc3vxedUaDXUBkYliuRqc7HcQ84NCJAihy/4=; b=KTm9I81M8cWYvo2JUKgDM5VV/LzuZirf1yRjQgxyMQNbNO+1D3w4WRZdp7f3Ud8bOB qXF0jcg+dpuHkix0MkTQDcBRgf5oE9Low9Vk5jZSROQ8qav8pLZzCRPxjhQuuFxyRC5F uQb7Ej2AMfgQ2OV1SsXMVMQvZjH40i+1bf7vKMzNhkQltemPAqClQl35wrmTErUh0pf1 ckVNPgh/omhhwyOb0T4oE2JkmAxs7LZNTuma93y4sUtUHNYY3a7fLKsY+vkMPh8eT/VD ZcuwBxZnlLB2iGYsyaCAUCG6yfEcY97EVIafu5j0H3gU8LIiPO69O38WYvfIoFIsZPoQ tpRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hBv/652Zc3vxedUaDXUBkYliuRqc7HcQ84NCJAihy/4=; b=G6FA79Et4BQy61frLxEZ+HqNVALJJB4iYeBMFKh3zpwmVKw/uJKxQP1DAvmhBMmvxZ IS1EZ1AMvc3qzcKkneIV6fAX8XoXGshBAdqNf4Gg9d8kQJVk+7hWdDGQMaAKjJQLPNVm 8nJCWvO73FWgC3MYHDmx7M/+4nG3uNStwac+FcKNXGT+ZrWyC5xTN6TYWqtdwrcZSvTP htiEi2EVCMp5IrYPM76S3/dLs7qBqSisDW2x7PhU5Edv3WCR9P95OUg4DW8XwWy3VJFd DNNhjcCLt+lFb+Jh50VztjPZhG5gEAk9mR4hDWxDAJsorlWKjXDvFeoGxm/DVGkCK7uC dPzg== X-Gm-Message-State: AOAM530G+cEKWN68HoraZEU9yGBY3oZRzzXxOWNzYf3CGWYPnSM6bdOL krsV6A1+JNcRoyvSn/I6Gz3UBBdJoO8= X-Google-Smtp-Source: ABdhPJy//E3qeJYtO8uurp2A08lQP2AGt+yAbHxqmkKqdVWvA1At/ppHFIq0FUDEc9Q5a6NbKkA0Eg== X-Received: by 2002:aca:44c3:: with SMTP id r186mr3256905oia.53.1599166856381; Thu, 03 Sep 2020 14:00:56 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id t22sm765241otq.44.2020.09.03.14.00.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:55 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 56/77] target/hppa: Free some temps in do_sub Date: Thu, 3 Sep 2020 15:59:14 -0500 Message-Id: <20200903205935.27832-57-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Two temps allocated but not freed. Do enough subtractions within a single TB and one can run out of temps entirely. Fixes: b2167459ae ("target-hppa: Implement basic arithmetic") Buglink: https://bugs.launchpad.net/qemu/+bug/1880287 Tested-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20200720174039.517902-1-richard.henderson@linaro.org> (cherry picked from commit 79826f99feb7222b7804058f0b4ace9ee0546361) Signed-off-by: Michael Roth --- target/hppa/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 52d7bea1ea..4bd22d4820 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -1294,6 +1294,8 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1, save_or_nullify(ctx, cpu_psw_cb_msb, cb_msb); save_gpr(ctx, rt, dest); tcg_temp_free(dest); + tcg_temp_free(cb); + tcg_temp_free(cb_msb); /* Install the new nullification. */ cond_free(&ctx->null_cond); From patchwork Thu Sep 3 20:59:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=t3Z9QAOi; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDc25K9xz9sPB for ; Fri, 4 Sep 2020 07:34:56 +1000 (AEST) Received: from localhost ([::1]:33296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwsf-0002oQ-Kj for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:34:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLt-0004qx-LY; Thu, 03 Sep 2020 17:01:01 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:39459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLr-0007p4-AV; Thu, 03 Sep 2020 17:01:01 -0400 Received: by mail-ot1-x341.google.com with SMTP id u25so4010867otq.6; Thu, 03 Sep 2020 14:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZGuqioQ81AJZZTMFCUZaggIBmQ2hKOBauKIF8BVgJKE=; b=t3Z9QAOiFV38Bvy88UMabvWB9aka5Pwguc3uO0J5C8WmqW80gF67t7YPJU2BG/LrH9 lUzjKYN/vh8bqGQjoK+mTkmOEqbqXm2EbRCCwpw6iei5dH6vEVxYsB7UpT2i2gXYhJrC 4ZYMCMXd3Z9eWG/90IbLbrp20bgEOFpObOJbhVyPzfzJTkcxyBljCII27wY+7tL51L7D NPQkNuf3drqJ2n20YHA1gigfbKN2447i7zI4gi4B5bRz67rXV6A98c/aPttVK3H7IZp2 JCiDZKFo18bRt2Bzzw+dLo639fUho/YYZWS4cTFd1h5GbBPwM13pecNBSPqQdTg/4W0D jXug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZGuqioQ81AJZZTMFCUZaggIBmQ2hKOBauKIF8BVgJKE=; b=FPfHB3HFoABVxP6Va9/PQU6Ip6XzcKwSW/xqkL4g5Tq7AFaJbwnS+ZMMdnWSd32n5L Py9729vGGUXstPo4RnrANumgQKtV7gjwrm6WxHVGuD1arXa2tt91zsXt1NDDNSmNAFc9 oUKRey0c6xgWGtUmufylw1D7JxKZxpG8jmlCQPKZFVCPEEZkQcTU1N6jqn1h6RYizzxt 3op9PDKYT1tHjjviZWJ/KxgqbUI7fjGCvyYcSjhAjfJQQ5UkzgjtuIf7kitSlfjwci46 tt1Jxc2Uedu7Bpddsjz60JlrVYwUfSxAWSHsGP6EMHqqNTFyecnIVEDn+wK6xvGs1biC TtiQ== X-Gm-Message-State: AOAM531OJ9nWXEO3oHu7i/y4JaBmryCsk6/a651vri8zI1T/qetlcg+2 ASNJxPBnnrEDuWx67uATPs82kjIPgo7qrw== X-Google-Smtp-Source: ABdhPJy/v8mjZfWytj+5MDYTP3PhgJaV7wQ7wilhaIq21KHwQ+47BAM3XHGdzoDCkoPhWz7w6zwxpw== X-Received: by 2002:a05:6830:19ee:: with SMTP id t14mr3084951ott.171.1599166857524; Thu, 03 Sep 2020 14:00:57 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id g18sm760177otj.41.2020.09.03.14.00.56 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:57 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 57/77] tpm: tpm_spapr: Exit on TPM backend failures Date: Thu, 3 Sep 2020 15:59:15 -0500 Message-Id: <20200903205935.27832-58-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=flukshun@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Berger , qemu-stable@nongnu.org, Stefan Berger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Berger Exit on TPM backend failures in the same way as the TPM CRB and TIS device models do. With this change we now get an error report when the backend did not start up properly: error: internal error: qemu unexpectedly closed the monitor: 2020-07-07T12:49:28.333928Z qemu-system-ppc64: tpm-emulator: \ TPM result for CMD_INIT: 0x101 operation failed Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau Message-id: 20200707201625.4177419-2-stefanb@linux.vnet.ibm.com (cherry picked from commit f8b332a1ff107dc014a52eaf9bf547995205f18a) Signed-off-by: Michael Roth --- hw/tpm/tpm_spapr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c index ce65eb2e45..b67aafb24e 100644 --- a/hw/tpm/tpm_spapr.c +++ b/hw/tpm/tpm_spapr.c @@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev) TPM_SPAPR_BUFFER_MAX); tpm_backend_reset(s->be_driver); - tpm_spapr_do_startup_tpm(s, s->be_buffer_size); + + if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) { + exit(1); + } } static enum TPMVersion tpm_spapr_get_version(TPMIf *ti) From patchwork Thu Sep 3 20:59:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CzikMDXV; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDsC6qmDz9sTR for ; Fri, 4 Sep 2020 07:46:23 +1000 (AEST) Received: from localhost ([::1]:57296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx3k-0007eZ-8r for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:46:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLv-0004u3-05; Thu, 03 Sep 2020 17:01:03 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:40119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLs-0007pU-Bw; Thu, 03 Sep 2020 17:01:02 -0400 Received: by mail-oi1-x244.google.com with SMTP id t76so4500619oif.7; Thu, 03 Sep 2020 14:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mcURfk5W32wdNJCNi/KCDUV8DNNwwxKl3IilrVi/wvI=; b=CzikMDXVLKlKz+t6WqY0ApV+J4z9aQkNKVvl2qWLWG/dsu4TN3E5z6gzWCugT4G8GE y2a9PQN6PrAB1CTLD0ksddMJ1xofxWOW4gFNEBTONfCXdz/Al1cLEMZREnSJdHb/a0Ss DNqpNOE/+IhpiJWmIEEpRf+uPweWlLbBPe2HGRe8iplq6W8bfkjX4JWThEabF4LHC+F/ craUQKzKXV4zIL3/UeM9ikFR+hXmqT6XomjxX6KgdP+vqZ+WuKfyN/HpoK811LBXsA3A SynCplR3iRFe1265c/IElQoqgvS0kC83NJUgloTS5P/fRdtDQryhR2PlTvFQdL6q1IPV D8Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mcURfk5W32wdNJCNi/KCDUV8DNNwwxKl3IilrVi/wvI=; b=uMTXCxIvSEgQdv0H9d8m1pGpqlU3Q3KiVTk1tJtgOozBJIv6RpAUMNjo1pXSYggVGy 1RNZ2TYg50uUSC+KFGVOr6MSKJIUfeia+Hk3QLbkyG/jrxicspWY4ey12zdBiWPThSYl YQAN+DPmhMDJGJjrooT9z8GyOzYbdgcK1iyzk1VJtH79fOsjCOpm8qrblVSa4qvLBKaH GktX8bgqbcOtXWEWK4dJzKqEo1jUPGH+xKAbpdyXRoNVCjFKqL3Wa79ZBW0IxxgGcPcq byzE188ER8XJF6isBj9MRys4kdg5/PNuRAgk1R+ijF3gOYrjg1vF7hf8qFGL1D5fS720 R6rg== X-Gm-Message-State: AOAM532nCarS1jntynEQbnuR6LyBY/nsIkiMDEYT+Naggcrl+rgf0KjP bF5g3QsCTi2pL/3AIFrBDWRXo3Q+VCgIxA== X-Google-Smtp-Source: ABdhPJxkAI4+DhwXOvR1NOhvLXk3KuK5QvhSEJhe0qtC7QaI9W88quAYK3iU0t9wz4cPa/X/oBAtjg== X-Received: by 2002:aca:c3c7:: with SMTP id t190mr3419222oif.167.1599166858651; Thu, 03 Sep 2020 14:00:58 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 187sm707041oie.42.2020.09.03.14.00.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:58 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 58/77] tests: tpm: Skip over pcrUpdateCounter byte in result comparison Date: Thu, 3 Sep 2020 15:59:16 -0500 Message-Id: <20200903205935.27832-59-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Berger , qemu-stable@nongnu.org, Stefan Berger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Berger The TPM 2 code in libtpms was fixed to handle the PCR 'TCB group' according to the PCClient profile. The change of the PCRs belonging to the 'TCB group' now affects the pcrUpdateCounter in the TPM2_PCRRead() responses where its value is now different (typically lower by '1') than what it was before. To not fail the tests, we skip the comparison of the 14th byte, which represents the pcrUpdateCounter. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau Message-id: 20200707201625.4177419-3-stefanb@linux.vnet.ibm.com (cherry picked from commit df8a7568932e4c3c930fdfeb228dd72b4bb71a1f) Signed-off-by: Michael Roth --- tests/qtest/tpm-util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c index 34efae8f18..58a9593745 100644 --- a/tests/qtest/tpm-util.c +++ b/tests/qtest/tpm-util.c @@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx, tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer)); - g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size); + /* skip pcrUpdateCounter (14th byte) in comparison */ + g_assert(exp_resp_size >= 15); + g_assert_cmpmem(buffer, 13, exp_resp, 13); + g_assert_cmpmem(&buffer[14], exp_resp_size - 14, + &exp_resp[14], exp_resp_size - 14); } bool tpm_util_swtpm_has_tpm2(void) From patchwork Thu Sep 3 20:59:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nwEX8IKy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDxB5t9bz9sTr for ; Fri, 4 Sep 2020 07:49:50 +1000 (AEST) Received: from localhost ([::1]:42358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx76-0004eW-OC for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:49:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLw-0004wu-As; Thu, 03 Sep 2020 17:01:04 -0400 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:38503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLt-0007ph-Gi; Thu, 03 Sep 2020 17:01:03 -0400 Received: by mail-oi1-x22a.google.com with SMTP id y6so4514799oie.5; Thu, 03 Sep 2020 14:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J5mrcebEEpiZtia/WaO3DA7r7OpI7bIX2tDGLHmyEhs=; b=nwEX8IKyKQ6TAIjvlR2cfpkbAihlKBEihOhbC/fOnOiMXJ9pUJxOPnSawUZGUABA2p bPTHgS5cTadspvYZHFMP4h9I8YM0L0R+co3E30Z7ph4AjeIR7HB1RvRXxEOkwtRTO2dV TGmyOwR1WBRElufNieK0Zpk/YPoDaiAogwtvoPDDh3Eq3JyTzlT87evFM0RZPm7QfVvm aeJ2SdNEz1ir2uDIhFX7BiZLqa5whvDc5TpzCZyxvZVb21dirxsves9YELD242gRBTG9 kndy2NuMBc9jNIrYqETHd+z2/MG5lkHiBIJT7IiTJUZCYzcmUbt2d0WYXSZ0QTCDVlxr j9tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=J5mrcebEEpiZtia/WaO3DA7r7OpI7bIX2tDGLHmyEhs=; b=kF2qCqg5474k4bM/CCht0fIwPCuMh3vmC/HlDXhSdBRtcQ6daj9AXsKhVf2B+3nBrR TyKWwW9UryMsfk0LQQviRY3QpgMXryrtyMOhNSfk3Nn0DMjtfG6fVpT3g+CDJqJbTIQS Nywm50hYHWh6WOL6LClWiFEGcLQJaAGAQOz3NJYcbMHESu4vJxv4vAkR8UyCryeDUW95 DFozfJT5uVJ3TL1eiEyr/Img+gWJCgZvsAF4GtbH7fyavghypUcxe7LilFZl0mlVgnOt h8QvTzdQmqONgJKg312he84uoLrbsV0Nb6BREHx6uQ/Uxr61IaGG+oFjKsbMmX0TbTBF Fpbg== X-Gm-Message-State: AOAM532skcsyw6FRJsz8o/fSv6pgoOpa7A8F00jFLY9kxe2LwvEpBwqa 5/pl7wxMblVEqSPfkXTVdBHVwLs/6BPr3w== X-Google-Smtp-Source: ABdhPJypvYo3b+ibutqMHOkUgaTnTNWJsv5Lh1c4Kuv9x3z0NkReaNS8d62fwIhGRyHCuZ8lQdzvEA== X-Received: by 2002:aca:eb82:: with SMTP id j124mr3356100oih.39.1599166859683; Thu, 03 Sep 2020 14:00:59 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l3sm842867oom.18.2020.09.03.14.00.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:00:59 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 59/77] qdev: Fix device_add DRIVER,help to print to monitor Date: Thu, 3 Sep 2020 15:59:17 -0500 Message-Id: <20200903205935.27832-60-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=flukshun@gmail.com; helo=mail-oi1-x22a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-stable@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Markus Armbruster Help on device properties gets printed to stdout instead of the monitor. If you have the monitor anywhere else, no help for you. Broken when commit e1043d674d "qdev: use object_property_help()" accidentally switched from qemu_printf() to printf(). Switch right back. Fixes: e1043d674d792ff64aebae1a3eafc08b38a8a085 Cc: Marc-André Lureau Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster Message-Id: <20200714160202.3121879-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang Reviewed-by: Dr. David Alan Gilbert (cherry picked from commit 029afc4e76041e1a320530d97f99122a1b3d5da2) Signed-off-by: Michael Roth --- qdev-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qdev-monitor.c b/qdev-monitor.c index 9833b33549..6bf6339ff5 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -299,7 +299,7 @@ int qdev_device_help(QemuOpts *opts) } g_ptr_array_sort(array, (GCompareFunc)qemu_pstrcmp0); for (i = 0; i < array->len; i++) { - printf("%s\n", (char *)array->pdata[i]); + qemu_printf("%s\n", (char *)array->pdata[i]); } g_ptr_array_set_free_func(array, g_free); g_ptr_array_free(array, true); From patchwork Thu Sep 3 20:59:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=D6OtWzvO; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDz20BvBz9sTr for ; Fri, 4 Sep 2020 07:51:25 +1000 (AEST) Received: from localhost ([::1]:49092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx8b-0007W5-Gu for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLw-0004xH-Qx; Thu, 03 Sep 2020 17:01:04 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:38621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLv-0007qK-2y; Thu, 03 Sep 2020 17:01:04 -0400 Received: by mail-oi1-x244.google.com with SMTP id y6so4514878oie.5; Thu, 03 Sep 2020 14:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=6sopWa3b6iZGsfPhmep7blcBK54TQmJ/CkRAM88fyYE=; b=D6OtWzvOyBZyNVF95/oyLszPwT+KpsjiXUqf5If8bU/Qh9imETvmnlLZ5HBTscqARJ ib1/jSk1dY74B0l6b9KngunO2f0wpDC2qDGgara55qPNifZlF4K2WCbuHZGd7sQeO62b cZyo11JCQKog4m3OtBT++xIs2JJNfh8LmNIeXZT6LR8Q7lbiB0PizCs3yu7pJa1kOvqM sRAQwfDQPBUhFDVYleGZC4RT6HjiDK4RMyg2Av0jyRXT6UYD3OVrb5aTn/IpXbwAzv9C qtdTB9YpoypGG/G7pzhcsS8AduWxtG6pFjipkTeBosMK9oKfqyDpADDkKZvt37VrjBYD ZKzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=6sopWa3b6iZGsfPhmep7blcBK54TQmJ/CkRAM88fyYE=; b=PCGdQW9I2Bs8kc6Is/x0QXF74xEfeem/D+Q76g1xDc0p30RRQqm6ccWRKUPRuBp8Uh 06JcOH6wnIkLTG0uHc1JDkYvbZLZ/o2EEWaC5blFBM75vu/cO1fQdl0eJMNKDVanwFiZ GgouRplkDJnkhOl865PGiCJb8W3FpSS/b0dLpu04UM/w4gS5Inaxnmgbg2vyZAvagYAl TRDqLWUAlp+k3eWr1YkdwoSCNtxkVIKuoob3xG45tYjTH2XCpcMz40bbjUJZTEQfuCdb 7LYpHzRyGRD3j+xEi4k84wnFrf/LTNWrNCyxM4omXT9d0ThIssjqKfsbiIpkERt922Y9 iEWw== X-Gm-Message-State: AOAM530pzpVsPKQAE/y8azGeLVvxt/4FKEWvfOdtfVqz4mQOoIrqzngU Pg74ebj//4enax3s9h80bweVw1a4KidAKg== X-Google-Smtp-Source: ABdhPJwaXRhtMv8BjNSUOl5LHh7UrzWk7yp+3GyL2TEth7DIsNbbgZTJ7QJKGX6/mPSynAQSXDFwzw== X-Received: by 2002:aca:4b95:: with SMTP id y143mr3410873oia.121.1599166860982; Thu, 03 Sep 2020 14:01:00 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l23sm766436otk.79.2020.09.03.14.01.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:00 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 60/77] virtio-balloon: Prevent guest from starting a report when we didn't request one Date: Thu, 3 Sep 2020 15:59:18 -0500 Message-Id: <20200903205935.27832-61-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Duyck , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alexander Duyck Based on code review it appears possible for the driver to force the device out of a stopped state when hinting by repeating the last ID it was provided. Prevent this by only allowing a transition to the start state when we are in the requested state. This way the driver is only allowed to send one descriptor that will transition the device into the start state. All others will leave it in the stop state once it has finished. Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Acked-by: David Hildenbrand Signed-off-by: Alexander Duyck Message-Id: <20200720175115.21935.99563.stgit@localhost.localdomain> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 20a4da0f23078deeff5ea6d1e12f47d968d7c3c9) Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index e20f90dad4..a30a0c7bfa 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -466,7 +466,8 @@ static bool get_free_page_hints(VirtIOBalloon *dev) ret = false; goto out; } - if (id == dev->free_page_report_cmd_id) { + if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED && + id == dev->free_page_report_cmd_id) { dev->free_page_report_status = FREE_PAGE_REPORT_S_START; } else { /* From patchwork Thu Sep 3 20:59:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=PUB4EqqT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDtz5PF4z9sTr for ; Fri, 4 Sep 2020 07:47:55 +1000 (AEST) Received: from localhost ([::1]:35186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx5F-0001j5-LP for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:47:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwLz-0004zS-5E; Thu, 03 Sep 2020 17:01:08 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:39462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLx-0007rD-I7; Thu, 03 Sep 2020 17:01:06 -0400 Received: by mail-ot1-x343.google.com with SMTP id u25so4011160otq.6; Thu, 03 Sep 2020 14:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+zLfmnBFP/TeeGYdGSH1pa11E0h2MWm5y03tUduxidk=; b=PUB4EqqTypNgzUzN5URL9J7mB3WKH4hJB4uWdqshHaGw64dfMHaQLBgtXek2SyIYqj yqKFNbrft9aKaQMfGP6AkqsI/LQO0sKW9fLE46J4B1pnURzSE05QOwJPDKmhe0zkBU0k v3TQmqq1kPA9aXjtj55bZI3ASj+OSD2ELUMZPimO2G/sqTBobztQEB+B0H/70jaRRW6N UNEBtD5tHqmeHCu88cvxo8B4LA3igdbemY03mGwbw7TBEcj9diG7Z0/piqofa/qNefvT Z/J2exSQRhlbBKWdBk2XTU8oFJ/fdTDyWjrrf0oo/x8wrPd3CM3VS4PyFoa/96n+8vq/ VjGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+zLfmnBFP/TeeGYdGSH1pa11E0h2MWm5y03tUduxidk=; b=e/k77FUX+WdxMMZoNxDDC/+vME8clmvIdV2IA6Fya0j7vcOZnh0nFG/NWZysUWXAX1 KwA6QGce90hTOgPOojVykKZux3Qt+OKLs/HJ9cWrjaN1nkJQP1cWakbWsFLvnVVorFkt 3mssm1VcLulnFqkjlQsgucNkYnfSoroDd3X/mzY9mZFZq+UX86QsHJxsOpmt6sOyi7MG M7MgBvEy597Nmg4Zt3ki3D+LtWw+S6m7xQ6W9Sae+N1CvgLQUeUbMp5Bwk6Sd0jHFf2R Ch3qh8FXMPy6zFCaPLhjuYMxqaHG4Blh5MGQrw/pfSUq2dwRQOGuiMpUvtg88ZbLbhXm WT4A== X-Gm-Message-State: AOAM530RPmNlmZ0cxTD4uspbQ/FAnd6p2+l92c8l/4Z1knzNUmqajJC4 uyEAD2zfg3wlSe8YdsK50Q1SK0RM2xcFRA== X-Google-Smtp-Source: ABdhPJxXZT59Cwq7J9KCk365RRx4jaW/UHgqMF12aBI000tGNpMuIQL44oqULfMHyRfPEkLJqcMmew== X-Received: by 2002:a05:6830:4bb:: with SMTP id l27mr2956902otd.372.1599166863841; Thu, 03 Sep 2020 14:01:03 -0700 (PDT) Received: from localhost ([2600:1700:70:e488:ed8a:a712:8057:9526]) by smtp.gmail.com with ESMTPSA id g26sm775698otn.77.2020.09.03.14.01.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:03 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 61/77] virtio-balloon: Add locking to prevent possible race when starting hinting Date: Thu, 3 Sep 2020 15:59:19 -0500 Message-Id: <20200903205935.27832-62-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Duyck , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alexander Duyck There is already locking in place when we are stopping free page hinting but there is not similar protections in place when we start. I can only assume this was overlooked as in most cases the page hinting should not be occurring when we are starting the hinting, however there is still a chance we could be processing hints by the time we get back around to restarting the hinting so we are better off making sure to protect the state with the mutex lock rather than just updating the value with no protections. Based on feedback from Peter Maydell this issue had also been spotted by Coverity: CID 1430269 Acked-by: David Hildenbrand Signed-off-by: Alexander Duyck Message-Id: <20200720175122.21935.78013.stgit@localhost.localdomain> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 1a83e0b9c492a0eaeacd6fbb858fc81d04ab9c3e) Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a30a0c7bfa..d6e31de1d9 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -532,6 +532,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s) return; } + qemu_mutex_lock(&s->free_page_lock); + if (s->free_page_report_cmd_id == UINT_MAX) { s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; @@ -540,6 +542,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s) } s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED; + qemu_mutex_unlock(&s->free_page_lock); + virtio_notify_config(vdev); } From patchwork Thu Sep 3 20:59:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357015 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EM1Jf/jO; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDWm6vRJz9sTR for ; Fri, 4 Sep 2020 07:31:16 +1000 (AEST) Received: from localhost ([::1]:43910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwp8-0003qR-Sj for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:31:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwM0-0004zl-Js; Thu, 03 Sep 2020 17:01:10 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:36685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwLy-0007rj-QL; Thu, 03 Sep 2020 17:01:08 -0400 Received: by mail-oi1-x243.google.com with SMTP id x19so4535893oix.3; Thu, 03 Sep 2020 14:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=OBNgeqRx4bpj7whZl9Nqe1uUGZCI5XWKl7ZvXD57/RM=; b=EM1Jf/jOulJZ8qFNufvClh5XlmBbYtMw65yMz85r7W3UbzXG9ba8m6NiQXEBd2W746 N7PLgo1L9QJKYTsjTPerD5uSn+tNXpeZ5TIBKsijToaJROvnVK+6UQ65lSjVOhQS8+77 mT/jauay0mnzRsW/tdMPzpG8sZRVGa0cfnI8FLOgO96XwlUPj/Jrv0IqxYj5ixy0mkee 3srFEYSGVRcf+kzqP6jyQ+BDcFiXY2z3jSn3s/ELfl+dgxi9ztembWmsvxolBEigR3oJ g9gosWkrCcHwL9F7RcrpFl9BtULFZGERhece6psxXxH1WEwJ1DLSICg1lqZYDgkm0cuU Yuiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=OBNgeqRx4bpj7whZl9Nqe1uUGZCI5XWKl7ZvXD57/RM=; b=M7+M3r25wjaX7Cy7tOOcwlxuvgcydCgD2IcqVhdV1YjmlkLEPJdQxrUk8osMQ2PUxV D1P5TttqmOI+7xW1D1h2s3ZwaJDHpXFDZA62p/1z9fo1YO4uz6VBmr9sJw/thjMTTAZp FruXLD/gyYiRRkvtureBHQDF5WgA4KkeBfyTjn97Iqq76mj/4wkhr3YbdFJVyR8Z/87D 8JS0+QfagdGCIvr+HqhbSULwuZFekMoguD/UQOqtyZ9q8Jm+BmzvESa+13x1HFpbaLLE fCuDsoqmfbt18A9SxxlXm3EUFt5secq7920wks0gYUfHWMDAFjfKhAgeEkaqzs3RkTZP U0FA== X-Gm-Message-State: AOAM531WglEwZK2aOnf1cDUSBD5Q3Uy8uOvIO69XmLZyflU0G/2jQeuq Q8OfWciD2YcBb/YckD4+3ClO+nFh/5UKSQ== X-Google-Smtp-Source: ABdhPJz75tcfMw+vHfTPyDv3z7hv/nXY8YkMUZJga3pGDzEmq2rdRMrGuop0U3ge1l3P9ahldkImfg== X-Received: by 2002:aca:fc85:: with SMTP id a127mr3290379oii.148.1599166864926; Thu, 03 Sep 2020 14:01:04 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id l63sm712081oia.56.2020.09.03.14.01.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:04 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 62/77] virtio-balloon: always indicate S_DONE when migration fails Date: Thu, 3 Sep 2020 15:59:20 -0500 Message-Id: <20200903205935.27832-63-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::243; envelope-from=flukshun@gmail.com; helo=mail-oi1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Wang , "Michael S . Tsirkin" , qemu-stable@nongnu.org, Alexander Duyck , David Hildenbrand Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand If something goes wrong during precopy, before stopping the VM, we will never send a S_DONE indication to the VM, resulting in the hinted pages not getting released to be used by the guest OS (e.g., Linux). Easy to reproduce: 1. Start migration (e.g., HMP "migrate -d 'exec:gzip -c > STATEFILE.gz'") 2. Cancel migration (e.g., HMP "migrate_cancel") 3. Oberve in the guest (e.g., cat /proc/meminfo) that there is basically no free memory left. While at it, add similar locking to virtio_balloon_free_page_done() as done in virtio_balloon_free_page_stop. Locking is still weird, but that has to be sorted out separately. There is nothing to do in the PRECOPY_NOTIFY_COMPLETE case. Add some comments regarding S_DONE handling. Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Reviewed-by: Alexander Duyck Cc: Wei Wang Cc: Alexander Duyck Signed-off-by: David Hildenbrand Message-Id: <20200629080615.26022-1-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit dd8eeb9671fc881e613008bd20035b85fe45383d) Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index d6e31de1d9..6c75db123e 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -572,8 +572,13 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - s->free_page_report_status = FREE_PAGE_REPORT_S_DONE; - virtio_notify_config(vdev); + if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) { + /* See virtio_balloon_free_page_stop() */ + qemu_mutex_lock(&s->free_page_lock); + s->free_page_report_status = FREE_PAGE_REPORT_S_DONE; + qemu_mutex_unlock(&s->free_page_lock); + virtio_notify_config(vdev); + } } static int @@ -597,17 +602,26 @@ virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data) case PRECOPY_NOTIFY_SETUP: precopy_enable_free_page_optimization(); break; - case PRECOPY_NOTIFY_COMPLETE: - case PRECOPY_NOTIFY_CLEANUP: case PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC: virtio_balloon_free_page_stop(dev); break; case PRECOPY_NOTIFY_AFTER_BITMAP_SYNC: if (vdev->vm_running) { virtio_balloon_free_page_start(dev); - } else { - virtio_balloon_free_page_done(dev); + break; } + /* + * Set S_DONE before migrating the vmstate, so the guest will reuse + * all hinted pages once running on the destination. Fall through. + */ + case PRECOPY_NOTIFY_CLEANUP: + /* + * Especially, if something goes wrong during precopy or if migration + * is canceled, we have to properly communicate S_DONE to the VM. + */ + virtio_balloon_free_page_done(dev); + break; + case PRECOPY_NOTIFY_COMPLETE: break; default: virtio_error(vdev, "%s: %d reason unknown", __func__, pnd->reason); From patchwork Thu Sep 3 20:59:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aJyLKGfr; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDhS5Mszz9sSP for ; Fri, 4 Sep 2020 07:38:48 +1000 (AEST) Received: from localhost ([::1]:51020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwwQ-0001rV-HA for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwM3-00050h-Dy; Thu, 03 Sep 2020 17:01:12 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:42807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM0-0007sA-NM; Thu, 03 Sep 2020 17:01:11 -0400 Received: by mail-oi1-x242.google.com with SMTP id x14so4504714oic.9; Thu, 03 Sep 2020 14:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bENPocKW9pJTga5jwg+bAbqtRDswiJmyAs33gqjaesk=; b=aJyLKGfrIViSFMTXZtWpsjtbyiQoqxGO7txA/dxWXz8b/kSMpDV8lf36Rdf6vPgKhD SADSoGZbVl/qJvye0Vv6PzNYr/rRzvt79BHYUMFZHysn0rfMpDaNA/UB1xRImDVyCJNr sWOvT7k2qesY4VUVaIczbZa8ihhYfZWtpBHWG4u5k+bmz8GwGmscYS9As+578bYKfUn7 gsD6u+Q6RH3JFN8XrV292C0DS4N4qvqIygQNFPXJatp5gYbwHoHNO/cVl2Z64pEx4Mr5 2hJIsFZPOcQUrp6uLtMiOoGcxjlU8t4Htd3iYssskg/UDokSlcU9EgWZEuaUUKOiJT2Y ErKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bENPocKW9pJTga5jwg+bAbqtRDswiJmyAs33gqjaesk=; b=a2Ixu1RYBaRq1bRdHYbhXRLHSsOPre73exo8YnQU/Bbh0zEsriKgnfYr7FUcbYTyOT 3GhXLLB54xcB1ZxwHHe17x59XUHHM7acB686BYrEutyfy6vVTmihuVQiNmeFJ5lFOiMq 2xmkgg4ZgbOJwTdsL9JukZQO2BPQxDtgIyLIsV+UnwilnjQLdxy6MvfN9FkSKMFa+TOc eOj4gci12AKQJa9GnrqZ7uT178PvsYA0nWeGejqi0LVMl5cRyPH9HaEDVqGdJ8vlbuHl G43oqSfGzLuM4XrPGLoxoA64wdegqd2kuq49b0vPhyz7mP4IYEPWZfB/8gDs4TwjOt5U v3IA== X-Gm-Message-State: AOAM5305A3QZEjg0oVmE0C5qdzPgu4uMwgS6VUAUMwCe+FXiHusFT/Dw Dia1jvamjHp8hHwDk8yvFVB60C4J6JMFZQ== X-Google-Smtp-Source: ABdhPJyYqNfRESDDfEyeW+fcfu3Aq9JwxQyANp8w2DYPnhsw2VBnM4x5YdasYGNFLfeFz9EOiQ/xAw== X-Received: by 2002:aca:ab07:: with SMTP id u7mr3435917oie.115.1599166866184; Thu, 03 Sep 2020 14:01:06 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id b65sm761913otc.42.2020.09.03.14.01.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:05 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 63/77] linux-headers: update against Linux 5.7-rc3 Date: Thu, 3 Sep 2020 15:59:21 -0500 Message-Id: <20200903205935.27832-64-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::242; envelope-from=flukshun@gmail.com; helo=mail-oi1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cornelia Huck commit 6a8b55ed4056ea5559ebe4f6a4b247f627870d4c Reviewed-by: Michael S. Tsirkin # virtio/vhost parts Signed-off-by: Cornelia Huck Message-Id: <20200427102415.10915-3-cohuck@redhat.com> (cherry picked from commit dc6f8d458a4ccc360723993f31d310d06469f55f) *dep for 3219b42f02 Signed-off-by: Michael Roth --- include/standard-headers/linux/ethtool.h | 10 +- .../linux/input-event-codes.h | 5 +- include/standard-headers/linux/pci_regs.h | 2 + include/standard-headers/linux/vhost_types.h | 8 ++ .../standard-headers/linux/virtio_balloon.h | 12 ++- include/standard-headers/linux/virtio_ids.h | 1 + include/standard-headers/linux/virtio_net.h | 102 +++++++++++++++++- linux-headers/COPYING | 2 + linux-headers/asm-x86/kvm.h | 1 + linux-headers/asm-x86/unistd_32.h | 1 + linux-headers/asm-x86/unistd_64.h | 1 + linux-headers/asm-x86/unistd_x32.h | 1 + linux-headers/linux/kvm.h | 47 +++++++- linux-headers/linux/mman.h | 5 +- linux-headers/linux/userfaultfd.h | 40 +++++-- linux-headers/linux/vfio.h | 37 +++++++ linux-headers/linux/vhost.h | 24 +++++ 17 files changed, 280 insertions(+), 19 deletions(-) diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h index 8adf3b018b..1200890c86 100644 --- a/include/standard-headers/linux/ethtool.h +++ b/include/standard-headers/linux/ethtool.h @@ -596,6 +596,9 @@ struct ethtool_pauseparam { * @ETH_SS_LINK_MODES: link mode names * @ETH_SS_MSG_CLASSES: debug message class names * @ETH_SS_WOL_MODES: wake-on-lan modes + * @ETH_SS_SOF_TIMESTAMPING: SOF_TIMESTAMPING_* flags + * @ETH_SS_TS_TX_TYPES: timestamping Tx types + * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters */ enum ethtool_stringset { ETH_SS_TEST = 0, @@ -610,6 +613,9 @@ enum ethtool_stringset { ETH_SS_LINK_MODES, ETH_SS_MSG_CLASSES, ETH_SS_WOL_MODES, + ETH_SS_SOF_TIMESTAMPING, + ETH_SS_TS_TX_TYPES, + ETH_SS_TS_RX_FILTERS, /* add new constants above here */ ETH_SS_COUNT @@ -1330,6 +1336,7 @@ enum ethtool_fec_config_bits { ETHTOOL_FEC_OFF_BIT, ETHTOOL_FEC_RS_BIT, ETHTOOL_FEC_BASER_BIT, + ETHTOOL_FEC_LLRS_BIT, }; #define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT) @@ -1337,6 +1344,7 @@ enum ethtool_fec_config_bits { #define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT) #define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT) #define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT) +#define ETHTOOL_FEC_LLRS (1 << ETHTOOL_FEC_LLRS_BIT) /* CMDs currently supported */ #define ETHTOOL_GSET 0x00000001 /* DEPRECATED, Get settings. @@ -1521,7 +1529,7 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71, ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72, ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73, - + ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 74, /* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS }; diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h index b484c25289..ebf72c1031 100644 --- a/include/standard-headers/linux/input-event-codes.h +++ b/include/standard-headers/linux/input-event-codes.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* * Input event codes * @@ -652,6 +652,9 @@ /* Electronic privacy screen control */ #define KEY_PRIVACY_SCREEN_TOGGLE 0x279 +/* Select an area of screen to be copied */ +#define KEY_SELECTIVE_SCREENSHOT 0x27a + /* * Some keyboards have keys which do not have a defined meaning, these keys * are intended to be programmed / bound to macros by the user. For most diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h index 5437690483..f9701410d3 100644 --- a/include/standard-headers/linux/pci_regs.h +++ b/include/standard-headers/linux/pci_regs.h @@ -605,6 +605,7 @@ #define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */ #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ +#define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */ #define PCI_EXP_SLTSTA 26 /* Slot Status */ #define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */ #define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */ @@ -680,6 +681,7 @@ #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */ #define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */ +#define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */ #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ #define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */ diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-headers/linux/vhost_types.h index 5351fe172d..a678d8fbaa 100644 --- a/include/standard-headers/linux/vhost_types.h +++ b/include/standard-headers/linux/vhost_types.h @@ -119,6 +119,14 @@ struct vhost_scsi_target { unsigned short reserved; }; +/* VHOST_VDPA specific definitions */ + +struct vhost_vdpa_config { + uint32_t off; + uint32_t len; + uint8_t buf[0]; +}; + /* Feature bits */ /* Log all write descriptors. Can be changed while device is active. */ #define VHOST_F_LOG_ALL 26 diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h index 9375ca2a70..f343bfefd8 100644 --- a/include/standard-headers/linux/virtio_balloon.h +++ b/include/standard-headers/linux/virtio_balloon.h @@ -36,6 +36,7 @@ #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM 2 /* Deflate balloon on OOM */ #define VIRTIO_BALLOON_F_FREE_PAGE_HINT 3 /* VQ to report free pages */ #define VIRTIO_BALLOON_F_PAGE_POISON 4 /* Guest is using page poisoning */ +#define VIRTIO_BALLOON_F_REPORTING 5 /* Page reporting virtqueue */ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 @@ -47,8 +48,15 @@ struct virtio_balloon_config { uint32_t num_pages; /* Number of pages we've actually got in balloon. */ uint32_t actual; - /* Free page report command id, readonly by guest */ - uint32_t free_page_report_cmd_id; + /* + * Free page hint command id, readonly by guest. + * Was previously named free_page_report_cmd_id so we + * need to carry that name for legacy support. + */ + union { + uint32_t free_page_hint_cmd_id; + uint32_t free_page_report_cmd_id; /* deprecated */ + }; /* Stores PAGE_POISON if page poisoning is in use */ uint32_t poison_val; }; diff --git a/include/standard-headers/linux/virtio_ids.h b/include/standard-headers/linux/virtio_ids.h index 585e07b273..ecc27a1740 100644 --- a/include/standard-headers/linux/virtio_ids.h +++ b/include/standard-headers/linux/virtio_ids.h @@ -46,5 +46,6 @@ #define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */ #define VIRTIO_ID_FS 26 /* virtio filesystem */ #define VIRTIO_ID_PMEM 27 /* virtio pmem */ +#define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */ #endif /* _LINUX_VIRTIO_IDS_H */ diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h index 260c3681d7..a90f79e1b1 100644 --- a/include/standard-headers/linux/virtio_net.h +++ b/include/standard-headers/linux/virtio_net.h @@ -57,6 +57,9 @@ * Steering */ #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ +#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */ +#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */ +#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */ #define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device * with the same MAC. */ @@ -69,6 +72,17 @@ #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ +/* supported/enabled hash types */ +#define VIRTIO_NET_RSS_HASH_TYPE_IPv4 (1 << 0) +#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4 (1 << 1) +#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4 (1 << 2) +#define VIRTIO_NET_RSS_HASH_TYPE_IPv6 (1 << 3) +#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6 (1 << 4) +#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6 (1 << 5) +#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX (1 << 6) +#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX (1 << 7) +#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX (1 << 8) + struct virtio_net_config { /* The config defining mac address (if VIRTIO_NET_F_MAC) */ uint8_t mac[ETH_ALEN]; @@ -92,6 +106,12 @@ struct virtio_net_config { * Any other value stands for unknown. */ uint8_t duplex; + /* maximum size of RSS key */ + uint8_t rss_max_key_size; + /* maximum number of indirection table entries */ + uint16_t rss_max_indirection_table_length; + /* bitmask of supported VIRTIO_NET_RSS_HASH_ types */ + uint32_t supported_hash_types; } QEMU_PACKED; /* @@ -104,6 +124,7 @@ struct virtio_net_config { struct virtio_net_hdr_v1 { #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */ #define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */ +#define VIRTIO_NET_HDR_F_RSC_INFO 4 /* rsc info in csum_ fields */ uint8_t flags; #define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */ #define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ @@ -113,11 +134,46 @@ struct virtio_net_hdr_v1 { uint8_t gso_type; __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ __virtio16 gso_size; /* Bytes to append to hdr_len per frame */ - __virtio16 csum_start; /* Position to start checksumming from */ - __virtio16 csum_offset; /* Offset after that to place checksum */ + union { + struct { + __virtio16 csum_start; + __virtio16 csum_offset; + }; + /* Checksum calculation */ + struct { + /* Position to start checksumming from */ + __virtio16 start; + /* Offset after that to place checksum */ + __virtio16 offset; + } csum; + /* Receive Segment Coalescing */ + struct { + /* Number of coalesced segments */ + uint16_t segments; + /* Number of duplicated acks */ + uint16_t dup_acks; + } rsc; + }; __virtio16 num_buffers; /* Number of merged rx buffers */ }; +struct virtio_net_hdr_v1_hash { + struct virtio_net_hdr_v1 hdr; + uint32_t hash_value; +#define VIRTIO_NET_HASH_REPORT_NONE 0 +#define VIRTIO_NET_HASH_REPORT_IPv4 1 +#define VIRTIO_NET_HASH_REPORT_TCPv4 2 +#define VIRTIO_NET_HASH_REPORT_UDPv4 3 +#define VIRTIO_NET_HASH_REPORT_IPv6 4 +#define VIRTIO_NET_HASH_REPORT_TCPv6 5 +#define VIRTIO_NET_HASH_REPORT_UDPv6 6 +#define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 +#define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 +#define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 + uint16_t hash_report; + uint16_t padding; +}; + #ifndef VIRTIO_NET_NO_LEGACY /* This header comes first in the scatter-gather list. * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must @@ -228,7 +284,9 @@ struct virtio_net_ctrl_mac { /* * Control Receive Flow Steering - * + */ +#define VIRTIO_NET_CTRL_MQ 4 +/* * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET * enables Receive Flow Steering, specifying the number of the transmit and * receive queues that will be used. After the command is consumed and acked by @@ -241,11 +299,47 @@ struct virtio_net_ctrl_mq { __virtio16 virtqueue_pairs; }; -#define VIRTIO_NET_CTRL_MQ 4 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000 +/* + * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as + * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures + * the receive steering to use a hash calculated for incoming packet + * to decide on receive virtqueue to place the packet. The command + * also provides parameters to calculate a hash and receive virtqueue. + */ +struct virtio_net_rss_config { + uint32_t hash_types; + uint16_t indirection_table_mask; + uint16_t unclassified_queue; + uint16_t indirection_table[1/* + indirection_table_mask */]; + uint16_t max_tx_vq; + uint8_t hash_key_length; + uint8_t hash_key_data[/* hash_key_length */]; +}; + + #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG 1 + +/* + * The command VIRTIO_NET_CTRL_MQ_HASH_CONFIG requests the device + * to include in the virtio header of the packet the value of the + * calculated hash and the report type of hash. It also provides + * parameters for hash calculation. The command requires feature + * VIRTIO_NET_F_HASH_REPORT to be negotiated to extend the + * layout of virtio header as defined in virtio_net_hdr_v1_hash. + */ +struct virtio_net_hash_config { + uint32_t hash_types; + /* for compatibility with virtio_net_rss_config */ + uint16_t reserved[4]; + uint8_t hash_key_length; + uint8_t hash_key_data[/* hash_key_length */]; +}; + + #define VIRTIO_NET_CTRL_MQ_HASH_CONFIG 2 + /* * Control network offloads * diff --git a/linux-headers/COPYING b/linux-headers/COPYING index da4cb28feb..a635a38ef9 100644 --- a/linux-headers/COPYING +++ b/linux-headers/COPYING @@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see: Documentation/process/license-rules.rst for more details. + +All contributions to the Linux Kernel are subject to this COPYING file. diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 503d3f42da..3f3f780c8c 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -390,6 +390,7 @@ struct kvm_sync_regs { #define KVM_STATE_NESTED_GUEST_MODE 0x00000001 #define KVM_STATE_NESTED_RUN_PENDING 0x00000002 #define KVM_STATE_NESTED_EVMCS 0x00000004 +#define KVM_STATE_NESTED_MTF_PENDING 0x00000008 #define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001 #define KVM_STATE_NESTED_SMM_VMXON 0x00000002 diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h index f6e06fcfbd..1e6c1a5867 100644 --- a/linux-headers/asm-x86/unistd_32.h +++ b/linux-headers/asm-x86/unistd_32.h @@ -429,4 +429,5 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 + #endif /* _ASM_X86_UNISTD_32_H */ diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h index 924f826d2d..6daf0aecb2 100644 --- a/linux-headers/asm-x86/unistd_64.h +++ b/linux-headers/asm-x86/unistd_64.h @@ -351,4 +351,5 @@ #define __NR_openat2 437 #define __NR_pidfd_getfd 438 + #endif /* _ASM_X86_UNISTD_64_H */ diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h index 010307757b..e3f17ef370 100644 --- a/linux-headers/asm-x86/unistd_x32.h +++ b/linux-headers/asm-x86/unistd_x32.h @@ -340,4 +340,5 @@ #define __NR_preadv2 (__X32_SYSCALL_BIT + 546) #define __NR_pwritev2 (__X32_SYSCALL_BIT + 547) + #endif /* _ASM_X86_UNISTD_X32_H */ diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 265099100e..9804495a46 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -474,12 +474,17 @@ struct kvm_s390_mem_op { __u32 size; /* amount of bytes */ __u32 op; /* type of operation */ __u64 buf; /* buffer in userspace */ - __u8 ar; /* the access register number */ - __u8 reserved[31]; /* should be set to 0 */ + union { + __u8 ar; /* the access register number */ + __u32 sida_offset; /* offset into the sida */ + __u8 reserved[32]; /* should be set to 0 */ + }; }; /* types for kvm_s390_mem_op->op */ #define KVM_S390_MEMOP_LOGICAL_READ 0 #define KVM_S390_MEMOP_LOGICAL_WRITE 1 +#define KVM_S390_MEMOP_SIDA_READ 2 +#define KVM_S390_MEMOP_SIDA_WRITE 3 /* flags for kvm_s390_mem_op->flags */ #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0) #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1) @@ -1010,6 +1015,8 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_ARM_NISV_TO_USER 177 #define KVM_CAP_ARM_INJECT_EXT_DABT 178 #define KVM_CAP_S390_VCPU_RESETS 179 +#define KVM_CAP_S390_PROTECTED 180 +#define KVM_CAP_PPC_SECURE_GUEST 181 #ifdef KVM_CAP_IRQ_ROUTING @@ -1478,6 +1485,39 @@ struct kvm_enc_region { #define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3) #define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4) +struct kvm_s390_pv_sec_parm { + __u64 origin; + __u64 length; +}; + +struct kvm_s390_pv_unp { + __u64 addr; + __u64 size; + __u64 tweak; +}; + +enum pv_cmd_id { + KVM_PV_ENABLE, + KVM_PV_DISABLE, + KVM_PV_SET_SEC_PARMS, + KVM_PV_UNPACK, + KVM_PV_VERIFY, + KVM_PV_PREP_RESET, + KVM_PV_UNSHARE_ALL, +}; + +struct kvm_pv_cmd { + __u32 cmd; /* Command to be executed */ + __u16 rc; /* Ultravisor return code */ + __u16 rrc; /* Ultravisor return reason code */ + __u64 data; /* Data or address */ + __u32 flags; /* flags for future extensions. Must be 0 for now */ + __u32 reserved[3]; +}; + +/* Available with KVM_CAP_S390_PROTECTED */ +#define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd) + /* Secure Encrypted Virtualization command */ enum sev_cmd_id { /* Guest initialization commands */ @@ -1628,4 +1668,7 @@ struct kvm_hyperv_eventfd { #define KVM_HYPERV_CONN_ID_MASK 0x00ffffff #define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) +#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) +#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) + #endif /* __LINUX_KVM_H */ diff --git a/linux-headers/linux/mman.h b/linux-headers/linux/mman.h index 1f6e2cd89c..51ea363759 100644 --- a/linux-headers/linux/mman.h +++ b/linux-headers/linux/mman.h @@ -5,8 +5,9 @@ #include #include -#define MREMAP_MAYMOVE 1 -#define MREMAP_FIXED 2 +#define MREMAP_MAYMOVE 1 +#define MREMAP_FIXED 2 +#define MREMAP_DONTUNMAP 4 #define OVERCOMMIT_GUESS 0 #define OVERCOMMIT_ALWAYS 1 diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h index ce78878d12..8d3996eb82 100644 --- a/linux-headers/linux/userfaultfd.h +++ b/linux-headers/linux/userfaultfd.h @@ -19,7 +19,8 @@ * means the userland is reading). */ #define UFFD_API ((__u64)0xAA) -#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \ +#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | \ + UFFD_FEATURE_EVENT_FORK | \ UFFD_FEATURE_EVENT_REMAP | \ UFFD_FEATURE_EVENT_REMOVE | \ UFFD_FEATURE_EVENT_UNMAP | \ @@ -34,7 +35,8 @@ #define UFFD_API_RANGE_IOCTLS \ ((__u64)1 << _UFFDIO_WAKE | \ (__u64)1 << _UFFDIO_COPY | \ - (__u64)1 << _UFFDIO_ZEROPAGE) + (__u64)1 << _UFFDIO_ZEROPAGE | \ + (__u64)1 << _UFFDIO_WRITEPROTECT) #define UFFD_API_RANGE_IOCTLS_BASIC \ ((__u64)1 << _UFFDIO_WAKE | \ (__u64)1 << _UFFDIO_COPY) @@ -52,6 +54,7 @@ #define _UFFDIO_WAKE (0x02) #define _UFFDIO_COPY (0x03) #define _UFFDIO_ZEROPAGE (0x04) +#define _UFFDIO_WRITEPROTECT (0x06) #define _UFFDIO_API (0x3F) /* userfaultfd ioctl ids */ @@ -68,6 +71,8 @@ struct uffdio_copy) #define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, \ struct uffdio_zeropage) +#define UFFDIO_WRITEPROTECT _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \ + struct uffdio_writeprotect) /* read() structure */ struct uffd_msg { @@ -203,13 +208,14 @@ struct uffdio_copy { __u64 dst; __u64 src; __u64 len; +#define UFFDIO_COPY_MODE_DONTWAKE ((__u64)1<<0) /* - * There will be a wrprotection flag later that allows to map - * pages wrprotected on the fly. And such a flag will be - * available if the wrprotection ioctl are implemented for the - * range according to the uffdio_register.ioctls. + * UFFDIO_COPY_MODE_WP will map the page write protected on + * the fly. UFFDIO_COPY_MODE_WP is available only if the + * write protected ioctl is implemented for the range + * according to the uffdio_register.ioctls. */ -#define UFFDIO_COPY_MODE_DONTWAKE ((__u64)1<<0) +#define UFFDIO_COPY_MODE_WP ((__u64)1<<1) __u64 mode; /* @@ -231,4 +237,24 @@ struct uffdio_zeropage { __s64 zeropage; }; +struct uffdio_writeprotect { + struct uffdio_range range; +/* + * UFFDIO_WRITEPROTECT_MODE_WP: set the flag to write protect a range, + * unset the flag to undo protection of a range which was previously + * write protected. + * + * UFFDIO_WRITEPROTECT_MODE_DONTWAKE: set the flag to avoid waking up + * any wait thread after the operation succeeds. + * + * NOTE: Write protecting a region (WP=1) is unrelated to page faults, + * therefore DONTWAKE flag is meaningless with WP=1. Removing write + * protection (WP=0) in response to a page fault wakes the faulting + * task unless DONTWAKE is set. + */ +#define UFFDIO_WRITEPROTECT_MODE_WP ((__u64)1<<0) +#define UFFDIO_WRITEPROTECT_MODE_DONTWAKE ((__u64)1<<1) + __u64 mode; +}; + #endif /* _LINUX_USERFAULTFD_H */ diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index fb10370d29..a41c452865 100644 --- a/linux-headers/linux/vfio.h +++ b/linux-headers/linux/vfio.h @@ -707,6 +707,43 @@ struct vfio_device_ioeventfd { #define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16) +/** + * VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17, + * struct vfio_device_feature) + * + * Get, set, or probe feature data of the device. The feature is selected + * using the FEATURE_MASK portion of the flags field. Support for a feature + * can be probed by setting both the FEATURE_MASK and PROBE bits. A probe + * may optionally include the GET and/or SET bits to determine read vs write + * access of the feature respectively. Probing a feature will return success + * if the feature is supported and all of the optionally indicated GET/SET + * methods are supported. The format of the data portion of the structure is + * specific to the given feature. The data portion is not required for + * probing. GET and SET are mutually exclusive, except for use with PROBE. + * + * Return 0 on success, -errno on failure. + */ +struct vfio_device_feature { + __u32 argsz; + __u32 flags; +#define VFIO_DEVICE_FEATURE_MASK (0xffff) /* 16-bit feature index */ +#define VFIO_DEVICE_FEATURE_GET (1 << 16) /* Get feature into data[] */ +#define VFIO_DEVICE_FEATURE_SET (1 << 17) /* Set feature from data[] */ +#define VFIO_DEVICE_FEATURE_PROBE (1 << 18) /* Probe feature support */ + __u8 data[]; +}; + +#define VFIO_DEVICE_FEATURE _IO(VFIO_TYPE, VFIO_BASE + 17) + +/* + * Provide support for setting a PCI VF Token, which is used as a shared + * secret between PF and VF drivers. This feature may only be set on a + * PCI SR-IOV PF when SR-IOV is enabled on the PF and there are no existing + * open VFs. Data provided when setting this feature is a 16-byte array + * (__u8 b[16]), representing a UUID. + */ +#define VFIO_DEVICE_FEATURE_PCI_VF_TOKEN (0) + /* -------- API for Type1 VFIO IOMMU -------- */ /** diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index 40d028eed6..9fe72e4b13 100644 --- a/linux-headers/linux/vhost.h +++ b/linux-headers/linux/vhost.h @@ -116,4 +116,28 @@ #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) +/* VHOST_VDPA specific defines */ + +/* Get the device id. The device ids follow the same definition of + * the device id defined in virtio-spec. + */ +#define VHOST_VDPA_GET_DEVICE_ID _IOR(VHOST_VIRTIO, 0x70, __u32) +/* Get and set the status. The status bits follow the same definition + * of the device status defined in virtio-spec. + */ +#define VHOST_VDPA_GET_STATUS _IOR(VHOST_VIRTIO, 0x71, __u8) +#define VHOST_VDPA_SET_STATUS _IOW(VHOST_VIRTIO, 0x72, __u8) +/* Get and set the device config. The device config follows the same + * definition of the device config defined in virtio-spec. + */ +#define VHOST_VDPA_GET_CONFIG _IOR(VHOST_VIRTIO, 0x73, \ + struct vhost_vdpa_config) +#define VHOST_VDPA_SET_CONFIG _IOW(VHOST_VIRTIO, 0x74, \ + struct vhost_vdpa_config) +/* Enable/disable the ring. */ +#define VHOST_VDPA_SET_VRING_ENABLE _IOW(VHOST_VIRTIO, 0x75, \ + struct vhost_vring_state) +/* Get the max ring size. */ +#define VHOST_VDPA_GET_VRING_NUM _IOR(VHOST_VIRTIO, 0x76, __u16) + #endif From patchwork Thu Sep 3 20:59:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=d0uJXFLJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDl66Qb0z9sTK for ; Fri, 4 Sep 2020 07:41:06 +1000 (AEST) Received: from localhost ([::1]:33916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwye-0006NO-9Q for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:41:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwM5-00051B-3Q; Thu, 03 Sep 2020 17:01:14 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:35991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM3-0007sZ-2V; Thu, 03 Sep 2020 17:01:12 -0400 Received: by mail-ot1-x343.google.com with SMTP id 109so4029350otv.3; Thu, 03 Sep 2020 14:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=NUUa27g9FfQTx3QwommjwexBmgSJ8H2h1dZRmi8V6X8=; b=d0uJXFLJHt4Toc92+hJF3kNGo7iNLBufaa4ccu+zsOS2HRaJ18VLAATstxsoiuxfMV Oy9hUMp8dgduAo/Ex5Jn9SYFUisC5A9UX78wgV3rCLtkdkwEVWExd0Ax523cACj29I8X rE8CtvYszWLcerOi+D4ohtQkq2xbEEAIP+5HX5CIRXD3n/M+iGqtmayuTLaPgwoh2aIs trFvM7U5Xep94Pa1uPU8nVk+yhYynjrqwTA+RBWrHhEba6M3Ipk/dZet7j/a97H91MDe cR+CXr6jleIourvlxGuzOKv3Wanh202jgCuhSIZ8JzhuyTZyJdthWRSRwttG2JzMs7di lXyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=NUUa27g9FfQTx3QwommjwexBmgSJ8H2h1dZRmi8V6X8=; b=rgFgX5kDlkxAum4YBJ8+F+ocfCBKHfDNgoNavNtfKad1XAdWpdSiMBVcrKyrBtzV27 tp3+eNPqN3x5BempvTlua3KX2jOjpNvgmGQLe00NlBAhmSDPjuAR94OUJv50EIzf9i2f yMUWxOIUGanEiYi5ZAWksQ67ZAq+Gh4Ze4N6pBi+ITshRbcr9Y3jX4/yeZjEq0gPC5Pm reV2OykvwPCatUjRfCsvPI/FX1HkH+zDRqWbtK4y5kkZH4FnZVdByg34gYG3ElkiUwLz 67Kcy6itlR88fCDAnGMnErZoXZ6nulhNwayKtU/HjzYEBbkVRjjlWcWuFyzLfmchP8LZ quGw== X-Gm-Message-State: AOAM530ZVxQ3r9loElSkFAYOzXBl4ZwzB6qbcTv2Jk1CWe2RjQJ9X5Zx 2EfbOzhgfeu30upiFAF3RJslKpmUdtxyQg== X-Google-Smtp-Source: ABdhPJxv+8eXCfAe0oNlFT351AN1+lEk6Pwq7FNB4waz3fWGKEL+YJIb2C4fHSrU4MpFExrdny/mUw== X-Received: by 2002:a9d:6d95:: with SMTP id x21mr3141137otp.339.1599166867760; Thu, 03 Sep 2020 14:01:07 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id p24sm731285oip.2.2020.09.03.14.01.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:06 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 64/77] virtio-balloon: Replace free page hinting references to 'report' with 'hint' Date: Thu, 3 Sep 2020 15:59:22 -0500 Message-Id: <20200903205935.27832-65-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Duyck , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alexander Duyck Recently a feature named Free Page Reporting was added to the virtio balloon. In order to avoid any confusion we should drop the use of the word 'report' when referring to Free Page Hinting. So what this patch does is go through and replace all instances of 'report' with 'hint" when we are referring to free page hinting. Acked-by: David Hildenbrand Signed-off-by: Alexander Duyck Message-Id: <20200720175128.21935.93927.stgit@localhost.localdomain> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 3219b42f025d4d7a9c463235e9f937ab38067de3) Conflicts: hw/virtio/virtio-balloon.c include/hw/virtio/virtio-balloon.h *drop context deps on 91b867191d and 7483cbbaf8 Signed-off-by: Michael Roth --- hw/virtio/virtio-balloon.c | 76 +++++++++++++++--------------- include/hw/virtio/virtio-balloon.h | 20 ++++---- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 6c75db123e..035d4e0665 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -466,22 +466,22 @@ static bool get_free_page_hints(VirtIOBalloon *dev) ret = false; goto out; } - if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED && - id == dev->free_page_report_cmd_id) { - dev->free_page_report_status = FREE_PAGE_REPORT_S_START; + if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED && + id == dev->free_page_hint_cmd_id) { + dev->free_page_hint_status = FREE_PAGE_HINT_S_START; } else { /* * Stop the optimization only when it has started. This * avoids a stale stop sign for the previous command. */ - if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) { - dev->free_page_report_status = FREE_PAGE_REPORT_S_STOP; + if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) { + dev->free_page_hint_status = FREE_PAGE_HINT_S_STOP; } } } if (elem->in_num) { - if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) { + if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) { qemu_guest_free_page_hint(elem->in_sg[0].iov_base, elem->in_sg[0].iov_len); } @@ -507,11 +507,11 @@ static void virtio_ballloon_get_free_page_hints(void *opaque) qemu_mutex_unlock(&dev->free_page_lock); virtio_notify(vdev, vq); /* - * Start to poll the vq once the reporting started. Otherwise, continue + * Start to poll the vq once the hinting started. Otherwise, continue * only when there are entries on the vq, which need to be given back. */ } while (continue_to_get_hints || - dev->free_page_report_status == FREE_PAGE_REPORT_S_START); + dev->free_page_hint_status == FREE_PAGE_HINT_S_START); virtio_queue_set_notification(vq, 1); } @@ -534,14 +534,14 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s) qemu_mutex_lock(&s->free_page_lock); - if (s->free_page_report_cmd_id == UINT_MAX) { - s->free_page_report_cmd_id = - VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; + if (s->free_page_hint_cmd_id == UINT_MAX) { + s->free_page_hint_cmd_id = + VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; } else { - s->free_page_report_cmd_id++; + s->free_page_hint_cmd_id++; } - s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED; + s->free_page_hint_status = FREE_PAGE_HINT_S_REQUESTED; qemu_mutex_unlock(&s->free_page_lock); virtio_notify_config(vdev); @@ -551,18 +551,18 @@ static void virtio_balloon_free_page_stop(VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - if (s->free_page_report_status != FREE_PAGE_REPORT_S_STOP) { + if (s->free_page_hint_status != FREE_PAGE_HINT_S_STOP) { /* * The lock also guarantees us that the * virtio_ballloon_get_free_page_hints exits after the - * free_page_report_status is set to S_STOP. + * free_page_hint_status is set to S_STOP. */ qemu_mutex_lock(&s->free_page_lock); /* - * The guest hasn't done the reporting, so host sends a notification - * to the guest to actively stop the reporting. + * The guest isn't done hinting, so send a notification + * to the guest to actively stop the hinting. */ - s->free_page_report_status = FREE_PAGE_REPORT_S_STOP; + s->free_page_hint_status = FREE_PAGE_HINT_S_STOP; qemu_mutex_unlock(&s->free_page_lock); virtio_notify_config(vdev); } @@ -572,20 +572,20 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) { + if (s->free_page_hint_status != FREE_PAGE_HINT_S_DONE) { /* See virtio_balloon_free_page_stop() */ qemu_mutex_lock(&s->free_page_lock); - s->free_page_report_status = FREE_PAGE_REPORT_S_DONE; + s->free_page_hint_status = FREE_PAGE_HINT_S_DONE; qemu_mutex_unlock(&s->free_page_lock); virtio_notify_config(vdev); } } static int -virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data) +virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data) { VirtIOBalloon *dev = container_of(n, VirtIOBalloon, - free_page_report_notify); + free_page_hint_notify); VirtIODevice *vdev = VIRTIO_DEVICE(dev); PrecopyNotifyData *pnd = data; @@ -643,7 +643,7 @@ static size_t virtio_balloon_config_size(VirtIOBalloon *s) if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { return offsetof(struct virtio_balloon_config, poison_val); } - return offsetof(struct virtio_balloon_config, free_page_report_cmd_id); + return offsetof(struct virtio_balloon_config, free_page_hint_cmd_id); } static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data) @@ -654,14 +654,14 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data) config.num_pages = cpu_to_le32(dev->num_pages); config.actual = cpu_to_le32(dev->actual); - if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED) { - config.free_page_report_cmd_id = - cpu_to_le32(dev->free_page_report_cmd_id); - } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_STOP) { - config.free_page_report_cmd_id = + if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED) { + config.free_page_hint_cmd_id = + cpu_to_le32(dev->free_page_hint_cmd_id); + } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_STOP) { + config.free_page_hint_cmd_id = cpu_to_le32(VIRTIO_BALLOON_CMD_ID_STOP); - } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) { - config.free_page_report_cmd_id = + } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_DONE) { + config.free_page_hint_cmd_id = cpu_to_le32(VIRTIO_BALLOON_CMD_ID_DONE); } @@ -762,14 +762,14 @@ static int virtio_balloon_post_load_device(void *opaque, int version_id) return 0; } -static const VMStateDescription vmstate_virtio_balloon_free_page_report = { +static const VMStateDescription vmstate_virtio_balloon_free_page_hint = { .name = "virtio-balloon-device/free-page-report", .version_id = 1, .minimum_version_id = 1, .needed = virtio_balloon_free_page_support, .fields = (VMStateField[]) { - VMSTATE_UINT32(free_page_report_cmd_id, VirtIOBalloon), - VMSTATE_UINT32(free_page_report_status, VirtIOBalloon), + VMSTATE_UINT32(free_page_hint_cmd_id, VirtIOBalloon), + VMSTATE_UINT32(free_page_hint_status, VirtIOBalloon), VMSTATE_END_OF_LIST() } }; @@ -785,7 +785,7 @@ static const VMStateDescription vmstate_virtio_balloon_device = { VMSTATE_END_OF_LIST() }, .subsections = (const VMStateDescription * []) { - &vmstate_virtio_balloon_free_page_report, + &vmstate_virtio_balloon_free_page_hint, NULL } }; @@ -823,7 +823,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp) VIRTIO_BALLOON_F_FREE_PAGE_HINT)) { s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE, virtio_balloon_handle_free_page_vq); - precopy_add_notifier(&s->free_page_report_notify); + precopy_add_notifier(&s->free_page_hint_notify); object_ref(OBJECT(s->iothread)); s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread), @@ -841,7 +841,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp) qemu_bh_delete(s->free_page_bh); object_unref(OBJECT(s->iothread)); virtio_balloon_free_page_stop(s); - precopy_remove_notifier(&s->free_page_report_notify); + precopy_remove_notifier(&s->free_page_hint_notify); } balloon_stats_destroy_timer(s); qemu_remove_balloon_handler(s); @@ -908,8 +908,8 @@ static void virtio_balloon_instance_init(Object *obj) qemu_mutex_init(&s->free_page_lock); qemu_cond_init(&s->free_page_cond); - s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN; - s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify; + s->free_page_hint_cmd_id = VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN; + s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify; object_property_add(obj, "guest-stats", "guest statistics", balloon_stats_get_all, NULL, NULL, s, NULL); diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index d1c968d237..108cff97e7 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -23,7 +23,7 @@ #define VIRTIO_BALLOON(obj) \ OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON) -#define VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN 0x80000000 +#define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000 typedef struct virtio_balloon_stat VirtIOBalloonStat; @@ -33,20 +33,20 @@ typedef struct virtio_balloon_stat_modern { uint64_t val; } VirtIOBalloonStatModern; -enum virtio_balloon_free_page_report_status { - FREE_PAGE_REPORT_S_STOP = 0, - FREE_PAGE_REPORT_S_REQUESTED = 1, - FREE_PAGE_REPORT_S_START = 2, - FREE_PAGE_REPORT_S_DONE = 3, +enum virtio_balloon_free_page_hint_status { + FREE_PAGE_HINT_S_STOP = 0, + FREE_PAGE_HINT_S_REQUESTED = 1, + FREE_PAGE_HINT_S_START = 2, + FREE_PAGE_HINT_S_DONE = 3, }; typedef struct VirtIOBalloon { VirtIODevice parent_obj; VirtQueue *ivq, *dvq, *svq, *free_page_vq; - uint32_t free_page_report_status; + uint32_t free_page_hint_status; uint32_t num_pages; uint32_t actual; - uint32_t free_page_report_cmd_id; + uint32_t free_page_hint_cmd_id; uint64_t stats[VIRTIO_BALLOON_S_NR]; VirtQueueElement *stats_vq_elem; size_t stats_vq_offset; @@ -55,7 +55,7 @@ typedef struct VirtIOBalloon { QEMUBH *free_page_bh; /* * Lock to synchronize threads to access the free page reporting related - * fields (e.g. free_page_report_status). + * fields (e.g. free_page_hint_status). */ QemuMutex free_page_lock; QemuCond free_page_cond; @@ -64,7 +64,7 @@ typedef struct VirtIOBalloon { * stopped. */ bool block_iothread; - NotifierWithReturn free_page_report_notify; + NotifierWithReturn free_page_hint_notify; int64_t stats_last_update; int64_t stats_poll_interval; uint32_t host_features; From patchwork Thu Sep 3 20:59:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=cYnhSvU/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDxG6BJ3z9sTr for ; Fri, 4 Sep 2020 07:49:54 +1000 (AEST) Received: from localhost ([::1]:42620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx79-0004kz-JQ for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:49:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwM4-00051A-SZ; Thu, 03 Sep 2020 17:01:13 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]:34350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM3-0007sf-5s; Thu, 03 Sep 2020 17:01:12 -0400 Received: by mail-oo1-xc29.google.com with SMTP id k63so1135286oob.1; Thu, 03 Sep 2020 14:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ooJ5JWX44T4rpsVTQbxVK9w+LAQEjZ1790XiAupTrvE=; b=cYnhSvU/5APT+omor5i3Awsj9iTcCzyuAF5bA/l9EI4PrN7otvAu3MEhZKF78vkYZ8 AX2CJ1sAfKGs0/t7UntU0PdCZQaBFTck38wW0a9jNGjSgCxFI8LUkvBRuUv2vkbC+Q1d hSD20VxrSIXstJblKSwUpCkNIFqO8HcVnTMrLdlzcflWAVHfeXXV8T/P1OaA6IeUP05P HZ2EM15h6jXlEOckjfthQLDIkc9inMcduKqeLcSl3c5uscEutv3Vqxb82Mi0mgh5Yi7v Fwgkooh4eZqroxeWnm4rrfVtgAs2Ekn5A28Uonadg8cNJ/Y4oi8GpjbZ0CkQni0xs0FZ 2RSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ooJ5JWX44T4rpsVTQbxVK9w+LAQEjZ1790XiAupTrvE=; b=kO2fiqurucrOSPUA7mZ+HDorOkEveEAaPf54vpqWSAPlP4cugLFb/OLYbAr5RgaLfv knGsiesypq+8HYwEYUfx/Zo/NFYF5Stjl8IYzYPEoTRglcVY6VnPlSv+5VkXTAQNA3Pp brWyRICw75QjGwKhAjGBy+eyqm7DULr1vjI4gpX6zrJ3ZFmtu9pdzr75UflB7FRIDB53 VQYPfvy5mXC+Xq0diV7wbAYNfdDBtLf6v1+dpTithaWoSsu+5vXtEVHudnLSNrAheBxI QiumHnUHHTT1EHbZbr3JAoAi/Z5E/OfJrNgGPnhLH+fIkCug4FY1fUJv4izGqf9luy8b F4uA== X-Gm-Message-State: AOAM531eaYupr9jrV5/44HgXhW7VUdO0sy5arXzQ2w6GmESP+vwn0wed AvJZxCW0KAbT0TW5F2eh/JiTa1k/s0jE8g== X-Google-Smtp-Source: ABdhPJyrt/U04xIvJZzUVYMcbP/+B4V5yliYVgNS1ZJeIkJYJvEMJ/WKD6rDWMmPYyXbbkRSqGNAPA== X-Received: by 2002:a4a:d549:: with SMTP id q9mr3347752oos.74.1599166869225; Thu, 03 Sep 2020 14:01:09 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id e9sm814941oog.10.2020.09.03.14.01.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:08 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 65/77] virtio: list legacy-capable devices Date: Thu, 3 Sep 2020 15:59:23 -0500 Message-Id: <20200903205935.27832-66-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c29; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc29.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cornelia Huck Several types of virtio devices had already been around before the virtio standard was specified. These devices support virtio in legacy (and transitional) mode. Devices that have been added in the virtio standard are considered non-transitional (i.e. with no support for legacy virtio). Provide a helper function so virtio transports can figure that out easily. Signed-off-by: Cornelia Huck Message-Id: <20200707105446.677966-2-cohuck@redhat.com> Cc: qemu-stable@nongnu.org Acked-by: Halil Pasic Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 7c78bdd7a3d0086179331f10d1f6f8cdac34731a) Signed-off-by: Michael Roth --- hw/virtio/virtio.c | 25 +++++++++++++++++++++++++ include/hw/virtio/virtio.h | 2 ++ 2 files changed, 27 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index b6c8ef5bc0..398fd4a305 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -27,6 +27,7 @@ #include "hw/virtio/virtio-access.h" #include "sysemu/dma.h" #include "sysemu/runstate.h" +#include "standard-headers/linux/virtio_ids.h" /* * The alignment to use between consumer and producer parts of vring. @@ -3278,6 +3279,30 @@ void virtio_init(VirtIODevice *vdev, const char *name, vdev->use_guest_notifier_mask = true; } +/* + * Only devices that have already been around prior to defining the virtio + * standard support legacy mode; this includes devices not specified in the + * standard. All newer devices conform to the virtio standard only. + */ +bool virtio_legacy_allowed(VirtIODevice *vdev) +{ + switch (vdev->device_id) { + case VIRTIO_ID_NET: + case VIRTIO_ID_BLOCK: + case VIRTIO_ID_CONSOLE: + case VIRTIO_ID_RNG: + case VIRTIO_ID_BALLOON: + case VIRTIO_ID_RPMSG: + case VIRTIO_ID_SCSI: + case VIRTIO_ID_9P: + case VIRTIO_ID_RPROC_SERIAL: + case VIRTIO_ID_CAIF: + return true; + default: + return false; + } +} + hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n) { return vdev->vq[n].vring.desc; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b69d517496..198ffc7626 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -396,4 +396,6 @@ static inline bool virtio_device_disabled(VirtIODevice *vdev) return unlikely(vdev->disabled || vdev->broken); } +bool virtio_legacy_allowed(VirtIODevice *vdev); + #endif From patchwork Thu Sep 3 20:59:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EHVARZzr; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDn36mgqz9sTR for ; Fri, 4 Sep 2020 07:42:47 +1000 (AEST) Received: from localhost ([::1]:41906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx0H-0001IM-R9 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:42:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwM6-00051r-Hn; Thu, 03 Sep 2020 17:01:15 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:34068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM4-0007st-V3; Thu, 03 Sep 2020 17:01:14 -0400 Received: by mail-ot1-x332.google.com with SMTP id h17so3210601otr.1; Thu, 03 Sep 2020 14:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=MEvZmvR0w7xE2ynIxcSs7eM6zvrUrLkOXOPrCdnExrc=; b=EHVARZzruu/KPlIDrWXmbEK8SzjPDoBPrP213Sw4vVEv/ETNSwQ3+J09utdOCOdXLy v8hQl1dqYprtIYFzi2DDV1ELfl+KRdt181DF8t6VoFK+eACIxgfXlRDFFXw02MCqesWH 1axD5HMUfUjK6Sw/1m02UG2WoQay81nK/+mjDhbMKjT0fkB9yHOCYmkj1ALpfpTZRjFG ZNFai0xXGHza5azi9zy/n56NmM13u8RUPCugiroW3ZOK0Xb/h5ykXVHuflWNAqsIYdbr MBQftpqJXW6BrMMurehpUkEHRStJxGYE0uFbEfH7ULbjA9iA44MNYt35kfXNyCQZGLm3 nhwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=MEvZmvR0w7xE2ynIxcSs7eM6zvrUrLkOXOPrCdnExrc=; b=fx/o2ktpeCQqcH3JVsSDkim63q3en/X5Z48LUM9A13TdPRiJ/nC+iW6yhMYsepEl3X /9U9gdTOFSaK1lJYLx3g/Y+c9oeHcl0aHDh7J8kDaKhPjIq8eY5fLGCuMkhXOR3Jrp/x jAtMEx7zSZ8kDPPhQj+miSb8ntAkxrRlR20ywh+RHTEU6IQueyO/2B50pdvlqXyC7DDf Pc62neJOwx9a8OE10Vfuevwf3C+Ld0zVVADcDkG573WNzgp5xVQvo/sJVXALJf9XVhPN 20ri9bxFQD8qQSmGWV5wiJ5tuOwlm4YNogYH+2vDuEXtB2xCxXneGtx37ILNrHDwyjpB 9aYQ== X-Gm-Message-State: AOAM530eYwd/E1o4KFu6fAxChtozO4XWI7hxKMxjJw1bruduudnhYPKI g5VbmnEn1Zd8112x6SFX4BIhim3mw2H7zQ== X-Google-Smtp-Source: ABdhPJyJyLCTANyduaYarkhhRlhGRzO9m/cVeMwLioY1o2bStwQnmnE/dWD7V12NTVv+J6PlTctxgw== X-Received: by 2002:a9d:621a:: with SMTP id g26mr3233188otj.209.1599166870579; Thu, 03 Sep 2020 14:01:10 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 3sm767533otu.46.2020.09.03.14.01.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:10 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 66/77] virtio: verify that legacy support is not accidentally on Date: Thu, 3 Sep 2020 15:59:24 -0500 Message-Id: <20200903205935.27832-67-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=flukshun@gmail.com; helo=mail-ot1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Cornelia Huck If a virtio device does not have legacy support, make sure that it is actually off, and bail out if not. For virtio-pci, this means that any device without legacy support that has been specified to modern-only (or that has been forced to it) will work. For virtio-ccw, this duplicates the check that is currently done prior to realization for any device that explicitly specified no support for legacy. This catches devices that have not been fenced properly. Signed-off-by: Cornelia Huck Message-Id: <20200707105446.677966-3-cohuck@redhat.com> Cc: qemu-stable@nongnu.org Acked-by: Halil Pasic Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 9b3a35ec8236933ab958a4c3ad883163f1ca66e7) Signed-off-by: Michael Roth --- hw/s390x/virtio-ccw.c | 6 ++++++ hw/virtio/virtio-pci.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 64f928fc7d..c069719429 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1119,6 +1119,12 @@ static void virtio_ccw_device_plugged(DeviceState *d, Error **errp) dev->max_rev = 0; } + if (!virtio_ccw_rev_max(dev) && !virtio_legacy_allowed(vdev)) { + error_setg(errp, "Invalid value of property max_rev " + "(is %d expected >= 1)", virtio_ccw_rev_max(dev)); + return; + } + if (virtio_get_num_queues(vdev) > VIRTIO_QUEUE_MAX) { error_setg(errp, "The number of virtqueues %d " "exceeds virtio limit %d", n, diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 4cb784389c..2ca266e1cb 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1565,6 +1565,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) } if (legacy) { + if (!virtio_legacy_allowed(vdev)) { + error_setg(errp, "device is modern-only, use disable-legacy=on"); + return; + } if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) { error_setg(errp, "VIRTIO_F_IOMMU_PLATFORM was supported by" " neither legacy nor transitional device"); From patchwork Thu Sep 3 20:59:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZPl9B5Fz; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDzj5z1xz9sTr for ; Fri, 4 Sep 2020 07:52:01 +1000 (AEST) Received: from localhost ([::1]:51262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx9D-0008PF-PJ for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:51:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwM8-00052Y-9l; Thu, 03 Sep 2020 17:01:17 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:33364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM6-0007tE-Dh; Thu, 03 Sep 2020 17:01:15 -0400 Received: by mail-ot1-x332.google.com with SMTP id m12so1037932otr.0; Thu, 03 Sep 2020 14:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y3yC2SOnzE11vtRpT71Fc4IxJOCN3PFXC+OmZRbaviY=; b=ZPl9B5Fzq1R/hqw20AxD3H4qqtKxTa/lXYm+Tmk3eExvwymvFoyTzut0dC1WfLjIqD K5wDHLxDx81YFqSPJcGveId3LcCEop0Q2w8BjfDLsctbgcF1z6y/dS5klMyPi8zodpsP JlQWhGUDnbnkHZev6g0PHiZMcpOU/qAZoqCIbZ7O7LL7fSEzmdXsgK6KLa7/6g67jSBl 6hAps7dnF1RdSW6wrTNjDiO/L2YnOKC9hW3Srm5xSg9j8w9nSalo+zJe/+iqbZGHeHqQ xWdUbQwNJzp+tfLsX4X0GgshRo8GS0rAIUIFmLVmUtVQ9R7Yebv3S/VrPjqmOZg/S38z QUGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Y3yC2SOnzE11vtRpT71Fc4IxJOCN3PFXC+OmZRbaviY=; b=GvXGnC4ZzGS6WGWzI3wIuuJ0/U6/xJYJTPJpLIA6vNGghqLTKQuBzZM2VEReyXttsc vyEPj8ZYeWfM+i1aYNHmvOtU3rfyaYUoBN6stowTWXN6zaOy3Z8tE6XmkeWu6DpryccM /0Xfc2vagBCr049dBVTAnLnrAkPzU6dnAVR5cXpO2l4axfN7xXGJhkYfyfkhBG8mPhNc rnTlE7xp3RZQjZZJkfemog/jpPcOlR5LBxRin9OajJ6vaft0KymFbkdA9lLHJJ3EcgFe 4nPPUuPUDUv1dLsnBgw1NpY54hjgJvBfDZcupvIQf+wlPyB0gZ6d05SKsNfFBKrQnMU8 gEfQ== X-Gm-Message-State: AOAM531mna+6QwhMRIih45ty0fkZYtWBFnuefs0LA1+5Akrj9CtQ19+p IYGZIb61nS0rZ6SQMsVq0oC4IscqSQVRSQ== X-Google-Smtp-Source: ABdhPJxG8u0OcMNMEtQmHDl6WeqW/hTeDfHWLIldHXVV70RparNQ/X3+VWRVJ+ggemRtRuUZ6/IvGA== X-Received: by 2002:a05:6830:13d7:: with SMTP id e23mr3098746otq.98.1599166872334; Thu, 03 Sep 2020 14:01:12 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id t1sm855106ooi.27.2020.09.03.14.01.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:11 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 67/77] intel_iommu: Use correct shift for 256 bits qi descriptor Date: Thu, 3 Sep 2020 15:59:25 -0500 Message-Id: <20200903205935.27832-68-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=flukshun@gmail.com; helo=mail-ot1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liu Yi L , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Liu Yi L In chapter 10.4.23 of VT-d spec 3.0, Descriptor Width bit was introduced in VTD_IQA_REG. Software could set this bit to tell VT-d the QI descriptor from software would be 256 bits. Accordingly, the VTD_IQH_QH_SHIFT should be 5 when descriptor size is 256 bits. This patch adds the DW bit check when deciding the shift used to update VTD_IQH_REG. Signed-off-by: Liu Yi L Message-Id: <1593850035-35483-1-git-send-email-yi.l.liu@intel.com> Reviewed-by: Peter Xu Acked-by: Jason Wang Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit a4544c45e109ceee87ee8c19baff28be3890d788) Signed-off-by: Michael Roth --- hw/i386/intel_iommu.c | 7 ++++++- hw/i386/intel_iommu_internal.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index df7ad254ac..8703a2da42 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2549,6 +2549,11 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s) /* Try to fetch and process more Invalidation Descriptors */ static void vtd_fetch_inv_desc(IntelIOMMUState *s) { + int qi_shift; + + /* Refer to 10.4.23 of VT-d spec 3.0 */ + qi_shift = s->iq_dw ? VTD_IQH_QH_SHIFT_5 : VTD_IQH_QH_SHIFT_4; + trace_vtd_inv_qi_fetch(); if (s->iq_tail >= s->iq_size) { @@ -2567,7 +2572,7 @@ static void vtd_fetch_inv_desc(IntelIOMMUState *s) } /* Must update the IQH_REG in time */ vtd_set_quad_raw(s, DMAR_IQH_REG, - (((uint64_t)(s->iq_head)) << VTD_IQH_QH_SHIFT) & + (((uint64_t)(s->iq_head)) << qi_shift) & VTD_IQH_QH_MASK); } } diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 862033ebe6..3d5487fe2c 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -230,7 +230,8 @@ #define VTD_IQA_DW_MASK 0x800 /* IQH_REG */ -#define VTD_IQH_QH_SHIFT 4 +#define VTD_IQH_QH_SHIFT_4 4 +#define VTD_IQH_QH_SHIFT_5 5 #define VTD_IQH_QH_MASK 0x7fff0ULL /* ICS_REG */ From patchwork Thu Sep 3 20:59:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oQjL4VHb; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF234tVzz9sR4 for ; Fri, 4 Sep 2020 07:54:03 +1000 (AEST) Received: from localhost ([::1]:58284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxBB-0002tM-GE for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:54:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMB-00053X-82; Thu, 03 Sep 2020 17:01:19 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:34056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM8-0007tQ-D1; Thu, 03 Sep 2020 17:01:17 -0400 Received: by mail-ot1-x343.google.com with SMTP id h17so3210739otr.1; Thu, 03 Sep 2020 14:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=n/Y0ED6jz0ryYpBgvkE7oSql+mNnQ/ED8BzlFc5aOpo=; b=oQjL4VHbFjthDqTqh+7CgzXWbqRKSplmPXjIF7QiAVYkc1+JO8HkOwviNGDDkl1fSD HMJHBNgAqo1JOvnEKB48CkNP6MmOnwjSWJ1707topycQJd7uGz76hHND1pHsWfAVhLbb /q76evI+dJLSxwOv2jdinpYnhkdYcWct8TkU/n9kX8vIUmRgN3UtU8LGgyrq1pPo/yyf IoKZcMVCApVoCWTItRIBQ81qOJ0O1XRwRpURK3t/EN9+X0xyLJOYbdVSH3w6xUSjR5nF TUO+SpaPPQHBLO1Dv9QQ2aGz35TAiefiOW6lommVhWOgn36KwH3EpfTzSwyaePdWWhA2 jdUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=n/Y0ED6jz0ryYpBgvkE7oSql+mNnQ/ED8BzlFc5aOpo=; b=sSBPwKW5iEkpGmPQIII7LzpD9syE7M12hrX3OCxgjUtw9hDnjQQ783Hd47CP+JRc9e mg27lDT75PcEagfG8FWzQN5C4lpuMc5HO8D7f8DUm97cMUMIxT7ZHp/026wIVcdkf6KH 7vbvgLmCRSCPqWuQtTRQi5YUkkhG+7r0rF0FVEZnlHam+mqlT1riy9HqJ+qISKe8+HRQ 7aEVgXlSm5E9KZlWvBFmsKwEp25Aa6NDvU0DkHLplEaCRO8qQLTSv6VVAd+V3VD7AXfA /9SjnxE99gl7PueUGCpOBgJDIvAMNC4fSDGNlOi+U4TgIHWybsp1g2yKY0VXgcmD1ZqH J/Qw== X-Gm-Message-State: AOAM5326qHaxzeOCqa9d+Dvl8oCYe2rnMHWzeQvKBAl0BBxEZg+Yctfe fD60CqCQQH7haW3xknET6jEZ8ZSdyL9gBQ== X-Google-Smtp-Source: ABdhPJxjAw8KfmHTVuIJa9amBqio0ZRxQE+p2I2iruF+ViEeTxXfCrszfmyWrpwi1NSdRwzjHQrYRg== X-Received: by 2002:a9d:a6e:: with SMTP id 101mr2994077otg.80.1599166873456; Thu, 03 Sep 2020 14:01:13 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 91sm793490otn.18.2020.09.03.14.01.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:12 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 68/77] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks. Date: Thu, 3 Sep 2020 15:59:26 -0500 Message-Id: <20200903205935.27832-69-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=flukshun@gmail.com; helo=mail-ot1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Melnychenko , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Andrew Melnychenko There is an issue when callback may be called with invalid vdev. It happens on unplug when vdev already deleted and VirtIOPciProxy is not. So now, callbacks accept proxy device, and vdev retrieved from it. Technically memio callbacks should be removed during the flatview update, but memoryregions remain til PCI device(and it's address space) completely deleted. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1716352 Signed-off-by: Andrew Melnychenko Message-Id: <20200706112123.971087-1-andrew@daynix.com> Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit ccec7e9603f446fe75c6c563ba335c00cfda6a06) Signed-off-by: Michael Roth --- hw/virtio/virtio-pci.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 2ca266e1cb..ef11c66a21 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1317,11 +1317,12 @@ static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr, static void virtio_pci_notify_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - VirtIODevice *vdev = opaque; - VirtIOPCIProxy *proxy = VIRTIO_PCI(DEVICE(vdev)->parent_bus->parent); + VirtIOPCIProxy *proxy = opaque; + VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + unsigned queue = addr / virtio_pci_queue_mem_mult(proxy); - if (queue < VIRTIO_QUEUE_MAX) { + if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) { virtio_queue_notify(vdev, queue); } } @@ -1329,10 +1330,12 @@ static void virtio_pci_notify_write(void *opaque, hwaddr addr, static void virtio_pci_notify_write_pio(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - VirtIODevice *vdev = opaque; + VirtIOPCIProxy *proxy = opaque; + VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + unsigned queue = val; - if (queue < VIRTIO_QUEUE_MAX) { + if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) { virtio_queue_notify(vdev, queue); } } @@ -1356,9 +1359,14 @@ static void virtio_pci_isr_write(void *opaque, hwaddr addr, static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr, unsigned size) { - VirtIODevice *vdev = opaque; + VirtIOPCIProxy *proxy = opaque; + VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); uint64_t val = 0; + if (vdev == NULL) { + return val; + } + switch (size) { case 1: val = virtio_config_modern_readb(vdev, addr); @@ -1376,7 +1384,13 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr, static void virtio_pci_device_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - VirtIODevice *vdev = opaque; + VirtIOPCIProxy *proxy = opaque; + VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + + if (vdev == NULL) { + return; + } + switch (size) { case 1: virtio_config_modern_writeb(vdev, addr, val); @@ -1453,19 +1467,19 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) memory_region_init_io(&proxy->device.mr, OBJECT(proxy), &device_ops, - virtio_bus_get_device(&proxy->bus), + proxy, "virtio-pci-device", proxy->device.size); memory_region_init_io(&proxy->notify.mr, OBJECT(proxy), ¬ify_ops, - virtio_bus_get_device(&proxy->bus), + proxy, "virtio-pci-notify", proxy->notify.size); memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy), ¬ify_pio_ops, - virtio_bus_get_device(&proxy->bus), + proxy, "virtio-pci-notify-pio", proxy->notify_pio.size); } From patchwork Thu Sep 3 20:59:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=W0dnaJxy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDqB720tz9sTR for ; Fri, 4 Sep 2020 07:44:38 +1000 (AEST) Received: from localhost ([::1]:51156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx24-00052K-TC for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:44:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMB-00053W-8I; Thu, 03 Sep 2020 17:01:19 -0400 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]:35412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwM8-0007to-Dj; Thu, 03 Sep 2020 17:01:17 -0400 Received: by mail-oi1-x22f.google.com with SMTP id w16so4538889oia.2; Thu, 03 Sep 2020 14:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gp/FZKkqU04XfSMs8F0HgQ0MGLufMuTTwBeTutB4Yfc=; b=W0dnaJxyLxEtYVUQkNBcw94SnTLexrnfXoacpK8hj4/14ekxTOCFZffjuQDrlQeMW8 8c8i842QBlTBGnNow3sEUpV5BErW9ozafWYrw2dHaQevhVdhDzlVb0yIGlOsCGe5cv0a vSYpy0BkznZl0/dKU8vE4FyCATkI5vd7bYj4XFg65GVCD88h+KkBUEcbk7dhH5138Iyj V92FJHMazdYjZs6551FWkQqFC+ZuFv6Fc9BcyfUAOzhHbE1hKWmLhVJyK5Y6meBVlDib qOWJuD9y8WqNyFateEEc0b7bF504PsjaxGfc/RkYT2jZOetX6mJVzS9j6sOoG9kvf3Ul /tEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Gp/FZKkqU04XfSMs8F0HgQ0MGLufMuTTwBeTutB4Yfc=; b=WrWv6qLbiOABhtJlmHrIOipMT3kqZ0W8j7qzbEHyrRsLxxefWz+B/C0BZKOxDHiTo4 jaPrPDheWn2CczoBaguINGTEOsr8fBoKFtdtJK2zThkdJ/kfNCvfeMtv+Qp/6dmFHIjj t4Tkljmjmhz6+Q7QebXa0J3Z98Bq6VcydOQpz8HK55XvHujBK/FGhyNwp39gTusf7Ij/ cWU5EsO9hQsz5fwWHoaWj7jnvbYiX1rqioFyVjLFJl+48qnEPlzP1HIC37RArzVxhcK1 oiI9+XYxiln6Dg7LSj1m58FZNRgOVrLcb5MqeHvwQzff8dDT6wXTRflkm0/AcSDtEv+o KK5w== X-Gm-Message-State: AOAM530ikzARdlk5EASjTQn87h2Bn5r12c4QWSb4QXxt9oVFtYK1eQSj uXoWlumRV7JNxIcms27NcGtQMRQ2Z3OUzQ== X-Google-Smtp-Source: ABdhPJw0FKmpIMmf8R4+W5pubrGUqPcTL8IfyihYyCD7YNqT4kGmUwWFFhU6u/JrT4d2nHddRYWlsQ== X-Received: by 2002:aca:4403:: with SMTP id r3mr823175oia.94.1599166874742; Thu, 03 Sep 2020 14:01:14 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id b188sm716337oif.19.2020.09.03.14.01.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:14 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 69/77] libvhost-user: Report descriptor index on panic Date: Thu, 3 Sep 2020 15:59:27 -0500 Message-Id: <20200903205935.27832-70-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=flukshun@gmail.com; helo=mail-oi1-x22f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We want to report the index of the descriptor, not its pointer. Fixes: 7b2e5c65f4 ("contrib: add libvhost-user") Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200723171935.18535-1-philmd@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Raphael Norwitz Reviewed-by: Stefan Hajnoczi Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 8fe9805c73c277dc2feeaa83de73d6a58bf23f39) Signed-off-by: Michael Roth --- contrib/libvhost-user/libvhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index 3bca996c62..301f6d68b3 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -1867,7 +1867,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq, /* If their number is silly, that's a fatal mistake. */ if (*head >= vq->vring.num) { - vu_panic(dev, "Guest says index %u is available", head); + vu_panic(dev, "Guest says index %u is available", *head); return false; } @@ -1926,7 +1926,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc, smp_wmb(); if (*next >= max) { - vu_panic(dev, "Desc next is %u", next); + vu_panic(dev, "Desc next is %u", *next); return VIRTQUEUE_READ_DESC_ERROR; } From patchwork Thu Sep 3 20:59:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=BdRSvN1v; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDsz1t4Dz9sV8 for ; Fri, 4 Sep 2020 07:47:03 +1000 (AEST) Received: from localhost ([::1]:59712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx4P-0000CI-5x for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:47:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMJ-0005Ki-Hi; Thu, 03 Sep 2020 17:01:27 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:36470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMD-0007uw-T9; Thu, 03 Sep 2020 17:01:27 -0400 Received: by mail-ot1-x333.google.com with SMTP id 109so4029939otv.3; Thu, 03 Sep 2020 14:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8UZbDPwMe335VoDkpJh4Nr706sFcshFSpvnQAlENJwM=; b=BdRSvN1viCaDCG9ViRB3nlWlapUXzeSPvD6t4kevu9uXYcHbtzdzg4dtpqAoMmfC4k 4BrcsEMTQSzNA1cycwvX+4Cdg4fC6z97m1L8SHHp+2zB7l3PhnYOuPogWBENjZ55qhUF fOuguqU4D8bSeHCB2rLn5rhOPNKEUlFS9ubylvl7OBmyS7EJKeTMBfoDbqB5e2EcEexu 2QeP+GUmDwbNbCsqJ4a3p1zLqlzvvUoqhK6Ajv9O+71DxfLckiLpYnMFFiyhmEy4ppXR BVsHIXoqP8Sm4ZoDeWwmf0m4kMF2ITalnjmNfA9huKmJh15129OyhQ2RU3JQCncK/3sY X2DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8UZbDPwMe335VoDkpJh4Nr706sFcshFSpvnQAlENJwM=; b=owj9BRMihJj8y0RVoS2sqgd50IEFLHpHE0saHwyNQtJ+NF5QCAGApO/Cn8gtUTMEOC bQlHz+AsxsoSBMc/VSYpob/BH1bTP3EzSQWz1wcfBkWo3QYvQJbRGgW5KXzdudPBOqB+ rz52pfAHdTXLjlb/2dErra9NmfQbxhkDhrOs8eZSVzFxFn0xFAukG6wIiLMcFUIuafH6 jQnBt+Y0WbpzlVSYPFq4UAs+yu0tire/WNjRICLsujITKjsyKt3kEpnmJHR+M4231v3g nsbwzoKcSLvFrI5uePOMZ20uKzX4xN9QFyTPcivPd+6uBt+eClYqq6FJghxxdGNQxn2Q 0Vmg== X-Gm-Message-State: AOAM532TzAZjFt8yLs0cvoOJv0AqiTHDIx8xb3bZSNc3hAsX0aVUyWG9 miGgYPVlv6rRJIzg5S4g2CyZUcGadrcNwg== X-Google-Smtp-Source: ABdhPJy/fg0p15+IIZyth0nZBwNiy7gdl5nqEoPKc2xyDRZzkcKLQu9Kv8SsGDI9ZhEfNU435JZiog== X-Received: by 2002:a9d:171:: with SMTP id 104mr3040376otu.256.1599166876322; Thu, 03 Sep 2020 14:01:16 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id h24sm324714otj.33.2020.09.03.14.01.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:15 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 70/77] Update OpenBIOS images to 7f28286f built from submodule. Date: Thu, 3 Sep 2020 15:59:28 -0500 Message-Id: <20200903205935.27832-71-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=flukshun@gmail.com; helo=mail-ot1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Cc: qemu-stable@nongnu.org (cherry picked from commit 54414d0fb11314ede939ec80238787c5b2079f4e) Signed-off-by: Michael Roth --- pc-bios/openbios-ppc | Bin 696912 -> 696912 bytes pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes roms/openbios | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc index 1c9ab09af72daa1e382a95334e90a1d255d2a9bd..def6d4cf63380d2601f35e2320b38055b8c4d6f1 100644 GIT binary patch delta 30445 zcmZr&4_s8m_P;Y+6bNilNKnv4Q9w~qF&DvH5_4^_Ffp;Pmc+ytzOe9x&&6E?3xDAY zUG!jLVPRomVQ7nmg-`uuFM45V;R_WDi%JX2KUnPE-*@g^je5WReBjL%7T;hh{(!S=hwkYI_|qYd=4XaA{Lj+?jCD0sKJzSN zI~|c59%tcuuXLbgn03mj=%Ca_Ts`<6A#>ae^v%rRu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zG|0v=sBJ(H+_eR-RYnzU&uooXV7)4ab;J_%-Kn3fgSV_P-k;%F8 z9<^%w3^wkeKc5tMT9cw2EfnGE6wR@F6!VS>tHh!Ru(eke?{IT8g^BG;aMu0*U!Csr z`cGl$(4h-22iM;>SE9cA7zVZorSNb1tb5&8{)5IGt8al5570R;$%z7d~S)M%V)#qbwQ!7*>{{6c^TIP2m?G(F(0A!GT9u z<8&F^@kr9C|2KBCY?Ox&bBrG2YaB13HLE+PD`Pu=4eQ8MUKuqPu z?lcy{T^$_!2j%~>WJ{i{y7L;{`Hk+Wd)z~z`Y*YX)6)O| diff --git a/roms/openbios b/roms/openbios index 7e5b89e429..7f28286f5c 160000 --- a/roms/openbios +++ b/roms/openbios @@ -1 +1 @@ -Subproject commit 7e5b89e4295063d8eba55b9c8ce8bc681c2d129a +Subproject commit 7f28286f5cb1ca682e3ba0a8706d8884f12bc49e From patchwork Thu Sep 3 20:59:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZG9D6EGe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDZ53FB2z9sSP for ; Fri, 4 Sep 2020 07:33:17 +1000 (AEST) Received: from localhost ([::1]:53304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwr5-0007kG-9r for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:33:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMD-00058S-Um; Thu, 03 Sep 2020 17:01:21 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]:34353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMC-0007ub-6O; Thu, 03 Sep 2020 17:01:21 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id k63so1135379oob.1; Thu, 03 Sep 2020 14:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5RZT5c65N2inveAD4NSJ6yvBuDinvqkRBIn47Uw8RQo=; b=ZG9D6EGedpXkdaf31lj8tC4UHFbfFpmjul3uBFpfcF8LrbxsUPFymoFEmbjnfUsQ2+ Yx72FovkqHoaAZpPcqfAsC9TaLlB/ERke+kEbmB7sKpMnoHMINBiZd+BHGkC2fD1Zy9K ZKVMIWGhXB+QjH28SlA9FwHGmUMav5iDpib5YgXR7f8qftzw/sIsSgxoSXrHmX1Wt5u/ NKt3P9y13p7BQzEcGEKfi56CEE/kswPzr8lmg3k4m0r7x1XsH4rEsw2VmdHkjlnqSCNx g18y1mOSAXIJwCGgS6hCwozdcaWGItxFdw+QHrUzrzFWOgQ7wn7ZeubZQYjMxBLmfYNF qVNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5RZT5c65N2inveAD4NSJ6yvBuDinvqkRBIn47Uw8RQo=; b=W1s/sgY/7p/lFxUbI8XxkuHShVxyfw8mf/qU0v6uf1nV+LXwMyv+gTgggryrqbSrmw 4ogynOltb9sfxvIeveHYlFsbomDmml/ffskXZTx/J/g4+Zr0QrrRy/W/Kge5OHJ29Fh6 Mpzp2juPqfkYAiGDcA+I/T52011z7VuqGJvpBZjB0y+LYqlwQX0SVutPUPh94YGnD1Ba zyZVEAdY29qwi2oOa3WF4fgkN07Dw9fueyoLbG+vHu/rSwwGCHUT0rCVZCCBx2AWfmJH syf/vkin9Urv2NwgkLloLwTt15BOfH7DzT6sFMSOFb/gAtHE+pnn8nBws6/3eRDnS6rT Tqgg== X-Gm-Message-State: AOAM532+CPSHVadVRuSkXi5DNkBCzdb3JFtVj99eVlqHqG/h08OrNsfh 7/ecbtATq2vY4Qw3R4SLgDUptBcYimmZdQ== X-Google-Smtp-Source: ABdhPJzQQpluC1Y8YtuCuohjg3rsagUO4s8i7H/fF1RNw5sgUKz4eFbQrCdNaFwjJlsmmZ5mK0Z77w== X-Received: by 2002:a4a:5a06:: with SMTP id v6mr3367008ooa.22.1599166878534; Thu, 03 Sep 2020 14:01:18 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id v35sm763916otb.32.2020.09.03.14.01.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:17 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 71/77] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start Date: Thu, 3 Sep 2020 15:59:29 -0500 Message-Id: <20200903205935.27832-72-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::c2c; envelope-from=flukshun@gmail.com; helo=mail-oo1-xc2c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Vladimir Sementsov-Ogievskiy Using the _locked version of bdrv_enable_dirty_bitmap to bypass locking is wrong as we do not already own the mutex. Moreover, the adjacent call to bdrv_dirty_bitmap_enable_successor grabs the mutex. Fixes: 58f72b965e9e1q Cc: qemu-stable@nongnu.org # v3.0 Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Reviewed-by: Eric Blake Message-Id: <20200727194236.19551-8-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake (cherry picked from commit e6ce5e92248be5547daaee3eb6cd226e9820cf7b) Signed-off-by: Michael Roth --- migration/block-dirty-bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 7eafface61..16f1793ee3 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -498,7 +498,7 @@ void dirty_bitmap_mig_before_vm_start(void) DirtyBitmapLoadBitmapState *b = item->data; if (b->migrated) { - bdrv_enable_dirty_bitmap_locked(b->bitmap); + bdrv_enable_dirty_bitmap(b->bitmap); } else { bdrv_dirty_bitmap_enable_successor(b->bitmap); } From patchwork Thu Sep 3 20:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GndvPu3A; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF282L8mz9sR4 for ; Fri, 4 Sep 2020 07:54:08 +1000 (AEST) Received: from localhost ([::1]:58466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxBG-0002y7-6c for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:54:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMF-0005C0-Ad; Thu, 03 Sep 2020 17:01:23 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:37586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMD-0007un-ET; Thu, 03 Sep 2020 17:01:22 -0400 Received: by mail-oi1-x243.google.com with SMTP id e6so4530818oii.4; Thu, 03 Sep 2020 14:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=F7oBuPw2Gy+qGvdz894BU94j+ShqXQikgbDFVSsKbrY=; b=GndvPu3A1hgsuvcXKlLJ9kchrApbt6KknZc4A3O7EaT6KonEgE6giHY4eW0iG4xol3 /amPAY+I0XN290IUoodCK4ZGR4WRVlsoN5hCzY1WbvsPwDy0kPbtR4sq3kwOasD0zxqn SUlrsQkxkRMBXYgaXEerlohzFTPcAtQUn6qyX4jvTE1P13g8UbG36MooqO/cJ1sV7jpL x2i+p3TeLH8Lxt3CWjMPmSw4bwD/ZVmAAxIiKWnUDQ9QjT//YTx8ZcellqRj4wz8+bOG NjdIlZ8bQd7PM/o8uE1RgrTpSE7XrLe1A+urNtXsq1DEDSXCFm9FEdcZ+73sBKhDTCHF nZQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=F7oBuPw2Gy+qGvdz894BU94j+ShqXQikgbDFVSsKbrY=; b=BsQjxQ6p+MgNKImFtTH1w4Q7EaL1/EbOIKAB5WvZ7qkTMJdxVuyjCUE8/GsEDSAcyf SoRh/1Ls8H2/UJuEcXIcQuWQK4YQGAOoU/DzJA8eXwPstgw5O5UA72y7pkIM1YBEGMj1 Wr6IbQMFhCCylyxSnj2eVSI5hacNODN49RAxTTajcGyhNoa3QOfqqXqgdGctA8qx7sAd fW3qZRenbGnvOmfPTRiUMUo2b0s/dPsTMThaQfnrV0PDlRjPOFI86vcTaITefUL0Rdjh K6VjdymTHd1ubF7rlGFjxKgzQ3G7N9W6T5+LolS/6Kf0BSKgS1G+tMFEIbnr4iepvwYp vp6A== X-Gm-Message-State: AOAM532uZ/v2q3W5jtshQjhTOc37cpEk9X9N9VLsbkiFwLavyT0eY4th KaMZeZwFwe3XKZEgEfIv1QnnFKoRF8BAMQ== X-Google-Smtp-Source: ABdhPJwVh4BpARhvw4Dd7HCBv8KnMq0nujSwsYeCYf9x83quSLp5V/nN0F5Hamdhyq8rf/niSF4qZA== X-Received: by 2002:a05:6808:7c8:: with SMTP id f8mr3160952oij.119.1599166879648; Thu, 03 Sep 2020 14:01:19 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id x4sm725153oic.11.2020.09.03.14.01.18 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:19 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 72/77] block: Fix bdrv_aligned_p*v() for qiov_offset != 0 Date: Thu, 3 Sep 2020 15:59:30 -0500 Message-Id: <20200903205935.27832-73-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::243; envelope-from=flukshun@gmail.com; helo=mail-oi1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Max Reitz Since these functions take a @qiov_offset, they must always take it into account when working with @qiov. There are a couple of places where they do not, but they should. Fixes: 65cd4424b9df03bb5195351c33e04cbbecc0705c ("block/io: bdrv_aligned_preadv: use and support qiov_offset") Fixes: 28c4da28695bdbe04b336b2c9c463876cc3aaa6d ("block/io: bdrv_aligned_pwritev: use and support qiov_offset") Reported-by: Claudio Fontana Reported-by: Bruce Rogers Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Message-Id: <20200728120806.265916-2-mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Claudio Fontana Tested-by: Bruce Rogers (cherry picked from commit 134b7dec6ec2d90616d7986afb3b3b7ca7a4c383) Signed-off-by: Michael Roth --- block/io.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block/io.c b/block/io.c index aba67f66b9..496c813dd8 100644 --- a/block/io.c +++ b/block/io.c @@ -1501,12 +1501,13 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child, assert(num); ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining, - num, qiov, bytes - bytes_remaining, 0); + num, qiov, + qiov_offset + bytes - bytes_remaining, 0); max_bytes -= num; } else { num = bytes_remaining; - ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0, - bytes_remaining); + ret = qemu_iovec_memset(qiov, qiov_offset + bytes - bytes_remaining, + 0, bytes_remaining); } if (ret < 0) { goto out; @@ -2009,7 +2010,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child, } ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining, - num, qiov, bytes - bytes_remaining, + num, qiov, + qiov_offset + bytes - bytes_remaining, local_flags); if (ret < 0) { break; From patchwork Thu Sep 3 20:59:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ajidGXnS; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF4c6rd3z9sTr for ; Fri, 4 Sep 2020 07:56:16 +1000 (AEST) Received: from localhost ([::1]:38236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxDJ-0006c5-H8 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMG-0005Fl-QS; Thu, 03 Sep 2020 17:01:25 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:39224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMF-0007vC-4a; Thu, 03 Sep 2020 17:01:24 -0400 Received: by mail-ot1-x332.google.com with SMTP id u25so4011941otq.6; Thu, 03 Sep 2020 14:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=E70J8HSNM80vAgu3Ao3Q8OgYv6xE4YCHtBCrJzU2WUA=; b=ajidGXnSWBaH/GwIEMI1Hm9V2A2yedWl6ac4SRt4Lp3/DDRy3or7BijxgKTel4Qz8m F8LYry1WtlSkgOBbzXbc+pV/2iUa3Zgra6xbAEWbdNz2O71IPC1VqZrahbjdnPKtzgzQ u7l8D5mmjWRTdWtv6AvXZHDE5EruJJ04JFWypV8Hle5HaKtevvQG+y3ElJBwKTTBz2CF d6BCrzQRDQIEyMtqGcvfFMmf0K8lKTLMi6/70XEMYyQ0BpS5GeLPsnjSlwJ69PBM8a+G JqWaMLjF8CzwWOCQN/JMWzvGEw+BgE4rtBrAU7RWUwEYfmhaDFOsHRgVDAJedVXrWZiQ RkQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=E70J8HSNM80vAgu3Ao3Q8OgYv6xE4YCHtBCrJzU2WUA=; b=fEAe0V0jbrFR/KL8ogcV3CWdjnomSzmRBYJ7f4Bnrc6rSMq2TD+NWY9Y/Ex7/v98ZK I7uLB6WrZVXkVSGf2rA+bZVDuOwEtGJv+KALU/Vjxi0TLPhdQyRa4igCd3oIXtZVh263 DYxswEKLbaigZK5o+X0hE8ZlHmmMX1MeObMDdqrnEoAPTKyKBYZui2UzuTSlw4kBO6Mu ftJVCAgDCMA9bE00b1xNXzHMybypvQFhoAnmzrERg/KOw3iqzWsgMa+CYdtMG7INGta7 LYRiuOWaZjBmg+A8E9GTRUka0QKPBR72KJbBcYB0U4yKTGrFdvTqqf7MCLWyiT/cWnfe Cdew== X-Gm-Message-State: AOAM532cb0DcJF5HBF6nE2OlfYHGAn7qME8Wk/ZGpWKhjxVaN/RuIVz+ akWBPe/pC1xZKbh+drynvwd7WbeeVUArVA== X-Google-Smtp-Source: ABdhPJzXySGpZPVLjP7vOorjlMkpNhGQPAJfx5GEt8rwqFzqZ+hUAwqIIr2Oe8jg0FFtKSqjOzjtLw== X-Received: by 2002:a9d:7618:: with SMTP id k24mr3225209otl.34.1599166881283; Thu, 03 Sep 2020 14:01:21 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id 68sm771492otw.3.2020.09.03.14.01.19 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:20 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 73/77] iotests/028: Add test for cross-base-EOF reads Date: Thu, 3 Sep 2020 15:59:31 -0500 Message-Id: <20200903205935.27832-74-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=flukshun@gmail.com; helo=mail-ot1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20200728120806.265916-3-mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy Tested-by: Claudio Fontana (cherry picked from commit ae159450e161b3e1e2c5b815d19632abbbbcd1a1) Signed-off-by: Michael Roth --- tests/qemu-iotests/028 | 19 +++++++++++++++++++ tests/qemu-iotests/028.out | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028 index 797dae5350..1e52986b74 100755 --- a/tests/qemu-iotests/028 +++ b/tests/qemu-iotests/028 @@ -142,6 +142,25 @@ TEST_IMG="${TEST_IMG}.copy" io_zero readv $(( offset + 32 * 1024 )) 512 1024 32 _check_test_img +echo +echo '=== Reading across backing EOF in one operation ===' +echo + +# Use a cluster boundary as the base end here +base_size=$((3 * 1024 * 1024 * 1024)) + +TEST_IMG="$TEST_IMG.base" _make_test_img $base_size +_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size + +# Write 16 times 42 at the end of the base image +$QEMU_IO -c "write -P 42 $((base_size - 16)) 16" "$TEST_IMG.base" \ + | _filter_qemu_io + +# Read 32 bytes across the base EOF from the top; +# should be 16 times 0x2a, then 16 times 0x00 +$QEMU_IO -c "read -v $((base_size - 16)) 32" "$TEST_IMG" \ + | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out index 37aed84436..51ae06d38f 100644 --- a/tests/qemu-iotests/028.out +++ b/tests/qemu-iotests/028.out @@ -730,4 +730,15 @@ read 512/512 bytes at offset 3221257728 read 512/512 bytes at offset 3221258752 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) No errors were found on the image. + +=== Reading across backing EOF in one operation === + +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221225472 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT +wrote 16/16 bytes at offset 3221225456 +16 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +bffffff0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ................ +c0000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ +read 32/32 bytes at offset 3221225456 +32 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) *** done From patchwork Thu Sep 3 20:59:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ePb5m9dl; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDcY3mStz9sPB for ; Fri, 4 Sep 2020 07:35:25 +1000 (AEST) Received: from localhost ([::1]:34746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwt9-0003QY-EP for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:35:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMI-0005Iv-MA; Thu, 03 Sep 2020 17:01:26 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:37276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMG-0007vO-LQ; Thu, 03 Sep 2020 17:01:26 -0400 Received: by mail-ot1-x333.google.com with SMTP id 37so4025703oto.4; Thu, 03 Sep 2020 14:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JAH928Qnnsu2tDkDklCgu+9iEjldTCiX63xa+JPkWRQ=; b=ePb5m9dlRBPpA2JY/NHJt/ygzSjENB1Tptyn6Y1auHksrimzBwICqB57RaMQm8E9Bq qalsYwEHSvlESi4ZIAbgeG2m5OzB+JY3e625b7KZvLgrXY2A6/QoTbYSKG6h0uHzHcXR 8vDkBBOCtS0kNoDCDkcGMXRssdnvqsMONzrnSSRONFO/e1tVYOaS+z/60SIMKIgTyB2v /UG+YOmwUNl/DfhbTfNwORHKM/g0Xb9a7Swd3Y/c2DtIRcKVsSAwIQDztgsJNRPmtWOu E9VOcZa6W4jL+kINcrhbyLUh3iQVNSc1I4oAF5FPJsFhNLuGMyNASxjKb8MjFC2a8Xss 6dZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JAH928Qnnsu2tDkDklCgu+9iEjldTCiX63xa+JPkWRQ=; b=GlXLr2ijMauHpzw4/zSqYS1IUvQYF2/nywmurrGoopTTVWa3prPjxGUzw/iaqkFnTa NSSImx9Qd0q3CwEY6a+HdW1vkupS+KPR6KbHyaIKVCtJlmPsClGeQkVrYlmzCppSYR0U 972Hw3YLXzImCZ1L5ntboV0uhtXncutwROLc1Q2Umk4tCoY7S7aChK6hIFlXZFS6rFnf XaXsht92c2koXPRGdVQhRXSW11W/5JXfOzjGeZR+InYJnstMm5X9e3cTmmcwNAAl0ww2 racIxoYeZHWuLfuJ/oQ03vFgb6UrifDQDIkChm38zWMkZy6NlulCkIQMx1ucd5GclRj7 A8OA== X-Gm-Message-State: AOAM5313+ixlZseq6LzarKI0i3Jq3JXztkY8EXfdZP2J/RVIRsCgan8T 5EG76I9w+wqaHsMmPCmyDX4Eu3ihUIaPGg== X-Google-Smtp-Source: ABdhPJzHOzj28XTF1ohpba1t7iotP8fR1XnvsjUuRryK87lOOZHSE28M9mgP3tgxTy1pBTGCW7X2uQ== X-Received: by 2002:a9d:6f05:: with SMTP id n5mr3219530otq.346.1599166882786; Thu, 03 Sep 2020 14:01:22 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id q15sm830950ooh.44.2020.09.03.14.01.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:22 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 74/77] nbd: Fix large trim/zero requests Date: Thu, 3 Sep 2020 15:59:32 -0500 Message-Id: <20200903205935.27832-75-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=flukshun@gmail.com; helo=mail-ot1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake Although qemu as NBD client limits requests to <2G, the NBD protocol allows clients to send requests almost all the way up to 4G. But because our block layer is not yet 64-bit clean, we accidentally wrap such requests into a negative size, and fail with EIO instead of performing the intended operation. The bug is visible in modern systems with something as simple as: $ qemu-img create -f qcow2 /tmp/image.img 5G $ sudo qemu-nbd --connect=/dev/nbd0 /tmp/image.img $ sudo blkdiscard /dev/nbd0 or with user-space only: $ truncate --size=3G file $ qemu-nbd -f raw file $ nbdsh -u nbd://localhost:10809 -c 'h.trim(3*1024*1024*1024,0)' Although both blk_co_pdiscard and blk_pwrite_zeroes currently return 0 on success, this is also a good time to fix our code to a more robust paradigm that treats all non-negative values as success. Alas, our iotests do not currently make it easy to add external dependencies on blkdiscard or nbdsh, so we have to rely on manual testing for now. This patch can be reverted when we later improve the overall block layer to be 64-bit clean, but for now, a minimal fix was deemed less risky prior to release. CC: qemu-stable@nongnu.org Fixes: 1f4d6d18ed Fixes: 1c6c4bb7f0 Fixes: https://github.com/systemd/systemd/issues/16242 Signed-off-by: Eric Blake Message-Id: <20200722212231.535072-1-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy [eblake: rework success tests to use >=0] (cherry picked from commit 890cbccb089db9e646cc1baea3be9dc060e3917b) Signed-off-by: Michael Roth --- nbd/server.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 20754e9ebc..0918173c1b 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -2365,8 +2365,17 @@ static coroutine_fn int nbd_handle_request(NBDClient *client, if (request->flags & NBD_CMD_FLAG_FAST_ZERO) { flags |= BDRV_REQ_NO_FALLBACK; } - ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset, - request->len, flags); + ret = 0; + /* FIXME simplify this when blk_pwrite_zeroes switches to 64-bit */ + while (ret >= 0 && request->len) { + int align = client->check_align ?: 1; + int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES, + align)); + ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset, + len, flags); + request->len -= len; + request->from += len; + } return nbd_send_generic_reply(client, request->handle, ret, "writing to file failed", errp); @@ -2380,9 +2389,18 @@ static coroutine_fn int nbd_handle_request(NBDClient *client, "flush failed", errp); case NBD_CMD_TRIM: - ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset, - request->len); - if (ret == 0 && request->flags & NBD_CMD_FLAG_FUA) { + ret = 0; + /* FIXME simplify this when blk_co_pdiscard switches to 64-bit */ + while (ret >= 0 && request->len) { + int align = client->check_align ?: 1; + int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES, + align)); + ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset, + len); + request->len -= len; + request->from += len; + } + if (ret >= 0 && request->flags & NBD_CMD_FLAG_FUA) { ret = blk_co_flush(exp->blk); } return nbd_send_generic_reply(client, request->handle, ret, From patchwork Thu Sep 3 20:59:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WEoSrUV/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF6t3SHjz9sTg for ; Fri, 4 Sep 2020 07:58:14 +1000 (AEST) Received: from localhost ([::1]:46754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxFE-00020r-Cz for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:58:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMK-0005N5-66; Thu, 03 Sep 2020 17:01:28 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:46537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMH-0007va-UX; Thu, 03 Sep 2020 17:01:27 -0400 Received: by mail-ot1-x342.google.com with SMTP id c10so3976922otm.13; Thu, 03 Sep 2020 14:01:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xAeCy0dkrFXli/MZ20SoEmseBhxRBmTMNlsNI00ND14=; b=WEoSrUV/LzAYl33ehfkdIN86+C4rVusYx4wewIllU8ElcV4YrtStVmYiGVvMyC23az e9P/8G0Y5Uh2vRXPdvTzjVEzFeR751XcONMtLiOU0NgqWQDU6yaN0wz/7ccBRcouvgs5 OFLTeq2C1yt8q9bLnNr3yygyi7S3yBRgPdE+HEn1CNe80cC4IviIDqaH3clfP3kpjKEG w9X7h63J2wkhcuta2/yLIO2bBf2YAHnGRg3Sqqz8Z2plENrEMLX7Y8bAI4OncGhHaIoB Vzqpu0Oks+fB7l9vy8qWB6uyJBUiZyno5Zn/biS0pNo0EC0CNnHEE2vsQBHHEg7s0TXP KIvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xAeCy0dkrFXli/MZ20SoEmseBhxRBmTMNlsNI00ND14=; b=W4RUlvkJFlsuqYxKIhgjPaUGj5nOVuYAbS+b6h0WiZwxq01N02L1qIXJ+4/OsT1bAZ lmww64aBRo2GQAK+4rFMWgWHrz9zzhweJ2SIEenh9xP58ZSjn/E0BT63m/j1hb7n3BN4 qbOPjTyzzZdWr2gx3/CuMbmGauf7S27xZXHh+ecqXd/ZO5Y3CltnN1XqIC6meyHSJiyp zYc0q/hVNsHDdeGe6CDU99aDps5S0WvO+64xHlrGR6X4ygCiqopR44Z2UOKPhb2g/9a1 c98JcPk8qlEXO0AZVgkVRHBBy2pGNxe7hZThA4uGJU1srKdir2rhM6D/uZ3oN/jFE439 z4Ag== X-Gm-Message-State: AOAM531bL6M1fNBhNxdVLqRWZlFzAmmgpExQUGDqnaIilX7bxWtSv4v6 ytAT40KbbTFNAs6az2zuwFJutDEsFATsWQ== X-Google-Smtp-Source: ABdhPJzwTbCsl+Lytgoj2z8kHwkjguW6nV3JVs+HNrcQ/RMCz466MkpnxiQYgkQnz5rRU09YZbXfNg== X-Received: by 2002:a9d:d35:: with SMTP id 50mr3064963oti.166.1599166884190; Thu, 03 Sep 2020 14:01:24 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id m21sm787351otr.36.2020.09.03.14.01.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:23 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 75/77] virtio-net: align RSC fields with updated virtio-net header Date: Thu, 3 Sep 2020 15:59:33 -0500 Message-Id: <20200903205935.27832-76-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=flukshun@gmail.com; helo=mail-ot1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yuri Benditovich , Jason Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Yuri Benditovich Removal of duplicated RSC definitions. Changing names of the fields to ones defined in the Linux header. Signed-off-by: Yuri Benditovich Signed-off-by: Jason Wang (cherry picked from commit dd3d85e89123c907be7628957457af3d03e3b85b) Conflicts: hw/net/virtio-net.c *drop context dep. on 590790297c0 Signed-off-by: Michael Roth --- hw/net/virtio-net.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index e7e2c2acdb..6cb1448310 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -77,25 +77,6 @@ tso/gso/gro 'off'. */ #define VIRTIO_NET_RSC_DEFAULT_INTERVAL 300000 -/* temporary until standard header include it */ -#if !defined(VIRTIO_NET_HDR_F_RSC_INFO) - -#define VIRTIO_NET_HDR_F_RSC_INFO 4 /* rsc_ext data in csum_ fields */ -#define VIRTIO_NET_F_RSC_EXT 61 - -static inline __virtio16 *virtio_net_rsc_ext_num_packets( - struct virtio_net_hdr *hdr) -{ - return &hdr->csum_start; -} - -static inline __virtio16 *virtio_net_rsc_ext_num_dupacks( - struct virtio_net_hdr *hdr) -{ - return &hdr->csum_offset; -} - -#endif static VirtIOFeature feature_sizes[] = { {.flags = 1ULL << VIRTIO_NET_F_MAC, @@ -1539,15 +1520,15 @@ static size_t virtio_net_rsc_drain_seg(VirtioNetRscChain *chain, VirtioNetRscSeg *seg) { int ret; - struct virtio_net_hdr *h; + struct virtio_net_hdr_v1 *h; - h = (struct virtio_net_hdr *)seg->buf; + h = (struct virtio_net_hdr_v1 *)seg->buf; h->flags = 0; h->gso_type = VIRTIO_NET_HDR_GSO_NONE; if (seg->is_coalesced) { - *virtio_net_rsc_ext_num_packets(h) = seg->packets; - *virtio_net_rsc_ext_num_dupacks(h) = seg->dup_ack; + h->rsc.segments = seg->packets; + h->rsc.dup_acks = seg->dup_ack; h->flags = VIRTIO_NET_HDR_F_RSC_INFO; if (chain->proto == ETH_P_IP) { h->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; From patchwork Thu Sep 3 20:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357065 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EUCGFniQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjF6s2DVSz9sTK for ; Fri, 4 Sep 2020 07:58:13 +1000 (AEST) Received: from localhost ([::1]:46636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxFD-0001xE-8Q for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:58:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwML-0005Ov-2E; Thu, 03 Sep 2020 17:01:29 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:46539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMJ-0007vm-CE; Thu, 03 Sep 2020 17:01:28 -0400 Received: by mail-ot1-x344.google.com with SMTP id c10so3976986otm.13; Thu, 03 Sep 2020 14:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ukiMnU2Ka9CilWgAW2sSo5sQypISiGu+XOTOgn0j23Q=; b=EUCGFniQXNizA5SYD5PkHcdWgwJn+49NwLtLVyQFwft/kWN11w3Ls7K8tUaFkMw42A 9/wws5PNQVxB3V/4hD8vS+ojTNZq8N++M6EPbR0ETxQ645u16fHRojhD+yrcR4qWzH4z /jUQT+/uSVCRPEzrEuMRxeFNI6C4DpWlofEG5RZKXI5FeXMlqYDr627JSsnrf0xvEb9P 5EyKsI3viZotUyqt+poFpfl9MMCpPEJQJeYAPZnloUNGxW55uzNQYUy+pilj6mNTOJVU IZURk+eRV9ngU3UxWZxPbij5pwxpDmdePVgxQUGfsHvgzUH8Bb+hx1INeYUyhx5ev7Of VM1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ukiMnU2Ka9CilWgAW2sSo5sQypISiGu+XOTOgn0j23Q=; b=h/qz+sM5284+m9mEY0EYuOVJ1T7n4zNmQdECGvkE4r36cB/CIRxlvqMi+1fsnnHuwo kRrnXvEu+RAOv+q0RyZ2UQQzCAZjLsgFFTtfG5PfngLRBtwhGlUxDMCxqFW4N+kVYPYp 0soJ6r1E3cgR4BTF9VA3Qcwcp7oMI+2MoCBSa3AC4I00Fz2XDRaVw5GhtjfknIe2IbTO LBVKoz4PcADaENvnTjrUR/XQBr0gTnwrlnor0WaGzuqMfQtjaSV1e4Qe591JmGbX5pVw 0j2ljnA4TFVAkJcz4nslyA1tTvjAjvW1jpD69OrhM/fUn769YMaMOGZG/8Of7oWL/F7z Ybgw== X-Gm-Message-State: AOAM533RKODU/K4G3AU5td0T5mFy6zeB7A3zCRN/ABMJESlB6MKYI0aj uaciZCwCD7ffGNcBf6L6Nt0Y6xnrJP7tYA== X-Google-Smtp-Source: ABdhPJz8pRPBwG8xRM1knu8gsqApuT1ZW9/ewO5C+peXCXPcSQb2bt5OVOvxr6bERYp7cFyv/I7JQg== X-Received: by 2002:a05:6830:1c61:: with SMTP id s1mr2941421otg.149.1599166885564; Thu, 03 Sep 2020 14:01:25 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id w13sm740900oiw.50.2020.09.03.14.01.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:25 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 76/77] hw/arm/sbsa-ref: fix typo breaking PCIe IRQs Date: Thu, 3 Sep 2020 15:59:34 -0500 Message-Id: <20200903205935.27832-77-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::344; envelope-from=flukshun@gmail.com; helo=mail-ot1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Graeme Gregory , Peter Maydell , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Graeme Gregory Fixing a typo in a previous patch that translated an "i" to a 1 and therefore breaking the allocation of PCIe interrupts. This was discovered when virtio-net-pci devices ceased to function correctly. Cc: qemu-stable@nongnu.org Fixes: 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state") Signed-off-by: Graeme Gregory Reviewed-by: Philippe Mathieu-Daudé Message-id: 20200821083853.356490-1-graeme@nuviainc.com Signed-off-by: Peter Maydell (cherry picked from commit 870f0051b4ada9a361f7454f833432ae8c06c095) Signed-off-by: Michael Roth --- hw/arm/sbsa-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 8409ba853d..0b32084dc0 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -555,7 +555,7 @@ static void create_pcie(SBSAMachineState *sms) for (i = 0; i < GPEX_NUM_IRQS; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, - qdev_get_gpio_in(sms->gic, irq + 1)); + qdev_get_gpio_in(sms->gic, irq + i)); gpex_set_irq_num(GPEX_HOST(dev), i, irq + i); } From patchwork Thu Sep 3 20:59:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 1357053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=k6xOby3t; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjDx25Vzhz9sTr for ; Fri, 4 Sep 2020 07:49:42 +1000 (AEST) Received: from localhost ([::1]:41566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDx6y-0004Jo-O1 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 17:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwMM-0005RQ-4e; Thu, 03 Sep 2020 17:01:30 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:45218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDwMK-0007wA-D1; Thu, 03 Sep 2020 17:01:29 -0400 Received: by mail-oi1-x244.google.com with SMTP id d189so4481960oig.12; Thu, 03 Sep 2020 14:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yJG4bmyAfe4onsh//+ldhVr9OuPhOmvC3Rda7LK2uCg=; b=k6xOby3thIRRJDddVQLvw+z8lV4QE2aD9x/EsyTbu+ghwGLGlJVyrhLxRrPiaNbKZ1 Dcso8v6iTgu2aFSxPr8nzYftgA0ZCbCF97uNLI3p29opJKHsH3X7fgtpdyc4Lx7ULNMv ruZ4ildZnd6XUZcoFQJUN7ZnSIClBaze5P3ncBdYMXqmefVLYvwwtL4mI9ziVFlNH3cu Vzl7GDbX4nTznbgXl7A5SJCFLOulHkM8/v2BPoSbS2LtxE8+fcuxXaescTYcjg4FjFM3 +ZHx/mJc052FVLg0KWkPmc44rZ4HxNxpXzKHeyHJO5NPEFbKkgUL4/3Mb/QQFCiXKt7n nXJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=yJG4bmyAfe4onsh//+ldhVr9OuPhOmvC3Rda7LK2uCg=; b=F474/gaPJ3kSU9GI0GZQt5KZ9+wrqM9FJTotEq/+rYiDnMB1bKBQ1h6bUQ/b0ONffY 42KjkVxgPc3IiluOvxwYK6AHTRj8ZCYIeygTEt9MsvUJZjBxfK5l+yYqFkE2VO0xJO3X oqSGuKRTi2+mk53MbmiACuQ9x9aqt2ocjTY7sa0cv2J78ld/C2+4R1rcyaCHtK/qklw8 XfFpEj4sUSd6drDa3m1TvwUUeUsQOvPFt0oBzYK/92LKXqRUUwrdz+0zozl6S2inCKIH lMrnatOOkmsuiTx3n+dU+43VVWVLPctpBlZaU4AvcYu3s/4YDVpPg3Zdm5vj4+9rR2KD T2Lg== X-Gm-Message-State: AOAM53077Kpi5oA2lZIm/HJ8taO++5mllnbTPiivQkDxhU3K2EXmCOuo t9WQakRH8poF8dpZOOkr5gzW16KW6UMPKQ== X-Google-Smtp-Source: ABdhPJwI5FZOom6VdQLObxT/oi/6gDRd470470UysICywiKz7qDdueAXK9CfupJDhmn6+N4znDpRQA== X-Received: by 2002:aca:b705:: with SMTP id h5mr3203765oif.31.1599166886612; Thu, 03 Sep 2020 14:01:26 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id d28sm121339ooa.7.2020.09.03.14.01.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 14:01:26 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Subject: [PATCH 77/77] usb: fix setup_len init (CVE-2020-14364) Date: Thu, 3 Sep 2020 15:59:35 -0500 Message-Id: <20200903205935.27832-78-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> References: <20200903205935.27832-1-mdroth@linux.vnet.ibm.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::244; envelope-from=flukshun@gmail.com; helo=mail-oi1-x244.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Store calculated setup_len in a local variable, verify it, and only write it to the struct (USBDevice->setup_len) in case it passed the sanity checks. This prevents other code (do_token_{in,out} functions specifically) from working with invalid USBDevice->setup_len values and overrunning the USBDevice->setup_buf[] buffer. Fixes: CVE-2020-14364 Signed-off-by: Gerd Hoffmann Tested-by: Gonglei Reviewed-by: Li Qiang Message-id: 20200825053636.29648-1-kraxel@redhat.com (cherry picked from commit b946434f2659a182afc17e155be6791ebfb302eb) Signed-off-by: Michael Roth --- hw/usb/core.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/usb/core.c b/hw/usb/core.c index 5abd128b6b..5234dcc73f 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -129,6 +129,7 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream) static void do_token_setup(USBDevice *s, USBPacket *p) { int request, value, index; + unsigned int setup_len; if (p->iov.size != 8) { p->status = USB_RET_STALL; @@ -138,14 +139,15 @@ static void do_token_setup(USBDevice *s, USBPacket *p) usb_packet_copy(p, s->setup_buf, p->iov.size); s->setup_index = 0; p->actual_length = 0; - s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; - if (s->setup_len > sizeof(s->data_buf)) { + setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; + if (setup_len > sizeof(s->data_buf)) { fprintf(stderr, "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n", - s->setup_len, sizeof(s->data_buf)); + setup_len, sizeof(s->data_buf)); p->status = USB_RET_STALL; return; } + s->setup_len = setup_len; request = (s->setup_buf[0] << 8) | s->setup_buf[1]; value = (s->setup_buf[3] << 8) | s->setup_buf[2]; @@ -259,26 +261,28 @@ static void do_token_out(USBDevice *s, USBPacket *p) static void do_parameter(USBDevice *s, USBPacket *p) { int i, request, value, index; + unsigned int setup_len; for (i = 0; i < 8; i++) { s->setup_buf[i] = p->parameter >> (i*8); } s->setup_state = SETUP_STATE_PARAM; - s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; s->setup_index = 0; request = (s->setup_buf[0] << 8) | s->setup_buf[1]; value = (s->setup_buf[3] << 8) | s->setup_buf[2]; index = (s->setup_buf[5] << 8) | s->setup_buf[4]; - if (s->setup_len > sizeof(s->data_buf)) { + setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; + if (setup_len > sizeof(s->data_buf)) { fprintf(stderr, "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n", - s->setup_len, sizeof(s->data_buf)); + setup_len, sizeof(s->data_buf)); p->status = USB_RET_STALL; return; } + s->setup_len = setup_len; if (p->pid == USB_TOKEN_OUT) { usb_packet_copy(p, s->data_buf, s->setup_len);