From patchwork Tue Nov 16 11:02:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 519200 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp6972976imj; Tue, 16 Nov 2021 03:08:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeOQxtau8aYa15EaSPGvk+ZnbS93cOnZBIbjsV8KSCwDEavr9l5BuHaRamR5+2ZVqVCQ05 X-Received: by 2002:a05:620a:44d4:: with SMTP id y20mr5273322qkp.25.1637060923297; Tue, 16 Nov 2021 03:08:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637060923; cv=none; d=google.com; s=arc-20160816; b=qvygu2z7gq2wfJ/LONLJTzGtdGTqkofx8vGiVBy1bU4CTmTPnz+jYBD+rfqPHr9H/k GmPkk20dK8nCnT4hDC2/o38QyDCl2CJERbnEQmGtqrFmD1/+y/FrNH8wuqxNc4gDrvV7 GUcQro3nV/RsgpwA56aAaDX/gwTq8PcbRki9B8ihdp7k24y/VG+Q5otYE6TUEi4uPDOV TMvkzLrO8cDemjL2+m6Jk6fQN29vXaoIJXL+iXsLQ6ib+x+kDtabs7y9O8VO7iN21SHp wtR8ZN9/8/5TRGRCueIPEVuz6KclivmlEidCkuDAWBs+HhIiRp9hIoxG6mGosPkzRc6L B7Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5ersVyP4dai2FHOQSCztPDbnZ5yJisq87sPVkJZJ0M0=; b=Pm5p3xGEqA9FZICeApPoNR9gCY8Ut82b7+vSsW+CXhEEsLRWaLzAb1HipUnPk2Vp9b /wp5BNI7fmr2RtaONi3P3jW/oGIFk7nWOK1ozl/dRXCvZPWygbCK9cu65TaF+5rEBgeC tlTZAAwngK2V5jw/krDYh0r0D3OuoyYaIsq1k9EAHytO5GOFFJWw8yB83I6oqBoTYUml SY+WgPmoPcas52/9TEnAoDpZBXPm7uHqO0ea/z3zMMejz/HjF4zGhzfEyRb2/j2cVUG2 QAsorJLlX1PBcxgQhRj/mqc4fBRqHemKy5l6XAL0nj9c85uLGG6l1maMAStR5xqmMtFE 59lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J1vR8Eb6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bm4si27497724qkb.66.2021.11.16.03.08.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Nov 2021 03:08:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J1vR8Eb6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmwKQ-0004Rr-NI for patch@linaro.org; Tue, 16 Nov 2021 06:08:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmwF9-0001xF-4W for qemu-devel@nongnu.org; Tue, 16 Nov 2021 06:03:15 -0500 Received: from [2a00:1450:4864:20::336] (port=41843 helo=mail-wm1-x336.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmwF7-0004vl-Je for qemu-devel@nongnu.org; Tue, 16 Nov 2021 06:03:14 -0500 Received: by mail-wm1-x336.google.com with SMTP id f7-20020a1c1f07000000b0032ee11917ceso2088100wmf.0 for ; Tue, 16 Nov 2021 03:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ersVyP4dai2FHOQSCztPDbnZ5yJisq87sPVkJZJ0M0=; b=J1vR8Eb6AjJQj1Z3potXlFnMnTGQQI9Eogdymx8WjOKL9SEs3qV2Gx2TJuMuFADdoU IdN0en/wjSle+U5BTvUO8wooIuNevPVjzwDHwFYmBp88lHb8LGIiWlJp1K1etQHcXVui jBRpRZTpXa4B9y9guQqm2U1VGR5ARJTHYhStpxLKTl86eGJadSy6KQeWzJcK/U9p18dk skoH9OFha1Sh5zmPiwvusLhWVqdhqcgbUZrfiT1kLvtHh1vxog7NMQz5fe6SWB2l+eHg 7jngmIB0w/2mKFKXcGwdu/PBX5suBtLXar9jjmEl8baGIjKkAQYBoqpoxj+cp09kTp6w nNzA== 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=5ersVyP4dai2FHOQSCztPDbnZ5yJisq87sPVkJZJ0M0=; b=QfKZ/lUAVupQOQ6j/H5yDq9GvWvL1mBywOZCpfA5W3k1fkmXghzxt+UJKV/RSuXWd6 W7UB8f4axY2Ref+YxxnQi5w5kb6KaHz+p2FgDBtvsDRN86WMe0+Txg+gBOAI/mrquBqP YDB/laYcW4RpP+YHtGa56+7nT5RvnO3J1mxs+pADk2MGL0QYURJR0D0Dm4DJjJhkLOQ6 n2byVcjJsuyzRCFcaALGMPXVB7l7Mz4wRRrgivGptneFszJKOwoHaoMlAhUI8FL6ZTyL ntuaZvLuNcGDTpTdoam4639yiBvPuNe6Xnn32Z1qMAGftBPN6XhEKajxnooxOkaCM05O Q7TA== X-Gm-Message-State: AOAM533zGdtVBX43zImORX3gROZuYTshJxCGGaoUeWBbcQA1EUUNZ3ow IdTD7+oOcKNeSxW/CZ82J+YyVHcIFpKoh63dv3A= X-Received: by 2002:a1c:f319:: with SMTP id q25mr6602325wmq.33.1637060592322; Tue, 16 Nov 2021 03:03:12 -0800 (PST) Received: from localhost.localdomain (145.red-37-158-173.dynamicip.rima-tde.net. [37.158.173.145]) by smtp.gmail.com with ESMTPSA id f15sm2639779wmg.30.2021.11.16.03.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 03:03:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 9/9] common-user: Move safe-syscall.* from *-user Date: Tue, 16 Nov 2021 12:02:56 +0100 Message-Id: <20211116110256.365484-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211116110256.365484-1-richard.henderson@linaro.org> References: <20211116110256.365484-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::336 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu, imp@bsdimp.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Warner Losh Move linux-user/safe-syscall.S to common-user so that bsd-user can also use it. Also move safe-syscall.h to include/user/. Signed-off-by: Warner Losh [rth: Adjust build rules to eliminate common-save-syscall.S.] Signed-off-by: Richard Henderson --- meson.build | 8 ++++++-- {linux-user => include/user}/safe-syscall.h | 0 linux-user/signal.c | 2 +- linux-user/syscall.c | 2 +- common-user/meson.build | 2 ++ {linux-user => common-user}/safe-syscall.S | 0 linux-user/meson.build | 1 - 7 files changed, 10 insertions(+), 5 deletions(-) rename {linux-user => include/user}/safe-syscall.h (100%) create mode 100644 common-user/meson.build rename {linux-user => common-user}/safe-syscall.S (100%) diff --git a/meson.build b/meson.build index ec22cf05c1..c5b0b2b247 100644 --- a/meson.build +++ b/meson.build @@ -2359,6 +2359,7 @@ block_ss = ss.source_set() bsd_user_ss = ss.source_set() chardev_ss = ss.source_set() common_ss = ss.source_set() +common_user_ss = ss.source_set() crypto_ss = ss.source_set() hwcore_ss = ss.source_set() io_ss = ss.source_set() @@ -2605,12 +2606,15 @@ subdir('accel') subdir('plugins') subdir('bsd-user') subdir('linux-user') +subdir('common-user') subdir('ebpf') -specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) +specific_ss.add_all(when: 'CONFIG_BSD_USER', + if_true: [bsd_user_ss, common_user_ss]) linux_user_ss.add(files('thunk.c')) -specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) +specific_ss.add_all(when: 'CONFIG_LINUX_USER', + if_true: [linux_user_ss, common_user_ss]) # needed for fuzzing binaries subdir('tests/qtest/libqos') diff --git a/linux-user/safe-syscall.h b/include/user/safe-syscall.h similarity index 100% rename from linux-user/safe-syscall.h rename to include/user/safe-syscall.h diff --git a/linux-user/signal.c b/linux-user/signal.c index ca8f24b9ec..0744c6bf20 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -31,7 +31,7 @@ #include "trace.h" #include "signal-common.h" #include "host-signal.h" -#include "safe-syscall.h" +#include "user/safe-syscall.h" static struct target_sigaction sigact_table[TARGET_NSIG]; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 544f5b662f..0c5f63d08c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -132,7 +132,7 @@ #include "signal-common.h" #include "loader.h" #include "user-mmap.h" -#include "safe-syscall.h" +#include "user/safe-syscall.h" #include "qemu/guest-random.h" #include "qemu/selfmap.h" #include "user/syscall-trace.h" diff --git a/common-user/meson.build b/common-user/meson.build new file mode 100644 index 0000000000..233b69199c --- /dev/null +++ b/common-user/meson.build @@ -0,0 +1,2 @@ +# TODO: reorg the *-user headers so that this can be built once. +common_user_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('safe-syscall.S')) diff --git a/linux-user/safe-syscall.S b/common-user/safe-syscall.S similarity index 100% rename from linux-user/safe-syscall.S rename to common-user/safe-syscall.S diff --git a/linux-user/meson.build b/linux-user/meson.build index bf62c13e37..af8d39aecc 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -9,7 +9,6 @@ linux_user_ss.add(files( 'linuxload.c', 'main.c', 'mmap.c', - 'safe-syscall.S', 'signal.c', 'strace.c', 'syscall.c',