From patchwork Thu Aug 22 09:50:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13773167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7BFBBC5321E for ; Thu, 22 Aug 2024 09:51:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh4T8-0007Ao-TQ; Thu, 22 Aug 2024 05:51:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh4T4-000787-Vf for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:50:58 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh4T2-0001uE-LB for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:50:57 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42817f1eb1fso4187365e9.1 for ; Thu, 22 Aug 2024 02:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724320254; x=1724925054; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T0epmm+nCBqYd7cRlgUuUReUBppCgZRIHvF/VeKi9rI=; b=Zw+lXwTtHz+4x3h419f8WmyVJxIb3CI4dXEBqxVtWLvw+5WghrbqXxLX+wYj3Iw3p2 JisetiM9cnq9K3bjpsJFeWGOpNstjv35fySZo6yrncQUuS7+WTNNqydVQt1pPSoh6SoT 9GPsmKgSC9AR6p2uuIMVjZUy234OPf35G6SC6As3F5EvU4lqPTV+PH8t4Q9+9Y5b9iXr p9/2q08eAjU353c1NL7LRW2PgDrWB92aNDYUMQPXli8YkjJAkYnj/utVZ+Ct+vaJrKsT LsiEu63BnwNq7DTMppirGoRGs3EVDZHubLhIU2wbcHYtThFzOJcPnJEWE9i9xnVGr+B6 qFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724320254; x=1724925054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T0epmm+nCBqYd7cRlgUuUReUBppCgZRIHvF/VeKi9rI=; b=MuC0oqL/R5pTCFPFCO4KwjnrgagGW7qR13V+uRHviYK4RlpOae1jMoohM96bJnae4I PkXmPxmzniqkjOEL/6JUuFiL659JrSU31bbfeQcYZi/Z7S8uzsFIACaIf8qS+EtrMP4R laFGtdlu/ldzR4Qqz5G5jii/k7aXS7g3YJWk671Csh8Gapvx6OrnTpFhXFS3JMw+bQYn Fih7junszFoK/dCXtxbbyYC2kSxzHqH67jF2wh/xU7SagUFrP5YP+ennOzdAh1QD54ho 6iu9SY1mE9XfhQVtVCI2ELdZHCBT2SywPxyQ8Za/8zLHOM4baX6hL77n26S56WRHC2En Pg8g== X-Gm-Message-State: AOJu0Yz3B70YzUCSfyM4j5kfQtm63DB3skHlM9exfTxYp4UMotbkgzf4 g0zmHj94PUhs6WF5fKzh1RcP74Ey5c3nBonXaun6HD8pFISpe9l1Cc5Sl2CbZHp/y12w9iscW4Y M X-Google-Smtp-Source: AGHT+IEwmJ3lCCJr+zNgxahyMqJWUnAt1uYr5KiJRxXNaMGJYmLZz5nw55V3NlI+Z29FsLbSTKw3tA== X-Received: by 2002:a05:600c:1911:b0:426:59fc:cdec with SMTP id 5b1f17b1804b1-42abf065a48mr34862985e9.21.1724320254450; Thu, 22 Aug 2024 02:50:54 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-373081ff526sm1229242f8f.68.2024.08.22.02.50.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 02:50:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Riku Voipio , Laurent Vivier , Cleber Rosa , Paolo Bonzini , Wainer dos Santos Moschetta Subject: [PATCH v2 1/4] accel/tcg: Make page_set_flags() documentation public Date: Thu, 22 Aug 2024 11:50:42 +0200 Message-ID: <20240822095045.72643-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822095045.72643-1-philmd@linaro.org> References: <20240822095045.72643-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Commit e505a063ba ("translate-all: Add assert_(memory|tb)_lock annotations") states page_set_flags() is "public APIs and [is] documented as needing them held for linux-user mode". Document the prototype. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 13 +++++++++++++ accel/tcg/user-exec.c | 5 ----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 6f09b86e7f..45e6676938 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -166,7 +166,20 @@ typedef int (*walk_memory_regions_fn)(void *, target_ulong, int walk_memory_regions(void *, walk_memory_regions_fn); int page_get_flags(target_ulong address); + +/** + * page_set_flags: + * @start: first byte of range + * @last: last byte of range + * @flags: flags to set + * Context: holding mmap lock + * + * Modify the flags of a page and invalidate the code if necessary. + * The flag PAGE_WRITE_ORG is positioned automatically depending + * on PAGE_WRITE. The mmap_lock should already be held. + */ void page_set_flags(target_ulong start, target_ulong last, int flags); + void page_reset_target_data(target_ulong start, target_ulong last); /** diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 7ddc47b0ba..11b6d45e90 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -485,11 +485,6 @@ static bool pageflags_set_clear(target_ulong start, target_ulong last, return inval_tb; } -/* - * Modify the flags of a page and invalidate the code if necessary. - * The flag PAGE_WRITE_ORG is positioned automatically depending - * on PAGE_WRITE. The mmap_lock should already be held. - */ void page_set_flags(target_ulong start, target_ulong last, int flags) { bool reset = false; From patchwork Thu Aug 22 09:50:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13773166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 73FA8C3DA4A for ; Thu, 22 Aug 2024 09:51:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh4TC-0007K2-Hv; Thu, 22 Aug 2024 05:51:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh4TA-0007D3-BA for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:51:04 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh4T8-0001xz-LM for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:51:04 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42812945633so3987225e9.0 for ; Thu, 22 Aug 2024 02:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724320260; x=1724925060; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jQnk0OGW+ME2/AwCx9SVTlqQyyVvO6CjKhuRITvFw3A=; b=qZKgagxgYPqCoM3S436bR5J/XBuvvazpWJDY9WJvXAtafmvUE5voSDcRSO5SzneC7J LThl3RwcoyW7owTyVrCWPTyRMnmA29B+jTu6nEN+lJU+pROfwNsxQ+PxVYpQDugLPB5X /b4KkE7V8ZxamfVuW7KYpb/ts0mOEX/hIOpRq/B4O2P4DbJl8phVdOAsPr4g3dq4aFeJ zO1HpbsKSOGzJpOAz2rXO5PJ6miQ4QwkZIptktsMl3BXLrYrsuanIGY9vjdhdvdeHWAv FnNpnepQcSU7Ns/idGLDmIrb6yglrqO4QZRh/XP9uVwIpazxetLisg0x/bmSSD7j4YyO jB3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724320260; x=1724925060; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jQnk0OGW+ME2/AwCx9SVTlqQyyVvO6CjKhuRITvFw3A=; b=VWj9WhzBYHkKoUrf3ZrDKNBmyohssywUlvzW1KC4GS0aRx3UxJfa6XH0CfsiQMWlJX QclxueZLwiNprCk3szDjQSXKBWQ3UnM/m0iX/FlO3+6oZpW+NhGbZ6FSNpyK4caBvpzy N3cld5iLz8Wa3bP1AG2963Di867wWuzgyuu5CaZRYoGqFQfmYLB9vB9Wut0K8swppyTO aWOWMPNplVlfKAUickRMm4TNEvifI659RUWS3OOkBnqaJbuQoXWJ/l7VjX2SKeJx/HDx /We+3Fw7ZnZayYL2noGoVv5Li8P4uTIM1+HTv7RI6lPr97oWmTZY/NS3YnlujGaPSgfX xKFg== X-Gm-Message-State: AOJu0YzyLQyURM1LD/wx8/oRVTEClK0VY+QKjSJkzfUPo5dJl43uBIui i2I1mSJbyB4xtyRxkIcdkLQDMChBHruZRqbP2EqlegOD/uUWXx+z1Cte9r4mF8/ks4mzqr8MM9L u X-Google-Smtp-Source: AGHT+IEh05fT8MycNuua9GWWULedky34BTNZSkPh2E/Bn7KKuN0IKFSssZ/GFSrUh0tw4FKgcCD1Cw== X-Received: by 2002:a5d:650b:0:b0:371:9362:c286 with SMTP id ffacd0b85a97d-372fd577056mr2924619f8f.4.1724320260355; Thu, 22 Aug 2024 02:51:00 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3730821a92csm1232696f8f.93.2024.08.22.02.50.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 02:50:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Riku Voipio , Laurent Vivier , Cleber Rosa , Paolo Bonzini , Wainer dos Santos Moschetta Subject: [PATCH v2 2/4] linux-user/flatload: Take mmap_lock in load_flt_binary() Date: Thu, 22 Aug 2024 11:50:43 +0200 Message-ID: <20240822095045.72643-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822095045.72643-1-philmd@linaro.org> References: <20240822095045.72643-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org load_flt_binary() calls load_flat_file() -> page_set_flags(). page_set_flags() must be called with the mmap_lock held, otherwise it aborts: $ qemu-arm -L stm32/lib/ stm32/bin/busybox qemu-arm: ../accel/tcg/user-exec.c:505: page_set_flags: Assertion `have_mmap_lock()' failed. Aborted (core dumped) Fix by taking the lock in load_flt_binary(). Fixes: fbd3c4cff6 ("linux-user/arm: Mark the commpage executable") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2525 Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- linux-user/flatload.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 04d8138d12..0e4be5bf44 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -487,7 +487,10 @@ int load_flt_binary(struct linux_binprm *bprm, struct image_info *info) stack_len += (bprm->envc + 1) * 4; /* the envp array */ + mmap_lock(); res = load_flat_file(bprm, libinfo, 0, &stack_len); + mmap_unlock(); + if (is_error(res)) { return res; } From patchwork Thu Aug 22 09:50:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13773169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2602DC5320E for ; Thu, 22 Aug 2024 09:52:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh4TV-0007Zj-7H; Thu, 22 Aug 2024 05:51:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh4TH-0007Vt-CW for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:51:11 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh4TE-0001zY-Sf for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:51:10 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-428119da952so4245425e9.0 for ; Thu, 22 Aug 2024 02:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724320267; x=1724925067; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1Y695RxzqZMUrq71VyB6/VGmqxSsE/5rqhX6uBUfH0k=; b=UjCuO5OqlRk6YUeKRZ6KgZAu11zSKY7quLIKiLf4rPToNvNBMOkup3SoJ+QmR9NUOI ZAYA8NvYqGn2d6P2L+cuMzhU0wTs4EV+3RG1TFbFBmA5Jfto8+zMo70OqbzncOWOL0Xd HH+eUWHWdpDw42uRxGXM8VLbNZMwlG1ksq9dbBiCjKmIfC5xwFnhsskesTmZck42Cgmn 2YIN6d41xIcvm4U/3otXDXuXiYYbmWGjYbnnWfoFF4C7jaGkQfxFqAyoP3q0wuoLepWR QMfAzExxOefZlC/oUOYNsJX6YatoRufULJYULmzsrJmj0dEXg/UHAR+/vKbTYn99IOAk Lvgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724320267; x=1724925067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Y695RxzqZMUrq71VyB6/VGmqxSsE/5rqhX6uBUfH0k=; b=IsAnJBwciGfvMeypBmVVK3c0Qn5i6QnD+YBAu4YplI1S4eFUbZe5hG2JR2vdZ1V5oy zk6Lh+Ois9EOQ6fH6ITHz/5Z7hA6WNVmhHhACsymkd2aooucdW6FfVAlvMKvS4ihr65K aYj2NtfPk8RfiMJiYn6/6tpmWSUrsOEOrXUQWYZPtDyUq3b1nhcXu/iwR4XRLhksZpit HYWbJ+CaVg81MDJW/9BOwMbR5ehvunkIQErGhKKKxHN+yhMNDv+uxN9idWk9s6g7vCHM EmJEAQZ5BUHzJyTLdHv5uM2mjET71I5/Fz9d3tkr5W001hrj0QJGaQWGwt21vu9JCVAV u/LA== X-Gm-Message-State: AOJu0YxvnhCfh24d1Wtil6xyq//Mrlui3EUGWvqY6gnFP/xhdmX+ygb1 P3cQbjW55+RPRUtkUILxson3MZDwVgcQW82fdkjZeh3rXP6bJCzBUWlLCcxh+Jk7B24EobGoIdB C X-Google-Smtp-Source: AGHT+IG67ATmzsQrkaCNRJ5gb1BJ7J5T+3zS6KBrv8I0DTin7d/POJGU5degOlaTtnyWIszA8lFgwA== X-Received: by 2002:adf:f6c3:0:b0:368:5858:826e with SMTP id ffacd0b85a97d-372fd72c65dmr3222880f8f.59.1724320266636; Thu, 22 Aug 2024 02:51:06 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37308110035sm1251615f8f.16.2024.08.22.02.51.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 02:51:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Riku Voipio , Laurent Vivier , Cleber Rosa , Paolo Bonzini , Wainer dos Santos Moschetta , Thomas Huth Subject: [PATCH v2 3/4] tests/avocado: Allow running user-mode tests Date: Thu, 22 Aug 2024 11:50:44 +0200 Message-ID: <20240822095045.72643-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822095045.72643-1-philmd@linaro.org> References: <20240822095045.72643-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Commit 816d4201ea ("tests/avocado: Move LinuxTest related code into a separate file") removed the Avocado 'process' import which is used by the QemuUserTest class, restore it. Fixes: 816d4201ea ("tests/avocado: Move LinuxTest ...") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/avocado/avocado_qemu/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index ef935614cf..0d57addfea 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -17,7 +17,7 @@ import uuid import avocado -from avocado.utils import ssh +from avocado.utils import process, ssh from avocado.utils.path import find_command from qemu.machine import QEMUMachine From patchwork Thu Aug 22 09:50:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13773170 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2AF32C3DA4A for ; Thu, 22 Aug 2024 09:52:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh4Ta-0007ea-QB; Thu, 22 Aug 2024 05:51:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh4TQ-0007ZU-1K for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:51:23 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh4TM-00023f-Ul for qemu-devel@nongnu.org; Thu, 22 Aug 2024 05:51:18 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42819654737so3935745e9.1 for ; Thu, 22 Aug 2024 02:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724320273; x=1724925073; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mEt78BY1+b0Q2uRxu35ufp1qJ07/oJ8ixAjUQfbY+Bw=; b=Hyy9QXi0iVU86XpcnrEe+BPaTcMTodHfHG83N5djaETRPOFkTJ52neE27+f8gf6zJi jOr1SHt20IQM0i1ey3dqvbqE862AF2d6RZrJxEmoEYXWv1iaj+VFQkZ1Bbta+sgBRMPQ YcDrsDAUJvvGZxXwl9Xm1QLlPjs4OdbnT3q24QtEVIRWUoq0Lc7Ag+JOWxeaIJdVNGD+ BDml5ryiMd2EUor9irQa3wX1A2M7qXBCsf5NeHtMhBZFw4XmLubhHtPllaYo1YMJPmNi QJLuGXIP4tOITYTdlbPfzUqygECs8qgFmwGyNvGak+agQf+lYOlFsP4YIV4xOLSENQMO XUmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724320273; x=1724925073; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mEt78BY1+b0Q2uRxu35ufp1qJ07/oJ8ixAjUQfbY+Bw=; b=VIMNf0GGD4bcO2LFiEwOynBBPwg9JhUsHJ/UYqm/DJq0L/Hc4uSUXnQ9mzwuoajsGB 3QaS4mX1EmyNhGDZ/qRIySLnhmvgAbOv3PhqX62epfQyin3A7unVQjqBeH3oBAWkF4SC NnlKDsU03ZFP6aIbU81Jh07Hxhc1HK7IiCbycO8S0TNvxbOiHzZ2uTchzr6G9ZWdNHdj 55wbc9LWRkxOIFJNY6EYhe1Kb1fR60s1aHAtFysfbfZPZ4DbW8AbTpTf1/yeqivlJ0M3 IIGWrJ21O+qp6kLCvHE0tr0DkgkNnPjmbkLxG3iw5a2DNI1Ukyis1CYGosuFkN+0lsE0 LmzQ== X-Gm-Message-State: AOJu0Yx4PYEehCfLC8VZXKSS6Tz/or6LeyeAer4Xr0F3AJiiZN3t4gWk InUly1CR0muL1z7KXqmSSIXsNJx2QTIqXerZwwI8LapgaA+5P91mk22qnbom39mSK7dVSZw7rbE c X-Google-Smtp-Source: AGHT+IFxK8AYj+Zk4/YUdnzh2zR3OLsV+j2TX+Bndt7NHEOVwGLvECZth9RmePCmgxDcK2OY3YAutw== X-Received: by 2002:a05:600c:5114:b0:426:5269:9827 with SMTP id 5b1f17b1804b1-42ac5529b3dmr9941935e9.0.1724320272818; Thu, 22 Aug 2024 02:51:12 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ac5180339sm18190535e9.43.2024.08.22.02.51.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 02:51:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Riku Voipio , Laurent Vivier , Cleber Rosa , Paolo Bonzini , Wainer dos Santos Moschetta , Thomas Huth Subject: [PATCH v2 4/4] tests/avocado: Run STM32 bFLT busybox binary in current directory Date: Thu, 22 Aug 2024 11:50:45 +0200 Message-ID: <20240822095045.72643-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240822095045.72643-1-philmd@linaro.org> References: <20240822095045.72643-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When this test was added in commit 8011837a01, self.workdir was set to the test directory. As of this commit, it is not set anymore. Rather than using a full path to the busybox binary, we can run it in the current directory, effectively kludging the fact that self.workdir is not set. Good enough to run the test: Fetching asset from tests/avocado/load_bflt.py:LoadBFLT.test_stm32 JOB ID : 020d317281b042f46ad99013530d29df0f1d7eb7 JOB LOG : tests/results/job-2024-08-22T10.17-020d317/job.log (1/1) tests/avocado/load_bflt.py:LoadBFLT.test_stm32: PASS (0.09 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 0.62 s Reported-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- tests/avocado/load_bflt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/avocado/load_bflt.py b/tests/avocado/load_bflt.py index bb50cec1ee..264489ee25 100644 --- a/tests/avocado/load_bflt.py +++ b/tests/avocado/load_bflt.py @@ -41,7 +41,7 @@ def test_stm32(self): 'Stm32_mini_rootfs.cpio.bz2') rootfs_hash = '9f065e6ba40cce7411ba757f924f30fcc57951e6' rootfs_path_bz2 = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash) - busybox_path = os.path.join(self.workdir, "/bin/busybox") + busybox_path = os.path.join(self.workdir, "bin/busybox") self.extract_cpio(rootfs_path_bz2)