From patchwork Tue Dec 14 00:25:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523658 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5338423wro; Mon, 13 Dec 2021 16:31:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxXocv9cFeIYEd1475baT7+dLvQlVFD+YTKmdo413CYjQTLjMf2H92OWZm321PjYoIg6g4 X-Received: by 2002:a05:622a:291:: with SMTP id z17mr2325039qtw.138.1639441900979; Mon, 13 Dec 2021 16:31:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441900; cv=none; d=google.com; s=arc-20160816; b=KzDoYL5ncGBxig2jOgOW4jGsBlEwU2IM6lRRYDT8gohZMS6XATvvBHNJ/y3GNb02CV 8wf1gV+1xqzua65Uc0m9I9658//ot64e8s8m/iQnTtIBCfmfply30saAUzxjyQIMah3e 9/SoiW6OZvbCx38dAoFOPMMnv16VFB9DCT0Zsu3AwpGUkAIFBvSqnuneDxERlL11xKUw LRqI83uHvjY3u2hJfWWbeIJLAymsar8lWfifgkf7WlDiB/bG37s2YYBJ1ZDTKhih/pF8 OjAQ0ZJNMWBsu1OTrshyDuxnGLjW4UVCNj+InJ2H0Odd1x8wS33xBIu2BEbsIe9tWOgc CFTQ== 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=rx8o1uDxj4/J/lwyknM0buEGf3Zbqh5qXdTGD5dLKVI=; b=w2C2arGOL14a1+ZAmPnjECVHp5if5CL4hotdbqMCZTIDlnDFmWTptAlXZm7C8vluGi MpJz95TQ9kyfJQac3hEZuOvCCbtqAs9IGZgFFFQYFqkPig744MU90/zMs9F7pLTo2q/y tPllX6p93tyrov69HGI4w/nQiHUx7IimlFfo+OG0wWBrfDyild3AtKmkjD9+g/2UDlrp pywqcIO77IwWB6jolriVHMJHxScfYyqiNqDtGelnCeAAKWa3uY7hpSh+NVFX4sfQz94C 1QyWmwIDmThKSV5S/KlzkXqHBYFmSmd4s0MudZXPoKIArehWATrZIgZcdn+ZrR5vEIBQ 3UmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eB78219G; 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 t7si13810759qta.265.2021.12.13.16.31.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:31:40 -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=eB78219G; 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]:34874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvjI-0005U1-9g for patch@linaro.org; Mon, 13 Dec 2021 19:31:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve1-0007qJ-OW for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:13 -0500 Received: from [2607:f8b0:4864:20::1031] (port=42964 helo=mail-pj1-x1031.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwvdx-0005R1-5M for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:13 -0500 Received: by mail-pj1-x1031.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so14725217pjb.1 for ; Mon, 13 Dec 2021 16:26:08 -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=rx8o1uDxj4/J/lwyknM0buEGf3Zbqh5qXdTGD5dLKVI=; b=eB78219GHNjz30kjvr68sNiO5gTXuWEwp8fFYkpTpUWlQbeBc6XFeE8LAJIa6T1Y9L xzrXbZKT+o4+Dfan6erhFErZsFVrbBWLXuNDlZu77FcTIavnJk9iMnO349UjoLdnjLii 2ATifGLurkl1oBTXpWWmiUgYkQPwoVkVhn8Ip6mOf6wa0GlvDK2nxZ+Wyd1c+71ViCF/ II4nbenBvug8G+g0uUADPy7UwUnx+iUje9utwLIpO4vEHlV+CFlA4HBjr3vHoinu2wfh 42OjmicSXLNHdkb55Z8eBXqCPr7Xb3dvvVnsoynQUI4l15rXNtPFPGRHdN4039UWtuUZ wYDQ== 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=rx8o1uDxj4/J/lwyknM0buEGf3Zbqh5qXdTGD5dLKVI=; b=hP+5jJZyunnkuY5kN6lBffsnl7YwPG1nWkEZYfdqt2X45/8VWp0GfTpm2fXQIPwN64 l3jrI46fLCC1H2sMaR/lZP75vEiuNJsSq9M/KZE323VvClCuTj/Ghj0TkaaLbAXXuly/ OtGfz7wQdFgUJRY17oR1bnNHRJ7lkuaQZDh3gHQg9jTzp4E7RLitIpKIs0GY0f24e8RK wJ40gMBoFqV4buAlxxa7S4dBO/SGEF6TRXDotXazRRh0bzhKO/0k81/bJP2LBybhvN0W u4M7E4Mg9TKyn8yYP0A3sewS9+z2JH/Hv/KuQJ+iFSlled9KcPrxuzniNRJoGKdEtbEK 7FLQ== X-Gm-Message-State: AOAM5304o7Mko+ieZB3913WQbUUs4RA95cDmKEbT13qTOf8ypzI77rAr Oq81sCHL07KoyCWdxRQOjtwEKuLq1OBFyg== X-Received: by 2002:a17:90a:e389:: with SMTP id b9mr1771291pjz.235.1639441567373; Mon, 13 Dec 2021 16:26:07 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 01/15] linux-user: Untabify all safe-syscall.inc.S Date: Mon, 13 Dec 2021 16:25:50 -0800 Message-Id: <20211214002604.161983-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1031 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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, 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: git@xen0n.name, Peter Maydell , laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Warner Losh Suggested-by: Peter Maydell Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/host/aarch64/safe-syscall.inc.S | 110 +++++++------- linux-user/host/arm/safe-syscall.inc.S | 134 ++++++++--------- linux-user/host/i386/safe-syscall.inc.S | 158 ++++++++++----------- linux-user/host/ppc64/safe-syscall.inc.S | 134 ++++++++--------- linux-user/host/riscv/safe-syscall.inc.S | 114 +++++++-------- linux-user/host/s390x/safe-syscall.inc.S | 140 +++++++++--------- linux-user/host/x86_64/safe-syscall.inc.S | 2 +- 7 files changed, 396 insertions(+), 396 deletions(-) diff --git a/linux-user/host/aarch64/safe-syscall.inc.S b/linux-user/host/aarch64/safe-syscall.inc.S index bc1f5a9792..e2e726ef55 100644 --- a/linux-user/host/aarch64/safe-syscall.inc.S +++ b/linux-user/host/aarch64/safe-syscall.inc.S @@ -10,66 +10,66 @@ * See the COPYING file in the top-level directory. */ - .global safe_syscall_base - .global safe_syscall_start - .global safe_syscall_end - .type safe_syscall_base, #function - .type safe_syscall_start, #function - .type safe_syscall_end, #function + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, #function + .type safe_syscall_start, #function + .type safe_syscall_end, #function - /* This is the entry point for making a system call. The calling - * convention here is that of a C varargs function with the - * first argument an 'int *' to the signal_pending flag, the - * second one the system call number (as a 'long'), and all further - * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. - */ + /* This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + * We return a long which is the syscall's return value, which + * may be negative-errno on failure. Conversion to the + * -1-and-errno-set convention is done by the calling wrapper. + */ safe_syscall_base: - .cfi_startproc - /* The syscall calling convention isn't the same as the - * C one: - * we enter with x0 == *signal_pending - * x1 == syscall number - * x2 ... x7, (stack) == syscall arguments - * and return the result in x0 - * and the syscall instruction needs - * x8 == syscall number - * x0 ... x6 == syscall arguments - * and returns the result in x0 - * Shuffle everything around appropriately. - */ - mov x9, x0 /* signal_pending pointer */ - mov x8, x1 /* syscall number */ - mov x0, x2 /* syscall arguments */ - mov x1, x3 - mov x2, x4 - mov x3, x5 - mov x4, x6 - mov x5, x7 - ldr x6, [sp] + .cfi_startproc + /* The syscall calling convention isn't the same as the + * C one: + * we enter with x0 == *signal_pending + * x1 == syscall number + * x2 ... x7, (stack) == syscall arguments + * and return the result in x0 + * and the syscall instruction needs + * x8 == syscall number + * x0 ... x6 == syscall arguments + * and returns the result in x0 + * Shuffle everything around appropriately. + */ + mov x9, x0 /* signal_pending pointer */ + mov x8, x1 /* syscall number */ + mov x0, x2 /* syscall arguments */ + mov x1, x3 + mov x2, x4 + mov x3, x5 + mov x4, x6 + mov x5, x7 + ldr x6, [sp] - /* This next sequence of code works in conjunction with the - * rewind_if_safe_syscall_function(). If a signal is taken - * and the interrupted PC is anywhere between 'safe_syscall_start' - * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. - * The code sequence must therefore be able to cope with this, and - * the syscall instruction must be the final one in the sequence. - */ + /* This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ safe_syscall_start: - /* if signal_pending is non-zero, don't do the call */ - ldr w10, [x9] - cbnz w10, 0f - svc 0x0 + /* if signal_pending is non-zero, don't do the call */ + ldr w10, [x9] + cbnz w10, 0f + svc 0x0 safe_syscall_end: - /* code path for having successfully executed the syscall */ - ret + /* code path for having successfully executed the syscall */ + ret 0: - /* code path when we didn't execute the syscall */ - mov x0, #-TARGET_ERESTARTSYS - ret - .cfi_endproc + /* code path when we didn't execute the syscall */ + mov x0, #-TARGET_ERESTARTSYS + ret + .cfi_endproc - .size safe_syscall_base, .-safe_syscall_base + .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/arm/safe-syscall.inc.S b/linux-user/host/arm/safe-syscall.inc.S index 88c4958504..1f1ee8327b 100644 --- a/linux-user/host/arm/safe-syscall.inc.S +++ b/linux-user/host/arm/safe-syscall.inc.S @@ -10,81 +10,81 @@ * See the COPYING file in the top-level directory. */ - .global safe_syscall_base - .global safe_syscall_start - .global safe_syscall_end - .type safe_syscall_base, %function + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, %function - .cfi_sections .debug_frame + .cfi_sections .debug_frame - .text - .syntax unified - .arm - .align 2 + .text + .syntax unified + .arm + .align 2 - /* This is the entry point for making a system call. The calling - * convention here is that of a C varargs function with the - * first argument an 'int *' to the signal_pending flag, the - * second one the system call number (as a 'long'), and all further - * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. - */ + /* This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + * We return a long which is the syscall's return value, which + * may be negative-errno on failure. Conversion to the + * -1-and-errno-set convention is done by the calling wrapper. + */ safe_syscall_base: - .fnstart - .cfi_startproc - mov r12, sp /* save entry stack */ - push { r4, r5, r6, r7, r8, lr } - .save { r4, r5, r6, r7, r8, lr } - .cfi_adjust_cfa_offset 24 - .cfi_rel_offset r4, 0 - .cfi_rel_offset r5, 4 - .cfi_rel_offset r6, 8 - .cfi_rel_offset r7, 12 - .cfi_rel_offset r8, 16 - .cfi_rel_offset lr, 20 + .fnstart + .cfi_startproc + mov r12, sp /* save entry stack */ + push { r4, r5, r6, r7, r8, lr } + .save { r4, r5, r6, r7, r8, lr } + .cfi_adjust_cfa_offset 24 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + .cfi_rel_offset r6, 8 + .cfi_rel_offset r7, 12 + .cfi_rel_offset r8, 16 + .cfi_rel_offset lr, 20 - /* The syscall calling convention isn't the same as the C one: - * we enter with r0 == *signal_pending - * r1 == syscall number - * r2, r3, [sp+0] ... [sp+12] == syscall arguments - * and return the result in r0 - * and the syscall instruction needs - * r7 == syscall number - * r0 ... r6 == syscall arguments - * and returns the result in r0 - * Shuffle everything around appropriately. - * Note the 16 bytes that we pushed to save registers. - */ - mov r8, r0 /* copy signal_pending */ - mov r7, r1 /* syscall number */ - mov r0, r2 /* syscall args */ - mov r1, r3 - ldm r12, { r2, r3, r4, r5, r6 } + /* The syscall calling convention isn't the same as the C one: + * we enter with r0 == *signal_pending + * r1 == syscall number + * r2, r3, [sp+0] ... [sp+12] == syscall arguments + * and return the result in r0 + * and the syscall instruction needs + * r7 == syscall number + * r0 ... r6 == syscall arguments + * and returns the result in r0 + * Shuffle everything around appropriately. + * Note the 16 bytes that we pushed to save registers. + */ + mov r8, r0 /* copy signal_pending */ + mov r7, r1 /* syscall number */ + mov r0, r2 /* syscall args */ + mov r1, r3 + ldm r12, { r2, r3, r4, r5, r6 } - /* This next sequence of code works in conjunction with the - * rewind_if_safe_syscall_function(). If a signal is taken - * and the interrupted PC is anywhere between 'safe_syscall_start' - * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. - * The code sequence must therefore be able to cope with this, and - * the syscall instruction must be the final one in the sequence. - */ + /* This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ safe_syscall_start: - /* if signal_pending is non-zero, don't do the call */ - ldr r12, [r8] /* signal_pending */ - tst r12, r12 - bne 1f - swi 0 + /* if signal_pending is non-zero, don't do the call */ + ldr r12, [r8] /* signal_pending */ + tst r12, r12 + bne 1f + swi 0 safe_syscall_end: - /* code path for having successfully executed the syscall */ - pop { r4, r5, r6, r7, r8, pc } + /* code path for having successfully executed the syscall */ + pop { r4, r5, r6, r7, r8, pc } 1: - /* code path when we didn't execute the syscall */ - ldr r0, =-TARGET_ERESTARTSYS - pop { r4, r5, r6, r7, r8, pc } - .fnend - .cfi_endproc + /* code path when we didn't execute the syscall */ + ldr r0, =-TARGET_ERESTARTSYS + pop { r4, r5, r6, r7, r8, pc } + .fnend + .cfi_endproc - .size safe_syscall_base, .-safe_syscall_base + .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/i386/safe-syscall.inc.S b/linux-user/host/i386/safe-syscall.inc.S index 9e58fc6504..e425aa54d8 100644 --- a/linux-user/host/i386/safe-syscall.inc.S +++ b/linux-user/host/i386/safe-syscall.inc.S @@ -10,91 +10,91 @@ * See the COPYING file in the top-level directory. */ - .global safe_syscall_base - .global safe_syscall_start - .global safe_syscall_end - .type safe_syscall_base, @function + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, @function - /* This is the entry point for making a system call. The calling - * convention here is that of a C varargs function with the - * first argument an 'int *' to the signal_pending flag, the - * second one the system call number (as a 'long'), and all further - * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. - */ + /* This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + * We return a long which is the syscall's return value, which + * may be negative-errno on failure. Conversion to the + * -1-and-errno-set convention is done by the calling wrapper. + */ safe_syscall_base: - .cfi_startproc - push %ebp - .cfi_adjust_cfa_offset 4 - .cfi_rel_offset ebp, 0 - push %esi - .cfi_adjust_cfa_offset 4 - .cfi_rel_offset esi, 0 - push %edi - .cfi_adjust_cfa_offset 4 - .cfi_rel_offset edi, 0 - push %ebx - .cfi_adjust_cfa_offset 4 - .cfi_rel_offset ebx, 0 + .cfi_startproc + push %ebp + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset ebp, 0 + push %esi + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset esi, 0 + push %edi + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset edi, 0 + push %ebx + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset ebx, 0 - /* The syscall calling convention isn't the same as the C one: - * we enter with 0(%esp) == return address - * 4(%esp) == *signal_pending - * 8(%esp) == syscall number - * 12(%esp) ... 32(%esp) == syscall arguments - * and return the result in eax - * and the syscall instruction needs - * eax == syscall number - * ebx, ecx, edx, esi, edi, ebp == syscall arguments - * and returns the result in eax - * Shuffle everything around appropriately. - * Note the 16 bytes that we pushed to save registers. - */ - mov 12+16(%esp), %ebx /* the syscall arguments */ - mov 16+16(%esp), %ecx - mov 20+16(%esp), %edx - mov 24+16(%esp), %esi - mov 28+16(%esp), %edi - mov 32+16(%esp), %ebp + /* The syscall calling convention isn't the same as the C one: + * we enter with 0(%esp) == return address + * 4(%esp) == *signal_pending + * 8(%esp) == syscall number + * 12(%esp) ... 32(%esp) == syscall arguments + * and return the result in eax + * and the syscall instruction needs + * eax == syscall number + * ebx, ecx, edx, esi, edi, ebp == syscall arguments + * and returns the result in eax + * Shuffle everything around appropriately. + * Note the 16 bytes that we pushed to save registers. + */ + mov 12+16(%esp), %ebx /* the syscall arguments */ + mov 16+16(%esp), %ecx + mov 20+16(%esp), %edx + mov 24+16(%esp), %esi + mov 28+16(%esp), %edi + mov 32+16(%esp), %ebp - /* This next sequence of code works in conjunction with the - * rewind_if_safe_syscall_function(). If a signal is taken - * and the interrupted PC is anywhere between 'safe_syscall_start' - * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. - * The code sequence must therefore be able to cope with this, and - * the syscall instruction must be the final one in the sequence. - */ + /* This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ safe_syscall_start: - /* if signal_pending is non-zero, don't do the call */ - mov 4+16(%esp), %eax /* signal_pending */ - cmpl $0, (%eax) - jnz 1f - mov 8+16(%esp), %eax /* syscall number */ - int $0x80 + /* if signal_pending is non-zero, don't do the call */ + mov 4+16(%esp), %eax /* signal_pending */ + cmpl $0, (%eax) + jnz 1f + mov 8+16(%esp), %eax /* syscall number */ + int $0x80 safe_syscall_end: - /* code path for having successfully executed the syscall */ - pop %ebx - .cfi_remember_state - .cfi_adjust_cfa_offset -4 - .cfi_restore ebx - pop %edi - .cfi_adjust_cfa_offset -4 - .cfi_restore edi - pop %esi - .cfi_adjust_cfa_offset -4 - .cfi_restore esi - pop %ebp - .cfi_adjust_cfa_offset -4 - .cfi_restore ebp - ret + /* code path for having successfully executed the syscall */ + pop %ebx + .cfi_remember_state + .cfi_adjust_cfa_offset -4 + .cfi_restore ebx + pop %edi + .cfi_adjust_cfa_offset -4 + .cfi_restore edi + pop %esi + .cfi_adjust_cfa_offset -4 + .cfi_restore esi + pop %ebp + .cfi_adjust_cfa_offset -4 + .cfi_restore ebp + ret 1: - /* code path when we didn't execute the syscall */ - .cfi_restore_state - mov $-TARGET_ERESTARTSYS, %eax - jmp safe_syscall_end - .cfi_endproc + /* code path when we didn't execute the syscall */ + .cfi_restore_state + mov $-TARGET_ERESTARTSYS, %eax + jmp safe_syscall_end + .cfi_endproc - .size safe_syscall_base, .-safe_syscall_base + .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/ppc64/safe-syscall.inc.S b/linux-user/host/ppc64/safe-syscall.inc.S index 875133173b..4b57440585 100644 --- a/linux-user/host/ppc64/safe-syscall.inc.S +++ b/linux-user/host/ppc64/safe-syscall.inc.S @@ -10,87 +10,87 @@ * See the COPYING file in the top-level directory. */ - .global safe_syscall_base - .global safe_syscall_start - .global safe_syscall_end - .type safe_syscall_base, @function + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, @function - .text + .text - /* This is the entry point for making a system call. The calling - * convention here is that of a C varargs function with the - * first argument an 'int *' to the signal_pending flag, the - * second one the system call number (as a 'long'), and all further - * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. - */ + /* This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + * We return a long which is the syscall's return value, which + * may be negative-errno on failure. Conversion to the + * -1-and-errno-set convention is done by the calling wrapper. + */ #if _CALL_ELF == 2 safe_syscall_base: - .cfi_startproc - .localentry safe_syscall_base,0 + .cfi_startproc + .localentry safe_syscall_base,0 #else - .section ".opd","aw" - .align 3 + .section ".opd","aw" + .align 3 safe_syscall_base: - .quad .L.safe_syscall_base,.TOC.@tocbase,0 - .previous + .quad .L.safe_syscall_base,.TOC.@tocbase,0 + .previous .L.safe_syscall_base: - .cfi_startproc + .cfi_startproc #endif - /* We enter with r3 == *signal_pending - * r4 == syscall number - * r5 ... r10 == syscall arguments - * and return the result in r3 - * and the syscall instruction needs - * r0 == syscall number - * r3 ... r8 == syscall arguments - * and returns the result in r3 - * Shuffle everything around appropriately. - */ - std 14, 16(1) /* Preserve r14 in SP+16 */ - .cfi_offset 14, 16 - mr 14, 3 /* signal_pending */ - mr 0, 4 /* syscall number */ - mr 3, 5 /* syscall arguments */ - mr 4, 6 - mr 5, 7 - mr 6, 8 - mr 7, 9 - mr 8, 10 + /* We enter with r3 == *signal_pending + * r4 == syscall number + * r5 ... r10 == syscall arguments + * and return the result in r3 + * and the syscall instruction needs + * r0 == syscall number + * r3 ... r8 == syscall arguments + * and returns the result in r3 + * Shuffle everything around appropriately. + */ + std 14, 16(1) /* Preserve r14 in SP+16 */ + .cfi_offset 14, 16 + mr 14, 3 /* signal_pending */ + mr 0, 4 /* syscall number */ + mr 3, 5 /* syscall arguments */ + mr 4, 6 + mr 5, 7 + mr 6, 8 + mr 7, 9 + mr 8, 10 - /* This next sequence of code works in conjunction with the - * rewind_if_safe_syscall_function(). If a signal is taken - * and the interrupted PC is anywhere between 'safe_syscall_start' - * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. - * The code sequence must therefore be able to cope with this, and - * the syscall instruction must be the final one in the sequence. - */ + /* This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ safe_syscall_start: - /* if signal_pending is non-zero, don't do the call */ - lwz 12, 0(14) - cmpwi 0, 12, 0 - bne- 0f - sc + /* if signal_pending is non-zero, don't do the call */ + lwz 12, 0(14) + cmpwi 0, 12, 0 + bne- 0f + sc safe_syscall_end: - /* code path when we did execute the syscall */ - ld 14, 16(1) /* restore r14 to its original value */ - bnslr+ + /* code path when we did execute the syscall */ + ld 14, 16(1) /* restore r14 to its original value */ + bnslr+ - /* syscall failed; return negative errno */ - neg 3, 3 - blr + /* syscall failed; return negative errno */ + neg 3, 3 + blr - /* code path when we didn't execute the syscall */ -0: addi 3, 0, -TARGET_ERESTARTSYS - ld 14, 16(1) /* restore r14 to its original value */ - blr - .cfi_endproc + /* code path when we didn't execute the syscall */ +0: addi 3, 0, -TARGET_ERESTARTSYS + ld 14, 16(1) /* restore r14 to its original value */ + blr + .cfi_endproc #if _CALL_ELF == 2 - .size safe_syscall_base, .-safe_syscall_base + .size safe_syscall_base, .-safe_syscall_base #else - .size safe_syscall_base, .-.L.safe_syscall_base - .size .L.safe_syscall_base, .-.L.safe_syscall_base + .size safe_syscall_base, .-.L.safe_syscall_base + .size .L.safe_syscall_base, .-.L.safe_syscall_base #endif diff --git a/linux-user/host/riscv/safe-syscall.inc.S b/linux-user/host/riscv/safe-syscall.inc.S index 9ca3fbfd1e..95c4832de2 100644 --- a/linux-user/host/riscv/safe-syscall.inc.S +++ b/linux-user/host/riscv/safe-syscall.inc.S @@ -10,68 +10,68 @@ * See the COPYING file in the top-level directory. */ - .global safe_syscall_base - .global safe_syscall_start - .global safe_syscall_end - .type safe_syscall_base, @function - .type safe_syscall_start, @function - .type safe_syscall_end, @function + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, @function + .type safe_syscall_start, @function + .type safe_syscall_end, @function - /* - * This is the entry point for making a system call. The calling - * convention here is that of a C varargs function with the - * first argument an 'int *' to the signal_pending flag, the - * second one the system call number (as a 'long'), and all further - * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. - */ + /* + * This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + * We return a long which is the syscall's return value, which + * may be negative-errno on failure. Conversion to the + * -1-and-errno-set convention is done by the calling wrapper. + */ safe_syscall_base: - .cfi_startproc - /* - * The syscall calling convention is nearly the same as C: - * we enter with a0 == *signal_pending - * a1 == syscall number - * a2 ... a7 == syscall arguments - * and return the result in a0 - * and the syscall instruction needs - * a7 == syscall number - * a0 ... a5 == syscall arguments - * and returns the result in a0 - * Shuffle everything around appropriately. - */ - mv t0, a0 /* signal_pending pointer */ - mv t1, a1 /* syscall number */ - mv a0, a2 /* syscall arguments */ - mv a1, a3 - mv a2, a4 - mv a3, a5 - mv a4, a6 - mv a5, a7 - mv a7, t1 + .cfi_startproc + /* + * The syscall calling convention is nearly the same as C: + * we enter with a0 == *signal_pending + * a1 == syscall number + * a2 ... a7 == syscall arguments + * and return the result in a0 + * and the syscall instruction needs + * a7 == syscall number + * a0 ... a5 == syscall arguments + * and returns the result in a0 + * Shuffle everything around appropriately. + */ + mv t0, a0 /* signal_pending pointer */ + mv t1, a1 /* syscall number */ + mv a0, a2 /* syscall arguments */ + mv a1, a3 + mv a2, a4 + mv a3, a5 + mv a4, a6 + mv a5, a7 + mv a7, t1 - /* - * This next sequence of code works in conjunction with the - * rewind_if_safe_syscall_function(). If a signal is taken - * and the interrupted PC is anywhere between 'safe_syscall_start' - * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. - * The code sequence must therefore be able to cope with this, and - * the syscall instruction must be the final one in the sequence. - */ + /* + * This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ safe_syscall_start: - /* If signal_pending is non-zero, don't do the call */ - lw t1, 0(t0) - bnez t1, 0f - scall + /* If signal_pending is non-zero, don't do the call */ + lw t1, 0(t0) + bnez t1, 0f + scall safe_syscall_end: - /* code path for having successfully executed the syscall */ - ret + /* code path for having successfully executed the syscall */ + ret 0: - /* code path when we didn't execute the syscall */ - li a0, -TARGET_ERESTARTSYS - ret - .cfi_endproc + /* code path when we didn't execute the syscall */ + li a0, -TARGET_ERESTARTSYS + ret + .cfi_endproc - .size safe_syscall_base, .-safe_syscall_base + .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/s390x/safe-syscall.inc.S b/linux-user/host/s390x/safe-syscall.inc.S index 414b44ad38..d97d27458e 100644 --- a/linux-user/host/s390x/safe-syscall.inc.S +++ b/linux-user/host/s390x/safe-syscall.inc.S @@ -10,81 +10,81 @@ * See the COPYING file in the top-level directory. */ - .global safe_syscall_base - .global safe_syscall_start - .global safe_syscall_end - .type safe_syscall_base, @function + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, @function - /* This is the entry point for making a system call. The calling - * convention here is that of a C varargs function with the - * first argument an 'int *' to the signal_pending flag, the - * second one the system call number (as a 'long'), and all further - * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. - */ + /* This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + * We return a long which is the syscall's return value, which + * may be negative-errno on failure. Conversion to the + * -1-and-errno-set convention is done by the calling wrapper. + */ safe_syscall_base: - .cfi_startproc - stmg %r6,%r15,48(%r15) /* save all call-saved registers */ - .cfi_offset %r15,-40 - .cfi_offset %r14,-48 - .cfi_offset %r13,-56 - .cfi_offset %r12,-64 - .cfi_offset %r11,-72 - .cfi_offset %r10,-80 - .cfi_offset %r9,-88 - .cfi_offset %r8,-96 - .cfi_offset %r7,-104 - .cfi_offset %r6,-112 - lgr %r1,%r15 - lg %r0,8(%r15) /* load eos */ - aghi %r15,-160 - .cfi_adjust_cfa_offset 160 - stg %r1,0(%r15) /* store back chain */ - stg %r0,8(%r15) /* store eos */ + .cfi_startproc + stmg %r6,%r15,48(%r15) /* save all call-saved registers */ + .cfi_offset %r15,-40 + .cfi_offset %r14,-48 + .cfi_offset %r13,-56 + .cfi_offset %r12,-64 + .cfi_offset %r11,-72 + .cfi_offset %r10,-80 + .cfi_offset %r9,-88 + .cfi_offset %r8,-96 + .cfi_offset %r7,-104 + .cfi_offset %r6,-112 + lgr %r1,%r15 + lg %r0,8(%r15) /* load eos */ + aghi %r15,-160 + .cfi_adjust_cfa_offset 160 + stg %r1,0(%r15) /* store back chain */ + stg %r0,8(%r15) /* store eos */ - /* The syscall calling convention isn't the same as the - * C one: - * we enter with r2 == *signal_pending - * r3 == syscall number - * r4, r5, r6, (stack) == syscall arguments - * and return the result in r2 - * and the syscall instruction needs - * r1 == syscall number - * r2 ... r7 == syscall arguments - * and returns the result in r2 - * Shuffle everything around appropriately. - */ - lgr %r8,%r2 /* signal_pending pointer */ - lgr %r1,%r3 /* syscall number */ - lgr %r2,%r4 /* syscall args */ - lgr %r3,%r5 - lgr %r4,%r6 - lmg %r5,%r7,320(%r15) + /* The syscall calling convention isn't the same as the + * C one: + * we enter with r2 == *signal_pending + * r3 == syscall number + * r4, r5, r6, (stack) == syscall arguments + * and return the result in r2 + * and the syscall instruction needs + * r1 == syscall number + * r2 ... r7 == syscall arguments + * and returns the result in r2 + * Shuffle everything around appropriately. + */ + lgr %r8,%r2 /* signal_pending pointer */ + lgr %r1,%r3 /* syscall number */ + lgr %r2,%r4 /* syscall args */ + lgr %r3,%r5 + lgr %r4,%r6 + lmg %r5,%r7,320(%r15) - /* This next sequence of code works in conjunction with the - * rewind_if_safe_syscall_function(). If a signal is taken - * and the interrupted PC is anywhere between 'safe_syscall_start' - * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. - * The code sequence must therefore be able to cope with this, and - * the syscall instruction must be the final one in the sequence. - */ + /* This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ safe_syscall_start: - /* if signal_pending is non-zero, don't do the call */ - icm %r0,15,0(%r8) - jne 2f - svc 0 + /* if signal_pending is non-zero, don't do the call */ + icm %r0,15,0(%r8) + jne 2f + svc 0 safe_syscall_end: -1: lg %r15,0(%r15) /* load back chain */ - .cfi_remember_state - .cfi_adjust_cfa_offset -160 - lmg %r6,%r15,48(%r15) /* load saved registers */ - br %r14 - .cfi_restore_state -2: lghi %r2, -TARGET_ERESTARTSYS - j 1b - .cfi_endproc +1: lg %r15,0(%r15) /* load back chain */ + .cfi_remember_state + .cfi_adjust_cfa_offset -160 + lmg %r6,%r15,48(%r15) /* load saved registers */ + br %r14 + .cfi_restore_state +2: lghi %r2, -TARGET_ERESTARTSYS + j 1b + .cfi_endproc - .size safe_syscall_base, .-safe_syscall_base + .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/linux-user/host/x86_64/safe-syscall.inc.S index f36992daa3..158225553e 100644 --- a/linux-user/host/x86_64/safe-syscall.inc.S +++ b/linux-user/host/x86_64/safe-syscall.inc.S @@ -67,7 +67,7 @@ safe_syscall_base: */ safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ - cmpl $0, (%rbp) + cmpl $0, (%rbp) jnz 1f syscall safe_syscall_end: From patchwork Tue Dec 14 00:25:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523654 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5335407wro; Mon, 13 Dec 2021 16:27:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3xAWGSs41nqOoyrTPjT+4cVOttOhn8BOkttpF4mqesiib0TRnkV4o/zm3EUJ+WgZLuJX2 X-Received: by 2002:a67:ef0e:: with SMTP id j14mr2319298vsr.82.1639441658800; Mon, 13 Dec 2021 16:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441658; cv=none; d=google.com; s=arc-20160816; b=eT723XVlfFRCBta46DM/G+WSUyxZox9m6j7Bq0XIOR0H32fZ286HYKoo+j97FpOim5 dKNVrRL0Jdb6vDe4tftjJbSIeSXY8OllqMwn4piSOWqdFBNVN+8ecVJshSxMHe5ob6XA aRbQMLxdOnMPmQlCmY0FJnQ/cemy11zAAIijfzNq2dvOc0DACztIYzd4BxuvWLFSpSIv hhQa07R5aKA/QAmoMPxWppp2DduF2+LCLjPx3I6Jotnb0cIYyUYyqbdibsO+IOgkFuHR gPnSQ+nDtZZxfdScOyHroVGo9Bbe4s7yG021Hnm8kO7mNxGKwVH1mLiF6HJ93rJvKO6S BCeg== 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=GufoDHfjYxZ3FYh1AK2uby8vthRBQr9IHhcQ3lafcZ8=; b=UA0O7OGMOhaaky0yORBoa5BPyL/BzfZwJYpXQgnLxCvZBR9vxI6MtYIx7nReZUkhgU KwgJSstMr8EdBQqCROoOAjhE0w4nS1Q1sqXPst3TsYLApjaYoGSa+OOgqiIzq84WoWZ/ iQJhHxK7EsrCZiTUPTdQCYoReqEbCwCEvECRW0L199YafqNDA3XkAS4x/eY517QYNShk 9H8IHyWXKPA2ju3neUm5PG6BGnvoLRItZ6ta2Nk7271+mWSqcY45hvDCldg10rwC8DxB 7P3hIF6WJBLgHj9uHP3U0XzPq1osbNC9K57Zwpr7nKm68YdIU2NJHgKm7vzEM6RZ4VM0 FBqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yjzXfZyf; 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=pass (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 s2si8963049vsh.622.2021.12.13.16.27.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:27:38 -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=pass header.i=@linaro.org header.s=google header.b=yjzXfZyf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvfO-0007rg-4L for patch@linaro.org; Mon, 13 Dec 2021 19:27:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve1-0007pK-AZ for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:13 -0500 Received: from [2607:f8b0:4864:20::631] (port=33617 helo=mail-pl1-x631.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwvdx-0005RC-TJ for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:12 -0500 Received: by mail-pl1-x631.google.com with SMTP id y7so12411256plp.0 for ; Mon, 13 Dec 2021 16:26:09 -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=GufoDHfjYxZ3FYh1AK2uby8vthRBQr9IHhcQ3lafcZ8=; b=yjzXfZyfYf+Mvfxj5BBbborIX0lsD7UproEquB/yVmxB6UeuIt4FChaookwrBLOFi2 J6V6VOOvhLuh893IC6NKk2driswgruSX7vf+N/E5S+CSSRrTHuNgFAsmT+pHae7pkzWE 5bQdktJB7fQyq4PsFykEvXwpJu8mh1uC/QFd31IfCRhwjpIci5lPCoxKQa7kdNjxtMta fXPpTNzF/IbSSlhaosWCndxD8Zg39W4iFGVQ7VDWAOQnlYVTOCAszX3k8s21aiDTNtyF wY+yAnyWHMZDvyWrk5IxYE4cVEnrq67RYj5iKVSlKhvvXaOANlaOgXZt9kZsV6qvI67Z WAkg== 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=GufoDHfjYxZ3FYh1AK2uby8vthRBQr9IHhcQ3lafcZ8=; b=R3/5KxuAJ88Y6JKC3NJ9gVS83IUeQe1swy/TJMGAYtZCvtxTEzhMoG509cxfOJC04I 4eGHwaVKis0H8RyuO7HqeyPtlBiPmBDgg7Wc0ZKZRKeBxGROrc4yGq7W5Rm1487S6GWj m/6J962ObkFtig4rBwEjv2NfLUwMwK+7xZ1DVjdo0T43HehW1qRnK5N30r/Hw9WbZ2Wd QL4jhxrderE0347a2/XYRxjy/bevJKcZUIRVSOOa6zKoS6+9aJREs7XqLPTzq1ttitKB /RKj+vqMKHNl0J+264i8aFMOAd5EAGYQSBhw4T3Ik0MHOlGF4OWJYkDFudOQHwQ4Oner mPdg== X-Gm-Message-State: AOAM531AzgNt6jzgYdwI6HirCNKdmsPElaViKxSTs09uyLqkBFDLbYSp wVMx6UNSqfDFhf9hlHBuK19oMUaLZWN20A== X-Received: by 2002:a17:902:ce85:b0:141:de7d:514e with SMTP id f5-20020a170902ce8500b00141de7d514emr2428011plg.0.1639441568452; Mon, 13 Dec 2021 16:26:08 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 02/15] linux-user: Move syscall error detection into safe_syscall_base Date: Mon, 13 Dec 2021 16:25:51 -0800 Message-Id: <20211214002604.161983-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::631 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The current api from safe_syscall_base() is to return -errno, which is the interface provided by *some* linux kernel abis. The wrapper macro, safe_syscall(), detects error, stores into errno, and returns -1, to match the api of the system syscall(). For those kernel abis that do not return -errno natively, this leads to double syscall error detection. E.g. Linux ppc64, which sets the SO flag for error. Simplify the usage from C by moving the error detection into assembly, and usage from assembly by providing a C helper with which to set errno. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson --- linux-user/safe-syscall.h | 16 +++------- linux-user/safe-syscall-error.c | 28 ++++++++++++++++ linux-user/host/aarch64/safe-syscall.inc.S | 20 ++++++------ linux-user/host/arm/safe-syscall.inc.S | 27 ++++++++++------ linux-user/host/i386/safe-syscall.inc.S | 37 +++++++++++++++------- linux-user/host/ppc64/safe-syscall.inc.S | 24 +++++++------- linux-user/host/riscv/safe-syscall.inc.S | 20 ++++++------ linux-user/host/s390x/safe-syscall.inc.S | 32 ++++++++++++------- linux-user/host/x86_64/safe-syscall.inc.S | 29 +++++++++-------- linux-user/meson.build | 1 + 10 files changed, 147 insertions(+), 87 deletions(-) create mode 100644 linux-user/safe-syscall-error.c diff --git a/linux-user/safe-syscall.h b/linux-user/safe-syscall.h index aaa9ffc0e2..97837faddb 100644 --- a/linux-user/safe-syscall.h +++ b/linux-user/safe-syscall.h @@ -127,21 +127,15 @@ #ifdef HAVE_SAFE_SYSCALL /* The core part of this function is implemented in assembly */ extern long safe_syscall_base(int *pending, long number, ...); +extern long safe_syscall_set_errno_tail(int value); + /* These are defined by the safe-syscall.inc.S file */ extern char safe_syscall_start[]; extern char safe_syscall_end[]; -#define safe_syscall(...) \ - ({ \ - long ret_; \ - int *psp_ = &((TaskState *)thread_cpu->opaque)->signal_pending; \ - ret_ = safe_syscall_base(psp_, __VA_ARGS__); \ - if (is_error(ret_)) { \ - errno = -ret_; \ - ret_ = -1; \ - } \ - ret_; \ - }) +#define safe_syscall(...) \ + safe_syscall_base(&((TaskState *)thread_cpu->opaque)->signal_pending, \ + __VA_ARGS__) #else diff --git a/linux-user/safe-syscall-error.c b/linux-user/safe-syscall-error.c new file mode 100644 index 0000000000..d7e2700f81 --- /dev/null +++ b/linux-user/safe-syscall-error.c @@ -0,0 +1,28 @@ +/* + * safe-syscall-error.c: errno setting fragment + * This is intended to be invoked by safe-syscall.S + * + * Written by Richard Henderson + * Copyright (C) 2021 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "hostdep.h" +#include "safe-syscall.h" + +#ifdef HAVE_SAFE_SYSCALL +/* + * This is intended to be invoked via tail-call on the error path + * from the assembly in host/arch/safe-syscall.inc.S. This takes + * care of the host specific addressing of errno. + * Return -1 to finalize the return value for safe_syscall_base. + */ +long safe_syscall_set_errno_tail(int value) +{ + errno = value; + return -1; +} +#endif diff --git a/linux-user/host/aarch64/safe-syscall.inc.S b/linux-user/host/aarch64/safe-syscall.inc.S index e2e726ef55..76a0a18a6c 100644 --- a/linux-user/host/aarch64/safe-syscall.inc.S +++ b/linux-user/host/aarch64/safe-syscall.inc.S @@ -22,15 +22,12 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ safe_syscall_base: .cfi_startproc /* The syscall calling convention isn't the same as the * C one: - * we enter with x0 == *signal_pending + * we enter with x0 == &signal_pending * x1 == syscall number * x2 ... x7, (stack) == syscall arguments * and return the result in x0 @@ -60,16 +57,21 @@ safe_syscall_base: safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ ldr w10, [x9] - cbnz w10, 0f + cbnz w10, 2f svc 0x0 safe_syscall_end: /* code path for having successfully executed the syscall */ + cmp x0, #-4096 + b.hi 0f ret -0: + /* code path setting errno */ +0: neg w0, w0 + b safe_syscall_set_errno_tail + /* code path when we didn't execute the syscall */ - mov x0, #-TARGET_ERESTARTSYS - ret - .cfi_endproc +2: mov w0, #TARGET_ERESTARTSYS + b safe_syscall_set_errno_tail + .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/arm/safe-syscall.inc.S b/linux-user/host/arm/safe-syscall.inc.S index 1f1ee8327b..618112c6bf 100644 --- a/linux-user/host/arm/safe-syscall.inc.S +++ b/linux-user/host/arm/safe-syscall.inc.S @@ -27,9 +27,6 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ safe_syscall_base: .fnstart @@ -46,7 +43,7 @@ safe_syscall_base: .cfi_rel_offset lr, 20 /* The syscall calling convention isn't the same as the C one: - * we enter with r0 == *signal_pending + * we enter with r0 == &signal_pending * r1 == syscall number * r2, r3, [sp+0] ... [sp+12] == syscall arguments * and return the result in r0 @@ -74,17 +71,29 @@ safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ ldr r12, [r8] /* signal_pending */ tst r12, r12 - bne 1f + bne 2f swi 0 safe_syscall_end: /* code path for having successfully executed the syscall */ + cmp r0, #-4096 + neghi r0, r0 + bhi 1f pop { r4, r5, r6, r7, r8, pc } -1: /* code path when we didn't execute the syscall */ - ldr r0, =-TARGET_ERESTARTSYS - pop { r4, r5, r6, r7, r8, pc } +2: mov r0, #TARGET_ERESTARTSYS + + /* code path setting errno */ +1: pop { r4, r5, r6, r7, r8, lr } + .cfi_adjust_cfa_offset -24 + .cfi_restore r4 + .cfi_restore r5 + .cfi_restore r6 + .cfi_restore r7 + .cfi_restore r8 + .cfi_restore lr + b safe_syscall_set_errno_tail + .fnend .cfi_endproc - .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/i386/safe-syscall.inc.S b/linux-user/host/i386/safe-syscall.inc.S index e425aa54d8..f5883234bb 100644 --- a/linux-user/host/i386/safe-syscall.inc.S +++ b/linux-user/host/i386/safe-syscall.inc.S @@ -20,9 +20,6 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ safe_syscall_base: .cfi_startproc @@ -41,7 +38,7 @@ safe_syscall_base: /* The syscall calling convention isn't the same as the C one: * we enter with 0(%esp) == return address - * 4(%esp) == *signal_pending + * 4(%esp) == &signal_pending * 8(%esp) == syscall number * 12(%esp) ... 32(%esp) == syscall arguments * and return the result in eax @@ -70,11 +67,13 @@ safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ mov 4+16(%esp), %eax /* signal_pending */ cmpl $0, (%eax) - jnz 1f + jnz 2f mov 8+16(%esp), %eax /* syscall number */ int $0x80 safe_syscall_end: /* code path for having successfully executed the syscall */ + cmp $-4095, %eax + jae 0f pop %ebx .cfi_remember_state .cfi_adjust_cfa_offset -4 @@ -89,12 +88,28 @@ safe_syscall_end: .cfi_adjust_cfa_offset -4 .cfi_restore ebp ret - -1: - /* code path when we didn't execute the syscall */ .cfi_restore_state - mov $-TARGET_ERESTARTSYS, %eax - jmp safe_syscall_end - .cfi_endproc +0: neg %eax + jmp 1f + + /* code path when we didn't execute the syscall */ +2: mov $TARGET_ERESTARTSYS, %eax + + /* code path setting errno */ +1: pop %ebx + .cfi_adjust_cfa_offset -4 + .cfi_restore ebx + pop %edi + .cfi_adjust_cfa_offset -4 + .cfi_restore edi + pop %esi + .cfi_adjust_cfa_offset -4 + .cfi_restore esi + pop %ebp + .cfi_adjust_cfa_offset -4 + .cfi_restore ebp + jmp safe_syscall_set_errno_tail + + .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/ppc64/safe-syscall.inc.S b/linux-user/host/ppc64/safe-syscall.inc.S index 4b57440585..3a640cfc04 100644 --- a/linux-user/host/ppc64/safe-syscall.inc.S +++ b/linux-user/host/ppc64/safe-syscall.inc.S @@ -22,9 +22,6 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ #if _CALL_ELF == 2 safe_syscall_base: @@ -39,7 +36,7 @@ safe_syscall_base: .L.safe_syscall_base: .cfi_startproc #endif - /* We enter with r3 == *signal_pending + /* We enter with r3 == &signal_pending * r4 == syscall number * r5 ... r10 == syscall arguments * and return the result in r3 @@ -71,21 +68,22 @@ safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ lwz 12, 0(14) cmpwi 0, 12, 0 - bne- 0f + bne- 2f sc safe_syscall_end: /* code path when we did execute the syscall */ - ld 14, 16(1) /* restore r14 to its original value */ - bnslr+ - - /* syscall failed; return negative errno */ - neg 3, 3 + ld 14, 16(1) /* restore r14 */ + bso- 1f blr /* code path when we didn't execute the syscall */ -0: addi 3, 0, -TARGET_ERESTARTSYS - ld 14, 16(1) /* restore r14 to its original value */ - blr +2: ld 14, 16(1) /* restore r14 */ + addi 3, 0, TARGET_ERESTARTSYS + + /* code path setting errno */ +1: b safe_syscall_set_errno_tail + nop /* per abi, for the linker to modify */ + .cfi_endproc #if _CALL_ELF == 2 diff --git a/linux-user/host/riscv/safe-syscall.inc.S b/linux-user/host/riscv/safe-syscall.inc.S index 95c4832de2..54c2e23f75 100644 --- a/linux-user/host/riscv/safe-syscall.inc.S +++ b/linux-user/host/riscv/safe-syscall.inc.S @@ -23,15 +23,12 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ safe_syscall_base: .cfi_startproc /* * The syscall calling convention is nearly the same as C: - * we enter with a0 == *signal_pending + * we enter with a0 == &signal_pending * a1 == syscall number * a2 ... a7 == syscall arguments * and return the result in a0 @@ -62,16 +59,21 @@ safe_syscall_base: safe_syscall_start: /* If signal_pending is non-zero, don't do the call */ lw t1, 0(t0) - bnez t1, 0f + bnez t1, 2f scall safe_syscall_end: /* code path for having successfully executed the syscall */ + li t2, -4096 + bgtu a0, t2, 0f ret -0: + /* code path setting errno */ +0: neg a0, a0 + j safe_syscall_set_errno_tail + /* code path when we didn't execute the syscall */ - li a0, -TARGET_ERESTARTSYS - ret - .cfi_endproc +2: li a0, TARGET_ERESTARTSYS + j safe_syscall_set_errno_tail + .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/s390x/safe-syscall.inc.S b/linux-user/host/s390x/safe-syscall.inc.S index d97d27458e..899dab39e9 100644 --- a/linux-user/host/s390x/safe-syscall.inc.S +++ b/linux-user/host/s390x/safe-syscall.inc.S @@ -20,9 +20,6 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ safe_syscall_base: .cfi_startproc @@ -44,9 +41,9 @@ safe_syscall_base: stg %r1,0(%r15) /* store back chain */ stg %r0,8(%r15) /* store eos */ - /* The syscall calling convention isn't the same as the - * C one: - * we enter with r2 == *signal_pending + /* + * The syscall calling convention isn't the same as the C one: + * we enter with r2 == &signal_pending * r3 == syscall number * r4, r5, r6, (stack) == syscall arguments * and return the result in r2 @@ -77,14 +74,25 @@ safe_syscall_start: svc 0 safe_syscall_end: -1: lg %r15,0(%r15) /* load back chain */ + /* code path for having successfully executed the syscall */ + lg %r15,0(%r15) /* load back chain */ .cfi_remember_state .cfi_adjust_cfa_offset -160 lmg %r6,%r15,48(%r15) /* load saved registers */ - br %r14 - .cfi_restore_state -2: lghi %r2, -TARGET_ERESTARTSYS - j 1b - .cfi_endproc + lghi %r0, -4095 /* check for syscall error */ + clgr %r2, %r0 + blr %r14 /* return on success */ + lcr %r2, %r2 /* create positive errno */ + jg safe_syscall_set_errno_tail + .cfi_restore_state + + /* code path when we didn't execute the syscall */ +2: lg %r15,0(%r15) /* load back chain */ + .cfi_adjust_cfa_offset -160 + lmg %r6,%r15,48(%r15) /* load saved registers */ + lghi %r2, TARGET_ERESTARTSYS + jg safe_syscall_set_errno_tail + + .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/linux-user/host/x86_64/safe-syscall.inc.S index 158225553e..39b64250c3 100644 --- a/linux-user/host/x86_64/safe-syscall.inc.S +++ b/linux-user/host/x86_64/safe-syscall.inc.S @@ -19,9 +19,6 @@ * first argument an 'int *' to the signal_pending flag, the * second one the system call number (as a 'long'), and all further * arguments being syscall arguments (also 'long'). - * We return a long which is the syscall's return value, which - * may be negative-errno on failure. Conversion to the - * -1-and-errno-set convention is done by the calling wrapper. */ safe_syscall_base: .cfi_startproc @@ -35,9 +32,9 @@ safe_syscall_base: .cfi_adjust_cfa_offset 8 .cfi_rel_offset rbp, 0 - /* The syscall calling convention isn't the same as the - * C one: - * we enter with rdi == *signal_pending + /* + * The syscall calling convention isn't the same as the C one: + * we enter with rdi == &signal_pending * rsi == syscall number * rdx, rcx, r8, r9, (stack), (stack) == syscall arguments * and return the result in rax @@ -68,24 +65,30 @@ safe_syscall_base: safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ cmpl $0, (%rbp) - jnz 1f + jnz 2f syscall safe_syscall_end: /* code path for having successfully executed the syscall */ + cmp $-4095, %rax + jae 0f pop %rbp .cfi_remember_state .cfi_def_cfa_offset 8 .cfi_restore rbp ret - -1: - /* code path when we didn't execute the syscall */ .cfi_restore_state - mov $-TARGET_ERESTARTSYS, %rax - pop %rbp + +0: neg %eax + jmp 1f + + /* code path when we didn't execute the syscall */ +2: mov $TARGET_ERESTARTSYS, %eax + + /* code path setting errno */ +1: pop %rbp .cfi_def_cfa_offset 8 .cfi_restore rbp - ret + jmp safe_syscall_set_errno_tail .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/meson.build b/linux-user/meson.build index bf62c13e37..94ac3c58ce 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -10,6 +10,7 @@ linux_user_ss.add(files( 'main.c', 'mmap.c', 'safe-syscall.S', + 'safe-syscall-error.c', 'signal.c', 'strace.c', 'syscall.c', From patchwork Tue Dec 14 00:25:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523661 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5339947wro; Mon, 13 Dec 2021 16:33:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwo9xYDECsslKIaDX6Ca/8j30oYU2c9qfHMI1KRG6SmQcfmQmc8GjkTHU7A9VpEKsbG1fyq X-Received: by 2002:a05:6102:3f0e:: with SMTP id k14mr2325214vsv.72.1639442010396; Mon, 13 Dec 2021 16:33:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442010; cv=none; d=google.com; s=arc-20160816; b=XSA4ecPwsEsq4W9aw7sGjcJ81gSaT7Yr1xwcWV+LDUh5lCbt/S49k7tXsCl6xfl06d kjKu6ahV2Ees1k2NNAZc7PwSTkGoGTTBnIFZpcELGCxgdxJNkGvj8hhZSKhMBW7EJMEa 5mOfWZlTZVLCGbMYxFxFgbQIifZcP4Z6dcSMgauvLLf3kyky7T5UAASH3wmbzSV7SJe1 spXMNmND5f7cnbd+VG81xowi3Q0hqq4hsdbDAm0oyqK0yKzTkThxROgY6YQJ6vzh79/5 7Lw1ysIBT/ZwqY0IjqxNFqX3/vA9/kfrCqn0me5q39UuI3t5YVsYLgeZtu/SOX8qWHP3 XH7A== 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=hxGCMJpmTzYYg3VRoBHyRUrZEqJuEhtbeQRnSM3V1e4=; b=mf3IaLghaopQ9rpHNG3JTrt7NmEUq3jQ9uaLxwMTBmfpOR7zx+mNzVODkM+hrU71NO ZbToY09nWNNB9OymnoIvoIzCz5HW+lzfU1Azt268yJAqKh+bp1DT+PMuLRyAiQKZH8Bx E8Br15LmY5gNsxf+D4AdKU6pJ8nybN6TxGJshbpYPJqCtTDtmusm17lqps8Wi2ftWoqg 4K9HMLqM3zhxGCXwTSKIj7ARrn2+X+N9sQXA1nRvIoOYtJmuS0Luuy+PkRK73/QZBlf1 YMHtUW26y5BNjnYn6+WFSw26CvrasGLunyoZLl4XR/UpiYLXtZTqpJKqhSJRvFlg2e/I OU0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dbF+3lXa; 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=pass (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 f1si9750754vke.258.2021.12.13.16.33.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:33:30 -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=pass header.i=@linaro.org header.s=google header.b=dbF+3lXa; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvl3-0002Vg-On for patch@linaro.org; Mon, 13 Dec 2021 19:33:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve2-0007q1-HP for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:14 -0500 Received: from [2607:f8b0:4864:20::1033] (port=34699 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwvdy-0005RU-P6 for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:13 -0500 Received: by mail-pj1-x1033.google.com with SMTP id q22-20020a17090a431600b001b0e3a74cf7so144842pjg.1 for ; Mon, 13 Dec 2021 16:26:10 -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=hxGCMJpmTzYYg3VRoBHyRUrZEqJuEhtbeQRnSM3V1e4=; b=dbF+3lXaYq9orqvj3clT+BRE13+kKag6qBt4UkOtlmLZsQZSh8IDPNtnT2N5Z4f/8M PVRws9TI4K4e82crqCdTAdRhNYwXt1Ki3DfrA8hGxM90EMGDN82Bhi1SHJ5FKd589DB4 5Shus49+I0YBsao6pRGYVhvEyHgf6zdRbsWKscAOZOPVJbU+XkEG+VYDgVUixr15BqYd IEEziPDApwOcOYloYr+UQ73aeLV00ws9cv1ONWQKs30eGL/9mhii0f7J8TsSlCQXB7Zu Y3QXLtTFnyiEz/q+wuAbhbbLASArt0bXGhHnxFH1mLmAhbC+BlGeHJKebqfBFyPUInDK kByA== 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=hxGCMJpmTzYYg3VRoBHyRUrZEqJuEhtbeQRnSM3V1e4=; b=bYlnWwOXi3L0Q7fc5cwYm8nhmHOWktogJcGmz5FXV6tg/cpR+bBihpGAHb7WcMUPYv OxmvlnucgQVixjvVDe93oQiSKRosFZN3UPOMo5JSMROnLOLvxHYYoUD1f3y7L3eeL3fa pekJEIS5+zuJoPdZcH8q9s5xCidRBICbKoJKkQnWc6uK541VNw/9B2cmQmfuLDnstqAW WHISWC+fA0HqAaGIGOCi5PcEwm+F/ymhfXbgwc5HEoN5jSJ3xrQGcGN3vp+8ff1PK7Qm e1BGDWrolHvW9A52wFevq3MAbjhbN2d+kjlQzpUPE5qMSWo+QXfKtmn42qkysl9n8xcY 6AAA== X-Gm-Message-State: AOAM532ghkfirJZ3twUwjA3ZZ3Com6nmvY8OuOhfmbD1Klg4Q4GBGj2x hhsToDfIxxjQvcvC4KNCDynIgbiakzaKoQ== X-Received: by 2002:a17:90b:3a89:: with SMTP id om9mr1692339pjb.99.1639441569448; Mon, 13 Dec 2021 16:26:09 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 03/15] linux-user/host/mips: Add safe-syscall.inc.S Date: Mon, 13 Dec 2021 16:25:52 -0800 Message-Id: <20211214002604.161983-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1033 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/host/mips/hostdep.h | 3 + linux-user/host/mips/safe-syscall.inc.S | 148 ++++++++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 linux-user/host/mips/safe-syscall.inc.S diff --git a/linux-user/host/mips/hostdep.h b/linux-user/host/mips/hostdep.h index ba111d75c3..d9e90a096b 100644 --- a/linux-user/host/mips/hostdep.h +++ b/linux-user/host/mips/hostdep.h @@ -12,4 +12,7 @@ #ifndef MIPS_HOSTDEP_H #define MIPS_HOSTDEP_H +/* We have a safe-syscall.inc.S */ +#define HAVE_SAFE_SYSCALL + #endif diff --git a/linux-user/host/mips/safe-syscall.inc.S b/linux-user/host/mips/safe-syscall.inc.S new file mode 100644 index 0000000000..041d1a6e65 --- /dev/null +++ b/linux-user/host/mips/safe-syscall.inc.S @@ -0,0 +1,148 @@ +/* + * safe-syscall.inc.S : host-specific assembly fragment + * to handle signals occurring at the same time as system calls. + * This is intended to be included by linux-user/safe-syscall.S + * + * Written by Richard Henderson + * Copyright (C) 2021 Linaro, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "sys/regdef.h" +#include "sys/asm.h" + + .text + .set nomips16 + .set reorder + + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_start, @function + .type safe_syscall_end, @function + + /* + * This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + */ + +#if _MIPS_SIM == _ABIO32 +/* 8 * 4 = 32 for outgoing parameters; 1 * 4 for s0 save; 1 * 4 for align. */ +#define FRAME 40 +#define OFS_S0 32 +#else +/* 1 * 8 for s0 save; 1 * 8 for align. */ +#define FRAME 16 +#define OFS_S0 0 +#endif + + +NESTED(safe_syscall_base, FRAME, ra) + .cfi_startproc + PTR_ADDIU sp, sp, -FRAME + .cfi_adjust_cfa_offset FRAME + REG_S s0, OFS_S0(sp) + .cfi_rel_offset s0, OFS_S0 +#if _MIPS_SIM == _ABIO32 + /* + * The syscall calling convention is nearly the same as C: + * we enter with a0 == &signal_pending + * a1 == syscall number + * a2, a3, stack == syscall arguments + * and return the result in a0 + * and the syscall instruction needs + * v0 == syscall number + * a0 ... a3, stack == syscall arguments + * and returns the result in v0 + * Shuffle everything around appropriately. + */ + move s0, a0 /* signal_pending pointer */ + move v0, a1 /* syscall number */ + move a0, a2 /* syscall arguments */ + move a1, a3 + lw a2, FRAME+16(sp) + lw a3, FRAME+20(sp) + lw t4, FRAME+24(sp) + lw t5, FRAME+28(sp) + lw t6, FRAME+32(sp) + lw t7, FRAME+40(sp) + sw t4, 16(sp) + sw t5, 20(sp) + sw t6, 24(sp) + sw t7, 28(sp) +#else + /* + * The syscall calling convention is nearly the same as C: + * we enter with a0 == &signal_pending + * a1 == syscall number + * a2 ... a7 == syscall arguments + * and return the result in a0 + * and the syscall instruction needs + * v0 == syscall number + * a0 ... a5 == syscall arguments + * and returns the result in v0 + * Shuffle everything around appropriately. + */ + move s0, a0 /* signal_pending pointer */ + move v0, a1 /* syscall number */ + move a0, a2 /* syscall arguments */ + move a1, a3 + move a2, a4 + move a3, a5 + move a4, a6 + move a5, a7 +#endif + + /* + * This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ +safe_syscall_start: + /* If signal_pending is non-zero, don't do the call */ + lw t1, 0(s0) + bnez t1, 2f + syscall +safe_syscall_end: + + /* code path for having successfully executed the syscall */ + REG_L s0, OFS_S0(sp) + PTR_ADDIU sp, sp, FRAME + .cfi_remember_state + .cfi_adjust_cfa_offset -FRAME + .cfi_restore s0 + bnez a3, 1f + jr ra + .cfi_restore_state + + /* code path when we didn't execute the syscall */ +2: REG_L s0, OFS_S0(sp) + PTR_ADDIU sp, sp, FRAME + .cfi_adjust_cfa_offset -FRAME + .cfi_restore s0 + li v0, TARGET_ERESTARTSYS + + /* code path setting errno */ + /* + * We didn't setup GP on entry, optimistic of the syscall success. + * We must do so now to load the address of the helper, as required + * by the ABI, into t9. + * + * Note that SETUP_GPX and SETUP_GPX64 are themselves conditional, + * so we can simply let the one that's not empty succeed. + */ +1: USE_ALT_CP(t0) + SETUP_GPX(t1) + SETUP_GPX64(t0, t1) + PTR_LA t9, safe_syscall_set_errno_tail + jr t9 + + .cfi_endproc +END(safe_syscall_base) From patchwork Tue Dec 14 00:25:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523657 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5338428wro; Mon, 13 Dec 2021 16:31:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNKKmeCWlW2F3aufeB5WlHbGsasF8ClMhutTqktfH0LrNvqjBqCWPaR1itZrg84H6SY1tc X-Received: by 2002:a05:6122:2088:: with SMTP id i8mr2928541vkd.5.1639441901206; Mon, 13 Dec 2021 16:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441901; cv=none; d=google.com; s=arc-20160816; b=czqH9mrxI6pXpXhy4eqpnXvJorRDIdpVqnttnfngzocS+XgA7EVdmbRc6yHFBnyj9u 0f4Ie1RInB0YjNVv7Azgd2TPwXXRa1amiDx82V6qNAqEZde+672XL5OK5ESnz4VpS/iJ N6IxJTGQ2aWcOlHg8u1/0T0shvaZe2X9ATg4LhBLtS0TWllKcfKvauBP7nEp2VahMw8L jlQB6/9YmFKqXObAIlpPcRLU1G+Bi2H/1xhgMNGbEOZDe0TH3i++OEvnhjbvMt3ugDK0 7vUIRx7xomKo+CPm9bZA0Gfg6mVFtAVzH8Q2C946eNfR5svRDCi4XI6WsweUOvGKRD/Y 47uQ== 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=mT+zuzmDZjEjStGuNXpCAnb7RPXTMmCHpcEJ6vHxP1Y=; b=vF/NNxRM8l1aB4BccaU6/BHX3ugqWwGUv8kzi1iQ5mIjkfF6egnSA2dEo2Jr+znGKx Acu8vuMMiXIhhwK3IKv3Lm5lf373PzeduUQouGKfFveY9gTxWUG19N+YBeBk1OPnPOGd iNl6fj54B3vjTI//YwN7US/vDn225QepQTjg+wA3bbTah3RJd9ujpNOTKGBzyaH//sc6 CnKCUOtRV4h2iaW/AS+BLLeR4ZU78psU6sopaGWUOgQY/UM+uwx0w8c1/WRi0vHAqXjJ ZN8SfhOmIxejUEx5+ghJ92o37W/TJVQoWOgaV9HTdT/I6iYcOd8MhHpXDnmbLeOvVrGW RCKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YXF13fGg; 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=pass (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 q2si11309989vsj.25.2021.12.13.16.31.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:31:41 -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=pass header.i=@linaro.org header.s=google header.b=YXF13fGg; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvjI-0005Vf-IB for patch@linaro.org; Mon, 13 Dec 2021 19:31:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve4-0007wc-Te for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:16 -0500 Received: from [2607:f8b0:4864:20::430] (port=44686 helo=mail-pf1-x430.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwvdz-0005Rf-LI for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:16 -0500 Received: by mail-pf1-x430.google.com with SMTP id k64so16381998pfd.11 for ; Mon, 13 Dec 2021 16:26:11 -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=mT+zuzmDZjEjStGuNXpCAnb7RPXTMmCHpcEJ6vHxP1Y=; b=YXF13fGg4flXkSMDyKjtvj47xNdYsKbM9bMeTnNo/ixKM3iasAgN3IX2PduOns+4jS t5wl6X1mRcet2X5ygudodl86nnLvOqNTQsBC1GX+NJ82FqVfuzYsdDL9QpH9UKIcvqAE YynWf0vLLXZPdnEthbszz2QwlpaZTXSyJ7eeA9/+/5jU7jVREHKFtmUp0PSEjVEbx1+0 XPB2WS9YIPKa3wF2wt1iiAiX3OqMRJS45KI1W4xpSlMfEEwHjRWsstf+nQrTNR228HZx MKDfkfOhuemgwUFkHKQtlIKxlSNhwyafSOv/DlcDujalIA3O9e0whHv4gX1qUJ0I0PgU knrA== 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=mT+zuzmDZjEjStGuNXpCAnb7RPXTMmCHpcEJ6vHxP1Y=; b=LxzllhdZOhp9JXy+pwtnnLx53UOWjOyQCVE+Q3HxujAvqnucV604B6WcwG93hkMKDa 77G+hsUdVQhURgKS3qtxUsva8h8RiIDMwMZi78DCBCbdIoqTNu6hoJfbF2NvcVoYGpMa 3U5naBYHqmLiRdEybbDCXMB/kvvL+4Uh3+fmOnTmxYS+uYQuFB3pp3QoB5byQqONPqah sHItdtBirMKeOKMScZjgdBPrPND8srfUoEuEk2tWqoLUsCCmKhFe9kD59YuvsY6r/83P CL4B/eDpwyBHtry4J55XRxlHB8lMEA3ydLbPVpZkrsGA8oOemGYNNq9a+MLEDLTpzrpb VYCw== X-Gm-Message-State: AOAM532Gerq261v0SH1F69VYcabg3bjSgEWNWtTWd87u9v5QJMuia3k+ rwPTyJgo5qVWmAgwVDa4plvh602yr90bgg== X-Received: by 2002:a63:354c:: with SMTP id c73mr1418923pga.532.1639441570355; Mon, 13 Dec 2021 16:26:10 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 04/15] linux-user/host/sparc64: Add safe-syscall.inc.S Date: Mon, 13 Dec 2021 16:25:53 -0800 Message-Id: <20211214002604.161983-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::430 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: git@xen0n.name, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/host/sparc64/hostdep.h | 3 + linux-user/host/sparc64/safe-syscall.inc.S | 89 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 linux-user/host/sparc64/safe-syscall.inc.S diff --git a/linux-user/host/sparc64/hostdep.h b/linux-user/host/sparc64/hostdep.h index ce3968fca0..d832868cb1 100644 --- a/linux-user/host/sparc64/hostdep.h +++ b/linux-user/host/sparc64/hostdep.h @@ -12,4 +12,7 @@ #ifndef SPARC64_HOSTDEP_H #define SPARC64_HOSTDEP_H +/* We have a safe-syscall.inc.S */ +#define HAVE_SAFE_SYSCALL + #endif diff --git a/linux-user/host/sparc64/safe-syscall.inc.S b/linux-user/host/sparc64/safe-syscall.inc.S new file mode 100644 index 0000000000..bb35c64cfc --- /dev/null +++ b/linux-user/host/sparc64/safe-syscall.inc.S @@ -0,0 +1,89 @@ +/* + * safe-syscall.inc.S : host-specific assembly fragment + * to handle signals occurring at the same time as system calls. + * This is intended to be included by linux-user/safe-syscall.S + * + * Written by Richard Henderson + * Copyright (C) 2021 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + + .text + .balign 4 + + .register %g2, #scratch + .register %g3, #scratch + + .global safe_syscall_base + .global safe_syscall_start + .global safe_syscall_end + .type safe_syscall_base, @function + .type safe_syscall_start, @function + .type safe_syscall_end, @function + +#define STACK_BIAS 2047 +#define PARAM(N) STACK_BIAS + N*8 + + /* + * This is the entry point for making a system call. The calling + * convention here is that of a C varargs function with the + * first argument an 'int *' to the signal_pending flag, the + * second one the system call number (as a 'long'), and all further + * arguments being syscall arguments (also 'long'). + */ +safe_syscall_base: + .cfi_startproc + /* + * The syscall calling convention isn't the same as the C one: + * we enter with o0 == &signal_pending + * o1 == syscall number + * o2 ... o5, (stack) == syscall arguments + * and return the result in x0 + * and the syscall instruction needs + * g1 == syscall number + * o0 ... o5 == syscall arguments + * and returns the result in o0 + * Shuffle everything around appropriately. + */ + mov %o0, %g2 /* signal_pending pointer */ + mov %o1, %g1 /* syscall number */ + mov %o2, %o0 /* syscall arguments */ + mov %o3, %o1 + mov %o4, %o2 + mov %o5, %o3 + ldx [%sp + PARAM(6)], %o4 + ldx [%sp + PARAM(7)], %o5 + + /* + * This next sequence of code works in conjunction with the + * rewind_if_safe_syscall_function(). If a signal is taken + * and the interrupted PC is anywhere between 'safe_syscall_start' + * and 'safe_syscall_end' then we rewind it to 'safe_syscall_start'. + * The code sequence must therefore be able to cope with this, and + * the syscall instruction must be the final one in the sequence. + */ +safe_syscall_start: + /* if signal_pending is non-zero, don't do the call */ + lduw [%g2], %g3 + brnz,pn %g3, 2f + nop + ta 0x6d +safe_syscall_end: + /* code path for having successfully executed the syscall */ + bcs,pn %xcc, 1f + nop + ret + nop + + /* code path when we didn't execute the syscall */ +2: set TARGET_ERESTARTSYS, %o0 + + /* code path setting errno */ +1: mov %o7, %g1 + call safe_syscall_set_errno_tail + mov %g1, %o7 + + .cfi_endproc + .size safe_syscall_base, .-safe_syscall_base From patchwork Tue Dec 14 00:25:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523660 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5339911wro; Mon, 13 Dec 2021 16:33:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxaU0mLS5GKHWwqqp33M3R8CnaMlegiUwdWO9lud3wHetYK35alV1JYKtT1vafS7BS5lzL X-Received: by 2002:a37:44e:: with SMTP id 75mr1436657qke.417.1639442007577; Mon, 13 Dec 2021 16:33:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442007; cv=none; d=google.com; s=arc-20160816; b=qecLajvzrHF8F92mm6gzQhpt+sBxsaAKP0D1Y+GzJQJFEKlW1gSi730pB6S6zfAvjX TIHn65hlUcm4cvAeJ6658nVlswqywMOSVS2dT6S3igVWK1WRd74W756Rj9JxM+cZrq+G G+AxbLq7huM+zlKP9Xv5dviV9/DMmwNdc0TZx388YoWj9WiJTWsZIX/RjWuyoTZrFNfi zU+FTsVHHldW+pUYCH1AkzP21VRUPLEbRTEBlCy2gATsxLamYtalcJ6QdflnWM4QXDXf sXioDmeag/RIytQ+10U7pZLWGBN6YP82TjnQrhS5jOAaIYKBHWYMfqq+qA5p6hVrACOz GFdA== 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=RxRUdWmNOzFbW06/oXjlpc/Ha36TYqwiBWfJ/9yrr1M=; b=ZBYzxWUKn1uFYz7lKwFoOfne4o6obwZJBdW9ZTrEORnVfdqZXZ+prKEZozbUvOcYfA uWJnl3wsUxkP6ddqnuy2tCSQxmTI3dSHIKcxuC5qZ6FLnYRmPhYeYaXuUFJDrmUQKclo PpRey4WjEea5k29hYfmnMpXAMZffbv4uI5lu33WQoNdEGIuO+f/dAaTp8r2RDTEWQ0Z4 Prdq7Sq+O4jbPnHOmHJGKypythM1rN9dCQsIJah/wwKlXmjYT/ofg0nVCO/2FEoFy/qQ 8Jm8jA0zospP3q5vht8iGX6Z2pVdfscpZeivXelMIWFW1s3Qhx+71tqOEztO7BhUta86 avMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jLFOrhb2; 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=pass (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 e12si13356356qtx.470.2021.12.13.16.33.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:33:27 -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=pass header.i=@linaro.org header.s=google header.b=jLFOrhb2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvl0-0002Lu-Un for patch@linaro.org; Mon, 13 Dec 2021 19:33:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve7-00083x-1C for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:19 -0500 Received: from [2607:f8b0:4864:20::62f] (port=44991 helo=mail-pl1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve1-0005Ro-7x for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:18 -0500 Received: by mail-pl1-x62f.google.com with SMTP id q17so12343391plr.11 for ; Mon, 13 Dec 2021 16:26:12 -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=RxRUdWmNOzFbW06/oXjlpc/Ha36TYqwiBWfJ/9yrr1M=; b=jLFOrhb2jZgumM7+1b+i4HZd0RuAftSgq7Ha4yNNAA55+Jcf1fbxRvEBeH0anzB63M N/wk/Dd1hSNFkSzIRbbsZxAM2LSR/MTyM3uEO99fkIFdCBXS2JCNyhunwOPRmooM+UQ5 QEMpSpTuGRV0ckMnuxqzkkjiKQrLpGlxkOFNGwGf03euyVttTJtVShlkvYwgNtL5GcxT cEhRKEK8Edp/zwKH6geRJHR7hiwRwG887zgqH0xBqCXNL/l0t/lOUpynbKsrfCaze3M6 WKtL91vE1HpJ7HrOYOXKaM+89AKMGOP9eFIkAj94lTa95fRRKs4T/Wi6bKyuSlGWF5Wu 8oqA== 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=RxRUdWmNOzFbW06/oXjlpc/Ha36TYqwiBWfJ/9yrr1M=; b=Zd7S2/kzwrydQxAxvP1bKqnHSif8HlMexA8m0lSpsCeZydLQFxAt+7+KmeGpKnkzkY sjRURfQRa7cuw+zUZwEzoOEx6mnE+2ASGDo6abKOraGw1hYZjmhr9cvmT+gcelUkkGGb O0t+ppt2wEbn6NmcDwSE19gO1pNEnj69P0m9k0WTlzWU3naucFyvlfJpVlubSr2RmgbQ 9ZvqUbQexCk9aDbDB6RejM/iKHlveEydbi8VYQ4nBb/oMw7kcJtVgfmNMsctZ1iGUc+S AOLAdVejTeltRGu0D850sWUIe+0347hOn8xk01XY1Ti56ropBQA/AJ1Ues7ElEwhZTU/ gn6w== X-Gm-Message-State: AOAM530y5CK4d1gIMnt7qyePZN5hvBZbTrrnkxF6ZQp+wBYrt+lovVmz v0C3G+LIMrcHFREFB7s/W4/fYnhdPBkS+g== X-Received: by 2002:a17:90b:1bc1:: with SMTP id oa1mr1809817pjb.163.1639441571212; Mon, 13 Dec 2021 16:26:11 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 05/15] linux-user: Remove HAVE_SAFE_SYSCALL and hostdep.h Date: Mon, 13 Dec 2021 16:25:54 -0800 Message-Id: <20211214002604.161983-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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: git@xen0n.name, laurent@vivier.eu, Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" All supported hosts now define HAVE_SAFE_SYSCALL, so remove the ifdefs. This leaves hostdep.h empty, so remove it. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/host/aarch64/hostdep.h | 18 ------------------ linux-user/host/arm/hostdep.h | 18 ------------------ linux-user/host/i386/hostdep.h | 18 ------------------ linux-user/host/ia64/hostdep.h | 15 --------------- linux-user/host/mips/hostdep.h | 18 ------------------ linux-user/host/ppc/hostdep.h | 15 --------------- linux-user/host/ppc64/hostdep.h | 18 ------------------ linux-user/host/riscv/hostdep.h | 14 -------------- linux-user/host/s390/hostdep.h | 15 --------------- linux-user/host/s390x/hostdep.h | 18 ------------------ linux-user/host/sparc/hostdep.h | 15 --------------- linux-user/host/sparc64/hostdep.h | 18 ------------------ linux-user/host/x32/hostdep.h | 15 --------------- linux-user/host/x86_64/hostdep.h | 18 ------------------ linux-user/safe-syscall.h | 13 +------------ linux-user/user-internals.h | 1 - linux-user/safe-syscall-error.c | 3 --- linux-user/signal.c | 2 -- linux-user/safe-syscall.S | 3 --- 19 files changed, 1 insertion(+), 254 deletions(-) delete mode 100644 linux-user/host/aarch64/hostdep.h delete mode 100644 linux-user/host/arm/hostdep.h delete mode 100644 linux-user/host/i386/hostdep.h delete mode 100644 linux-user/host/ia64/hostdep.h delete mode 100644 linux-user/host/mips/hostdep.h delete mode 100644 linux-user/host/ppc/hostdep.h delete mode 100644 linux-user/host/ppc64/hostdep.h delete mode 100644 linux-user/host/riscv/hostdep.h delete mode 100644 linux-user/host/s390/hostdep.h delete mode 100644 linux-user/host/s390x/hostdep.h delete mode 100644 linux-user/host/sparc/hostdep.h delete mode 100644 linux-user/host/sparc64/hostdep.h delete mode 100644 linux-user/host/x32/hostdep.h delete mode 100644 linux-user/host/x86_64/hostdep.h diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h deleted file mode 100644 index 39299d798a..0000000000 --- a/linux-user/host/aarch64/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef AARCH64_HOSTDEP_H -#define AARCH64_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/arm/hostdep.h b/linux-user/host/arm/hostdep.h deleted file mode 100644 index 86b137875a..0000000000 --- a/linux-user/host/arm/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef ARM_HOSTDEP_H -#define ARM_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/i386/hostdep.h b/linux-user/host/i386/hostdep.h deleted file mode 100644 index ce7136501f..0000000000 --- a/linux-user/host/i386/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef I386_HOSTDEP_H -#define I386_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/ia64/hostdep.h b/linux-user/host/ia64/hostdep.h deleted file mode 100644 index 263bf7658e..0000000000 --- a/linux-user/host/ia64/hostdep.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef IA64_HOSTDEP_H -#define IA64_HOSTDEP_H - -#endif diff --git a/linux-user/host/mips/hostdep.h b/linux-user/host/mips/hostdep.h deleted file mode 100644 index d9e90a096b..0000000000 --- a/linux-user/host/mips/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef MIPS_HOSTDEP_H -#define MIPS_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/ppc/hostdep.h b/linux-user/host/ppc/hostdep.h deleted file mode 100644 index 23d8bd9d47..0000000000 --- a/linux-user/host/ppc/hostdep.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef PPC_HOSTDEP_H -#define PPC_HOSTDEP_H - -#endif diff --git a/linux-user/host/ppc64/hostdep.h b/linux-user/host/ppc64/hostdep.h deleted file mode 100644 index 0c290dd904..0000000000 --- a/linux-user/host/ppc64/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef PPC64_HOSTDEP_H -#define PPC64_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/riscv/hostdep.h b/linux-user/host/riscv/hostdep.h deleted file mode 100644 index 7f67c22868..0000000000 --- a/linux-user/host/riscv/hostdep.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef RISCV_HOSTDEP_H -#define RISCV_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/s390/hostdep.h b/linux-user/host/s390/hostdep.h deleted file mode 100644 index afcba5a16a..0000000000 --- a/linux-user/host/s390/hostdep.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef S390_HOSTDEP_H -#define S390_HOSTDEP_H - -#endif diff --git a/linux-user/host/s390x/hostdep.h b/linux-user/host/s390x/hostdep.h deleted file mode 100644 index d801145854..0000000000 --- a/linux-user/host/s390x/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef S390X_HOSTDEP_H -#define S390X_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/sparc/hostdep.h b/linux-user/host/sparc/hostdep.h deleted file mode 100644 index 391ad923cf..0000000000 --- a/linux-user/host/sparc/hostdep.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef SPARC_HOSTDEP_H -#define SPARC_HOSTDEP_H - -#endif diff --git a/linux-user/host/sparc64/hostdep.h b/linux-user/host/sparc64/hostdep.h deleted file mode 100644 index d832868cb1..0000000000 --- a/linux-user/host/sparc64/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef SPARC64_HOSTDEP_H -#define SPARC64_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/host/x32/hostdep.h b/linux-user/host/x32/hostdep.h deleted file mode 100644 index 2c2d6d37da..0000000000 --- a/linux-user/host/x32/hostdep.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef X32_HOSTDEP_H -#define X32_HOSTDEP_H - -#endif diff --git a/linux-user/host/x86_64/hostdep.h b/linux-user/host/x86_64/hostdep.h deleted file mode 100644 index 9c62bd26bd..0000000000 --- a/linux-user/host/x86_64/hostdep.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * hostdep.h : things which are dependent on the host architecture - * - * * Written by Peter Maydell - * - * Copyright (C) 2016 Linaro Limited - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef X86_64_HOSTDEP_H -#define X86_64_HOSTDEP_H - -/* We have a safe-syscall.inc.S */ -#define HAVE_SAFE_SYSCALL - -#endif diff --git a/linux-user/safe-syscall.h b/linux-user/safe-syscall.h index 97837faddb..f43267a8fc 100644 --- a/linux-user/safe-syscall.h +++ b/linux-user/safe-syscall.h @@ -124,7 +124,7 @@ * need to check SA_RESTART flags in QEMU or distinguish the various * kinds of restartability. */ -#ifdef HAVE_SAFE_SYSCALL + /* The core part of this function is implemented in assembly */ extern long safe_syscall_base(int *pending, long number, ...); extern long safe_syscall_set_errno_tail(int value); @@ -137,15 +137,4 @@ extern char safe_syscall_end[]; safe_syscall_base(&((TaskState *)thread_cpu->opaque)->signal_pending, \ __VA_ARGS__) -#else - -/* - * Fallback for architectures which don't yet provide a safe-syscall assembly - * fragment; note that this is racy! - * This should go away when all host architectures have been updated. - */ -#define safe_syscall syscall - -#endif - #endif diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 661612a088..f71f372829 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -18,7 +18,6 @@ #ifndef LINUX_USER_USER_INTERNALS_H #define LINUX_USER_USER_INTERNALS_H -#include "hostdep.h" #include "exec/user/thunk.h" #include "exec/exec-all.h" #include "qemu/log.h" diff --git a/linux-user/safe-syscall-error.c b/linux-user/safe-syscall-error.c index d7e2700f81..55d95ac39a 100644 --- a/linux-user/safe-syscall-error.c +++ b/linux-user/safe-syscall-error.c @@ -10,10 +10,8 @@ */ #include "qemu/osdep.h" -#include "hostdep.h" #include "safe-syscall.h" -#ifdef HAVE_SAFE_SYSCALL /* * This is intended to be invoked via tail-call on the error path * from the assembly in host/arch/safe-syscall.inc.S. This takes @@ -25,4 +23,3 @@ long safe_syscall_set_errno_tail(int value) errno = value; return -1; } -#endif diff --git a/linux-user/signal.c b/linux-user/signal.c index 6d5e5b698c..ca8f24b9ec 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -798,7 +798,6 @@ int queue_signal(CPUArchState *env, int sig, int si_type, /* Adjust the signal context to rewind out of safe-syscall if we're in it */ static inline void rewind_if_in_safe_syscall(void *puc) { -#ifdef HAVE_SAFE_SYSCALL ucontext_t *uc = (ucontext_t *)puc; uintptr_t pcreg = host_signal_pc(uc); @@ -806,7 +805,6 @@ static inline void rewind_if_in_safe_syscall(void *puc) && pcreg < (uintptr_t)safe_syscall_end) { host_signal_set_pc(uc, (uintptr_t)safe_syscall_start); } -#endif } static void host_signal_handler(int host_sig, siginfo_t *info, void *puc) diff --git a/linux-user/safe-syscall.S b/linux-user/safe-syscall.S index 42ea7c40ba..7ddc997801 100644 --- a/linux-user/safe-syscall.S +++ b/linux-user/safe-syscall.S @@ -10,15 +10,12 @@ * See the COPYING file in the top-level directory. */ -#include "hostdep.h" #include "target_errno_defs.h" /* We have the correct host directory on our include path * so that this will pull in the right fragment for the architecture. */ -#ifdef HAVE_SAFE_SYSCALL #include "safe-syscall.inc.S" -#endif /* We must specifically say that we're happy for the stack to not be * executable, otherwise the toolchain will default to assuming our From patchwork Tue Dec 14 00:25:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523655 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5335462wro; Mon, 13 Dec 2021 16:27:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvf45RYqAtoh8YvC81e0Jfdslo/6T+YEgvD7MfZoyqFpo8MphEn7tQwvNHzu27jJwj7LtQ X-Received: by 2002:a0c:c586:: with SMTP id a6mr1862588qvj.124.1639441663208; Mon, 13 Dec 2021 16:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441663; cv=none; d=google.com; s=arc-20160816; b=icnEEImNgW5JFyFkOa0Drhqs5C7PDFjJJd3HOuNvBNWosE63pD7DDI1Wh8klRMgBjJ FFl/2R8KdA7/9uAesh/dRczLRDmzEfvpQxxJQLRbp8KbzYGCsQxWKyv6Q12WBi4JEIEa MbEv5Sbff4K4xZBYaGBdgNaBsU6ix6fT7TqytuaMS1N63S8Ry7/aP6zV5vhbdG8g00aN L2+3GUjJXvDhBb9QlI2NitRfeTYUpQrjlPsfX3rp8atgrFKmanqViG4fz8MwEhq+m067 +MihwR44Kk2Ox07C9Y4k/EEnTO9EZw5iK/dZe3U0fZPs+7273Je8bukay+8Rz2OXkprs 9NhQ== 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=un+uBKqutRG2ZAlN9b0r7MkK2+shFWeRn7g9wnKX5fc=; b=K9q5SQLaNY9ZJstc0cZtiQYj346NFSiFgw41n4cPdjvV+oUUyB+QKsFkJ6O0b8kr0V 1KtOESsVrCta9CBxDV6ZsQUzvWvo8bhslpkj6eW85kUGznz5DSA52TpjsHuxUtxOSxm/ tfblp0PI7kWwo8Sz+w9fYjfWo0MlKddsVvtG9gqskXsVjvVS150Yk4hN6+o+fVdYnPWA cRLqXgh67sSUPNx2tc2653LgR2/BDERE+Mj6Cx2ff8HFNhXJZgc8HLfP6B3mjZfASBZ1 ndmt2WPPVLkAlpkMKwG8DRLuEySRQL6qTAwAIspt1b9sf7TG6tPk4YvwWcM/Pz6Y7YlT iJqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=igGQfKAq; 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=pass (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 z11si11725608vse.566.2021.12.13.16.27.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:27: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=pass header.i=@linaro.org header.s=google header.b=igGQfKAq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvfS-000824-Gw for patch@linaro.org; Mon, 13 Dec 2021 19:27:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve4-0007vj-M3 for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:16 -0500 Received: from [2607:f8b0:4864:20::630] (port=44992 helo=mail-pl1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve1-0005S0-Kq for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:16 -0500 Received: by mail-pl1-x630.google.com with SMTP id q17so12343408plr.11 for ; Mon, 13 Dec 2021 16:26: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=un+uBKqutRG2ZAlN9b0r7MkK2+shFWeRn7g9wnKX5fc=; b=igGQfKAq/0x6OCmbFVHAtVhZqCuf70xGi2/ofT/L0iVQJPmDN+EkfohX0lWsKGrGlk ToxwM776Zn4gTrgK1omKUWXwrr9plhuy57yt9y8NBQIV/2bZsYmfWgIIU/ulbv203Zp9 MbeLOkT8Vsa4vZR05ElbMK7/mEqLm2VeZOAuRENp+NAXadifIa0YNbpzfTjkoWcklCeY QKBbhF27D0IzaOE0BXzL6Y8GSUb4h0on+PXrh4X0kiIS8NM8yhiIw0RAlNfs0uFcCXcL f1S7VcAFuIpb/xEp7odSwgF/QwiSocduaeJpBh+sAolazTboqzRwtOFPZJQbXjK1mcw0 /WRA== 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=un+uBKqutRG2ZAlN9b0r7MkK2+shFWeRn7g9wnKX5fc=; b=CabS5ubeLlQFnGZp8dWlrolspZVZa0uZik8NCHe/0jhwu0A0Ris+2xNsR++E+/wTu1 tQuudWXLz6cWMiCpvpBzbvMKUhKIEj3O7Ytd5yG1bwpqkZuLMEvlnAuqdX3FqNOdEkdm KzNksZgrh18lJrSJt73gTg/1Y+FD1TpZFIlBfyC6rRd6lhuCtI6Z36aQKMn78IPrrJ4N GBceKo40ZPZY2Ove7frmb5szBZa/nTt3wmc+OlIMaTNvLcPSg73QFnkRe/OXK+N/LctR QP/Xy26CaZ0g1wvq5kT8rbkdM5iQSTuOdIUdzfnLaoNab8fjeppzw5MGgDXRXZed0ANQ RAng== X-Gm-Message-State: AOAM530oAwB77VQFG9cErUCAkgiJfin2M8QcumHB6sAiysQdsspHwThm KU8tTNibRzKay0KtGgTHoqle9yd4oJnDRw== X-Received: by 2002:a17:90a:f0d7:: with SMTP id fa23mr788473pjb.17.1639441572190; Mon, 13 Dec 2021 16:26:12 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 06/15] linux-user: Rename TARGET_ERESTARTSYS to QEMU_ERESTARTSYS Date: Mon, 13 Dec 2021 16:25:55 -0800 Message-Id: <20211214002604.161983-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::630 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This value is fully internal to qemu, and so is not a TARGET define. We use this as an extra marker for both host and target errno. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/generic/target_errno_defs.h | 2 +- linux-user/safe-syscall.h | 8 ++++---- linux-user/signal-common.h | 2 +- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/cris/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 6 +++--- linux-user/m68k/cpu_loop.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/signal.c | 6 +++--- linux-user/sparc/cpu_loop.c | 2 +- linux-user/syscall.c | 16 ++++++++-------- linux-user/xtensa/cpu_loop.c | 2 +- linux-user/host/aarch64/safe-syscall.inc.S | 3 +-- linux-user/host/arm/safe-syscall.inc.S | 2 +- linux-user/host/i386/safe-syscall.inc.S | 2 +- linux-user/host/mips/safe-syscall.inc.S | 2 +- linux-user/host/ppc64/safe-syscall.inc.S | 2 +- linux-user/host/riscv/safe-syscall.inc.S | 2 +- linux-user/host/s390x/safe-syscall.inc.S | 2 +- linux-user/host/sparc64/safe-syscall.inc.S | 2 +- linux-user/host/x86_64/safe-syscall.inc.S | 2 +- 31 files changed, 45 insertions(+), 46 deletions(-) diff --git a/linux-user/generic/target_errno_defs.h b/linux-user/generic/target_errno_defs.h index 17d85e0b61..58a06a10d6 100644 --- a/linux-user/generic/target_errno_defs.h +++ b/linux-user/generic/target_errno_defs.h @@ -153,7 +153,7 @@ * after handling any pending signals. They match with the ones the guest * kernel uses for the same purpose. */ -#define TARGET_ERESTARTSYS 512 /* Restart system call (if SA_RESTART) */ +#define QEMU_ERESTARTSYS 512 /* Restart system call (if SA_RESTART) */ /* QEMU internal, not visible to the guest. This is returned by the * do_sigreturn() code after a successful sigreturn syscall, to indicate diff --git a/linux-user/safe-syscall.h b/linux-user/safe-syscall.h index f43267a8fc..61a04e2b5a 100644 --- a/linux-user/safe-syscall.h +++ b/linux-user/safe-syscall.h @@ -25,10 +25,10 @@ * * Call a system call if guest signal not pending. * This has the same API as the libc syscall() function, except that it - * may return -1 with errno == TARGET_ERESTARTSYS if a signal was pending. + * may return -1 with errno == QEMU_ERESTARTSYS if a signal was pending. * * Returns: the system call result, or -1 with an error code in errno - * (Errnos are host errnos; we rely on TARGET_ERESTARTSYS not clashing + * (Errnos are host errnos; we rely on QEMU_ERESTARTSYS not clashing * with any of the host errno values.) */ @@ -81,7 +81,7 @@ * which are only technically blocking (ie which we know in practice won't * stay in the host kernel indefinitely) it's OK to use libc if necessary. * You must be able to cope with backing out correctly if some safe_syscall - * you make in the implementation returns either -TARGET_ERESTARTSYS or + * you make in the implementation returns either -QEMU_ERESTARTSYS or * EINTR though.) * * block_signals() cannot be used for interruptible syscalls. @@ -94,7 +94,7 @@ * handler checks the interrupted host PC against the addresse of that * known section. If the PC is before or at the address of the syscall * instruction then we change the PC to point at a "return - * -TARGET_ERESTARTSYS" code path instead, and then exit the signal handler + * -QEMU_ERESTARTSYS" code path instead, and then exit the signal handler * (causing the safe_syscall() call to immediately return that value). * Then in the main.c loop if we see this magic return value we adjust * the guest PC to wind it back to before the system call, and invoke diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index 7457f8025c..b9f33bb44f 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -76,7 +76,7 @@ abi_long do_swapcontext(CPUArchState *env, abi_ulong uold_ctx, * Block all signals, and arrange that the signal mask is returned to * its correct value for the guest before we resume execution of guest code. * If this function returns non-zero, then the caller should immediately - * return -TARGET_ERESTARTSYS to the main loop, which will take the pending + * return -QEMU_ERESTARTSYS to the main loop, which will take the pending * signal and restart execution of the syscall. * If block_signals() returns zero, then the caller can continue with * emulation of the system call knowing that no signals can be taken diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index 97e0728b67..775ba43913 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -99,7 +99,7 @@ void cpu_loop(CPUARMState *env) env->xregs[4], env->xregs[5], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->pc -= 4; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->xregs[0] = ret; diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index 4029849d5c..ce9b251ce3 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -98,7 +98,7 @@ void cpu_loop(CPUAlphaState *env) env->ir[IR_A2], env->ir[IR_A3], env->ir[IR_A4], env->ir[IR_A5], 0, 0); - if (sysret == -TARGET_ERESTARTSYS) { + if (sysret == -QEMU_ERESTARTSYS) { env->pc -= 4; break; } diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index 01cb6eb534..1fcf19750e 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -407,7 +407,7 @@ void cpu_loop(CPUARMState *env) env->regs[4], env->regs[5], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->regs[15] -= env->thumb ? 2 : 4; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->regs[0] = ret; diff --git a/linux-user/cris/cpu_loop.c b/linux-user/cris/cpu_loop.c index 0d5d268609..f3e5b13f89 100644 --- a/linux-user/cris/cpu_loop.c +++ b/linux-user/cris/cpu_loop.c @@ -50,7 +50,7 @@ void cpu_loop(CPUCRISState *env) env->pregs[7], env->pregs[11], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->pc -= 2; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->regs[10] = ret; diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c index 6b24cbaba9..1cacbf42f1 100644 --- a/linux-user/hexagon/cpu_loop.c +++ b/linux-user/hexagon/cpu_loop.c @@ -54,7 +54,7 @@ void cpu_loop(CPUHexagonState *env) env->gpr[4], env->gpr[5], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->gpr[HEX_REG_PC] -= 4; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->gpr[0] = ret; diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 375576c8f0..5315224d12 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -133,7 +133,7 @@ void cpu_loop(CPUHPPAState *env) env->iaoq_f = env->gr[31]; env->iaoq_b = env->gr[31] + 4; break; - case -TARGET_ERESTARTSYS: + case -QEMU_ERESTARTSYS: case -TARGET_QEMU_ESIGRETURN: break; } diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index f6a1cc632b..fbd9a353e5 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -180,7 +180,7 @@ static void emulate_vsyscall(CPUX86State *env) ret = do_syscall(env, syscall, env->regs[R_EDI], env->regs[R_ESI], env->regs[R_EDX], env->regs[10], env->regs[8], env->regs[9], 0, 0); - g_assert(ret != -TARGET_ERESTARTSYS); + g_assert(ret != -QEMU_ERESTARTSYS); g_assert(ret != -TARGET_QEMU_ESIGRETURN); if (ret == -TARGET_EFAULT) { goto sigsegv; @@ -223,7 +223,7 @@ void cpu_loop(CPUX86State *env) env->regs[R_EDI], env->regs[R_EBP], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->eip -= 2; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->regs[R_EAX] = ret; @@ -241,7 +241,7 @@ void cpu_loop(CPUX86State *env) env->regs[8], env->regs[9], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->eip -= 2; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->regs[R_EAX] = ret; diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index 790bd558c3..b03c21a3dc 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -80,7 +80,7 @@ void cpu_loop(CPUM68KState *env) env->dregs[5], env->aregs[0], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->pc -= 2; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->dregs[0] = ret; diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c index a94467dd2d..6e368f986e 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -53,7 +53,7 @@ void cpu_loop(CPUMBState *env) env->regs[9], env->regs[10], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { /* Wind back to before the syscall. */ env->pc -= 4; } else if (ret != -TARGET_QEMU_ESIGRETURN) { diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index b735c99a24..64f308c6ad 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -141,7 +141,7 @@ done_syscall: env->active_tc.gpr[8], env->active_tc.gpr[9], env->active_tc.gpr[10], env->active_tc.gpr[11]); # endif /* O32 */ - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->active_tc.PC -= 4; break; } diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index 3cfdbbf037..3147ab2b62 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -48,7 +48,7 @@ void cpu_loop(CPUOpenRISCState *env) cpu_get_gpr(env, 6), cpu_get_gpr(env, 7), cpu_get_gpr(env, 8), 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->pc -= 4; } else if (ret != -TARGET_QEMU_ESIGRETURN) { cpu_set_gpr(env, 11, ret); diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index 483e669300..5348641e9e 100644 --- a/linux-user/ppc/cpu_loop.c +++ b/linux-user/ppc/cpu_loop.c @@ -428,7 +428,7 @@ void cpu_loop(CPUPPCState *env) ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4], env->gpr[5], env->gpr[6], env->gpr[7], env->gpr[8], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->nip -= 4; break; } diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index b301dac802..20f8c48b1d 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -69,7 +69,7 @@ void cpu_loop(CPURISCVState *env) env->gpr[xA5], 0, 0); } - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->pc -= 4; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->gpr[xA0] = ret; diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c index d089c8417e..043582ca7c 100644 --- a/linux-user/s390x/cpu_loop.c +++ b/linux-user/s390x/cpu_loop.c @@ -83,7 +83,7 @@ void cpu_loop(CPUS390XState *env) ret = do_syscall(env, n, env->regs[2], env->regs[3], env->regs[4], env->regs[5], env->regs[6], env->regs[7], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->psw.addr -= env->int_svc_ilen; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->regs[2] = ret; diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index ac9b01840c..6c4ebfa969 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -50,7 +50,7 @@ void cpu_loop(CPUSH4State *env) env->gregs[0], env->gregs[1], 0, 0); - if (ret == -TARGET_ERESTARTSYS) { + if (ret == -QEMU_ERESTARTSYS) { env->pc -= 2; } else if (ret != -TARGET_QEMU_ESIGRETURN) { env->gregs[0] = ret; diff --git a/linux-user/signal.c b/linux-user/signal.c index ca8f24b9ec..12b1705287 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -213,7 +213,7 @@ int block_signals(void) /* Wrapper for sigprocmask function * Emulates a sigprocmask in a safe way for the guest. Note that set and oldset - * are host signal set, not guest ones. Returns -TARGET_ERESTARTSYS if + * are host signal set, not guest ones. Returns -QEMU_ERESTARTSYS if * a signal was already pending and the syscall must be restarted, or * 0 on success. * If set is NULL, this is guaranteed not to fail. @@ -230,7 +230,7 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset) int i; if (block_signals()) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } switch (how) { @@ -985,7 +985,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, } if (block_signals()) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } k = &sigact_table[sig - 1]; diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 0ba65e431c..529337c5e0 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -181,7 +181,7 @@ void cpu_loop (CPUSPARCState *env) env->regwptr[2], env->regwptr[3], env->regwptr[4], env->regwptr[5], 0, 0); - if (ret == -TARGET_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) { + if (ret == -QEMU_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) { break; } if ((abi_ulong)ret >= (abi_ulong)(-515)) { diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f1cfcc8104..23fb45e0f1 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -547,7 +547,7 @@ static inline abi_long get_errno(abi_long ret) const char *target_strerror(int err) { - if (err == TARGET_ERESTARTSYS) { + if (err == QEMU_ERESTARTSYS) { return "To be restarted"; } if (err == TARGET_QEMU_ESIGRETURN) { @@ -6458,7 +6458,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, } if (block_signals()) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } fork_start(); @@ -8328,7 +8328,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, Do thread termination if we have more then one thread. */ if (block_signals()) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } pthread_mutex_lock(&clone_lock); @@ -9317,7 +9317,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask, SIGSET_T_SIZE)); - if (ret != -TARGET_ERESTARTSYS) { + if (ret != -QEMU_ERESTARTSYS) { ts->in_sigsuspend = 1; } } @@ -9336,7 +9336,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, unlock_user(p, arg1, 0); ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask, SIGSET_T_SIZE)); - if (ret != -TARGET_ERESTARTSYS) { + if (ret != -QEMU_ERESTARTSYS) { ts->in_sigsuspend = 1; } } @@ -9452,13 +9452,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_sigreturn case TARGET_NR_sigreturn: if (block_signals()) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } return do_sigreturn(cpu_env); #endif case TARGET_NR_rt_sigreturn: if (block_signals()) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } return do_rt_sigreturn(cpu_env); case TARGET_NR_sethostname: @@ -13145,7 +13145,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, static bool flag; flag = !flag; if (flag) { - return -TARGET_ERESTARTSYS; + return -QEMU_ERESTARTSYS; } } #endif diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index a83490ab35..29cc6f3830 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -184,7 +184,7 @@ void cpu_loop(CPUXtensaState *env) env->regs[2] = ret; break; - case -TARGET_ERESTARTSYS: + case -QEMU_ERESTARTSYS: env->pc -= 3; break; diff --git a/linux-user/host/aarch64/safe-syscall.inc.S b/linux-user/host/aarch64/safe-syscall.inc.S index 76a0a18a6c..87c9580faa 100644 --- a/linux-user/host/aarch64/safe-syscall.inc.S +++ b/linux-user/host/aarch64/safe-syscall.inc.S @@ -70,8 +70,7 @@ safe_syscall_end: b safe_syscall_set_errno_tail /* code path when we didn't execute the syscall */ -2: mov w0, #TARGET_ERESTARTSYS +2: mov w0, #QEMU_ERESTARTSYS b safe_syscall_set_errno_tail - .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/linux-user/host/arm/safe-syscall.inc.S b/linux-user/host/arm/safe-syscall.inc.S index 618112c6bf..f1a6aabfd3 100644 --- a/linux-user/host/arm/safe-syscall.inc.S +++ b/linux-user/host/arm/safe-syscall.inc.S @@ -81,7 +81,7 @@ safe_syscall_end: pop { r4, r5, r6, r7, r8, pc } /* code path when we didn't execute the syscall */ -2: mov r0, #TARGET_ERESTARTSYS +2: mov r0, #QEMU_ERESTARTSYS /* code path setting errno */ 1: pop { r4, r5, r6, r7, r8, lr } diff --git a/linux-user/host/i386/safe-syscall.inc.S b/linux-user/host/i386/safe-syscall.inc.S index f5883234bb..1fb031d228 100644 --- a/linux-user/host/i386/safe-syscall.inc.S +++ b/linux-user/host/i386/safe-syscall.inc.S @@ -94,7 +94,7 @@ safe_syscall_end: jmp 1f /* code path when we didn't execute the syscall */ -2: mov $TARGET_ERESTARTSYS, %eax +2: mov $QEMU_ERESTARTSYS, %eax /* code path setting errno */ 1: pop %ebx diff --git a/linux-user/host/mips/safe-syscall.inc.S b/linux-user/host/mips/safe-syscall.inc.S index 041d1a6e65..e9362e774d 100644 --- a/linux-user/host/mips/safe-syscall.inc.S +++ b/linux-user/host/mips/safe-syscall.inc.S @@ -127,7 +127,7 @@ safe_syscall_end: PTR_ADDIU sp, sp, FRAME .cfi_adjust_cfa_offset -FRAME .cfi_restore s0 - li v0, TARGET_ERESTARTSYS + li v0, QEMU_ERESTARTSYS /* code path setting errno */ /* diff --git a/linux-user/host/ppc64/safe-syscall.inc.S b/linux-user/host/ppc64/safe-syscall.inc.S index 3a640cfc04..69d3c70094 100644 --- a/linux-user/host/ppc64/safe-syscall.inc.S +++ b/linux-user/host/ppc64/safe-syscall.inc.S @@ -78,7 +78,7 @@ safe_syscall_end: /* code path when we didn't execute the syscall */ 2: ld 14, 16(1) /* restore r14 */ - addi 3, 0, TARGET_ERESTARTSYS + addi 3, 0, QEMU_ERESTARTSYS /* code path setting errno */ 1: b safe_syscall_set_errno_tail diff --git a/linux-user/host/riscv/safe-syscall.inc.S b/linux-user/host/riscv/safe-syscall.inc.S index 54c2e23f75..ca456d8a46 100644 --- a/linux-user/host/riscv/safe-syscall.inc.S +++ b/linux-user/host/riscv/safe-syscall.inc.S @@ -72,7 +72,7 @@ safe_syscall_end: j safe_syscall_set_errno_tail /* code path when we didn't execute the syscall */ -2: li a0, TARGET_ERESTARTSYS +2: li a0, QEMU_ERESTARTSYS j safe_syscall_set_errno_tail .cfi_endproc diff --git a/linux-user/host/s390x/safe-syscall.inc.S b/linux-user/host/s390x/safe-syscall.inc.S index 899dab39e9..66f84385a2 100644 --- a/linux-user/host/s390x/safe-syscall.inc.S +++ b/linux-user/host/s390x/safe-syscall.inc.S @@ -91,7 +91,7 @@ safe_syscall_end: 2: lg %r15,0(%r15) /* load back chain */ .cfi_adjust_cfa_offset -160 lmg %r6,%r15,48(%r15) /* load saved registers */ - lghi %r2, TARGET_ERESTARTSYS + lghi %r2, QEMU_ERESTARTSYS jg safe_syscall_set_errno_tail .cfi_endproc diff --git a/linux-user/host/sparc64/safe-syscall.inc.S b/linux-user/host/sparc64/safe-syscall.inc.S index bb35c64cfc..3a0e76fcc7 100644 --- a/linux-user/host/sparc64/safe-syscall.inc.S +++ b/linux-user/host/sparc64/safe-syscall.inc.S @@ -78,7 +78,7 @@ safe_syscall_end: nop /* code path when we didn't execute the syscall */ -2: set TARGET_ERESTARTSYS, %o0 +2: set QEMU_ERESTARTSYS, %o0 /* code path setting errno */ 1: mov %o7, %g1 diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/linux-user/host/x86_64/safe-syscall.inc.S index 39b64250c3..f88cbe1347 100644 --- a/linux-user/host/x86_64/safe-syscall.inc.S +++ b/linux-user/host/x86_64/safe-syscall.inc.S @@ -82,7 +82,7 @@ safe_syscall_end: jmp 1f /* code path when we didn't execute the syscall */ -2: mov $TARGET_ERESTARTSYS, %eax +2: mov $QEMU_ERESTARTSYS, %eax /* code path setting errno */ 1: pop %rbp From patchwork Tue Dec 14 00:25:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523664 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5341243wro; Mon, 13 Dec 2021 16:35:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyN/RXPuhjW9rOS7wLGOmO+zNrOF/Sqp8a40riqzoMxmowm+fvRemPeABdYVv8AWubdukOm X-Received: by 2002:ab0:698c:: with SMTP id t12mr2510625uaq.142.1639442111453; Mon, 13 Dec 2021 16:35:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442111; cv=none; d=google.com; s=arc-20160816; b=yujnIzu3yS0PYHz/OrbYndQIbL/syVtFxeynUOPLkRQcwpI7BqTOSPqNOxDfxc+BHp N42MlhxDGEEFJxJaR/nf2U/JT6ARZCrmHJ6vS3rWeUnywgvWhJJl2rKgDhFZfXigPP3O ZtyxUxAv+/3L8WB3QgMUPsjqCvk8xQdV6Uz6ZW1ci/uzlgfWgeGqULiv+SkbEbKzD3qO 32c0tP7T6hrnt4ln+WPxRd+9a7p0kLhIxTxIDCtyc0lPkPVOdqnHvUNpPQeFqjmZBG0w WtYm8UGQaHW9w0KCsW975+8BkG0heno8qcd61lfWkFdlaiyIhIuCtlNljvh//xh60n00 H1WA== 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=TFNb/strBQB9hLaOeOMEOLWgIeKVijWjHGUQ12nJnAw=; b=jqXotQ4jK9fqDU4F+BOt4+ZxMzDi3UPiSBSz20lyEZVaW8aqj9v6bVhwMP4Y/QDNSi yzfChZAqe0cqwXcwmSkEAqEJfWSObnt7TImX3yzHr+SK7DsxMTT0Yyq6TpmyO3sXZJoo DsrmKJB3FCdY8yvq1Btunpengp4ratmSw5VEcoYV4eC5EErvy5oYxvCjqHtQjrp16HMv 6wK9Mhf8LaV66VMdwGD6n49JDd6zdRQb9TU7jiMj5Z6vWYYYYZ2j8/ABaK/uE6RnufDt yEeg+5qr46LWoA+IfSBWJGzhMdr1PGoYlRed6WDd6zPIxLX5+MjzIJTyZJSXweTzD4xZ N9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PPModKLw; 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=pass (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 w6si9801041vkb.142.2021.12.13.16.35.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:35:11 -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=pass header.i=@linaro.org header.s=google header.b=PPModKLw; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvmg-0006rR-T8 for patch@linaro.org; Mon, 13 Dec 2021 19:35:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve3-0007tq-R5 for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:15 -0500 Received: from [2607:f8b0:4864:20::534] (port=41809 helo=mail-pg1-x534.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve2-0005S9-5P for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:15 -0500 Received: by mail-pg1-x534.google.com with SMTP id k4so15965173pgb.8 for ; Mon, 13 Dec 2021 16:26: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=TFNb/strBQB9hLaOeOMEOLWgIeKVijWjHGUQ12nJnAw=; b=PPModKLwQ5yV7V3sebUjlcZyy03stKkBYSPswRxm/NZlYwQm1ttk3xEF0BhqALmO+C 1VyEWIHR4lhzLnXhwxYbGGpy+8svAOtxlCLTqAn8WAJS+HvGzy/sTYuvo1RBceGH3nX/ kE/ZHl1/tf0/f3GuhihB0TbrjmDnLPcdOVebcvWLScmTBWCfOekI6UV8fEqHHqJEaXRR 7MFgylGCT4mJQ5Vc/dC0RaER1WKqLGnY9M/jmYyMCxjvkFFqM40vnX4M+wIyo6sSRAZZ zK4lqNXPudRiV6IxwSdPfLordy7EeS5rhNtA3n4wMcJGiLFwEJVY+3fRYRkhV4UuMeH6 cCeg== 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=TFNb/strBQB9hLaOeOMEOLWgIeKVijWjHGUQ12nJnAw=; b=c9GpndgNURw4qqTRBjyeXZ5FGL2ognBrLts7O0e8mNtoVpZxYyClz8LDHGUYxu7z9N 1bGzjoQ3+Cwg8LVOSKN9CDMKEMvwJ93KLkVspuvmVWoOtYgWho0r4wVd+aAa2mhcdGYi P19vUEw00p3RXBWi2Aj1z/C7hbcXZr1ui5IQFRNCkEPc2+a1QrkOJ8x9MCfDfjyJThv3 LI6axFQ+td1n+Nny6zjCvs9bB8XMJoYUIn5HdkO26N/y+lAPXRea4XpuYe8XFhZzxJqT se3DNT1OYORzozxyaIi/kRR6ZeYjw37+fWFxFw7ksS6I2HWO83qvMvFFxDK31WR4Na7J NLgA== X-Gm-Message-State: AOAM5317UNlc3I4C/zHEnON1x6+ZnequHRL9q6Fe9SH4QqIN+QAKf1Iq KE+kSZTxx9/zQFILpocV6poIFdIN8lO9IA== X-Received: by 2002:a65:44c4:: with SMTP id g4mr1410287pgs.103.1639441572992; Mon, 13 Dec 2021 16:26:12 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 07/15] bsd-user: Rename TARGET_ERESTARTSYS to QEMU_ERESTARTSYS Date: Mon, 13 Dec 2021 16:25:56 -0800 Message-Id: <20211214002604.161983-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::534 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This value is fully internal to qemu, and so is not a TARGET define. We use this as an extra marker for both host and target errno. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- bsd-user/errno_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/errno_defs.h b/bsd-user/errno_defs.h index 832671354f..141e08456c 100644 --- a/bsd-user/errno_defs.h +++ b/bsd-user/errno_defs.h @@ -151,6 +151,6 @@ /* Internal errors: */ #define TARGET_EJUSTRETURN 254 /* Just return without modifing regs */ #define TARGET_ERESTART 255 /* Restart syscall */ -#define TARGET_ERESTARTSYS TARGET_ERESTART /* Linux compat */ +#define QEMU_ERESTARTSYS TARGET_ERESTART #endif /* ! _ERRNO_DEFS_H_ */ From patchwork Tue Dec 14 00:25:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523663 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5341226wro; Mon, 13 Dec 2021 16:35:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO45dgWRCuJ2BbWqd511dKcz9XO8dR5Dfxslt1mZmDbXnszmq6bWCJk7dHZrHL03yAn0Zw X-Received: by 2002:a1f:a08c:: with SMTP id j134mr2829419vke.35.1639442110450; Mon, 13 Dec 2021 16:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442110; cv=none; d=google.com; s=arc-20160816; b=Auai+NPVzXxmLlvXzygXn0NbE0Wt37/H5TWgU6rp3sOb2xz/x8+QuZj3ZjDSCq+X42 jwk6g4vXVqPrNcEx5OTdBFDJ1xQhncn5RL/QUxHXsCiniY2KlCLCHAwva3iEc1sFEe5N fzJBQrHJFvdBULEx082wDbcC5b4R4yxk/UU7O8LcOH43X5y43EP8XynAUFwCzGPNXyeb ay/KUFP7UUdskZXtu04l3cx6w3FcADjsxpfSTJp0mycP7ZkFCraK8v8slEnu7iRiAnbp n7DfIm0XyS5QLRGA8jf/TM2owkL62aPlE0p7ZPq55ufDs3pDiUjUzPn5Unf33YqWl8y+ olbw== 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=OXKTkD0XslX3F2mSmJn4vyqwKgYwlny2SKE6rytHBgc=; b=SivGCrrb26bZfSTXS3mFBVHxKpQi5S1SDWryFl/xTDkOIhiTT33mDMe7tkseREZgJr q/ncQcmtiwnWiIrCNyZ02Aj0SMttLO0HrHFgMqMNz7hC8Zkey/z8eSjiCwkeHEg3l5QA iYOq/8KxAqMljDk1oIL0qjx5sjAtx5iOiG+YFKybvRBf2Cx0q5gNqZx4NOIL7hTo/kMB BpZvCe5XZvhE02wI3sNcON3GLE7/E//p3kVlKrfeH0dowcEPOTl4eM+XafZUOpOvJb99 8xLL59iwH9HK1bHbSXaPLbLaWIp3J3h8WJPavIfw6as8JB0AhIRy0vEsnMbaKAKzYU35 w0yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nfyhGvaJ; 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=pass (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 z76si10175979vkd.51.2021.12.13.16.35.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:35:10 -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=pass header.i=@linaro.org header.s=google header.b=nfyhGvaJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvmf-0006h9-ME for patch@linaro.org; Mon, 13 Dec 2021 19:35:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve8-00088c-OY for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:20 -0500 Received: from [2607:f8b0:4864:20::432] (port=44688 helo=mail-pf1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve3-0005SQ-Hq for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:19 -0500 Received: by mail-pf1-x432.google.com with SMTP id k64so16382094pfd.11 for ; Mon, 13 Dec 2021 16:26:15 -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=OXKTkD0XslX3F2mSmJn4vyqwKgYwlny2SKE6rytHBgc=; b=nfyhGvaJUFdaFde7h+VFWOWbrT1o1m0k7e121M7NzSmwkwAcyDK/P/ubshx7n1vYyn q7YnSjh1N9PWA4Ja1Ln0QZsnbRqUPAUOsoLnbS9DaSnSb6DYUUnv7iCKzOvURjffTV0G ImEfv8s7nR9nMf/O5rsyYdG4gPTdu5wSANeTW5q0Cj1ujmH8kX3KvFiP1+CTBnW/NLvw ViGtkYfFVGuZK0IQXN8CfY+TF6lzeI30MGTjeZaoi7pGw43mGJcG3tIBtd/oO+rj5y+U Tl0ZpKa4jAQOWmoqkB/opBdVOwsJi0kY83creKxTH0AwMIXc19y0m/wnJIk5kStFnywH JXKQ== 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=OXKTkD0XslX3F2mSmJn4vyqwKgYwlny2SKE6rytHBgc=; b=TiK1N20eQr3hdEpkizxQV9gcLSRGuyjaaswZsS77U88J12Id2rnfdSkESQWDlfQN7J vFoTpANA/154M+nY12O1L4u2jb1EzCT0fWtJBJMPAEBkMWFukF4oksRhPDXXsQy4Iuov uAtcG3wGTN0pVSGzs5rYEAcZd7uZb+7xdX3Fqa/c8doRMCqV7+BRW5KBAdVC0m8+CkNT yjNG5hpBkQrZA4oQDZIPUDFACcuTcEZoXcbftVehTxMq/ZZOVMNgO5IfV4rs9gTYn6G2 efx+YCRlB05fHf0HaUE/jNMHplLr8QFmFEclrM8L137taT56sYEp8n7oSzYH0Bmg+VQS 5fdw== X-Gm-Message-State: AOAM530X5uttNxThHiWtGkf6HY3gvczHTCfbVVjtUUsA4dcOHmmrzM30 +9TsGBFVZW5AYxlmsmZH+ihwZBF/JJVBww== X-Received: by 2002:a63:5754:: with SMTP id h20mr1352523pgm.475.1639441574114; Mon, 13 Dec 2021 16:26:14 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 08/15] linux-user: Rename TARGET_QEMU_ESIGRETURN to QEMU_ESIGRETURN Date: Mon, 13 Dec 2021 16:25:57 -0800 Message-Id: <20211214002604.161983-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::432 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This value is fully internal to qemu, and so is not a TARGET define. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/generic/target_errno_defs.h | 2 +- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/aarch64/signal.c | 4 ++-- linux-user/alpha/cpu_loop.c | 2 +- linux-user/alpha/signal.c | 8 ++++---- linux-user/arm/cpu_loop.c | 2 +- linux-user/arm/signal.c | 8 ++++---- linux-user/cris/cpu_loop.c | 2 +- linux-user/cris/signal.c | 4 ++-- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hexagon/signal.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/hppa/signal.c | 4 ++-- linux-user/i386/cpu_loop.c | 6 +++--- linux-user/i386/signal.c | 8 ++++---- linux-user/m68k/cpu_loop.c | 2 +- linux-user/m68k/signal.c | 8 ++++---- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/microblaze/signal.c | 4 ++-- linux-user/mips/cpu_loop.c | 2 +- linux-user/mips/signal.c | 8 ++++---- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/ppc/signal.c | 10 +++++----- linux-user/riscv/cpu_loop.c | 2 +- linux-user/riscv/signal.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/s390x/signal.c | 8 ++++---- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sh4/signal.c | 8 ++++---- linux-user/sparc/cpu_loop.c | 2 +- linux-user/sparc/signal.c | 8 ++++---- linux-user/syscall.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- linux-user/xtensa/signal.c | 4 ++-- 35 files changed, 70 insertions(+), 70 deletions(-) diff --git a/linux-user/generic/target_errno_defs.h b/linux-user/generic/target_errno_defs.h index 58a06a10d6..bb37d88be9 100644 --- a/linux-user/generic/target_errno_defs.h +++ b/linux-user/generic/target_errno_defs.h @@ -162,6 +162,6 @@ * ERESTART_NOINTR (which is kernel internal) to guarantee that we won't * clash with a valid guest errno now or in the future. */ -#define TARGET_QEMU_ESIGRETURN 513 /* Return from signal */ +#define QEMU_ESIGRETURN 513 /* Return from signal */ #endif diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index 775ba43913..98b53962cd 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -101,7 +101,7 @@ void cpu_loop(CPUARMState *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->pc -= 4; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->xregs[0] = ret; } break; diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c index 29c52db3f1..df9e39a4ba 100644 --- a/linux-user/aarch64/signal.c +++ b/linux-user/aarch64/signal.c @@ -556,12 +556,12 @@ long do_rt_sigreturn(CPUARMState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_sigreturn(CPUARMState *env) diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c index ce9b251ce3..37c33f0ccd 100644 --- a/linux-user/alpha/cpu_loop.c +++ b/linux-user/alpha/cpu_loop.c @@ -102,7 +102,7 @@ void cpu_loop(CPUAlphaState *env) env->pc -= 4; break; } - if (sysret == -TARGET_QEMU_ESIGRETURN) { + if (sysret == -QEMU_ESIGRETURN) { break; } /* Syscall writes 0 to V0 to bypass error check, similar diff --git a/linux-user/alpha/signal.c b/linux-user/alpha/signal.c index bbe3dd175a..4ec42994d4 100644 --- a/linux-user/alpha/signal.c +++ b/linux-user/alpha/signal.c @@ -225,11 +225,11 @@ long do_sigreturn(CPUAlphaState *env) restore_sigcontext(env, sc); unlock_user_struct(sc, sc_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_rt_sigreturn(CPUAlphaState *env) @@ -249,13 +249,13 @@ long do_rt_sigreturn(CPUAlphaState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index 1fcf19750e..f153ab503a 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -409,7 +409,7 @@ void cpu_loop(CPUARMState *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->regs[15] -= env->thumb ? 2 : 4; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->regs[0] = ret; } } diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c index df9f8e8eb2..cf99fd7b8a 100644 --- a/linux-user/arm/signal.c +++ b/linux-user/arm/signal.c @@ -511,12 +511,12 @@ long do_sigreturn(CPUARMState *env) } unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_rt_sigreturn(CPUARMState *env) @@ -546,12 +546,12 @@ long do_rt_sigreturn(CPUARMState *env) } unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } /* diff --git a/linux-user/cris/cpu_loop.c b/linux-user/cris/cpu_loop.c index f3e5b13f89..5213aebf55 100644 --- a/linux-user/cris/cpu_loop.c +++ b/linux-user/cris/cpu_loop.c @@ -52,7 +52,7 @@ void cpu_loop(CPUCRISState *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->pc -= 2; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->regs[10] = ret; } break; diff --git a/linux-user/cris/signal.c b/linux-user/cris/signal.c index 7f6aca934e..4f532b2903 100644 --- a/linux-user/cris/signal.c +++ b/linux-user/cris/signal.c @@ -177,10 +177,10 @@ long do_sigreturn(CPUCRISState *env) restore_sigcontext(&frame->sc, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_rt_sigreturn(CPUCRISState *env) diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c index 1cacbf42f1..b84e25bf71 100644 --- a/linux-user/hexagon/cpu_loop.c +++ b/linux-user/hexagon/cpu_loop.c @@ -56,7 +56,7 @@ void cpu_loop(CPUHexagonState *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->gpr[HEX_REG_PC] -= 4; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->gpr[0] = ret; } break; diff --git a/linux-user/hexagon/signal.c b/linux-user/hexagon/signal.c index 74e61739a0..ad4e3822d5 100644 --- a/linux-user/hexagon/signal.c +++ b/linux-user/hexagon/signal.c @@ -268,7 +268,7 @@ long do_rt_sigreturn(CPUHexagonState *env) target_restore_altstack(&frame->uc.uc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 5315224d12..a47a63176b 100644 --- a/linux-user/hppa/cpu_loop.c +++ b/linux-user/hppa/cpu_loop.c @@ -134,7 +134,7 @@ void cpu_loop(CPUHPPAState *env) env->iaoq_b = env->gr[31] + 4; break; case -QEMU_ERESTARTSYS: - case -TARGET_QEMU_ESIGRETURN: + case -QEMU_ESIGRETURN: break; } break; diff --git a/linux-user/hppa/signal.c b/linux-user/hppa/signal.c index c2fbc26ebb..962f551c04 100644 --- a/linux-user/hppa/signal.c +++ b/linux-user/hppa/signal.c @@ -191,9 +191,9 @@ long do_rt_sigreturn(CPUArchState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index fbd9a353e5..9aaae93e2f 100644 --- a/linux-user/i386/cpu_loop.c +++ b/linux-user/i386/cpu_loop.c @@ -181,7 +181,7 @@ static void emulate_vsyscall(CPUX86State *env) env->regs[R_EDX], env->regs[10], env->regs[8], env->regs[9], 0, 0); g_assert(ret != -QEMU_ERESTARTSYS); - g_assert(ret != -TARGET_QEMU_ESIGRETURN); + g_assert(ret != -QEMU_ESIGRETURN); if (ret == -TARGET_EFAULT) { goto sigsegv; } @@ -225,7 +225,7 @@ void cpu_loop(CPUX86State *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->eip -= 2; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->regs[R_EAX] = ret; } break; @@ -243,7 +243,7 @@ void cpu_loop(CPUX86State *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->eip -= 2; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->regs[R_EAX] = ret; } break; diff --git a/linux-user/i386/signal.c b/linux-user/i386/signal.c index 433efa3d69..4372621a4d 100644 --- a/linux-user/i386/signal.c +++ b/linux-user/i386/signal.c @@ -559,12 +559,12 @@ long do_sigreturn(CPUX86State *env) if (restore_sigcontext(env, &frame->sc)) goto badframe; unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } #endif @@ -588,12 +588,12 @@ long do_rt_sigreturn(CPUX86State *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } #ifndef TARGET_X86_64 diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index b03c21a3dc..3181594414 100644 --- a/linux-user/m68k/cpu_loop.c +++ b/linux-user/m68k/cpu_loop.c @@ -82,7 +82,7 @@ void cpu_loop(CPUM68KState *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->pc -= 2; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->dregs[0] = ret; } } diff --git a/linux-user/m68k/signal.c b/linux-user/m68k/signal.c index ec33482e14..5f35354487 100644 --- a/linux-user/m68k/signal.c +++ b/linux-user/m68k/signal.c @@ -353,11 +353,11 @@ long do_sigreturn(CPUM68KState *env) restore_sigcontext(env, &frame->sc); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_rt_sigreturn(CPUM68KState *env) @@ -381,12 +381,12 @@ long do_rt_sigreturn(CPUM68KState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c index 6e368f986e..ff1fb26c8b 100644 --- a/linux-user/microblaze/cpu_loop.c +++ b/linux-user/microblaze/cpu_loop.c @@ -56,7 +56,7 @@ void cpu_loop(CPUMBState *env) if (ret == -QEMU_ERESTARTSYS) { /* Wind back to before the syscall. */ env->pc -= 4; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->regs[3] = ret; } /* All syscall exits result in guest r14 being equal to the diff --git a/linux-user/microblaze/signal.c b/linux-user/microblaze/signal.c index 8ebb6a1b7d..5188d74025 100644 --- a/linux-user/microblaze/signal.c +++ b/linux-user/microblaze/signal.c @@ -207,12 +207,12 @@ long do_rt_sigreturn(CPUMBState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 64f308c6ad..32f9fc1c1c 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -145,7 +145,7 @@ done_syscall: env->active_tc.PC -= 4; break; } - if (ret == -TARGET_QEMU_ESIGRETURN) { + if (ret == -QEMU_ESIGRETURN) { /* Returning from a successful sigreturn syscall. Avoid clobbering register state. */ break; diff --git a/linux-user/mips/signal.c b/linux-user/mips/signal.c index 8f79e405ec..58a9d7a8a3 100644 --- a/linux-user/mips/signal.c +++ b/linux-user/mips/signal.c @@ -281,11 +281,11 @@ long do_sigreturn(CPUMIPSState *regs) /* I am not sure this is right, but it seems to work * maybe a problem with nested signals ? */ regs->CP0_EPC = 0; - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } # endif /* O32 */ @@ -371,11 +371,11 @@ long do_rt_sigreturn(CPUMIPSState *env) /* I am not sure this is right, but it seems to work * maybe a problem with nested signals ? */ env->CP0_EPC = 0; - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c index 3147ab2b62..592901a68b 100644 --- a/linux-user/openrisc/cpu_loop.c +++ b/linux-user/openrisc/cpu_loop.c @@ -50,7 +50,7 @@ void cpu_loop(CPUOpenRISCState *env) cpu_get_gpr(env, 8), 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->pc -= 4; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { cpu_set_gpr(env, 11, ret); } break; diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index 5348641e9e..30c82f2354 100644 --- a/linux-user/ppc/cpu_loop.c +++ b/linux-user/ppc/cpu_loop.c @@ -432,7 +432,7 @@ void cpu_loop(CPUPPCState *env) env->nip -= 4; break; } - if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) { + if (ret == (target_ulong)(-QEMU_ESIGRETURN)) { /* Returning from a successful sigreturn syscall. Avoid corrupting register state. */ break; diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c index 90a0369632..176c9d8503 100644 --- a/linux-user/ppc/signal.c +++ b/linux-user/ppc/signal.c @@ -591,13 +591,13 @@ long do_sigreturn(CPUPPCState *env) unlock_user_struct(sr, sr_addr, 1); unlock_user_struct(sc, sc_addr, 1); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; sigsegv: unlock_user_struct(sr, sr_addr, 1); unlock_user_struct(sc, sc_addr, 1); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } #endif /* !defined(TARGET_PPC64) */ @@ -646,12 +646,12 @@ long do_rt_sigreturn(CPUPPCState *env) target_restore_altstack(&rt_sf->uc.tuc_stack, env); unlock_user_struct(rt_sf, rt_sf_addr, 1); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; sigsegv: unlock_user_struct(rt_sf, rt_sf_addr, 1); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } /* This syscall implements {get,set,swap}context for userland. */ @@ -704,7 +704,7 @@ abi_long do_swapcontext(CPUArchState *env, abi_ulong uold_ctx, /* We cannot return to a partially updated context. */ force_sig(TARGET_SIGSEGV); } - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } return 0; diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 20f8c48b1d..0cd8985cb8 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -71,7 +71,7 @@ void cpu_loop(CPURISCVState *env) } if (ret == -QEMU_ERESTARTSYS) { env->pc -= 4; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->gpr[xA0] = ret; } if (cs->singlestep_enabled) { diff --git a/linux-user/riscv/signal.c b/linux-user/riscv/signal.c index a0f9542ce3..296e39fbf0 100644 --- a/linux-user/riscv/signal.c +++ b/linux-user/riscv/signal.c @@ -188,7 +188,7 @@ long do_rt_sigreturn(CPURISCVState *env) target_restore_altstack(&frame->uc.uc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c index 043582ca7c..ad0c3cd263 100644 --- a/linux-user/s390x/cpu_loop.c +++ b/linux-user/s390x/cpu_loop.c @@ -85,7 +85,7 @@ void cpu_loop(CPUS390XState *env) env->regs[6], env->regs[7], 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->psw.addr -= env->int_svc_ilen; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->regs[2] = ret; } break; diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index 676b948147..f47713e04a 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -359,7 +359,7 @@ long do_sigreturn(CPUS390XState *env) trace_user_do_sigreturn(env, frame_addr); if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } /* Make sure that we're initializing all of target_set. */ @@ -373,7 +373,7 @@ long do_sigreturn(CPUS390XState *env) restore_sigregs_ext(env, &frame->sregs_ext); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_rt_sigreturn(CPUS390XState *env) @@ -385,7 +385,7 @@ long do_rt_sigreturn(CPUS390XState *env) trace_user_do_rt_sigreturn(env, frame_addr); if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } target_to_host_sigset(&set, &frame->uc.tuc_sigmask); @@ -397,7 +397,7 @@ long do_rt_sigreturn(CPUS390XState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index 6c4ebfa969..3290f6445c 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -52,7 +52,7 @@ void cpu_loop(CPUSH4State *env) 0, 0); if (ret == -QEMU_ERESTARTSYS) { env->pc -= 2; - } else if (ret != -TARGET_QEMU_ESIGRETURN) { + } else if (ret != -QEMU_ESIGRETURN) { env->gregs[0] = ret; } break; diff --git a/linux-user/sh4/signal.c b/linux-user/sh4/signal.c index faa869fb19..f6a18bc6b5 100644 --- a/linux-user/sh4/signal.c +++ b/linux-user/sh4/signal.c @@ -286,12 +286,12 @@ long do_sigreturn(CPUSH4State *regs) restore_sigcontext(regs, &frame->sc); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } long do_rt_sigreturn(CPUSH4State *regs) @@ -313,12 +313,12 @@ long do_rt_sigreturn(CPUSH4State *regs) target_restore_altstack(&frame->uc.tuc_stack, regs); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 529337c5e0..8765ab6020 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -181,7 +181,7 @@ void cpu_loop (CPUSPARCState *env) env->regwptr[2], env->regwptr[3], env->regwptr[4], env->regwptr[5], 0, 0); - if (ret == -QEMU_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) { + if (ret == -QEMU_ERESTARTSYS || ret == -QEMU_ESIGRETURN) { break; } if ((abi_ulong)ret >= (abi_ulong)(-515)) { diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 23e1e761de..b501750fe0 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -431,12 +431,12 @@ long do_sigreturn(CPUSPARCState *env) set_sigmask(&host_set); unlock_user_struct(sf, sf_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; segv_and_exit: unlock_user_struct(sf, sf_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; #else return -TARGET_ENOSYS; #endif @@ -495,12 +495,12 @@ long do_rt_sigreturn(CPUSPARCState *env) env->npc = tnpc; unlock_user_struct(sf, sf_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; segv_and_exit: unlock_user_struct(sf, sf_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 23fb45e0f1..2867be4cd3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -550,7 +550,7 @@ const char *target_strerror(int err) if (err == QEMU_ERESTARTSYS) { return "To be restarted"; } - if (err == TARGET_QEMU_ESIGRETURN) { + if (err == QEMU_ESIGRETURN) { return "Successful exit from sigreturn"; } diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index 29cc6f3830..6bc6d6dee6 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -188,7 +188,7 @@ void cpu_loop(CPUXtensaState *env) env->pc -= 3; break; - case -TARGET_QEMU_ESIGRETURN: + case -QEMU_ESIGRETURN: break; } break; diff --git a/linux-user/xtensa/signal.c b/linux-user/xtensa/signal.c index 81572a5fc7..06d91a37ec 100644 --- a/linux-user/xtensa/signal.c +++ b/linux-user/xtensa/signal.c @@ -263,12 +263,12 @@ long do_rt_sigreturn(CPUXtensaState *env) target_restore_altstack(&frame->uc.tuc_stack, env); unlock_user_struct(frame, frame_addr, 0); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; badframe: unlock_user_struct(frame, frame_addr, 0); force_sig(TARGET_SIGSEGV); - return -TARGET_QEMU_ESIGRETURN; + return -QEMU_ESIGRETURN; } void setup_sigtramp(abi_ulong sigtramp_page) From patchwork Tue Dec 14 00:25:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523667 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp6830179imb; Mon, 13 Dec 2021 16:43:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoJ3Bhaciv5P7sASMR8U92WQ2pE617D7v0kFExEq1Pi/DY90jhQ/hT5bscaLy0FJd8vEaA X-Received: by 2002:a05:6102:e88:: with SMTP id l8mr2667177vst.55.1639442635186; Mon, 13 Dec 2021 16:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442635; cv=none; d=google.com; s=arc-20160816; b=Js2xwDcHpQ18MZj1uKnDmtSs08TjA1RD6n2jBk0TGfZp2pEnVh0YNBQqOjviDZpGju NDijIc22KB5YhJTe/um7WD7YstjPhIEUJzlxO0vWPxCLs/kH7d5m19eMnKQO+wEzHTdX bet7UqdFcWCwVqD/obmLkwiRjSLbSMCd1yMR9kLqAuhaydAviRBa3ST0xZQjPlbiYO1p K/6LzKls5Hu8HhjmuW/WjIVPfNTugNBY/0S3P5GBgzroVlTLpEHT2YKa+75gWFtC0GkZ eQ8Vn6+JvkJIV0eawERk4J8UU1eLBIhYyHZnd1miRYSaUJcHZytZqFNlr4SlZaTMIe7V 74Bw== 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=TT19p4RIHqcMgyPqlvdP5DEN83TNSNvFv1GopYPkozA=; b=Om7pDZ5EF8o0OJ6w0q+1c92IqMRspAEAzWuoo7jC20iMCuqkp7VkIaDejzQiJC2e5Y /feyMV81cDRzz6gxo0EeO/K3NpsCrPyA2R+6zlouE0knZKrT9TUY3t6jiFUpvVUdB0Ov ar0HONOr19Tk+HTvLl8yR5rEQCrvhfvoElbb7cGVYMRud7AEuMVg8+PMVSWxowAyGV8h VmVd9PshBwERvHIEvYiKQKzlgJ2viJD3AfGuQbW3LGIFoMfAc5yJJ4DfDKqH+g1x6eML 5LCic7my2bmtvqe+S8Ni7OTd/Y7F0WJC4XmkRQ1KPi15AzZn5wGXhSEzG9VmihxiMIKF Ad6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IKHleyWN; 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=pass (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 h2si12584565vsf.353.2021.12.13.16.43.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:43:55 -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=pass header.i=@linaro.org header.s=google header.b=IKHleyWN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvv8-0005v2-1T for patch@linaro.org; Mon, 13 Dec 2021 19:43:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveC-0008Ig-6B for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:24 -0500 Received: from [2607:f8b0:4864:20::634] (port=40825 helo=mail-pl1-x634.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve4-0005Sa-Ab for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:23 -0500 Received: by mail-pl1-x634.google.com with SMTP id v19so12369707plo.7 for ; Mon, 13 Dec 2021 16:26:15 -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=TT19p4RIHqcMgyPqlvdP5DEN83TNSNvFv1GopYPkozA=; b=IKHleyWNxJWW7tzS1wPb5hc40MjhQ/vEb6xQ7/7BjmkXBktVpeDXh8Nct5pq9qwG73 5l1J0gKhP1Z2ZHljN5xTapSuj9ygLeXZrFYja883nNfDWKYG7qKKdIPseiP27Fk6h6Xv aUXYIE3lU5wt7g2yBQpwyVB8W8i+mvL2RgS2tVEiWdr647S1moHH46gWBdbP61hn8VFb Y/NrwBtkzRD1at1R0dyjs6uA/8bJ1begPzd5/rpc1REe2KQS6FpONNlf61fD8C5db61Q /ga8QgNaYihQNT7PvzJOGXgj5TnphKQLm1rdFpV0+xfgqjgICNC8AFFrwPyEXhoKsSq9 imbw== 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=TT19p4RIHqcMgyPqlvdP5DEN83TNSNvFv1GopYPkozA=; b=hR6p6tq1WW3yHwU269UpuROCWlnti5bTnUC57mcZbFXkq6RHnE7q1tgp1ndSjZqCb7 NGfCA0YIf+EkQ9ESgs2IObJQmdxhqeYwRtu5f/yNDDkkAOhCm2bHH5e0Cm7jHIU4aKHP GsTyqNnNPaMb0vGzcWTUJyjUX+YHu2zTzW9eXoyPUQ1Pm2Txo5RpY9tQcfVi3/u1ptPL 2nR2y7lF5jZ3xcHFQc4hIwzv7bTFqoKTckVt2HulWP5sVK4bCyBzrH80FH/g+Xi49tqz ySXYXkhbtSk+9jE2h20riFIewR3V6Eu591ZbgZy1dovdFAVvb7m4oCjej+R2tSsyyjDD xPBA== X-Gm-Message-State: AOAM533Xe/e3+QPzwPZEFEwKVr4xIDWIXgx2tsZGFsGP5G2IBT/YDcSC OniX9OUbxe71I4/Yj7K2JUu3Gx/OrFmGyA== X-Received: by 2002:a17:90a:3e09:: with SMTP id j9mr1761672pjc.24.1639441574978; Mon, 13 Dec 2021 16:26:14 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 09/15] linux-user: Create special-errno.h Date: Mon, 13 Dec 2021 16:25:58 -0800 Message-Id: <20211214002604.161983-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::634 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Pull the two internal errno used by qemu internally into their own header file. This includes the one define required by safe-syscall.S. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- linux-user/cpu_loop-common.h | 1 + linux-user/generic/target_errno_defs.h | 17 -------------- linux-user/signal-common.h | 2 ++ linux-user/special-errno.h | 32 ++++++++++++++++++++++++++ linux-user/syscall.c | 1 + linux-user/safe-syscall.S | 2 +- 6 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 linux-user/special-errno.h diff --git a/linux-user/cpu_loop-common.h b/linux-user/cpu_loop-common.h index 8828af28a4..dc0042e4de 100644 --- a/linux-user/cpu_loop-common.h +++ b/linux-user/cpu_loop-common.h @@ -21,6 +21,7 @@ #define CPU_LOOP_COMMON_H #include "exec/log.h" +#include "special-errno.h" #define EXCP_DUMP(env, fmt, ...) \ do { \ diff --git a/linux-user/generic/target_errno_defs.h b/linux-user/generic/target_errno_defs.h index bb37d88be9..c2f9d403e7 100644 --- a/linux-user/generic/target_errno_defs.h +++ b/linux-user/generic/target_errno_defs.h @@ -147,21 +147,4 @@ #define TARGET_ERFKILL 132 /* Operation not possible due to RF-kill */ #define TARGET_EHWPOISON 133 /* Memory page has hardware error */ -/* QEMU internal, not visible to the guest. This is returned when a - * system call should be restarted, to tell the main loop that it - * should wind the guest PC backwards so it will re-execute the syscall - * after handling any pending signals. They match with the ones the guest - * kernel uses for the same purpose. - */ -#define QEMU_ERESTARTSYS 512 /* Restart system call (if SA_RESTART) */ - -/* QEMU internal, not visible to the guest. This is returned by the - * do_sigreturn() code after a successful sigreturn syscall, to indicate - * that it has correctly set the guest registers and so the main loop - * should not touch them. We use the value the guest would use for - * ERESTART_NOINTR (which is kernel internal) to guarantee that we won't - * clash with a valid guest errno now or in the future. - */ -#define QEMU_ESIGRETURN 513 /* Return from signal */ - #endif diff --git a/linux-user/signal-common.h b/linux-user/signal-common.h index b9f33bb44f..42aa479080 100644 --- a/linux-user/signal-common.h +++ b/linux-user/signal-common.h @@ -20,6 +20,8 @@ #ifndef SIGNAL_COMMON_H #define SIGNAL_COMMON_H +#include "special-errno.h" + /* Fallback addresses into sigtramp page. */ extern abi_ulong default_sigreturn; extern abi_ulong default_rt_sigreturn; diff --git a/linux-user/special-errno.h b/linux-user/special-errno.h new file mode 100644 index 0000000000..4120455baa --- /dev/null +++ b/linux-user/special-errno.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * QEMU internal errno values for implementing user-only POSIX. + * + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2021 Linaro, Ltd. + */ + +#ifndef SPECIAL_ERRNO_H +#define SPECIAL_ERRNO_H + +/* + * All of these are QEMU internal, not visible to the guest. + * They should be chosen so as to not overlap with any host + * or guest errno. + */ + +/* + * This is returned when a system call should be restarted, to tell the + * main loop that it should wind the guest PC backwards so it will + * re-execute the syscall after handling any pending signals. + */ +#define QEMU_ERESTARTSYS 512 + +/* + * This is returned after a successful sigreturn syscall, to indicate + * that it has correctly set the guest registers and so the main loop + * should not touch them. + */ +#define QEMU_ESIGRETURN 513 + +#endif /* SPECIAL_ERRNO_H */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2867be4cd3..f5bf6d155c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -136,6 +136,7 @@ #include "qemu/guest-random.h" #include "qemu/selfmap.h" #include "user/syscall-trace.h" +#include "special-errno.h" #include "qapi/error.h" #include "fd-trans.h" #include "tcg/tcg.h" diff --git a/linux-user/safe-syscall.S b/linux-user/safe-syscall.S index 7ddc997801..74f7e35694 100644 --- a/linux-user/safe-syscall.S +++ b/linux-user/safe-syscall.S @@ -10,7 +10,7 @@ * See the COPYING file in the top-level directory. */ -#include "target_errno_defs.h" +#include "special-errno.h" /* We have the correct host directory on our include path * so that this will pull in the right fragment for the architecture. From patchwork Tue Dec 14 00:25:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523659 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5338877wro; Mon, 13 Dec 2021 16:32:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+LDGR3i6pvNZxY9dFm+rlQ67blqy7jta+7/vR/qWsnVR8ydGHirb/Ob8vLa3CYvkfNJYX X-Received: by 2002:a05:6102:c0e:: with SMTP id x14mr2362473vss.24.1639441935395; Mon, 13 Dec 2021 16:32:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441935; cv=none; d=google.com; s=arc-20160816; b=0bdtVcufiORgtQk58PWGcEg/3U3uoUHn+MVFObvy/oaEnFQOE5fvTR8P56EBDKOlPX cJpTwbmeeEy6J8OL3Kr2OpuZ8TrPALPn1OVvJ8GX1aw68pbSmVTHCN/HEQqGb83HipKw ByCD5qHNcUCeeSDHVJIXbfXRv1Kr1WvTzmDLyZw2clNa27jPtagp9ZQLPHgO2ljrNS29 3kaaw3o96p+Q8QQ+N1rPcEsN7e6FwPy7Mlk628M4/g78AEAfka63N00YvEw6D7AWkf1Z 6v/iOLE6TCpjrGbBmxQpmZ1VgF4VbSzkOBPQCc1t7xGb0GopSMFooraPBgO7Z8IT40ig aWmQ== 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=HHuNKnhfo/1w0XhuBwX3/PDJWu35E1qSroF+d/Nu4gg=; b=uL7yTRKhrdwZPMp/o45NntDD+A8Y+2Gz1RYTiToH+E/aa9Maib4fQ2JuAoiI1SlUxT cUzAOF5OnWKojtVF6c38sw3nPKTD5cZQU3Gx0WoGejJquGDrklakY8IXDDIwmKXr98FG cQcCh4BhLZD6zJqrw+iIrH1VnfIPK228m486XxSgs/P7Iz8EbzlJsnp4iV24q4xGySvr YhsCbXhjHbWmUnU+OJiFJPvHVVX/DcvtqHXe+0ag9LvI7aDKD4hXxCjgZ8/LX75dOagY NOEpAKgunxrx5cOVc9hAlxF9rAMnPXyC9lwATzVS6w+TeJgt2keC9JwdIFQZg6KvoMQU bVqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xHAihF5f; 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=pass (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 w12si10936511uaj.7.2021.12.13.16.32.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:32:15 -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=pass header.i=@linaro.org header.s=google header.b=xHAihF5f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvjq-0007rv-PZ for patch@linaro.org; Mon, 13 Dec 2021 19:32:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveA-0008GE-Vb for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:23 -0500 Received: from [2607:f8b0:4864:20::62b] (port=46997 helo=mail-pl1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve5-0005Sq-1t for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:22 -0500 Received: by mail-pl1-x62b.google.com with SMTP id p18so12332512plf.13 for ; Mon, 13 Dec 2021 16:26:16 -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=HHuNKnhfo/1w0XhuBwX3/PDJWu35E1qSroF+d/Nu4gg=; b=xHAihF5fnAB24mFHo66RY38HsKkD9qqAanvezlTSRVowpXZMdQZjauxTbj7BZPZg8x 3zbqgzje3dOYLG9y1DLIx5PSKvUzBK8i0StTpm0P7N0ovVaHfiYbQN8LRaP3PldJ5ddh xYuSP4BIvhvIimWLy2dTNuLlbNnOj+itSiDkdNWC9h/oU492JgBqDvymoeMT0kQRURw4 qeylRZrss7wc9JmK5HykLwncXQeeGIrbNhYHszqYwbc4y936DqJLg3JzspVHnwQSFLKr 8+eKc4eUXRfkDuNKWjaoSCQNUqmRrXO4yU72dwzzqHDebC5kjra6RTTKO4DSavxB0qte bv3A== 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=HHuNKnhfo/1w0XhuBwX3/PDJWu35E1qSroF+d/Nu4gg=; b=CO6W7wYTyd4BF4AEYVpe3fw6Sd4913pIjpz42tADlhFpWFPZE2iWwDyPPkQXbQEWhy 6zcDpij4x70DYNAMpkSNP09EioOSNkId+c3Tf73iRjk9C5ywovmcT6KR75c0fgQXyGPP ixvm8BEtPz95CN+E6Ku56CFuz1jwAY+iZnfc1wWbfMmREZ67tGH86mzaUCnOnwlVcSAC 4Jm3EuLQovTjoXCNU3Fm0DygwbL4q32b53yGcEq7DrMInXYxPbv5dj2KK5onEvV7wSWH r95dQhytdJrl4zuOePurpyHAn0T041sqOzb5sbXgXc6LMX7KMuUZ9IcMJPG3bHezIy4z gSXw== X-Gm-Message-State: AOAM533jP9X1NhFnJk4SAxTLbdxSUkAFSJvch7bVBrV6H4h8xq3AahN8 ezYnokGhASMvrNVuur0P7LLiGeByy0ancg== X-Received: by 2002:a17:90a:ec0a:: with SMTP id l10mr1755670pjy.92.1639441575802; Mon, 13 Dec 2021 16:26:15 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 10/15] bsd-user: Create special-errno.h Date: Mon, 13 Dec 2021 16:25:59 -0800 Message-Id: <20211214002604.161983-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Pull the internal errno used by qemu internally its own header file, for use by safe-syscall.S. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/errno_defs.h | 6 +++++- bsd-user/special-errno.h | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 bsd-user/special-errno.h diff --git a/bsd-user/errno_defs.h b/bsd-user/errno_defs.h index 141e08456c..73cfa24b7f 100644 --- a/bsd-user/errno_defs.h +++ b/bsd-user/errno_defs.h @@ -151,6 +151,10 @@ /* Internal errors: */ #define TARGET_EJUSTRETURN 254 /* Just return without modifing regs */ #define TARGET_ERESTART 255 /* Restart syscall */ -#define QEMU_ERESTARTSYS TARGET_ERESTART + +#include "special-errno.h" + +_Static_assert(TARGET_ERESTART == QEMU_ERESTARTSYS, + "TARGET_ERESTART and QEMU_ERESTARTSYS expected to match"); #endif /* ! _ERRNO_DEFS_H_ */ diff --git a/bsd-user/special-errno.h b/bsd-user/special-errno.h new file mode 100644 index 0000000000..03599d9b5a --- /dev/null +++ b/bsd-user/special-errno.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * QEMU internal errno values for implementing user-only POSIX. + * + * Copyright (c) 2021 Linaro, Ltd. + */ + +#ifndef SPECIAL_ERRNO_H +#define SPECIAL_ERRNO_H + +/* + * All of these are QEMU internal, not visible to the guest. + * They should be chosen so as to not overlap with any host + * or guest errno. + */ + +/* + * This is returned when a system call should be restarted, to tell the + * main loop that it should wind the guest PC backwards so it will + * re-execute the syscall after handling any pending signals. + */ +#define QEMU_ERESTARTSYS 255 + +#endif /* SPECIAL_ERRNO_H */ From patchwork Tue Dec 14 00:26:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523665 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5342993wro; Mon, 13 Dec 2021 16:37:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7I/pordCq/Gft3R6zUKxu5PBxGjmS66WFqIRHyaAvktr/F4Irv/QQ3akFcf1EbvDXpBTz X-Received: by 2002:ab0:36c4:: with SMTP id v4mr2530785uau.8.1639442258052; Mon, 13 Dec 2021 16:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442258; cv=none; d=google.com; s=arc-20160816; b=GgCw75PRtFw3inqPAJw6RaGnw25pEy0vchWM1viZWGZGdY70eGQ9E2IXrXVhtYwVMs hHiGXhj/u8dvaDCsulgcnaeDnJxWQJe1wn+P3AuEBnPcy0zBiJeI9RT9N1KRR+vzVIiI 9031HCunhKKPYaKRJE7HWz2se5qU1/cBylwGU05BzeyXPK58vc+ae5rY9SmmFUKuhJVA hAzn6JPlQbiGH14kD2GTYZnN3gpnql56jJNIN5FFE9+SI8eT3vWU88lmIem+/9223Wwa fMHR8uHx1OY72sY8hA0bylWhRwhhZjQANJ8y+vUJU04LCOSySAjHZfs9fQQ8CZe9WzgM fX2w== 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=TF/5F0KhHfx4Tt29kavc4e0UvcD5M5TJZh5E8RHIj5w=; b=PTMazQcXoBbqD7G74ilokltqyFAya/Hy7bmns10aLr4temdLvxoWB8xECffEM/BFtj V8niX36JDIwyMP+fN1zxEcYQjx0DLlIJjpm+wFoVjzVkiK5Hou8DnO3XGy89DzEQCSk3 xH25rpt7HqB+igLbzswXQuntM6S6Ch1w4Iju7KtKJBPj4NyIChNsuM+SkcdqiKbsHRpm tNnCdXW1li0fRf91kupp1T3tHHfVGNq1S5aU/UDU0cnbtrLZTsvAN0qJpbTvRm1pVrQn 31vxmAv8Z72zQ9tUnlHsirs+aKK7drZ4M53VTCkaBdZ9IQ2ej+xZspOpYed0U4YdBNRK eDyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iqreD0J5; 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=pass (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 u9si10678691vsk.614.2021.12.13.16.37.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:37:38 -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=pass header.i=@linaro.org header.s=google header.b=iqreD0J5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvp3-0001ry-DT for patch@linaro.org; Mon, 13 Dec 2021 19:37:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwve9-0008Da-UF for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:22 -0500 Received: from [2607:f8b0:4864:20::1029] (port=56029 helo=mail-pj1-x1029.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve6-0005TC-AP for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:21 -0500 Received: by mail-pj1-x1029.google.com with SMTP id v23so13037927pjr.5 for ; Mon, 13 Dec 2021 16:26:17 -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=TF/5F0KhHfx4Tt29kavc4e0UvcD5M5TJZh5E8RHIj5w=; b=iqreD0J5GHHEZJB+yJ4cGfWCkCzY1B2RJ7wdBVq9ClI0JFX0OWeiVS6CMLgVDmdUTX X1a9zQ7oQXbDLTJnEFLUxeB367/EPtmOIWTbc9YXCbCdI82knRH7tkCi/YNRXe9Tc2yq iEJh8fNMdCOHm5Zo3yLDBgpxCJo4cU4lbf/jkcyl3uY5StXgzLhrDdQ1RoG66It5K9eD m7TTr4/mnbdVFIjOm/tmUUD9hFKMbwhcQRU7/nq8gSvIcom8DEbLX8majITWjEIHQ9Po cA5gtbqBGccrtKdrF85rMQnJa/Eg1aASk8IZ8y19UjRSesh45ppTtCwA5BJKaf16ZkaX xQ6A== 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=TF/5F0KhHfx4Tt29kavc4e0UvcD5M5TJZh5E8RHIj5w=; b=cRgJQTJIWkUYB0qbNGIjnpuFBv4A69tt08vO0dkrEyHXfjy7Cy6B264WAwrZMfLlXY Ypup0hLmot5dGrTR1L6sN25K0F2nQGPeFyU/yLAaeG0RXrmMAufFFkIHNq0V0N7R6VyN C1KZQaBWaq4cj/pvSczsW2uDw9hzoj7jcJQFMVpNMpLQXTPXepv5Q8hDVoFu+PpeyAGZ 0FAF90p4zYtEJmPVABx+9LorRfUOFLcg0kEFHFGBvQoZJmkpDY6qyJqTKwv20Ot5JDvY iwboigjNqKUv7760khZoIN7v+YzRgxaXYVQMPQfidGEwBDK5PKwXjltj7hHQvJU8S+Ik kT5A== X-Gm-Message-State: AOAM530D9CxT6uN+Ck+uNCnggFTLlW9OmXWIRmTYkJaKEX6KH/uJu7ZG i1ZAFskpum0PzwzTgejsEAk8S7xy1WAbfQ== X-Received: by 2002:a17:90b:4c8f:: with SMTP id my15mr1689293pjb.132.1639441576961; Mon, 13 Dec 2021 16:26:16 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 11/15] common-user: Move safe-syscall.* from linux-user Date: Mon, 13 Dec 2021 16:26:00 -0800 Message-Id: <20211214002604.161983-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1029 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Move linux-user safe-syscall.S and safe-syscall-error.c to common-user so that bsd-user can also use it. Also move safe-syscall.h to include/user/. Since there is nothing here that is related to the guest, as opposed to the host, build it once. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- meson.build | 18 +++++++++++++++++- {linux-user => include/user}/safe-syscall.h | 0 .../safe-syscall-error.c | 2 +- linux-user/signal.c | 2 +- linux-user/syscall.c | 2 +- MAINTAINERS | 2 ++ bsd-user/meson.build | 2 ++ .../host/aarch64/safe-syscall.inc.S | 2 +- .../host/arm/safe-syscall.inc.S | 2 +- .../host/i386/safe-syscall.inc.S | 2 +- .../host/mips/safe-syscall.inc.S | 2 +- .../host/ppc64/safe-syscall.inc.S | 2 +- .../host/riscv/safe-syscall.inc.S | 2 +- .../host/s390x/safe-syscall.inc.S | 2 +- .../host/sparc64/safe-syscall.inc.S | 2 +- .../host/x86_64/safe-syscall.inc.S | 2 +- common-user/meson.build | 6 ++++++ {linux-user => common-user}/safe-syscall.S | 0 linux-user/meson.build | 5 +++-- 19 files changed, 42 insertions(+), 15 deletions(-) rename {linux-user => include/user}/safe-syscall.h (100%) rename {linux-user => common-user}/safe-syscall-error.c (95%) rename {linux-user => common-user}/host/aarch64/safe-syscall.inc.S (97%) rename {linux-user => common-user}/host/arm/safe-syscall.inc.S (98%) rename {linux-user => common-user}/host/i386/safe-syscall.inc.S (98%) rename {linux-user => common-user}/host/mips/safe-syscall.inc.S (98%) rename {linux-user => common-user}/host/ppc64/safe-syscall.inc.S (98%) rename {linux-user => common-user}/host/riscv/safe-syscall.inc.S (97%) rename {linux-user => common-user}/host/s390x/safe-syscall.inc.S (98%) rename {linux-user => common-user}/host/sparc64/safe-syscall.inc.S (97%) rename {linux-user => common-user}/host/x86_64/safe-syscall.inc.S (98%) 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 96de1a6ef9..d5ac65b877 100644 --- a/meson.build +++ b/meson.build @@ -2366,6 +2366,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() @@ -2610,15 +2611,30 @@ subdir('tcg') subdir('fpu') subdir('accel') subdir('plugins') +subdir('ebpf') + +common_user_inc = [] + +subdir('common-user') subdir('bsd-user') subdir('linux-user') -subdir('ebpf') specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) linux_user_ss.add(files('thunk.c')) specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) +common_user_ss = common_user_ss.apply(config_all, strict: false) +common_user = static_library('common-user', + sources: common_user_ss.sources(), + dependencies: common_user_ss.dependencies(), + include_directories: common_user_inc, + name_suffix: 'fa', + build_by_default: false) +common_user = declare_dependency(link_with: common_user) + +user_ss.add(common_user) + # needed for fuzzing binaries subdir('tests/qtest/libqos') subdir('tests/qtest/fuzz') 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/safe-syscall-error.c b/common-user/safe-syscall-error.c similarity index 95% rename from linux-user/safe-syscall-error.c rename to common-user/safe-syscall-error.c index 55d95ac39a..cf74b504f8 100644 --- a/linux-user/safe-syscall-error.c +++ b/common-user/safe-syscall-error.c @@ -10,7 +10,7 @@ */ #include "qemu/osdep.h" -#include "safe-syscall.h" +#include "user/safe-syscall.h" /* * This is intended to be invoked via tail-call on the error path diff --git a/linux-user/signal.c b/linux-user/signal.c index 12b1705287..510db73c34 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 f5bf6d155c..56a3e17183 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/MAINTAINERS b/MAINTAINERS index 7543eb4d59..6dc3e1cd1d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3078,6 +3078,8 @@ M: Riku Voipio S: Maintained F: thunk.c F: accel/tcg/user-exec*.c +F: include/user/ +F: common-user/ BSD user M: Warner Losh diff --git a/bsd-user/meson.build b/bsd-user/meson.build index 87885d91ed..25c3976ead 100644 --- a/bsd-user/meson.build +++ b/bsd-user/meson.build @@ -2,6 +2,8 @@ if not have_bsd_user subdir_done() endif +common_user_inc += include_directories('.') + bsd_user_ss.add(files( 'bsdload.c', 'elfload.c', diff --git a/linux-user/host/aarch64/safe-syscall.inc.S b/common-user/host/aarch64/safe-syscall.inc.S similarity index 97% rename from linux-user/host/aarch64/safe-syscall.inc.S rename to common-user/host/aarch64/safe-syscall.inc.S index 87c9580faa..73a04b73b3 100644 --- a/linux-user/host/aarch64/safe-syscall.inc.S +++ b/common-user/host/aarch64/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2016 Red Hat, Inc. diff --git a/linux-user/host/arm/safe-syscall.inc.S b/common-user/host/arm/safe-syscall.inc.S similarity index 98% rename from linux-user/host/arm/safe-syscall.inc.S rename to common-user/host/arm/safe-syscall.inc.S index f1a6aabfd3..66176a902c 100644 --- a/linux-user/host/arm/safe-syscall.inc.S +++ b/common-user/host/arm/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2016 Red Hat, Inc. diff --git a/linux-user/host/i386/safe-syscall.inc.S b/common-user/host/i386/safe-syscall.inc.S similarity index 98% rename from linux-user/host/i386/safe-syscall.inc.S rename to common-user/host/i386/safe-syscall.inc.S index 1fb031d228..aced8c5141 100644 --- a/linux-user/host/i386/safe-syscall.inc.S +++ b/common-user/host/i386/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2016 Red Hat, Inc. diff --git a/linux-user/host/mips/safe-syscall.inc.S b/common-user/host/mips/safe-syscall.inc.S similarity index 98% rename from linux-user/host/mips/safe-syscall.inc.S rename to common-user/host/mips/safe-syscall.inc.S index e9362e774d..fc75a337d1 100644 --- a/linux-user/host/mips/safe-syscall.inc.S +++ b/common-user/host/mips/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2021 Linaro, Inc. diff --git a/linux-user/host/ppc64/safe-syscall.inc.S b/common-user/host/ppc64/safe-syscall.inc.S similarity index 98% rename from linux-user/host/ppc64/safe-syscall.inc.S rename to common-user/host/ppc64/safe-syscall.inc.S index 69d3c70094..947a850dfd 100644 --- a/linux-user/host/ppc64/safe-syscall.inc.S +++ b/common-user/host/ppc64/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2016 Red Hat, Inc. diff --git a/linux-user/host/riscv/safe-syscall.inc.S b/common-user/host/riscv/safe-syscall.inc.S similarity index 97% rename from linux-user/host/riscv/safe-syscall.inc.S rename to common-user/host/riscv/safe-syscall.inc.S index ca456d8a46..dfe83c300e 100644 --- a/linux-user/host/riscv/safe-syscall.inc.S +++ b/common-user/host/riscv/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2018 Linaro, Inc. diff --git a/linux-user/host/s390x/safe-syscall.inc.S b/common-user/host/s390x/safe-syscall.inc.S similarity index 98% rename from linux-user/host/s390x/safe-syscall.inc.S rename to common-user/host/s390x/safe-syscall.inc.S index 66f84385a2..2ccbaa2402 100644 --- a/linux-user/host/s390x/safe-syscall.inc.S +++ b/common-user/host/s390x/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2016 Red Hat, Inc. diff --git a/linux-user/host/sparc64/safe-syscall.inc.S b/common-user/host/sparc64/safe-syscall.inc.S similarity index 97% rename from linux-user/host/sparc64/safe-syscall.inc.S rename to common-user/host/sparc64/safe-syscall.inc.S index 3a0e76fcc7..6ad0b06d9a 100644 --- a/linux-user/host/sparc64/safe-syscall.inc.S +++ b/common-user/host/sparc64/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Written by Richard Henderson * Copyright (C) 2021 Red Hat, Inc. diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/common-user/host/x86_64/safe-syscall.inc.S similarity index 98% rename from linux-user/host/x86_64/safe-syscall.inc.S rename to common-user/host/x86_64/safe-syscall.inc.S index f88cbe1347..84fed206f9 100644 --- a/linux-user/host/x86_64/safe-syscall.inc.S +++ b/common-user/host/x86_64/safe-syscall.inc.S @@ -1,7 +1,7 @@ /* * safe-syscall.inc.S : host-specific assembly fragment * to handle signals occurring at the same time as system calls. - * This is intended to be included by linux-user/safe-syscall.S + * This is intended to be included by common-user/safe-syscall.S * * Copyright (C) 2015 Timothy Edward Baldwin * diff --git a/common-user/meson.build b/common-user/meson.build new file mode 100644 index 0000000000..45b8d0de2c --- /dev/null +++ b/common-user/meson.build @@ -0,0 +1,6 @@ +common_user_inc += include_directories('host/' / config_host['ARCH']) + +common_user_ss.add(files( + 'safe-syscall.S', + 'safe-syscall-error.c', +)) 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 94ac3c58ce..bf9d945504 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -2,6 +2,9 @@ if not have_linux_user subdir_done() endif +common_user_inc += include_directories('host/' / config_host['ARCH']) +common_user_inc += include_directories('.') + linux_user_ss.add(files( 'elfload.c', 'exit.c', @@ -9,8 +12,6 @@ linux_user_ss.add(files( 'linuxload.c', 'main.c', 'mmap.c', - 'safe-syscall.S', - 'safe-syscall-error.c', 'signal.c', 'strace.c', 'syscall.c', From patchwork Tue Dec 14 00:26:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523662 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5340428wro; Mon, 13 Dec 2021 16:34:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcAnfQkk3uefOPbx5l3nDSqOtzCOqecSSQihIjLLSHNgkr8ZfzOHXdcaPZkGCg3rxn+/7P X-Received: by 2002:ac8:5c50:: with SMTP id j16mr2222098qtj.255.1639442046153; Mon, 13 Dec 2021 16:34:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442046; cv=none; d=google.com; s=arc-20160816; b=QGSYIK/Gpw7Q8R5Bhg9EIY93JiS2dtyFrimUgYTYF24+hh0PJscex/IX3xF7I01gHW QzKI34fAWj8+3tkiPCaOdKt4S1n/beNoDAaf2DGVSFTT4Kk+AXcXNSn+azU1dkEpNa9N PiRnpHhFsn5pXHm13AORmClZyeIk0JIBvJfMDlgv930MZ+OXb93N5JQVST4mEOYeju4y YmPdT2CsXWHuiN9joBOQ71DnCQTfKFYX2A6/EpGccNzTOVUyadyVnLNdAC5t/VOq1KaY NPKhVkCfNQyMNHu2PqHc9u6EO4MS5rgVU86v0C2u07b+QOiTBPa8b2dldvMHXlPG75Tb uIMA== 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=eT2OMMtgUWRlyX31jrb7FBHkLkGN7+LrqX+ZG1ZjPS0=; b=pNRiOEAz/9sAioUBfE9C+7tlytkC86evK/jUiVWiBWNzNGasVd51TbklPnpexlG1M2 AGnpy3PPzFaVAKF6hn4CfG36BritKZwTPJVVo5OoaUpXFSJLM9O2+RP0JWvAHkVqe9Re hKNHm5lvoFmNjPds83Odc90GNQsfyvrODHk7RIyUrNcrLCIK/YyJRtxgJGIBtyr/JhyJ 7/yr6NbDXwMsFgVFu0ATk2NZ/dHJviUnrNa5PwQcOgewfC+D952FpH9HuWgmLl5dVrcs brZCzBDzCbuRqhGyOhloLXI+rkCUFvpdYGObzepoSAMlee4Dul64sxwiDvdJScWNBsy3 LKlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UegC0wto; 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=pass (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 z2si11070571qkl.277.2021.12.13.16.34.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:34:06 -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=pass header.i=@linaro.org header.s=google header.b=UegC0wto; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvld-0003wT-IK for patch@linaro.org; Mon, 13 Dec 2021 19:34:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveC-0008LM-QG for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:24 -0500 Received: from [2607:f8b0:4864:20::429] (port=33625 helo=mail-pf1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve7-0005TM-4S for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:24 -0500 Received: by mail-pf1-x429.google.com with SMTP id x5so16487324pfr.0 for ; Mon, 13 Dec 2021 16:26:18 -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=eT2OMMtgUWRlyX31jrb7FBHkLkGN7+LrqX+ZG1ZjPS0=; b=UegC0wtoanFt+7J6lKtDfPrNiqkzITr4HLS5OZULysGaPG1Vy4UIgwbpf1X+MYwghQ sJCiaGU3tIMOQbfrPbystQdEuGE53mZJHPuFlLUm+2Y/C8Q5xNVDFPrsSiuYflJ0PHTs T1m8DLCdnVMNOQ0JgMHUG2YwzAd5cOeahP2KVzQ61bzYCKpJRvPAwDE+ivAj7p00kyL4 oHs2fhB99dAU759wMba6Yf0miEy85D6EUwC5nPTMnFzHqcpJSq5aDw14cGebcainMaZ9 hGVkO9E2vvs9bnvbA2TBhrVtcbSGb5MwdKsrJCaQ1lvPWmLhPD7ZqvIxjLRpE7j0sXK8 SQ1Q== 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=eT2OMMtgUWRlyX31jrb7FBHkLkGN7+LrqX+ZG1ZjPS0=; b=j4mymPx+UPkM/zGuiU8q/4l+jUVYgyC8qXcDzDNl5rauVCMHjxblNkzIo3oUyr9EOv xDjnRt2FNFHqDE+q2Sniljg/lsfMEkYrZUovpEaG63xVJ+xaSHzj5R6Xdy0Yn3TsKRj2 Ge4gdTbhc4VaJNDnH86l3QIw6UMSEkitrBbkWt2+lVrLQaAob6uDaXnMRb6izmh0eLWf IkAWQTLsnvtL/zKPXadc7tiCzOXoHDeYDMNxliX2ZLn7cotI3Rxe2krRa5/lbQaAkgHG jpvsYWYu9rimCUtp+AshV5GSsYwNdkpMXF4/sAiendkDk9Lbc+7JaT0/OCsxgJfstQFV Ct8w== X-Gm-Message-State: AOAM532STKkR4k/9y9ml97k2/q8jBuCNrRwgRCcvM0FZgWqt2xs7Vuwc Fd2CSZcu4vfFEnPpSFsDIxSvGEwvPARJZQ== X-Received: by 2002:a63:6ecb:: with SMTP id j194mr1411119pgc.46.1639441577795; Mon, 13 Dec 2021 16:26:17 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 12/15] common-user: Adjust system call return on FreeBSD Date: Mon, 13 Dec 2021 16:26:01 -0800 Message-Id: <20211214002604.161983-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::429 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" FreeBSD system calls return positive errno. On the 4 hosts for which we have support, error is indicated by the C bit set or clear. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson --- common-user/host/aarch64/safe-syscall.inc.S | 14 +++++++++++++- common-user/host/arm/safe-syscall.inc.S | 9 +++++++++ common-user/host/i386/safe-syscall.inc.S | 11 +++++++++++ common-user/host/x86_64/safe-syscall.inc.S | 11 +++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/common-user/host/aarch64/safe-syscall.inc.S b/common-user/host/aarch64/safe-syscall.inc.S index 73a04b73b3..b8fd5b553e 100644 --- a/common-user/host/aarch64/safe-syscall.inc.S +++ b/common-user/host/aarch64/safe-syscall.inc.S @@ -60,17 +60,29 @@ safe_syscall_start: cbnz w10, 2f svc 0x0 safe_syscall_end: + /* code path for having successfully executed the syscall */ +#if defined(__linux__) + /* Linux kernel returns (small) negative errno. */ cmp x0, #-4096 b.hi 0f +#elif defined(__FreeBSD__) + /* FreeBSD kernel returns positive errno and C bit set. */ + b.cs 1f +#else +#error "unsupported os" +#endif ret +#if defined(__linux__) /* code path setting errno */ 0: neg w0, w0 b safe_syscall_set_errno_tail +#endif /* code path when we didn't execute the syscall */ 2: mov w0, #QEMU_ERESTARTSYS - b safe_syscall_set_errno_tail +1: b safe_syscall_set_errno_tail + .cfi_endproc .size safe_syscall_base, .-safe_syscall_base diff --git a/common-user/host/arm/safe-syscall.inc.S b/common-user/host/arm/safe-syscall.inc.S index 66176a902c..bbfb89634e 100644 --- a/common-user/host/arm/safe-syscall.inc.S +++ b/common-user/host/arm/safe-syscall.inc.S @@ -74,10 +74,19 @@ safe_syscall_start: bne 2f swi 0 safe_syscall_end: + /* code path for having successfully executed the syscall */ +#if defined(__linux__) + /* Linux kernel returns (small) negative errno. */ cmp r0, #-4096 neghi r0, r0 bhi 1f +#elif defined(__FreeBSD__) + /* FreeBSD kernel returns positive errno and C bit set. */ + bcs 1f +#else +#error "unsupported os" +#endif pop { r4, r5, r6, r7, r8, pc } /* code path when we didn't execute the syscall */ diff --git a/common-user/host/i386/safe-syscall.inc.S b/common-user/host/i386/safe-syscall.inc.S index aced8c5141..baf5400a29 100644 --- a/common-user/host/i386/safe-syscall.inc.S +++ b/common-user/host/i386/safe-syscall.inc.S @@ -71,9 +71,18 @@ safe_syscall_start: mov 8+16(%esp), %eax /* syscall number */ int $0x80 safe_syscall_end: + /* code path for having successfully executed the syscall */ +#if defined(__linux__) + /* Linux kernel returns (small) negative errno. */ cmp $-4095, %eax jae 0f +#elif defined(__FreeBSD__) + /* FreeBSD kernel returns positive errno and C bit set. */ + jc 1f +#else +#error "unsupported os" +#endif pop %ebx .cfi_remember_state .cfi_adjust_cfa_offset -4 @@ -90,8 +99,10 @@ safe_syscall_end: ret .cfi_restore_state +#if defined(__linux__) 0: neg %eax jmp 1f +#endif /* code path when we didn't execute the syscall */ 2: mov $QEMU_ERESTARTSYS, %eax diff --git a/common-user/host/x86_64/safe-syscall.inc.S b/common-user/host/x86_64/safe-syscall.inc.S index 84fed206f9..a20927a783 100644 --- a/common-user/host/x86_64/safe-syscall.inc.S +++ b/common-user/host/x86_64/safe-syscall.inc.S @@ -68,9 +68,18 @@ safe_syscall_start: jnz 2f syscall safe_syscall_end: + /* code path for having successfully executed the syscall */ +#if defined(__linux__) + /* Linux kernel returns (small) negative errno. */ cmp $-4095, %rax jae 0f +#elif defined(__FreeBSD__) + /* FreeBSD kernel returns positive errno and C bit set. */ + jc 1f +#else +#error "unsupported os" +#endif pop %rbp .cfi_remember_state .cfi_def_cfa_offset 8 @@ -78,8 +87,10 @@ safe_syscall_end: ret .cfi_restore_state +#if defined(__linux__) 0: neg %eax jmp 1f +#endif /* code path when we didn't execute the syscall */ 2: mov $QEMU_ERESTARTSYS, %eax From patchwork Tue Dec 14 00:26:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523666 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5343057wro; Mon, 13 Dec 2021 16:37:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyM4jbX0ZnUaEDZIdAftwtXZdTdEK73Crxm/X8nSmGVDqa/kfeOydQ8IATRWDi+oMIYv7Jb X-Received: by 2002:a67:6ac1:: with SMTP id f184mr2601155vsc.83.1639442265279; Mon, 13 Dec 2021 16:37:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442265; cv=none; d=google.com; s=arc-20160816; b=V2ig03BwCMO5yoMHqVcFH/WfuVY9ZOPWFt9TKB8DimS5Lmn+c7ugdAXsql3gs54r09 6auI4nZo0W9eLH3YXL1bxkEB+/9GZjVHpLH46/5HlNkseSryh4zGw75fvOtmqmRrMGWk +b+VLJQY75sY7/wsedrrHFt0TSj5etc3lCjKfA+rmV1NUgh5MTViV7119opHd4i0d7ta VPS2JhHtjQneHS9+y2DVEV2mpCPNWc/mehRrfjr/ICVmfb59Fu2buMbc1pqI3qA9Hwpu Wa8u/cibfJiPv4bskInuhhB5Ou5olr6BNiE9YH6kWF3hrDj2HC0kss1+cYCmlWcuzFn1 m+LQ== 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=jGfLGGGTH1EqFPSWJdPeDV41FqhsvuJx8DurTLn0ZgA=; b=LA1qtJ54CYvlmZLkpfFqFFj0Pw68mlPjjq3C8ErmJBuOr8sqZpaWjcHS/q0xOkJU/M r/yLWNW5OGhbPApRXUW7+FflbPfCQMpwZBZfA3P+ll53kFlpktakuvrHLIHq+/Iz4C+t cxTrqRhKpu1ixk6AV9br7NR+fChovOA6OAswVJPeV0GqJO8OJYPM/CW0VaVEl7xOU5RB oFvHRtUNOnQEAStEpSP8mz/6KUr72rMBR97cezwmLUiO7QujVonTTRZnt/LX8sPWexOQ TmKjAL0Qo4eUPACJgn1f7C/2GiT8QHP+7wDbNXxQqaDu0RRD/iL2C7LS4J51ySxhcFL+ lE3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LWpMNkj5; 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=pass (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 m21si11424425vsp.359.2021.12.13.16.37.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:37:45 -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=pass header.i=@linaro.org header.s=google header.b=LWpMNkj5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvpA-00020x-Mx for patch@linaro.org; Mon, 13 Dec 2021 19:37:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveD-0008N4-83 for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:25 -0500 Received: from [2607:f8b0:4864:20::42f] (port=38684 helo=mail-pf1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve8-0005TW-O0 for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:24 -0500 Received: by mail-pf1-x42f.google.com with SMTP id g18so16407059pfk.5 for ; Mon, 13 Dec 2021 16:26:19 -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=jGfLGGGTH1EqFPSWJdPeDV41FqhsvuJx8DurTLn0ZgA=; b=LWpMNkj5rGjMc424FuA3hYlINik861oWS3mwah2SCpln/HZOZ/UwBbdue37k3Rf0F3 NfU5ZPH/CjxO/TGLJkeWH6C1Crnuuna3Wd689tEfj2AcMYEbhIRwDkf0Ha9A3MHFM8MF VaKHSdSpAZC98T/XDiK6d1QyalSPimkMeDTb8evQaoCHUEAFFopn4rp28XlcQfpnRVKV Jl0baZyB7MFcoiYAupHHH++6YJa5EpTsVr11g/Z9IrQ5gdENt/17soljdR48oy56UNLN LeRl/RbjwhviVKUNkBSkwh5cS2yfqTFwwzuo8slhMNUZnSnjwtfh1x9tFbORc4XeNHEt MsYw== 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=jGfLGGGTH1EqFPSWJdPeDV41FqhsvuJx8DurTLn0ZgA=; b=hvjXu4rlAvanHq1aJVOl/+5SKn9h3Xk/ecggh8M0WdkRpj2M0koV/KQjksrKSllIf3 P1Bf5aLkc5QZ4IRuOtYwjGHGViAk/rQKY/u9jKIvaSHHILt0HSA0B2S4j3VQsvcT+SQ7 neQ+XDSR5xTGsqIXeW01Ggf7fA7nBnrOgO6XZPSV2pfLRdU6OIFfUjnDLRwWSGkxRs9J v6ZiohoowwMbGdhTymc/AcBmHLdz4DRN/b4tYvBYRMwc40hGMLBTBG3CMyN1uTqhbmLx WwcW5tu+Nz1zCEfAmOkLilrtZVIsj2I2H//IRL39P6nZ9FWmt4wk1Tj6YBze5grySIyf NHfQ== X-Gm-Message-State: AOAM531rPOaK43y97zn1YXfXV77VPqjwUWdw9vQQDd0HFeU5JbLAXGPP /ihr30FqkPULwj7L6VEec3zyznfuPFA/2Q== X-Received: by 2002:a63:fa42:: with SMTP id g2mr1370957pgk.239.1639441578488; Mon, 13 Dec 2021 16:26:18 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 13/15] linux-user: Move thunk.c from top-level Date: Mon, 13 Dec 2021 16:26:02 -0800 Message-Id: <20211214002604.161983-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" So far, linux-user is the only user of these functions. Clean up the build machinery by restricting it to linux-user. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 1 - thunk.c => linux-user/thunk.c | 0 MAINTAINERS | 1 - linux-user/meson.build | 1 + 4 files changed, 1 insertion(+), 2 deletions(-) rename thunk.c => linux-user/thunk.c (100%) diff --git a/meson.build b/meson.build index d5ac65b877..cd97b154bd 100644 --- a/meson.build +++ b/meson.build @@ -2621,7 +2621,6 @@ subdir('linux-user') specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) -linux_user_ss.add(files('thunk.c')) specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) common_user_ss = common_user_ss.apply(config_all, strict: false) diff --git a/thunk.c b/linux-user/thunk.c similarity index 100% rename from thunk.c rename to linux-user/thunk.c diff --git a/MAINTAINERS b/MAINTAINERS index 6dc3e1cd1d..3fd57f8fac 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3076,7 +3076,6 @@ Usermode Emulation Overall usermode emulation M: Riku Voipio S: Maintained -F: thunk.c F: accel/tcg/user-exec*.c F: include/user/ F: common-user/ diff --git a/linux-user/meson.build b/linux-user/meson.build index bf9d945504..fcf7d40f23 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -15,6 +15,7 @@ linux_user_ss.add(files( 'signal.c', 'strace.c', 'syscall.c', + 'thunk.c', 'uaccess.c', 'uname.c', )) From patchwork Tue Dec 14 00:26:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523668 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp6833530imb; Mon, 13 Dec 2021 16:47:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHZLhRprW704Lz3a9dEEvNW0mjjq4cFDDkdA3bJm+NwTV4O3AfifD0F7vmAnYCpHTMFMwJ X-Received: by 2002:ac8:7f09:: with SMTP id f9mr2276626qtk.163.1639442827186; Mon, 13 Dec 2021 16:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639442827; cv=none; d=google.com; s=arc-20160816; b=g6DUUKkFYQg2TdudViANyFTlYoN+htVUMxJ+K1SuhhvzRqhIqd0m4YRhE+BBuZsm16 R7sMmVU+hpZCWTVLl5gCo6ddg6WeIoSt6OuJO354V0yPpVmIRP5HYwYeMe725looruQg DtDsyQe3jcoarOOQFVvbuhL81XMNWQWAfQHsUB88LgXg5wyeRdNarg89dn6lpTDAutT/ ML8ZNODq/GpwqNisMSYRj/kRY91v3Ps8n8jAdEh9QN4agaqdqFICsMr9js506MDzt9FF UsliubL518AK1keHHz/0OTlb28FpO45QPnkgL0KniaJt66kdXtsW57zY1UWPoJ3dcfIN bENQ== 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=BZTFEWkCcq7QoVstw7Mtl+bBngHaigSh+UQzae6el5A=; b=qJARFGG6X693KZ7+dgn6WzFFjDKSNH7OJkQ5L/biVREfHVmrWikFOTwEpA9gnbxXXA x2WtNttqUyJaQ32RPzXrFRq4yaw1gobcwyH/XqE8v4WnI6pUiRSXtG1yh3Trc4PxOcVA 4vW/1cAHCclkQ/1HuSGhIK7PmLhDHrYXd7P0dTZ728ZTj0WkStk8sr8iRjouuMhLaZEv ztSsptpCwyhdxiuvhZ9J58S926qEXVjeNoE5XSYMEFn83euHKZri/Mbs23wssGxnUtTO xFFcAHpCPN617DAPbnbP4kAa+mz+6nbb3MdBX2JWB1njrhg2foZHu/UmDbdvwonctjky dF8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EVkZTRp6; 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=pass (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 ke7si12879079qvb.113.2021.12.13.16.47.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:47:07 -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=pass header.i=@linaro.org header.s=google header.b=EVkZTRp6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvyE-0000HA-N4 for patch@linaro.org; Mon, 13 Dec 2021 19:47:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveD-0008Nc-Bl for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:25 -0500 Received: from [2607:f8b0:4864:20::102d] (port=41695 helo=mail-pj1-x102d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve9-0005Tg-KJ for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:25 -0500 Received: by mail-pj1-x102d.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso14761111pjb.0 for ; Mon, 13 Dec 2021 16:26:20 -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=BZTFEWkCcq7QoVstw7Mtl+bBngHaigSh+UQzae6el5A=; b=EVkZTRp6QchOFwzbG5utVxrpA3Z4rkRIW0deCBoQwjiozSoAByEaHvfsrzWKNj2gYC z/R2+6AbYqxyCK58I2YTzrAkz7jloEZnls7Zjq/Xs/0ZEj9vtHzduIgKCYpgZAAe5gvC V9U5M5Dz96yPraRBH0uySBUKYPDnrVQBw396EHHXPvmmemD57GbmpiayAC4m+MRbNS2v mtjYeS/1f2Z5kWZqAlLABzsKyZIiRiKu8DSsNK5NYEPRF6MH+4Jphe2JNMB5fUeLmZJE RA32b+FG0qdNmvxFGwPpBiljFe4DKHbF9kweas7cxOCZYEJscBA6Z5ofa0z17gwIb5f1 Sy6g== 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=BZTFEWkCcq7QoVstw7Mtl+bBngHaigSh+UQzae6el5A=; b=xDBNlbtKY0V90/Vjef5n9v8OEAA72F55RnX0Lp0JH+b35YXLKzNm3Fe9deXcSjBjaj P6T9+xOcweL/QP0/sucLrmG4BCUiOSyeIIdec1f31YBLpP94Gs8u69G6M0XbabBiOy5P fAEbnVv12ziN7/3uxO45rydS1c+2LfrvB5DLuDU09jdB47p3fRYGXnnGLfUJnI3n9iSs iFZW3iOeA7CiYD/8uJ9c5q2XCbmN1mrl2B9x0i2ywFz4R05XS6S1r8D150OvPQ6+1u+D zSpkr/U4Fq0cKfBV/d/qAs79zqFVYAtiaJAeuXiDbKBIibHIEyTrQGQrN8LElux4UF0v +jxg== X-Gm-Message-State: AOAM533z3IkauFSWzP0Wi/Z+oY7W+85te/lvSDE30C46+YhsPkVhiQbQ nDck/PPfhccdGKeOfvxAAscoXQ0TZyGGzA== X-Received: by 2002:a17:903:22cc:b0:142:d31:bd9 with SMTP id y12-20020a17090322cc00b001420d310bd9mr1665495plg.64.1639441579331; Mon, 13 Dec 2021 16:26:19 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 14/15] meson: Move linux_user_ss to linux-user/ Date: Mon, 13 Dec 2021 16:26:03 -0800 Message-Id: <20211214002604.161983-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We have no need to reference linux_user_ss outside of linux-user. Go ahead and merge it directly into specific_ss. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- meson.build | 3 --- linux-user/meson.build | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index cd97b154bd..bf7af382de 100644 --- a/meson.build +++ b/meson.build @@ -2370,7 +2370,6 @@ common_user_ss = ss.source_set() crypto_ss = ss.source_set() hwcore_ss = ss.source_set() io_ss = ss.source_set() -linux_user_ss = ss.source_set() qmp_ss = ss.source_set() qom_ss = ss.source_set() softmmu_ss = ss.source_set() @@ -2621,8 +2620,6 @@ subdir('linux-user') specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) -specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) - common_user_ss = common_user_ss.apply(config_all, strict: false) common_user = static_library('common-user', sources: common_user_ss.sources(), diff --git a/linux-user/meson.build b/linux-user/meson.build index fcf7d40f23..b89534c49c 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -2,6 +2,8 @@ if not have_linux_user subdir_done() endif +linux_user_ss = ss.source_set() + common_user_inc += include_directories('host/' / config_host['ARCH']) common_user_inc += include_directories('.') @@ -42,3 +44,5 @@ subdir('sh4') subdir('sparc') subdir('x86_64') subdir('xtensa') + +specific_ss.add_all(when: 'CONFIG_LINUX_USER', if_true: linux_user_ss) From patchwork Tue Dec 14 00:26:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 523656 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp5336154wro; Mon, 13 Dec 2021 16:28:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzQwBvt3CyYD+VEwM44LvdtvZj/wp8gPHsj646KW3hmQvKN9lOKlip/0+x12557dq9QnRP X-Received: by 2002:ad4:4f0a:: with SMTP id fb10mr1862295qvb.40.1639441725552; Mon, 13 Dec 2021 16:28:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639441725; cv=none; d=google.com; s=arc-20160816; b=uzn2cFpJPT0H4ONsfpptchUVgpTNhQ80hpSC2o5QXPXI7CkmsGtk3u5tHkIUgbmSaj j5WXeXgWUN5a50LbBMukc5RchnLn9nylcbsBtCDq5u/2ZE68yr66reGULoIWepcN2ZDq XKEyJBYIcKP+a8NIeqdhBhqNI9szSXhfiMqJRMfJ7kgi9b+xGW1U7qvDjuR2//EFI9mu qNjEjlP9bIR8R1m/TxV3J5Ciux4vY3+rdm0GLR+2iRrpFkBc5+2+tvUSZONrWd9Ju+om HhTmjfDbhrgKWCt8fogGNKfGEhACU+TY31CFH4sGlCtTnm7ezoAfi+vk63GOAzxYRNUf jaIg== 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=EG4DMUGXVEyZNv1Q4b/NktcGLb+o4TMJ3Kcuz4Efvk0=; b=cUSolCe0nQuEcM+0+X9lfqoZI1g0Zzj2EPCcfY34O6lYnkLjVB0b/yTuyn/ZpIFtId wqq/Rbjw041GYA5qUT8JGXlTdVJCH/2vMCIHFk4/Oria+RifyMKIJfJNRdGZQqprlQAP OCCB/2gUK4AIoW+GSIdbyGq8Fgzsm/byyfH9it3dt/ki3iEz5wte/S2BVzmp3EDN9vWe 4141ZAZX27B8CsGKclbpGvfboGmtsWIqX5sBFWVo/x5+9BYRlVzTkgFWaB/aGhn7nmng CSBHPr5ODZeBSMRj923d+BYR1NqrjMrUchRg0LICxQKuuGeD+D2uQ2Q22SwY9JP+i5Zp mFbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=knUFG4Z6; 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=pass (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 g25si11029395vsk.132.2021.12.13.16.28.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Dec 2021 16:28:45 -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=pass header.i=@linaro.org header.s=google header.b=knUFG4Z6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwvgS-0002Jk-SV for patch@linaro.org; Mon, 13 Dec 2021 19:28:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwveE-0008Qt-62 for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:26 -0500 Received: from [2607:f8b0:4864:20::433] (port=45705 helo=mail-pf1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwve9-0005Tn-OT for qemu-devel@nongnu.org; Mon, 13 Dec 2021 19:26:25 -0500 Received: by mail-pf1-x433.google.com with SMTP id x131so16369667pfc.12 for ; Mon, 13 Dec 2021 16:26:21 -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=EG4DMUGXVEyZNv1Q4b/NktcGLb+o4TMJ3Kcuz4Efvk0=; b=knUFG4Z6NSHK/w/xdb4FSS+/FE0ec0ftoa84sxqLU9mj3YrlGmvlmFwposiXxKJfmQ 4m67cxgpAjCNNbanEJnDEWM5WlmvJeEJNqjpniYCv1TPKLzxhgL+TlFUCaegc/6qPNck GEVsdeSJXDxoFl+UXOc2BQhNvla0YlFF3HXAiLtdDOoDyKpvD7cDLIRbA5ZZI5cC3f5U R8oih2cKtWY0VaSJYSgwQn+wm37jtB2dklsk87AD5OFnBhsC685nnGVAR5mkhH1j/qYt gSqwtxsoJ497y3/4NGv6QN5Fq546qT/QiaFUqYTSwAFK+utbtpmC1AHvi+b0IoaOYp2V couQ== 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=EG4DMUGXVEyZNv1Q4b/NktcGLb+o4TMJ3Kcuz4Efvk0=; b=SchVbeUMSAFRYp0lqOTnMs3/vjGHzbpjN4m7aKTt8N2pyOotfh0RVqTNmPirh6Tt67 MhJtm4zKqribpnsQiir9P+Ihbp/rfiSlyYgxS6fTCHtYJYMJgwexanUSzPoQ6sa6/aPK m8FIGqqhnJJ93WJKbCpWF7t8AhuaEe4hMz/q2FdzbYaSQu4qQs29JWFW+sZlPznTajHJ xHn4cW767XkfURAfuY99CANrs3mdZsov3QUNpenPxzvjrBBdqFl00yBbYWx4zysn8f+9 U2gsCk97Ljskj4UuBfquBdjOC5qjqJWs27OUszZrqyF+JbDZSBbMEXl4mWt9t1FOlugC UfyQ== X-Gm-Message-State: AOAM532utobPlOJ0XvzRRYkLREKSBpLWVWR/zUCgHIFGn6a6x2A2wyRl rZPHWLO1JGJUDflmKLofpKN7VhZl4fwh7Q== X-Received: by 2002:a63:87c3:: with SMTP id i186mr1369381pge.507.1639441580395; Mon, 13 Dec 2021 16:26:20 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id w7sm11320253pgo.56.2021.12.13.16.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 16:26:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 15/15] meson: Move bsd_user_ss to bsd-user/ Date: Mon, 13 Dec 2021 16:26:04 -0800 Message-Id: <20211214002604.161983-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211214002604.161983-1-richard.henderson@linaro.org> References: <20211214002604.161983-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::433 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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, 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: git@xen0n.name, laurent@vivier.eu, Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We have no need to reference bsd_user_ss outside of bsd-user. Go ahead and merge it directly into specific_ss. Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 3 --- bsd-user/meson.build | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index bf7af382de..e425129011 100644 --- a/meson.build +++ b/meson.build @@ -2363,7 +2363,6 @@ genh += hxdep authz_ss = ss.source_set() blockdev_ss = ss.source_set() 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() @@ -2618,8 +2617,6 @@ subdir('common-user') subdir('bsd-user') subdir('linux-user') -specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) - common_user_ss = common_user_ss.apply(config_all, strict: false) common_user = static_library('common-user', sources: common_user_ss.sources(), diff --git a/bsd-user/meson.build b/bsd-user/meson.build index 25c3976ead..9fcb80c3fa 100644 --- a/bsd-user/meson.build +++ b/bsd-user/meson.build @@ -2,6 +2,8 @@ if not have_bsd_user subdir_done() endif +bsd_user_ss = ss.source_set() + common_user_inc += include_directories('.') bsd_user_ss.add(files( @@ -17,3 +19,5 @@ bsd_user_ss.add(files( # Pull in the OS-specific build glue, if any subdir(targetos) + +specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)