From nobody Sun May 12 23:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638044550517442.20688804363726; Sat, 27 Nov 2021 12:22:30 -0800 (PST) Received: from localhost ([::1]:36852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr4DM-0005wE-A4 for importer@patchew.org; Sat, 27 Nov 2021 15:22:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr4Af-0003oC-Sa for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:41 -0500 Received: from [2607:f8b0:4864:20::d35] (port=38868 helo=mail-io1-xd35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr4Ad-0004tx-6a for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:41 -0500 Received: by mail-io1-xd35.google.com with SMTP id z18so15890610iof.5 for ; Sat, 27 Nov 2021 12:19:38 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h12sm3091632ila.81.2021.11.27.12.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 12:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nN3GoD+NmVWnXx5scKILO0Lt9wSgr2FWl8DwY/rYPok=; b=LLKbl0bc47yHoJNn+XnAU2DygrATZjnQpMCdRUSOjNlECLacEYXWaz+J8nxxJ71qxM fbnKZvAli2AodBM7VtvXWs/YnGGttjykBHvAISrKauzvCAce3I+JynjVj50lpzWU6ral TyPDVsQOqZHzhcxzJ1QzCHX2MvlmqEdJs/+RFCjhnBJBPOGnCOS8FYbiVC50BVeQ3w+K VeZMsWKelb5eW0c+bLmaOSyleyogOldWzGtPDSah8N0k9yGRHpBphalIkZptW9QPEldV xMvxXaC6WrSyF8ySoJpUvX6ya3ojmXur13LYkSQCZ3gqxXf1A611qT/WZcwnsA0mMpBJ LONw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nN3GoD+NmVWnXx5scKILO0Lt9wSgr2FWl8DwY/rYPok=; b=zAujSU/Wxe48VAkbomFMPG85oCompKbFM8D4wrp1yPuhqAOEBQqaLiS/sfiRSmx9wY IXtVfIutXr57Lzivc3Z/a3m+hCUqXz6WJAehP1J7h8yfhr0TnmasFQGfC5n3cSdVaJMR KMC2b/b6sF83oxVMoXT8GzFCGKnKCUg7E9U0/31yXj5nHh9OybpHUdN0LqcPpSSGUBZ/ +ahxBKTwdE6xDMpTTnclxCnfnkmARfB7LWlvTLc5IiFgEBjy/GosWqb33OhzrM9LZtyn dvMntcnU/8i9Mg5iGcE0Yl9o5aO/zzdN+BKsL3PnEah7JCakMr8h2KtJuadvXzOt+gz2 y9fQ== X-Gm-Message-State: AOAM530qJb8um6FgqLIsx6gUNXTmW2KDGuPD8t6CKq/qyTADGDsZMKh2 sc+UU5bgzA8JllPHUaZSOXz2XEtQbBsXqt6O X-Google-Smtp-Source: ABdhPJzHJktS2vZkGu3z5sPaqFvrSQ/akrXWplbWQDaoIffl1WD0Y8e46Owr0g95kVzlnrG6ooZEnQ== X-Received: by 2002:a6b:3b13:: with SMTP id i19mr39988331ioa.210.1638044377631; Sat, 27 Nov 2021 12:19:37 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH for 7.0 1/5] h.armv7: Simple hello-world test for armv7 Date: Sat, 27 Nov 2021 13:18:42 -0700 Message-Id: <20211127201846.64187-2-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com> References: <20211127201846.64187-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d35 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: arrowd@freebsd.org, kevans@freebsd.org, richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org, Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1638044552310100001 Content-Type: text/plain; charset="utf-8" A simple, tiny, statically linked armv7 'hello world' test. It uses two system calls (write and exit) and provides a basic sanity check to make sure that the arm bsd-user binary can interpret FreeBSD armv7 binaries. Signed-off-by: Warner Losh --- tests/bsd-user-smoke/h.armv7.S | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/bsd-user-smoke/h.armv7.S diff --git a/tests/bsd-user-smoke/h.armv7.S b/tests/bsd-user-smoke/h.armv7.S new file mode 100644 index 00000000000..fe986f15ef6 --- /dev/null +++ b/tests/bsd-user-smoke/h.armv7.S @@ -0,0 +1,37 @@ +# Copyright (c) 2021 Warner Losh +# SPDX-License-Identifier: BSD-2-Clause + +#include +#define STDOUT_FILENO 1 + + .text + .file "hello.s" + .syntax unified + .globl qemu_start @ -- Begin function qemu_sta= rt + .p2align 2 + .type qemu_start,%function + .code 32 @ @qemu_start +qemu_start: +@ %bb.0: @ %entry + + # write(1, .L.str, sizeof(.L.str) - 1) + movw r1, :lower16:.L.str @ Load hello world + movt r1, :upper16:.L.str + ldr r0, =3DSTDOUT_FILENO + ldr r2, =3D(.L.strEnd - .L.str - 1) + ldr r7, =3DSYS_write + swi 0 + + # _exit(0) + ldr r0, =3D0 @ success + ldr r7, =3DSYS_exit + swi 0 +.Lfunc_end0: + .size qemu_start, .Lfunc_end0-qemu_start + @ -- End function + .type .L.str,%object @ @.str + .section .rodata.str1.1,"aMS",%progbits,1 +.L.str: + .asciz "Hello World\n" +.L.strEnd: + .size .L.str, .L.strEnd - .L.str --=20 2.33.0 From nobody Sun May 12 23:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163804466596022.85770820576454; Sat, 27 Nov 2021 12:24:25 -0800 (PST) Received: from localhost ([::1]:43122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr4FE-0001lJ-V9 for importer@patchew.org; Sat, 27 Nov 2021 15:24:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr4Ag-0003oM-9n for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: from [2607:f8b0:4864:20::136] (port=33729 helo=mail-il1-x136.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr4Ad-0004u0-N9 for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: by mail-il1-x136.google.com with SMTP id i6so12731574ila.0 for ; Sat, 27 Nov 2021 12:19:39 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h12sm3091632ila.81.2021.11.27.12.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 12:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9lAojg4ZHM7UKvsEnUnT2wI+wj26o0gCpxnY2EoluH8=; b=ZubATuUcRLk6y8WRRuw/Cnp5wNeL6Lt/8JIzT+QaEH0gZQN+rWOr8dbu6+/4ztqEUT +CCoUrPjzbiDh+sp7Qrg8skJbY2glOWEUKYUWurCeOTDyPW9f+GtZyWXJwL0NTctW1fb PHau+X2Jfe+5t68/42YM49rTsHLI+LntdYeRHQcG5kNZgPhwl2QRbEzHFP/IU6tmkpnC Bq/7iqoTMYmCc4i4qrhr9/S26XjmH7hO1wybl7XEyIPGnwdQIKGA9fV/qer0HNfYs5IY 5lEqEpdMkMtK2RxZZFhKKJl2i+w7KGuGV9xqSfYZhgGDQTvEeykZJblxAI+vU5fjX29a hRNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9lAojg4ZHM7UKvsEnUnT2wI+wj26o0gCpxnY2EoluH8=; b=Hp6hHdYINPVHQ1ZybW7PQl3DZ+U1AHe77VJ4I8R826CoLs0I/plgVr10EbCr4HUErl XS3dU/TDsug19wWaIzmK63aRP8ymFtUdTlAJmmoUh1tcv3sgor/WtZskcLwtF/xSnKI8 SnhAz4AvyM1wAmTjVzpIL2V/8UOp8SCFusI0Wq3n5edxd0w+9Gmbm8wGU1J9DuPfNQzn 3X46ZP6O2eP34LQP9sM1ZqmTzvHhKKznEIbaiQYnEvKzNWSZuU3s/KbW7zq3jGbtDLCc hnyXYr+pTdcu2tcXO3AWREuue8uAR1TxHEea1onUVDnshxgJ9HLUooLPUzf2FUtec5PL 2Mtg== X-Gm-Message-State: AOAM531adzw1sgjbUmtbnPXiDUXpNAVda8gF16xTStObS/Z6YE+u9cMM C1gzUdhn3TjZ13Aa8g9O3uUOgvG2mnoQfw8F X-Google-Smtp-Source: ABdhPJwIDQvszE+KBT6DyNw54VC/zHIHmVnTdPuM1s22yF0Xvx0GVvMfhidoVlI4rvDjotcQ4KEdlA== X-Received: by 2002:a92:d7ce:: with SMTP id g14mr37206536ilq.176.1638044378438; Sat, 27 Nov 2021 12:19:38 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH for 7.0 2/5] h.i386: Simple hello-world test for i386 Date: Sat, 27 Nov 2021 13:18:43 -0700 Message-Id: <20211127201846.64187-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com> References: <20211127201846.64187-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::136 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: arrowd@freebsd.org, kevans@freebsd.org, richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org, Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1638044667233100003 Content-Type: text/plain; charset="utf-8" A simple, tiny, statically linked i386 'hello world' test. It uses two system calls (write and exit) and provides a basic sanity check to make sure that the arm bsd-user binary can interpret FreeBSD 32-bit i386 binaries. Signed-off-by: Warner Losh --- tests/bsd-user-smoke/h.i386.S | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/bsd-user-smoke/h.i386.S diff --git a/tests/bsd-user-smoke/h.i386.S b/tests/bsd-user-smoke/h.i386.S new file mode 100644 index 00000000000..0af5a709f15 --- /dev/null +++ b/tests/bsd-user-smoke/h.i386.S @@ -0,0 +1,39 @@ +# Copyright (c) 2021 Warner Losh +# SPDX-License-Identifier: BSD-2-Clause + +#include +#define STDOUT_FILENO 1 + + .text + .file "hello.s" + .globl qemu_start # -- Begin function qemu_sta= rt + .p2align 4, 0x90 + .type qemu_start,@function +qemu_start: # @qemu_start +# %bb.0: # %entry + pushl %ebp + movl %esp, %ebp + + # write(1, .L.str, sizeof(.L.str) - 1) + pushl $(.L.strEnd - .L.str - 1) + pushl $.L.str + pushl $STDOUT_FILENO + pushl %eax # dummy return address + movl $SYS_write, %eax + int $0x80 + addl $16, %esp # 3 args + 1 dummy + + # _exit(0) + pushl $0 + pushl %eax # dummy return address + movl $SYS_exit, %eax + int $0x80 +.Lfunc_end0: + .size qemu_start, .Lfunc_end0-qemu_start + # -- End function + .type .L.str,@object # @.str + .section .rodata.str1.1,"aMS",@progbits,1 +.L.str: + .asciz "Hello World\n" +.L.strEnd: + .size .L.str, .L.strEnd - .L.str --=20 2.33.0 From nobody Sun May 12 23:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638044665175207.56657450710247; Sat, 27 Nov 2021 12:24:25 -0800 (PST) Received: from localhost ([::1]:43078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr4FE-0001je-7t for importer@patchew.org; Sat, 27 Nov 2021 15:24:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr4Ag-0003oK-7u for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: from [2607:f8b0:4864:20::12f] (port=46683 helo=mail-il1-x12f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr4Ae-0004u5-Bf for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:41 -0500 Received: by mail-il1-x12f.google.com with SMTP id j7so12631166ilk.13 for ; Sat, 27 Nov 2021 12:19:40 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h12sm3091632ila.81.2021.11.27.12.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 12:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=18nG1RiOQQDpk4JlKalLlRbugb78uilgZdJRzkAfZlM=; b=rk7KN4YpniH8nK8f6371T3eBKVCZ5uuCLe2p/s/s1UaXCWFc7QcS2ttQvkI4N5iHq9 NHVXvYtrink5ehcWHsusehjMMwHzmLisOmHCB6R9J2IpGaIU14LA/+R3sAqKc6cgxXry NqYIUd9Aw/0nkgzqYVnSYc7c7Ptrz9+ohdBEtm3xBU/fQ5L1LJInfS/kU5xBZGcguyMe OoMumIQmOoCeyLuJyenqg44JTljyifZhijXRjiMOAAqVdMuBzOCvwiq8v+AtkX6CH28G hWwVuE2r9ksmpb8v1S0Uow6lge1J2iG6fpTfipSHZc4Skpc8LYjofYhxwjpUaqO2bSQ4 /Ugg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=18nG1RiOQQDpk4JlKalLlRbugb78uilgZdJRzkAfZlM=; b=TwwR/q6gcXLxWGnKokNZ32RDBCYujypXua1cAk6GIEw38VRP0rKxehrf7LBK5fToBE 3S9VRpKtUVedkYvOtemPaoG7tTqvVtnB0MfymNaWESdmdfD53+PAIZr9ME0AFWi+6Gpp JBK4SxrKbkVJ6fuxlbwdbsWq6ZWP5rkO2EuG33O1G+3c/WatDPexcSf/VQUVYQSz1YMe +j4WKs/t4sCN9cmF9LaHYkb0aytdFglnJ+/nqNRrQaaFZRDTN+I/bGYNY4X/GehCh3bi kMfkHkc0IA01qWG/Th/qoiuMSwAVeWnDZZiQjrniQMXRgVPZGWhBfUDpUe9VC4CkqCLL 6pbw== X-Gm-Message-State: AOAM530A9/6kLcTxdyzDWOTVw4WXQOPApuS8SXr6EWnhNXeLBj7jgcir xRVk25pTch9axpYnHSVWXmxNy6y7GIBEZ5Ze X-Google-Smtp-Source: ABdhPJyf6V3vvq17qBwC1oNpEe3HjZz/Kqb5Ci+wJ6h9rcOVFE1KQ5Bvk7YRPhXQ5+LiDIqtZfVZkg== X-Received: by 2002:a92:7d11:: with SMTP id y17mr37372864ilc.223.1638044379135; Sat, 27 Nov 2021 12:19:39 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH for 7.0 3/5] h.amd64: Simple hello-world test for x86_64 Date: Sat, 27 Nov 2021 13:18:44 -0700 Message-Id: <20211127201846.64187-4-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com> References: <20211127201846.64187-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12f (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12f; envelope-from=imp@bsdimp.com; helo=mail-il1-x12f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: arrowd@freebsd.org, kevans@freebsd.org, richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org, Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1638044667070100001 Content-Type: text/plain; charset="utf-8" A simple, tiny, statically linked 64-bit x86 'hello world' test. It uses two system calls (write and exit) and provides a basic sanity check to make sure that the arm bsd-user binary can interpret FreeBSD 64-bit amd64 binaries. Please note: it's named amd64 because that's the target name for FreeBSD's clang and it simplifies building a little. Signed-off-by: Warner Losh --- tests/bsd-user-smoke/h.amd64.S | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/bsd-user-smoke/h.amd64.S diff --git a/tests/bsd-user-smoke/h.amd64.S b/tests/bsd-user-smoke/h.amd64.S new file mode 100644 index 00000000000..a769e59beb8 --- /dev/null +++ b/tests/bsd-user-smoke/h.amd64.S @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Warner Losh +# SPDX-License-Identifier: BSD-2-Clause + +#include +#define STDOUT_FILENO 1 + + .text + .globl qemu_start + .p2align 4, 0x90 +qemu_start: + + # write(1, .L.str, sizeof(.L.str) - 1) + movq $.L.str, %rsi + movl $STDOUT_FILENO, %edi + movl $len, %edx + movl $SYS_write, %eax + syscall + + # _exit(0) + xorl %edi, %edi + movl $SYS_exit, %eax + syscall + + .section .rodata.str1.1,"aMS",@progbits,1 +.L.str: + .asciz "Hello World\n" +.L.strEnd: +len=3D.L.strEnd - .L.str - 1 --=20 2.33.0 From nobody Sun May 12 23:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638044734969999.9730857644739; Sat, 27 Nov 2021 12:25:34 -0800 (PST) Received: from localhost ([::1]:46270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr4GL-0003vF-TM for importer@patchew.org; Sat, 27 Nov 2021 15:25:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr4Ag-0003p1-Sz for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: from [2607:f8b0:4864:20::132] (port=39573 helo=mail-il1-x132.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr4Af-0004uL-It for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:42 -0500 Received: by mail-il1-x132.google.com with SMTP id a11so12394356ilj.6 for ; Sat, 27 Nov 2021 12:19:41 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h12sm3091632ila.81.2021.11.27.12.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 12:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eam3w9LXPfpndp7R0xNZyvXloRay7O+0JeoCABaTlpc=; b=yQQlkAminKrQHJOm6nO+jNBtiaE4WVysjOgY5c/dxicc9KIJ7XBqxPDlLv/H8Nwpw0 yEu/ZjUZox2+P20nMCoCgrh1oHjotmh7K+kLdY8oaVdo1nSiEVjdMrzoj5UkpaTk5pxK iBIOer7QbdkXJgBYIWv4DmVlCYOCPnhE2dzjMsFojRsZJSryTBDmWSmuOe+QH+/jP07J khgAfTnvJ+2UFKb6q5poiUfjVf7SUswGM4mxk1tjS4nn5MGheW96hR5sJRVqazmS7T1n fOz5NT3TKRZJK8zUeqx4PprPzr6vfC0/djcQYa6D1Ksk23mFLVn8oTx1/BNNgqJzUn7G MAIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eam3w9LXPfpndp7R0xNZyvXloRay7O+0JeoCABaTlpc=; b=1BMGp7IAB5n0mMn2VgiFtYtByIHkGTiJ99SFNXmLvBdy4c0lNC8JaXv9adkkl6WyCf ++upLSmknVQdesQOeZYdGj2y6EC+74IOstbSV5VHcoe3l0jwovfYXT1FQwJzJl9g6gxs FykAq+u8eNbtq8RzB3+mniPln3I5+ZvEoeJznPPYpozgcz3HetTDxbmqFM11jFUhQ0sS BUEGOiRiEcd5BUzIue4D5zwpVTc/UFM03zBOPvHJksmUw//qC5kCbTS2/wui8+DSZgiA ykaVDx3c72flMyHhE4ZWAMqu3aET+RtpqZuhuNviyy7ECrxihB1aHkmHFsyBeMBg+s/L 3jug== X-Gm-Message-State: AOAM530OdnyhhYmc6664x79NpqzYwWUJr36se0MyjUgnrlcPUlVNgp3o 3aEb44f9YW/fF5IkVTv8Wv+dU2Db+mFI0yCb X-Google-Smtp-Source: ABdhPJyiXeX8r5IKzWzThWc62auuYi54xY0JecD2OPa1qEZDJPzxHh97JHeBlDxUwlV1OdtBViA+Ng== X-Received: by 2002:a05:6e02:188a:: with SMTP id o10mr47292032ilu.296.1638044380272; Sat, 27 Nov 2021 12:19:40 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH for 7.0 4/5] smoke-bsd-user: A test script to run all the FreeBSD binaries Date: Sat, 27 Nov 2021 13:18:45 -0700 Message-Id: <20211127201846.64187-5-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com> References: <20211127201846.64187-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::132 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::132; envelope-from=imp@bsdimp.com; helo=mail-il1-x132.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: arrowd@freebsd.org, kevans@freebsd.org, richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org, Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1638044736979100001 Content-Type: text/plain; charset="utf-8" Simple shell script to iterate through all the FreeBSD binaries running qemu-$binary to ensure that we have minimal functionality for each platform. When more of the bsd-user fork has been upstreamed, this will be replaced by more extensive regresion tests. Signed-off-by: Warner Losh --- tests/bsd-user-smoke/smoke-bsd-user | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/bsd-user-smoke/smoke-bsd-user diff --git a/tests/bsd-user-smoke/smoke-bsd-user b/tests/bsd-user-smoke/smo= ke-bsd-user new file mode 100644 index 00000000000..20818fdf918 --- /dev/null +++ b/tests/bsd-user-smoke/smoke-bsd-user @@ -0,0 +1,22 @@ +#!/bin/sh + +build=3D$1 +testing=3D$2 + +smoke_one() { + local a=3D$1 q=3D$2 + + echo Hello World > foo1 + $build/qemu-$q $testing/h.$a > foo2 || die "cmd failed: $build/qemu-$q $t= esting/h.$a" + cmp foo1 foo2 || die "Hello World expected" + rm foo1 foo2 +} + +die() { + echo $1 + exit 1 +} + +smoke_one amd64 x86_64 +smoke_one armv7 arm +smoke_one i386 i386 --=20 2.33.0 From nobody Sun May 12 23:36:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638044552551819.2653636552166; Sat, 27 Nov 2021 12:22:32 -0800 (PST) Received: from localhost ([::1]:36964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr4DP-00061D-AK for importer@patchew.org; Sat, 27 Nov 2021 15:22:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr4Ah-0003q1-Ir for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:43 -0500 Received: from [2607:f8b0:4864:20::d2a] (port=35807 helo=mail-io1-xd2a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr4Ag-0004uU-9d for qemu-devel@nongnu.org; Sat, 27 Nov 2021 15:19:43 -0500 Received: by mail-io1-xd2a.google.com with SMTP id 14so15818900ioe.2 for ; Sat, 27 Nov 2021 12:19:41 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h12sm3091632ila.81.2021.11.27.12.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Nov 2021 12:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rtiy+rgX5dTfBlv3E94hpueK7awXe/1kmS2lnCTQDNA=; b=ytThQhic7MHv5GgTI0CHz+gKQaZcbKGT/EzTCpzGmQfYRK/ZeDk6ClRRq2ONoTMg2h t/qIoa67zhP/HD/3M0dWHiN4fZfFdd2OpG2d/zWvfLbCy5uOUAC+0Aqo4TDWkYoUWuGo Ta48VqESaF2tDE3nCywCIkYGMYMwCu0z++TE4KRVsJu/PgdbiTmdQ2/qtZI7kbraBngH 7fW2SHIgkOptFl3BNWBnva2eb4zpQWwV6ey2cyuH7bxIbOxbl5SniQcowYgX5h2tFqVN 6heX2y1opk6AY/YOUP4kv6t/6QAuTMCe+isJ5FCctXammM6KhaWagmvacZhbtncqiKSB PxuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rtiy+rgX5dTfBlv3E94hpueK7awXe/1kmS2lnCTQDNA=; b=TJpG8FcA1azn6GXX57v+kjd73cf1noyYgi/DDglzQi3FkkWRmA27C525ruk25ImJU2 2Z2S/MUsEO3sBgDWVMEAouttmq5AWTgFl2vNXczUnq89RvZbjVVwZJkv7B1qgFf+74cH 2Pw6L86oGWF1mAGlkd1Gn/t8YyTjhrEvcti07bJOX0azMayDextIVXOs8rSqxPXld/on g5hwigMNtawRL0K8Coy7WaxmvxEjEWInLED25wY2BgpQ9uC9mxfamX+8/MENBCtGkmOK rHdJ9UfKP4iGh/oAAe1K5WGWtahA1ptBqWq17UyhRmz82XA1ffoGUvHumOcvPJOC899d lBkA== X-Gm-Message-State: AOAM531V0hPXQVPBgdOfQFscQflqvrVdyWqg7Q6OX5oodenGBjGALkkx YEROKYzJYZzOXRotyMwQlvnJLdaMIls5Rzkk X-Google-Smtp-Source: ABdhPJyd0EwU1g2XqEx79VhAB/Z+QApS8lDMHqw2RHJuJuEaAKSS08vC92UCrEEEdNPHuj6TxgjM0g== X-Received: by 2002:a5e:c645:: with SMTP id s5mr44293413ioo.154.1638044381145; Sat, 27 Nov 2021 12:19:41 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH for 7.0 5/5] bsd-user-smoke: Add to build Date: Sat, 27 Nov 2021 13:18:46 -0700 Message-Id: <20211127201846.64187-6-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211127201846.64187-1-imp@bsdimp.com> References: <20211127201846.64187-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2a (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2a; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2a.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: arrowd@freebsd.org, kevans@freebsd.org, richard.henderson@linaro.org, f4bug@amsat.org, def@freebsd.org, Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1638044553790100004 Content-Type: text/plain; charset="utf-8" Add a simple bsd-user smoke test for ensuring bsd-user is minimally functional. This runs only when bsd-user has been configured. It adds a simple execution of 'hello world' type binaries for bsd-user. At the present these are tiny, hand-crafted binaries that are statically linked and do not depend on any host libraries being present (they also take advantage of the fact that on FreeBSD all system call numbers are uniform on all architectures). This was done both for building and testing simplicity, as well as recognizing the current state of bsd-user in qemu upstream is extremely basic. Signed-off-by: Warner Losh --- tests/bsd-user-smoke/meson.build | 31 +++++++++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 32 insertions(+) create mode 100644 tests/bsd-user-smoke/meson.build diff --git a/tests/bsd-user-smoke/meson.build b/tests/bsd-user-smoke/meson.= build new file mode 100644 index 00000000000..586697ab3b6 --- /dev/null +++ b/tests/bsd-user-smoke/meson.build @@ -0,0 +1,31 @@ +if not have_bsd_user + subdir_done() +endif + +smoke_bsd_user =3D find_program('smoke-bsd-user') + +bsd_user_archs =3D [ 'armv7', 'amd64', 'i386' ] +targs =3D [] +foreach i : bsd_user_archs + h =3D 'h.' + i + targs +=3D custom_target('bsd-user h.' + i, + output : h, + input : h + '.S', + command : ['clang', + '-target', + i + '-unknown-freebsd14.0', + '-o', + '@OUTPUT@', + '@INPUT@', + '-nostdlib', + '-Wl,-e', + '-Wl,qemu_start', + '-static'], + install : false) +endforeach + +test('bsd-user-smoke', smoke_bsd_user, + args: [meson.project_build_root(), meson.current_build_dir()], + suite: 'smoke', + depends: targs +) diff --git a/tests/meson.build b/tests/meson.build index 3f3882748ae..3b95efe8896 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,6 +1,7 @@ py3 =3D import('python').find_installation() =20 subdir('bench') +subdir('bsd-user-smoke') =20 test_qapi_outputs =3D [ 'qapi-builtin-types.c', --=20 2.33.0