From patchwork Wed Jan 5 00:40:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1575417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=okq8YPLp; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JT9rj1gPlz9sSs for ; Wed, 5 Jan 2022 11:50:43 +1100 (AEDT) Received: from localhost ([::1]:42228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4uVk-0001z1-Ex for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2022 19:50:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4uMW-0005Eb-Ls for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:12 -0500 Received: from [2607:f8b0:4864:20::1034] (port=45886 helo=mail-pj1-x1034.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4uML-0005eu-Em for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:08 -0500 Received: by mail-pj1-x1034.google.com with SMTP id l16-20020a17090a409000b001b2e9628c9cso4785087pjg.4 for ; Tue, 04 Jan 2022 16:40:57 -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=5JjYgAjXn1kQxSGxYgLEIz1R3XcGictv5Sz0+SPB7Hc=; b=okq8YPLpf8gr+v1HLphYVdWkyNhpTaBGTZXgSz5MxC7wkCPXN9QKxAEvI0ILgxOoqF yYBHSd7k3HMVqptvHqGViuDD/ByRXTlT9A7fw4rIDbF76u6rkM6fhZ4U+xSwkckzvHxF lb3QR6CNAcO1FscanxVPCVT7xP0zYmmkG+gOq6A6VPmeUSgRKFpnN8hDxOVQTpn9vfdK qorZAG62A4Tu8sTpgxIwlEogZxpIU6qWArXRR3zErc0RPlcyqqlTQuz1gyEuOR5kANm/ HYe9KMhj/Q+TEImj37F3Gf4owjqA2uav7CzDJYHJ6X2fhlnRPqr5RB/IzBRvj9fs5mro 7Iyw== 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=5JjYgAjXn1kQxSGxYgLEIz1R3XcGictv5Sz0+SPB7Hc=; b=upy/0BgbksnmMhbLn2VgypWGMtt6ePIHItMilA2uLSBqVWbcDW1I7xOkrDP6yKtbs8 +WJtDyNoCOx/rrORDmby/N0Y7LJqZf+Gd5UyzYEnd8x8VfexgFULh/fMV6+RH9/F6N+E nvnRPcLKNSy3UziCD1VMPvvA8shOdcpOVFLNCwCIB+bVhVilCOeMrQB/dxV6rVrzD/Bl 06eslgNq3ABdoZMEAFUfDtIVA0bqLcfgwpFWnaH3Q/o43ZgY2oLAlTeO+8yBd2eh+aup A6DD2UkAx4z9Oc4GD17wngfRUHzIeZ5FlOOTxb0mbg33ECy3PJAPZhxO8tLRcza0JAoH vz+Q== X-Gm-Message-State: AOAM533qR424MdkXPllqf2UDZt+1dlEVYJHRBDxTYI9LZoNcg98HLdK9 PeorJWlUYDjfAS7aHgf0RGh8YcBZpjSaqg== X-Google-Smtp-Source: ABdhPJzeanz0S3bR2zMY8WuSvOQAlmj+GW702GpRNqDCkaLd7RKzCiZS951DK2f5W6WoTSIAOGQLuQ== X-Received: by 2002:a17:902:d487:b0:149:c6e8:b4aa with SMTP id c7-20020a170902d48700b00149c6e8b4aamr3805936plg.108.1641343256134; Tue, 04 Jan 2022 16:40:56 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id k3sm35312356pgq.54.2022.01.04.16.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 16:40:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 1/4] tcg/optimize: Fix folding of vector ops Date: Tue, 4 Jan 2022 16:40:51 -0800 Message-Id: <20220105004054.587588-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220105004054.587588-1-richard.henderson@linaro.org> References: <20220105004054.587588-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1034 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Bitwise operations are easy to fold, because the operation is identical regardless of element size. But add and sub need extra element size info that is not currently propagated. Fixes: 2f9f08ba43d Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/799 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2397f2cf93..e573000951 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -308,13 +308,13 @@ static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y) CASE_OP_32_64(mul): return x * y; - CASE_OP_32_64(and): + CASE_OP_32_64_VEC(and): return x & y; - CASE_OP_32_64(or): + CASE_OP_32_64_VEC(or): return x | y; - CASE_OP_32_64(xor): + CASE_OP_32_64_VEC(xor): return x ^ y; case INDEX_op_shl_i32: @@ -347,16 +347,16 @@ static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y) case INDEX_op_rotl_i64: return rol64(x, y & 63); - CASE_OP_32_64(not): + CASE_OP_32_64_VEC(not): return ~x; CASE_OP_32_64(neg): return -x; - CASE_OP_32_64(andc): + CASE_OP_32_64_VEC(andc): return x & ~y; - CASE_OP_32_64(orc): + CASE_OP_32_64_VEC(orc): return x | ~y; CASE_OP_32_64(eqv): @@ -751,6 +751,12 @@ static bool fold_const2(OptContext *ctx, TCGOp *op) return false; } +static bool fold_commutative(OptContext *ctx, TCGOp *op) +{ + swap_commutative(op->args[0], &op->args[1], &op->args[2]); + return false; +} + static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) { swap_commutative(op->args[0], &op->args[1], &op->args[2]); @@ -905,6 +911,16 @@ static bool fold_add(OptContext *ctx, TCGOp *op) return false; } +/* We cannot as yet do_constant_folding with vectors. */ +static bool fold_add_vec(OptContext *ctx, TCGOp *op) +{ + if (fold_commutative(ctx, op) || + fold_xi_to_x(ctx, op, 0)) { + return true; + } + return false; +} + static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) { if (arg_is_const(op->args[2]) && arg_is_const(op->args[3]) && @@ -1938,10 +1954,10 @@ static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op) return false; } -static bool fold_sub(OptContext *ctx, TCGOp *op) +/* We cannot as yet do_constant_folding with vectors. */ +static bool fold_sub_vec(OptContext *ctx, TCGOp *op) { - if (fold_const2(ctx, op) || - fold_xx_to_i(ctx, op, 0) || + if (fold_xx_to_i(ctx, op, 0) || fold_xi_to_x(ctx, op, 0) || fold_sub_to_neg(ctx, op)) { return true; @@ -1949,6 +1965,11 @@ static bool fold_sub(OptContext *ctx, TCGOp *op) return false; } +static bool fold_sub(OptContext *ctx, TCGOp *op) +{ + return fold_const2(ctx, op) || fold_sub_vec(ctx, op); +} + static bool fold_sub2(OptContext *ctx, TCGOp *op) { return fold_addsub2(ctx, op, false); @@ -2052,9 +2073,12 @@ void tcg_optimize(TCGContext *s) * Sorted alphabetically by opcode as much as possible. */ switch (opc) { - CASE_OP_32_64_VEC(add): + CASE_OP_32_64(add): done = fold_add(&ctx, op); break; + case INDEX_op_add_vec: + done = fold_add_vec(&ctx, op); + break; CASE_OP_32_64(add2): done = fold_add2(&ctx, op); break; @@ -2193,9 +2217,12 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(sextract): done = fold_sextract(&ctx, op); break; - CASE_OP_32_64_VEC(sub): + CASE_OP_32_64(sub): done = fold_sub(&ctx, op); break; + case INDEX_op_sub_vec: + done = fold_sub_vec(&ctx, op); + break; CASE_OP_32_64(sub2): done = fold_sub2(&ctx, op); break; From patchwork Wed Jan 5 00:40:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1575415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=HRHc4Wzo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JT9js4kzzz9ssD for ; Wed, 5 Jan 2022 11:44:48 +1100 (AEDT) Received: from localhost ([::1]:35110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4uQ0-0005P4-9p for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2022 19:44:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4uMP-0005Cv-Nn for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:02 -0500 Received: from [2607:f8b0:4864:20::629] (port=33649 helo=mail-pl1-x629.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4uML-0005ez-UW for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:00 -0500 Received: by mail-pl1-x629.google.com with SMTP id i6so22144134pla.0 for ; Tue, 04 Jan 2022 16:40:57 -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=jM9WH4tZn+WozYyxodUMJ3vMf971E4f0f2uwJh5rJpw=; b=HRHc4Wzo89vBt/A8Gkis1iMXeE7IqYzDzZBBsSC7Fsnojr7vLv6Zn/dNseocyy+Rjd hkfemKB08AXe/3HF1MWnGM/2e6qwYLklWtEQlJvhV3Ri4ukCyhqlXx1Mt+Z+yICtr3Ud 1Eup4cVgJaokud6g51p3JvQm25+zapUqDdJpSdWwT2zFDnpsYS1KaRCcYoh0948XYxQ9 DSbNbcTCP8hwdseI7pZhMXZhnYIC1QxbUKMgyo2lv7QAJmj49M9YNY+fOMBl3vAH47cC GLtEBLwKom1BIdelE6Qqyp4LToaTvhugrCBBcobYvhrqqlkkLsL+DP75SrFFggS5OQRN ivgg== 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=jM9WH4tZn+WozYyxodUMJ3vMf971E4f0f2uwJh5rJpw=; b=kEkztIJVcoWpm7+Xa27WOqVD1bLHMwXTdPLfSU3AypHAUM70Je3clPrTtaiWUaox32 W56Hsl+VmQuDC4AHDuIvjIQLcMMP9hdAtHxi0UmibklwGeuuO+K41nsYuw3U+zn88Zs6 oVMyGcodVgIW7iEd8fUE8oUtnuqfuMb6c0rNDKIOx8Qc0FGiaGGwrF/HrKFGc8gzdOGx OlKwKOFgP5wxla2BKZp16aOLcbkUrtZhO/qRSbADbTDuzsRDT8P6OTvi3rQ12k/MHFgB Fs1Jq7RPbwdl9PBRJz8pGzKDsGiGlq9VuvkUcdv2CVloopSs5wqBLk+yD4b0qip+bXQR EKBA== X-Gm-Message-State: AOAM530aljfAFqSMRgI0xKyKB8tUYzRMsoqKYV1qv/SuQnflovK+U8Ft u/9Ml6phJPXqpM28MB1Bbpyd6AoCJucqjw== X-Google-Smtp-Source: ABdhPJwhjjvZR9uzNm4otbcTm2A+I+p2F0mZm/dO++0ICdLpV/Z6nwxmgX+3eBu7v8UqMN1fLvb9fQ== X-Received: by 2002:a17:90b:20e:: with SMTP id fy14mr12859pjb.22.1641343256756; Tue, 04 Jan 2022 16:40:56 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id k3sm35312356pgq.54.2022.01.04.16.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 16:40:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 2/4] linux-user: Fix trivial build error on loongarch64 hosts Date: Tue, 4 Jan 2022 16:40:52 -0800 Message-Id: <20220105004054.587588-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220105004054.587588-1-richard.henderson@linaro.org> References: <20220105004054.587588-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::629 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: WANG Xuerui , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building using GCC 8.3.0 on loongarch64 (Loongnix) we get: In file included from ../linux-user/signal.c:33: ../linux-user/host/loongarch64/host-signal.h: In function ‘host_signal_write’: ../linux-user/host/loongarch64/host-signal.h:57:9: error: a label can only be part of a statement and a declaration is not a statement uint32_t sel = (insn >> 15) & 0b11111111111; ^~~~~~~~ We don't use the 'sel' variable more than once, so drop it. Meson output for the record: Host machine cpu family: loongarch64 Host machine cpu: loongarch64 C compiler for the host machine: cc (gcc 8.3.0 "cc (Loongnix 8.3.0-6.lnd.vec.27) 8.3.0") C linker for the host machine: cc ld.bfd 2.31.1-system Fixes: ad812c3bd65 ("linux-user: Implement CPU-specific signal handler for loongarch64 hosts") Reported-by: Song Gao Suggested-by: Song Gao Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: WANG Xuerui Reviewed-by: Richard Henderson Message-Id: <20220104215027.2180972-1-f4bug@amsat.org> Signed-off-by: Richard Henderson --- linux-user/host/loongarch64/host-signal.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux-user/host/loongarch64/host-signal.h b/linux-user/host/loongarch64/host-signal.h index 05e2c82371..7effa24251 100644 --- a/linux-user/host/loongarch64/host-signal.h +++ b/linux-user/host/loongarch64/host-signal.h @@ -54,9 +54,7 @@ static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) } break; case 0b001110: /* indexed, atomic, bounds-checking memory operations */ - uint32_t sel = (insn >> 15) & 0b11111111111; - - switch (sel) { + switch ((insn >> 15) & 0b11111111111) { case 0b00000100000: /* stx.b */ case 0b00000101000: /* stx.h */ case 0b00000110000: /* stx.w */ From patchwork Wed Jan 5 00:40:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1575416 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=s2VfolWq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JT9kw51MKz9sSs for ; Wed, 5 Jan 2022 11:45:44 +1100 (AEDT) Received: from localhost ([::1]:36162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4uQw-0006C4-HF for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2022 19:45:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4uMP-0005Cd-Qa for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:02 -0500 Received: from [2607:f8b0:4864:20::1036] (port=33536 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4uMM-0005fC-Nh for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:00 -0500 Received: by mail-pj1-x1036.google.com with SMTP id g11-20020a17090a7d0b00b001b2c12c7273so2534929pjl.0 for ; Tue, 04 Jan 2022 16:40:58 -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=YcPV3VwSDfshYOTe7weRDXAZxBZo/GP8+IJKpZqZQJU=; b=s2VfolWq3b3H2u0VfbQEvQzNjrQYFtvwehOlgKhi39cHOKCB5gXoyEj3TVV51Ouctc D0JQ85pX3/3ATU7NTTSn1uV5oNhphGWZOAz4EybTFVqRkU7VIWudzcsMYgsd+JqikmQp nWtmE6IVqeXqki6NlG93158i+NMj7ZZWoJxmDlYajN/afwzTJ/75OC4uD4Bc1ALdr/J5 9HSav6dn/XWaCzEowVC18vqtcmtLNRm3rMxJZkHqlOAxIeVp1lsWk/zUMJ7BGLPRi/Mz Jn7fN59LzhDRJIskgS7bYskF/A1j+ZmeCXLM/zusAUb5sBL9Wb0NHjvRWLs2KnwNuDD4 FkiA== 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=YcPV3VwSDfshYOTe7weRDXAZxBZo/GP8+IJKpZqZQJU=; b=01TQDfRsd8xVG6doOsvIdhbEIWy+DpYIwu2yCBhnW+bu1AzRZMnTqqyT3Y0qJ5JHbJ MR6VhqTjNuKVafkGxzqAps2Qxa+zyiiwNXJi7ms8unh/F9kSUoefD1eVhJ+6GcwhuEqw 6cOs6FUHV+OvwEY4/scgf2+pSoTLHhhoUoo63ODrlbKcV56sBLJIRjJXjP21ZIW0hcWM c0bbVAEWBrxLFA/VXAI0ICez6XnmEsY2Q1uqOkziSmJa4WN5kI+yCmEKJbm+PrfeKuQM U6UVGupe2EB4KE2VwVl90PH+AjeCvNA9IPS+KL/Uw1BBWuM5yHrUErgljFHLwU6aoMRm 6Krg== X-Gm-Message-State: AOAM531yFRSupmL3HVYB+iwZUmkZ+fjzdYK+k5mxXUm6urKrryC3Ytfs Kqau/HAad2eZI63vc9Z9GncJxwDJo+7mTw== X-Google-Smtp-Source: ABdhPJxkqCmahfY2L1fcYyJZKPzZE9/7UWSjfG2pkj4kDRpxJ4U9C/fFsVijLxbu86gsdBQeoEcnkw== X-Received: by 2002:a17:90b:38c1:: with SMTP id nn1mr1132529pjb.65.1641343257374; Tue, 04 Jan 2022 16:40:57 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id k3sm35312356pgq.54.2022.01.04.16.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 16:40:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 3/4] sysemu: Cleanup qemu_run_machine_init_done_notifiers() Date: Tue, 4 Jan 2022 16:40:53 -0800 Message-Id: <20220105004054.587588-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220105004054.587588-1-richard.henderson@linaro.org> References: <20220105004054.587588-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: Xiaoyao Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Xiaoyao Li Remove qemu_run_machine_init_done_notifiers() since no implementation and user. Fixes: f66dc8737c9 ("vl: move all generic initialization out of vl.c") Signed-off-by: Xiaoyao Li Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220104024136.1433545-1-xiaoyao.li@intel.com> Signed-off-by: Richard Henderson --- include/sysemu/sysemu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 8fae667172..b9421e03ff 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -16,7 +16,6 @@ extern bool qemu_uuid_set; void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); -void qemu_run_machine_init_done_notifiers(void); void qemu_add_machine_init_done_notifier(Notifier *notify); void qemu_remove_machine_init_done_notifier(Notifier *notify); From patchwork Wed Jan 5 00:40:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1575418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=DFqByQYV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JT9sH0Y6Wz9sSs for ; Wed, 5 Jan 2022 11:51:15 +1100 (AEDT) Received: from localhost ([::1]:42776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4uWG-0002LQ-Br for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2022 19:51:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4uMP-0005Cw-OQ for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:02 -0500 Received: from [2607:f8b0:4864:20::1030] (port=42561 helo=mail-pj1-x1030.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4uMN-0005fI-7f for qemu-devel@nongnu.org; Tue, 04 Jan 2022 19:41:00 -0500 Received: by mail-pj1-x1030.google.com with SMTP id lr15-20020a17090b4b8f00b001b19671cbebso4793152pjb.1 for ; Tue, 04 Jan 2022 16:40:58 -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=Nhccvc7jO1lfQcqH/y9qaOyEsCQIn9/GtRZwxj3VwPc=; b=DFqByQYViWahJCUHFKCiNgbawmqnRTKsEOmnZ8v9Op2TPOzrOUE3Ow8KOlmbk8gRvG jsMbnmeDhWgoKHiWbhQu6BVuGT9r/JyXFZKzPuH2TAHeg/dJc/ow9+QZSdnDW0YXkhDr wa78WxQ0pcAkMOCwVPtGQTj+xFhghK1EagThE6Xco3R1JDLJZ1/u1TRY4RBtP4U/fxuk gOF32cXGPEUkGcJDGONGdQ2miZtdv2yQho2ERWWi9db0Eu/2iQ0W70mLPGhk2tB3ax0+ MZV6TtV3Sl7r8pbbo4Q9FqiYi2NkDZydO1i3XBFIVcc7TNiiOJsLQbO1Zh2tM0CZU2Cn XQoA== 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=Nhccvc7jO1lfQcqH/y9qaOyEsCQIn9/GtRZwxj3VwPc=; b=NVpwA0sYI5b+B4WuSZpw7LH2NcFMUOjetmMkLRyVyOic8QH08qGAUOIYiD1zQg9X0D wBL9E2fm1TOvQCG5G3ufpqyPVXH3dGinnbRS5pzfbc0yxp1iqliG3dcl7sOq/t1Zu7jb bP9mYiCb1D9TwTU+hOaYIgp2FctvgoVA3attucjfJKIbgPRQoG26OFN281F3HHfEJsBn GUF+mmOmwxQjo65SFO3fLCLhLVzqBhmmcqGX+tnxWDdK4s7f0tspOrEEdqc8Wzew9jaF 20v+x9Xc4OFYLBepSMNcNjapEdTdVH8WkdEG71Ad6nPVuTSLBrzWI4isiPBISrs4SnXx tRiQ== X-Gm-Message-State: AOAM532pUkjdztzYg0dJrJRZQL40n+edCVsLIPsH4CT6aX9+YMbXh2Jj KTko25/HMt7VA/2oBI9LH6nhnnwyl8juqw== X-Google-Smtp-Source: ABdhPJy1f4yWF/vHX3LD++WpvkaVofTpXWr9rDR7WVNVYdHUmfEQox8QbZumQLv947kQqRLS8WFcfw== X-Received: by 2002:a17:90a:e603:: with SMTP id j3mr1145313pjy.166.1641343257944; Tue, 04 Jan 2022 16:40:57 -0800 (PST) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id k3sm35312356pgq.54.2022.01.04.16.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 16:40:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 4/4] common-user: Fix tail calls to safe_syscall_set_errno_tail Date: Tue, 4 Jan 2022 16:40:54 -0800 Message-Id: <20220105004054.587588-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220105004054.587588-1-richard.henderson@linaro.org> References: <20220105004054.587588-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1030 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" For the ABIs in which the syscall return register is not also the first function argument register, move the errno value into the correct place. Fixes: a3310c0397e2 ("linux-user: Move syscall error detection into safe_syscall_base") Reported-by: Laurent Vivier Tested-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id: <20220104190454.542225-1-richard.henderson@linaro.org> --- common-user/host/i386/safe-syscall.inc.S | 1 + common-user/host/mips/safe-syscall.inc.S | 1 + common-user/host/x86_64/safe-syscall.inc.S | 1 + 3 files changed, 3 insertions(+) diff --git a/common-user/host/i386/safe-syscall.inc.S b/common-user/host/i386/safe-syscall.inc.S index baf5400a29..9c45e56e48 100644 --- a/common-user/host/i386/safe-syscall.inc.S +++ b/common-user/host/i386/safe-syscall.inc.S @@ -120,6 +120,7 @@ safe_syscall_end: pop %ebp .cfi_adjust_cfa_offset -4 .cfi_restore ebp + mov %eax, (%esp) jmp safe_syscall_set_errno_tail .cfi_endproc diff --git a/common-user/host/mips/safe-syscall.inc.S b/common-user/host/mips/safe-syscall.inc.S index fc75a337d1..6a44614970 100644 --- a/common-user/host/mips/safe-syscall.inc.S +++ b/common-user/host/mips/safe-syscall.inc.S @@ -141,6 +141,7 @@ safe_syscall_end: 1: USE_ALT_CP(t0) SETUP_GPX(t1) SETUP_GPX64(t0, t1) + move a0, v0 PTR_LA t9, safe_syscall_set_errno_tail jr t9 diff --git a/common-user/host/x86_64/safe-syscall.inc.S b/common-user/host/x86_64/safe-syscall.inc.S index a20927a783..d1a67a303a 100644 --- a/common-user/host/x86_64/safe-syscall.inc.S +++ b/common-user/host/x86_64/safe-syscall.inc.S @@ -99,6 +99,7 @@ safe_syscall_end: 1: pop %rbp .cfi_def_cfa_offset 8 .cfi_restore rbp + mov %eax, %edi jmp safe_syscall_set_errno_tail .cfi_endproc