From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040142; cv=none; d=zoho.com; s=zohoarc; b=Y9gCmhxW5FO36W3Eaou4pjNLXz3ZeFW7OVli7ygSmrW9nXdM4yvCW77aU4ShhSPb9kwUPeUfKFzRx7BiygTpTU5ch8gUkilJAor4vNG2sagoGzvsDxT7LaBPe2pi/e7QpSyhmfnc8jmtbw1s8XNt6+yO5WH31kV699uWWia+U4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040142; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ioxK2kUUvhJn3ibL7fxkhbHvv7iuDuKl2QhEX38aenY=; b=A5Ey2WVCey3UJ4iWdennvQU3Mbcy/qWoNgdgfxt7xWFIItZjHlCzckjXM7T1AEBVjC93qxPeh8BMh2e22x16IIAnhCU4gx23NM5AF1OC4InZioNkvy37kGuUpsaHf6Du689CuHLLrBlFjy5MlbbBBBc4awZJnUHyX0Q9TW7dpQA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040142788871.862629457841; Wed, 6 Nov 2019 03:35:42 -0800 (PST) Received: from localhost ([::1]:56358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJb8-0005lv-UO for importer@patchew.org; Wed, 06 Nov 2019 06:35:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37788) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZA-0003m3-7T for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZ8-0007El-84 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:35 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55067) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZ8-0007CW-0t for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:34 -0500 Received: by mail-wm1-x344.google.com with SMTP id z26so2935326wmi.4 for ; Wed, 06 Nov 2019 03:33:33 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:31 -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; bh=ioxK2kUUvhJn3ibL7fxkhbHvv7iuDuKl2QhEX38aenY=; b=yNLrWy6GyCdnmMokFxjBAnPWS6IkMNctG4Pi56lKHsYGCDR27zkhdR3N8/A/Rm2Muv qhmE7gdL+hhiZ6zUBf/9NGyli6aVg7pljq3FA9beQ7dVAx6xVXaMSzyigwMjFMoFl1yK LzuhT3rsXN95+8ghZJ//pUUll9lbg2MFL4vOG0lMCGeyyLwca6TsEM3EgDtMOhbhjxyV b5/mnbLUP3kevd+qEJ56fyckEFk6tH721GNrdsn2aIzqnPf0dfvv48ulQHsXmF8vTHjm pOwXqnw42973g2Q6uL6YPLJ/aLzxYkrZaJsrqPdBFWaWgyLnE3lrJF/lylyscVg7X4Ei ouBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ioxK2kUUvhJn3ibL7fxkhbHvv7iuDuKl2QhEX38aenY=; b=maVl+oZbAy6i9bc9DG+fACqgwYjSUlte2b1o3czhGy9iuLNO3s6aS1gmPV5bAML0Xh kcf/gQPMoo39sLEOoimpLgxk7ol2/JqBF+ssVUBcWM0E2ve2LBTBuCh9D/kGz3giCfJN srsy7XIP2YZkdj5q0956frDdSK52J99SAaSFijtMaD2/bx18439AaJt55i7ymnGbnUni Qy1XTa8nP5klUie6/nKD+1YtpXH3iafDpMyUw6ezjzHseN7wlFtfT97Dr6JjJ25eQpEb b4KG3dV/xZtQwJRFiZ0oXlgyJx7cyOxVNqkY0CWpOEVhlkg1/LVOjfCtL70oN4X6bXCI +YAA== X-Gm-Message-State: APjAAAWAUVz3NRPypmzTF6IREmF+tez1lQvoWdd6TXqAvKVgJtMHFZoZ aMKQhagF6036k/yRmcSJ6hxjWPx72oxZmA== X-Google-Smtp-Source: APXvYqxFWa8yPzw6/A87OUTxngcn5VGsstrflzuahcNq28tBvVlVsSBgpw9GZb6OmbKQ7glK2tN+vw== X-Received: by 2002:a1c:7e0e:: with SMTP id z14mr2199100wmc.52.1573040011787; Wed, 06 Nov 2019 03:33:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 01/12] scripts/qemu-binfmt-conf: Update for sparc64 Date: Wed, 6 Nov 2019 12:33:07 +0100 Message-Id: <20191106113318.10226-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Also note that we were missing the qemu_target_list entry for plain sparc; fix that at the same time. Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Richard Henderson Message-Id: <20191025113921.9412-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index b5a16742a1..9f1580a91c 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -1,8 +1,8 @@ #!/bin/sh # Enable automatic program execution by the kernel. =20 -qemu_target_list=3D"i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64l= e m68k \ -mips mipsel mipsn32 mipsn32el mips64 mips64el \ +qemu_target_list=3D"i386 i486 alpha arm armeb sparc sparc32plus sparc64 \ +ppc ppc64 ppc64le m68k mips mipsel mipsn32 mipsn32el mips64 mips64el \ sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \ microblaze microblazeel or1k x86_64" =20 @@ -38,6 +38,10 @@ sparc32plus_magic=3D'\x7fELF\x01\x02\x01\x00\x00\x00\x00= \x00\x00\x00\x00\x00\x00\x sparc32plus_mask=3D'\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\x= ff\xff\xff\xff\xfe\xff\xff' sparc32plus_family=3Dsparc =20 +sparc64_magic=3D'\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x= 00\x02\x00\x2b' +sparc64_mask=3D'\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x= ff\xff\xff\xfe\xff\xff' +sparc64_family=3Dsparc + ppc_magic=3D'\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x= 02\x00\x14' ppc_mask=3D'\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\x= ff\xff\xfe\xff\xff' ppc_family=3Dppc --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040142; cv=none; d=zoho.com; s=zohoarc; b=eKr78AKB11ZNsrl+S6MnnHKw8qrmmDQ3H3ZcLV5DDJ+Fh4tPYpssJI/PktJIPHZyHaj5LHRvSuqHK8Y5fVWAw0qtuhdk2dUTaTnwlGePNHIRrWLQ5kpeLoLeTAwKY2/72/AFu8r/xqinGIB1yRnvXpTomZwNp5GC03Y5Sic87wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040142; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c9UPRPKHJUNhzqq+bqS8IJr3Nntx8YxeU90N3YYxIP4=; b=PKhJLNowQf032pk6Xu/9ffQ9eXmQ+avLmmkGSu4tMLxeCgnVC+QxxR2b9OmfIZprUhcPCk7tYBTX8z/Kj2ftMWxYuj9b/g5Bg8NuSB2G4RUADqz6wxR/GJP81bRoYWFBH5DWbL1r/6u9NnnKM/LVnkradkPPM/MNnyED2nLuHCs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040142789980.5998238003588; Wed, 6 Nov 2019 03:35:42 -0800 (PST) Received: from localhost ([::1]:56354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJb6-0005k8-DU for importer@patchew.org; Wed, 06 Nov 2019 06:35:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37789) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZA-0003m4-7j for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZ8-0007F0-GE for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:35 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:40357) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZ8-0007DG-A1 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:34 -0500 Received: by mail-wm1-x341.google.com with SMTP id f3so2896204wmc.5 for ; Wed, 06 Nov 2019 03:33:34 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:32 -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=c9UPRPKHJUNhzqq+bqS8IJr3Nntx8YxeU90N3YYxIP4=; b=aOjCzRcbQWDShqOS/dQd5Ioj1a5B13l3MPPMSqKMK0wjR4r9wMcjosBdIL1V2Zc+xO 3d3dT0TylBhZOsoQgFJQVcXPyDYK1uEbH5qH0KuQgDpnBz7yrr/LjuNxRLNVfEvzIY3X N0MChXKCcQjpFH9u/LDFpAhvvYz74mPOQZ1bFbtJc2zjsysCx9fGE2Of2MWIU5uG8tTi B3iQXLgKLCPJykI3DpEYIs6mtNmjOXFtrujF9DQjWJZTwgyZs8PKDyPtjuPOKzGf7kdK t0mlTY7ZvM1EKvElw432Ae6a24xg7sxZPAAzCSKkiZPWcTGIHAsfoP8woyI7wLipP380 qEOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c9UPRPKHJUNhzqq+bqS8IJr3Nntx8YxeU90N3YYxIP4=; b=fBiNXdXrsbMZrIia7Gko1ON+KAEqw7vBQxuwkC2BcJ2G/xdFjDu1l1Pzih7aH4vYoL crQkvxYXP/QvuNbsFFIgbpH9OyZLNMr8pNBJjLqQJYnXPVXI3jBFQL7ztc/wmGeE0bY7 px6ghBnjDlMbv35vJ6WI1N3oWNAxlR3phl7vP5WvVOtfOo7cmnDVxgIfGrFefOyxOHNe V7BAz+q6EMh6rONecjFvKclzEe9EyrOBHC/KsZCFIoNhtKtpWDSrN9aIjzEfVhBC3rfN r2AkCDa2/8NKWgD9bOKXOEogPSsa85B8dIyDWtaUtpvSRLwONNfgAAqmH4IyPXArIc3L AJMQ== X-Gm-Message-State: APjAAAUVsI829kqHX3eooZObEZlHzjsk1KXzzCr66s31yJmgTVy/TMR2 UsudiI5p+Pvuq0AzhoGZZ1aYmKsfxTFjNQ== X-Google-Smtp-Source: APXvYqxRk/wyk3Wt+WACNu+cGcubPFW8W0uYPVPysB2V9aA5VDNu4zjVhvE8ylv3IS8thO8YqbXiXw== X-Received: by 2002:a05:600c:28c:: with SMTP id 12mr1989359wmk.25.1573040012975; Wed, 06 Nov 2019 03:33:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 02/12] tests/tcg/multiarch/linux-test: Fix error check for shmat Date: Wed, 6 Nov 2019 12:33:08 +0100 Message-Id: <20191106113318.10226-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) The error indicator for this syscall is -1, not 0. Fixes: e374bfa35bfb ("shm tests - disabled clone test") Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191025113921.9412-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- tests/tcg/multiarch/linux-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-t= est.c index fa4243fc04..673d7c8a1c 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -503,8 +503,9 @@ static void test_shm(void) =20 shmid =3D chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777)); ptr =3D shmat(shmid, NULL, 0); - if (!ptr) + if (ptr =3D=3D (void *)-1) { error("shmat"); + } =20 memset(ptr, 0, SHM_SIZE); =20 --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040296; cv=none; d=zoho.com; s=zohoarc; b=XGycJ1TGHxuhWx1Id/L6sRu9WYiOGXJyzXEeA4Yjj5Qn55myEg/CuD+Vy2ib6TYr8AOOuLXnCbxPQOzqBbpIEYPXziBt4tT8ldpq61LLk6lLusOH6f2RJclbxjD2DH/F9ZbjAbAWCEP2FqnMZydMuGc/c8kMlCeNk0Xj2Nv6RVE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040296; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=/0sggaw1v8ZuIdMOPOdNQg2kpFmBqjitREJdcWvNbpc=; b=aZ/UMwQnankIob6p34CKYcGEJVGseYD3SyhmyydenHL5ffXzrklPaxK3t1/ro4asyipNhtgJ7fpqFS7mpk/qYV5tLEIw8P+H/YsMKamHVsqNa9k6LxaPy6vOzOoNvNFQgULldUaPNTuCZahcIDh7Ec0cOOCzC/dkZSNlCe9ILjA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040296951693.9576247417566; Wed, 6 Nov 2019 03:38:16 -0800 (PST) Received: from localhost ([::1]:56404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJdf-00017B-Gp for importer@patchew.org; Wed, 06 Nov 2019 06:38:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37828) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZC-0003mP-5E for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZA-0007H0-4u for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:38 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:44428) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZ9-0007F9-Vn for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:36 -0500 Received: by mail-wr1-x42e.google.com with SMTP id f2so16415741wrs.11 for ; Wed, 06 Nov 2019 03:33:35 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:33 -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; bh=/0sggaw1v8ZuIdMOPOdNQg2kpFmBqjitREJdcWvNbpc=; b=qU0On76WqJf4dxsXSFTpvmiacgEnXGgWszbuqTr5AucrI/LhAv+aUt5rH5cd+yQhPD LSLYfxnpSIFvS4axbpepqe27inlzdm73fop24eDnlYKjP+nkpaKkpnl5G5ilhtGzee0e Xtdnf3oTtKuyAtbPUM4EsBceaWyCmEtbKipKL5BA/bkzcpaqHpbxdquhYJSjoQa04SrW AqeN39KLXxs9fthIcWNXzORt9R6RlQnp6Kq4CXyhymdHE6fTMSw0GhkS/L1rVsizChuF tB0/kZTIZcypiGKeJXVVt02Fp6rL9JEVBHlC+K94GZDWytusK7M6PveTv9hUDHLb7inV jG/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/0sggaw1v8ZuIdMOPOdNQg2kpFmBqjitREJdcWvNbpc=; b=sid/GP6gMh0wrCumO94PMhGr8+YjHS6EsDacSHOIpdhamdfj/HdYIeoWx5BG3hWSQ+ xrbIQvk+dUOGyp4ENvWCYAmETE/Bco7zbBRNfj04DJVfWD0htIhaIjxh28q/C7vL8jJm M7Z4JYliqsKmXqaSdZyTjnVeiW90JFNaS3Dm3y9mpBCGs6SILABauAOxW0ABnsinfY/0 RjWe9uBH2ke216UhNAUrszxFOlP07GGZDylOYXnNVOqUMQ8y0MCQfLxIYnHOxKRbARTp IzswP1POeOC6TOobkF99iPsYK3I1yx31th2TOvs+oluV7syDT85hnb9IarqggxxdNQoe WVdw== X-Gm-Message-State: APjAAAUM3Ax6r/6euLmBHySIflS+ZdJhonr1MhZhPccAWrtlWvmXauyy IVqfer4/KEwdI66V2VI3PgFsLxY+TZbGjg== X-Google-Smtp-Source: APXvYqz0AhkSWQjfclLXjhy3Sngz9oj4tX39iSgdVd374fH9dLv/Mljrv2NHj5IxX0lcu25I3aKE4Q== X-Received: by 2002:a5d:674d:: with SMTP id l13mr2286784wrw.170.1573040014245; Wed, 06 Nov 2019 03:33:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 03/12] target/sparc: Define an enumeration for accessing env->regwptr Date: Wed, 6 Nov 2019 12:33:09 +0100 Message-Id: <20191106113318.10226-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Message-Id: <20191025113921.9412-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/sparc/cpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 778aa8e073..ae97c7d9f7 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -13,6 +13,39 @@ =20 /*#define EXCP_INTERRUPT 0x100*/ =20 +/* Windowed register indexes. */ +enum { + WREG_O0, + WREG_O1, + WREG_O2, + WREG_O3, + WREG_O4, + WREG_O5, + WREG_O6, + WREG_O7, + + WREG_L0, + WREG_L1, + WREG_L2, + WREG_L3, + WREG_L4, + WREG_L5, + WREG_L6, + WREG_L7, + + WREG_I0, + WREG_I1, + WREG_I2, + WREG_I3, + WREG_I4, + WREG_I5, + WREG_I6, + WREG_I7, + + WREG_SP =3D WREG_O6, + WREG_FP =3D WREG_I6, +}; + /* trap definitions */ #ifndef TARGET_SPARC64 #define TT_TFAULT 0x01 --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040501; cv=none; d=zoho.com; s=zohoarc; b=ACZDmv1udgZQnrJoEY7DfHyEuqJOy+6mXe4iVKYJDv7sDbqUKj1uQOyfXUdVyks82IcXC2BHF3Ki2KPyGdWi8AfNJxwIjPaxZK2nxQIsVv9GlGMF5ns+p7JYoauin+ybnTtgdcIoFHJcQEsljn6mivC/Dav2inwOrqcWTvIVZhw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040501; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=s3dwTlrDDpUYfBm35ZTmNP1iU/J47qcplhioQiqvjIo=; b=b9LdUYL9tTMQr9Ywfh9SVSO/X3i97L+T3meEdzshhsshgUERRFEnIa6TN6oUdGe5a8OQi2LyPf/aPl/+R6w4paJacsKD8qdKDyxzkSXI8nRmQgHIr0kCH4JLkuV+hRZ7aH502U26SlLGy1Z4MzBIiNac1TPS0RyzBAB68Z6g0pY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157304050178353.96801343109905; Wed, 6 Nov 2019 03:41:41 -0800 (PST) Received: from localhost ([::1]:56458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJgy-00054k-J0 for importer@patchew.org; Wed, 06 Nov 2019 06:41:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37857) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZD-0003nQ-DZ for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZC-0007NS-9w for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:39 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:35645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZC-0007HH-3l for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:38 -0500 Received: by mail-wm1-x344.google.com with SMTP id 8so2953669wmo.0 for ; Wed, 06 Nov 2019 03:33:36 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:35 -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; bh=s3dwTlrDDpUYfBm35ZTmNP1iU/J47qcplhioQiqvjIo=; b=Rhp4LYJmaMgM95v343vixf0U4RAGvipb82Hwie/A42J68lE0AwWTrx43EaHhPXyvmV MApd5eoLvFk6GGMzZIb9zB7ebsGZGQBlFnf06cQDr+G6KNu2m6GF3OUnWD1+2fbA5awx K2S/h76WzLHPqGgslcjnjeeuHWWpWXZxvP7zsc1PzCCNwYsP8ain60dpSXjhZrLLQDnG ZTesOZWwUxKIIsXOeiHW75OfpLdavoUkhj1tz0i0h3oX0ZOznuYeP68Bg6vyr2oOGv+G cl1h0beY1DxQ+XAfl8X30AqkqrEkNlfeZqC2FK3X5AHTjXvupaAmkd752IeOzD4VME6c 54SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s3dwTlrDDpUYfBm35ZTmNP1iU/J47qcplhioQiqvjIo=; b=PaG0cJO7zC5IS2PWSQLiB5XeGXHrU5EpXNDaKocnAKC6cKUWvHQGai9+cYlHEv5R56 UuZs4s5v1TdbTzyUKFACFXbDmp11OPVxXfWAbQCkSzXpT2hii+JD18DRQQKZIffCsHg4 gSodBxCM5ZYHuXtdeqMzfCm12BX/w2M6sRrr3JwRfiAQAuV6D+GFAwzw20sdYMxJ2AUs lS6McM4R2ScSJwLFMnFxcJvn6VbDReRVpX+oXC4QMlWjeCyOWDFyZjjyXmpKLtyHBcpe rpeY4HB4aIqWyLxDsltBTMETnK/bhA5DJaywI2mzrzwmqFaxy5YVBKbvMKlyRtAju4RT EPuw== X-Gm-Message-State: APjAAAX+gxW6m6q6iq05XzSoBPwkd5/atI3pV4So72EaGsdgUICxsEAO 6eB83v/xTXeLYybdA05NMYf2EJ81pym4tw== X-Google-Smtp-Source: APXvYqw/FywvKYpNtgAE+XOG6ioL+hMw90o7f0MWMcMF+L25nuUYIHoR2kqfM6IJ0A7psh18L2t1Vw== X-Received: by 2002:a7b:c858:: with SMTP id c24mr2135270wml.174.1573040015600; Wed, 06 Nov 2019 03:33:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 04/12] linux-user/sparc: Use WREG constants in sparc/target_cpu.h Date: Wed, 6 Nov 2019 12:33:10 +0100 Message-Id: <20191106113318.10226-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This fixes a naming bug wherein we used "UREG_FP" to access the stack pointer. OTOH, the "UREG_FP" constant was also defined incorrectly such that it *did* reference the stack pointer. Note that the kernel legitimately uses the name "FP", because it utilizes the rolled stack window in processing the system call. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191025113921.9412-5-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/target_cpu.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 1ffc0ae9f2..b30fbc72c4 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -41,15 +41,9 @@ static inline void cpu_set_tls(CPUSPARCState *env, targe= t_ulong newtls) env->gregs[7] =3D newtls; } =20 -#ifndef UREG_I6 -#define UREG_I6 6 -#endif -#ifndef UREG_FP -#define UREG_FP UREG_I6 -#endif - static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) { - return state->regwptr[UREG_FP]; + return state->regwptr[WREG_SP]; } + #endif --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040145; cv=none; d=zoho.com; s=zohoarc; b=Km/xNfCNTv5oRjgo9J9rtQxb2Tulnxwz3r4xq2TOQgkxNyqPRh4SGZ8siNgrLRBn7T6LxykELOswx8q9baFhte5MHXnH3yVcTxKjulpnNvSk/IIipjyTwGPrbe1ceJ9AXOyxUVtTsG9V6C8u9d1zhNIr3DSKYoaWT04RiXEK+R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040145; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=LRaQpCgWP3gyA/5Ocmoh3fal+6bjZX/Jqe93fN58T0A=; b=YkIrWDam3ikaBIHMm7iibDP2sZa7SAI0VWTWAFQ4H8sC+/4tut3vd3VzUVnM2ttKScnrxuqZjfjWWA+/7vtawYKTl4P9EvDhRteRW5d0vfMYAgfp7IZEUXA70obJuAxUTXS5OQUBw54J5mP6u5M2QEl8SHJ0AVcAxWm8qOiEUTk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040145265546.2515066278299; Wed, 6 Nov 2019 03:35:45 -0800 (PST) Received: from localhost ([::1]:56362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJbD-0005tQ-Ql for importer@patchew.org; Wed, 06 Nov 2019 06:35:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37879) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZE-0003oI-1v for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZC-0007O5-CN for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:39 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:45124) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZC-0007LM-5x for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:38 -0500 Received: by mail-wr1-x444.google.com with SMTP id q13so25341122wrs.12 for ; Wed, 06 Nov 2019 03:33:38 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:36 -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; bh=LRaQpCgWP3gyA/5Ocmoh3fal+6bjZX/Jqe93fN58T0A=; b=T3Gj7WjwMpNDH46x5hjk7lq61GF8mq0urLyrU7tPVdwhAC7HnF+e4BZtM0AaC8j8IS tUoy+IiM7xvKW0jXFo+n1qsr4PWzXHTvobfFa0gJD68IrKqXC2YluIP/VQ3QY7oXdNqN YnelKroET5zMpSzArv/XNAl1mAcnBYsb6kHeFLysNZ0xqIf2B1MUr/lh42H2+RKDyTuG I9ftJUE57anqO24zt2t+EszVcFaltSH849+tX1CrJsb8+bxahDCfBNOKpua29t4bV6Tl WXaYiyb5od30sWNb+Y4B2QDhAiqtS00ZLtiJfKsqpl5Pf6xR/KZHANtQNHUEy0tqWOJS TEig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LRaQpCgWP3gyA/5Ocmoh3fal+6bjZX/Jqe93fN58T0A=; b=OJ/xpy7yjKSQRZVHeB5CEt7VkG/KdIcJ/550qkSza+wx+NvP8Lz+x7mXkEqimajII+ xOUNXT/oMWgHktWkiCBLb6cFP1nau3Xu19ya6pYH/4hwkiFAAciSpge+pZ/zIyOpsNtG EOecITL2M377TDPQMadjUtw9qFV79kbGG6QPCqxrln10NAxxyaECTl6i2Q7T4mYawDP+ ODZsNVQZTI8zfg0Gpp61kQ6VFAvuyYiu94dPBQI0kqDfTtpd8NB083asS8CB3o8fZqb3 HW+e8ZVBhM/XSCinuw0mHBNJJnQ8P/g8yVeqnpQuvnVDopsDxvRgFv9WpCVtCQvlG2uN MNVg== X-Gm-Message-State: APjAAAVpzcpBXOudRFoynAxUPTliIshXAB6E4ICirKaC6lFebT/pyvHE dSEzzhnjtvdh8xEIJoNX1QOxfh/8SVRtgQ== X-Google-Smtp-Source: APXvYqzarbvJPRVbybWaeuq+lTrk9W6sV6mYGB2Vz4hTqSdbwMz8XA9pWxdG7Li2BArkQf9c66s8yw== X-Received: by 2002:a5d:4a45:: with SMTP id v5mr2345961wrs.288.1573040016778; Wed, 06 Nov 2019 03:33:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 05/12] linux-user/sparc: Begin using WREG constants in sparc/signal.c Date: Wed, 6 Nov 2019 12:33:11 +0100 Message-Id: <20191106113318.10226-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is non-obvious because the UREG constants are in fact wrong. s/UREG_I/WREG_O/g s/UREG_O/WREG_I/g s/UREG_L/WREG_L/g These substitutions have identical integer values. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191025113921.9412-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 93 ++++++++++++++------------------------- 1 file changed, 32 insertions(+), 61 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index ead169fbaa..aac37da239 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -104,19 +104,8 @@ struct target_rt_signal_frame { qemu_siginfo_fpu_t fpu_state; }; =20 -#define UREG_O0 16 -#define UREG_O6 22 -#define UREG_I0 0 -#define UREG_I1 1 -#define UREG_I2 2 -#define UREG_I3 3 -#define UREG_I4 4 -#define UREG_I5 5 -#define UREG_I6 6 -#define UREG_I7 7 -#define UREG_L0 8 -#define UREG_FP UREG_I6 -#define UREG_SP UREG_O6 +#define UREG_FP WREG_O6 +#define UREG_SP WREG_I6 =20 static inline abi_ulong get_sigframe(struct target_sigaction *sa,=20 CPUSPARCState *env, @@ -159,30 +148,12 @@ setup___siginfo(__siginfo_t *si, CPUSPARCState *env, = abi_ulong mask) __put_user(env->gregs[i], &si->si_regs.u_regs[i]); } for (i=3D0; i < 8; i++) { - __put_user(env->regwptr[UREG_I0 + i], &si->si_regs.u_regs[i+8]); + __put_user(env->regwptr[WREG_O0 + i], &si->si_regs.u_regs[i + 8]); } __put_user(mask, &si->si_mask); return err; } =20 -#if 0 -static int -setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,= */ - CPUSPARCState *env, unsigned long mask) -{ - int err =3D 0; - - __put_user(mask, &sc->sigc_mask); - __put_user(env->regwptr[UREG_SP], &sc->sigc_sp); - __put_user(env->pc, &sc->sigc_pc); - __put_user(env->npc, &sc->sigc_npc); - __put_user(env->psr, &sc->sigc_psr); - __put_user(env->gregs[1], &sc->sigc_g1); - __put_user(env->regwptr[UREG_O0], &sc->sigc_o0); - - return err; -} -#endif #define NF_ALIGNEDSZ (((sizeof(struct target_signal_frame) + 7) & (~7))) =20 void setup_frame(int sig, struct target_sigaction *ka, @@ -221,20 +192,20 @@ void setup_frame(int sig, struct target_sigaction *ka, } =20 for (i =3D 0; i < 8; i++) { - __put_user(env->regwptr[i + UREG_L0], &sf->ss.locals[i]); + __put_user(env->regwptr[i + WREG_L0], &sf->ss.locals[i]); } for (i =3D 0; i < 8; i++) { - __put_user(env->regwptr[i + UREG_I0], &sf->ss.ins[i]); + __put_user(env->regwptr[i + WREG_O0], &sf->ss.ins[i]); } if (err) goto sigsegv; =20 /* 3. signal handler back-trampoline and parameters */ env->regwptr[UREG_FP] =3D sf_addr; - env->regwptr[UREG_I0] =3D sig; - env->regwptr[UREG_I1] =3D sf_addr + + env->regwptr[WREG_O0] =3D sig; + env->regwptr[WREG_O1] =3D sf_addr + offsetof(struct target_signal_frame, info); - env->regwptr[UREG_I2] =3D sf_addr + + env->regwptr[WREG_O2] =3D sf_addr + offsetof(struct target_signal_frame, info); =20 /* 4. signal handler */ @@ -242,11 +213,11 @@ void setup_frame(int sig, struct target_sigaction *ka, env->npc =3D (env->pc + 4); /* 5. return to kernel instructions */ if (ka->ka_restorer) { - env->regwptr[UREG_I7] =3D ka->ka_restorer; + env->regwptr[WREG_O7] =3D ka->ka_restorer; } else { uint32_t val32; =20 - env->regwptr[UREG_I7] =3D sf_addr + + env->regwptr[WREG_O7] =3D sf_addr + offsetof(struct target_signal_frame, insns) - 2 * 4; =20 /* mov __NR_sigreturn, %g1 */ @@ -316,7 +287,7 @@ long do_sigreturn(CPUSPARCState *env) __get_user(env->gregs[i], &sf->info.si_regs.u_regs[i]); } for (i=3D0; i < 8; i++) { - __get_user(env->regwptr[i + UREG_I0], &sf->info.si_regs.u_regs[i+8= ]); + __get_user(env->regwptr[i + WREG_O0], &sf->info.si_regs.u_regs[i += 8]); } =20 /* FIXME: implement FPU save/restore: @@ -433,7 +404,7 @@ void sparc64_set_context(CPUSPARCState *env) abi_ulong fp, i7, w_addr; unsigned int i; =20 - ucp_addr =3D env->regwptr[UREG_I0]; + ucp_addr =3D env->regwptr[WREG_O0]; if (!lock_user_struct(VERIFY_READ, ucp, ucp_addr, 1)) { goto do_sigsegv; } @@ -443,7 +414,7 @@ void sparc64_set_context(CPUSPARCState *env) if ((pc | npc) & 3) { goto do_sigsegv; } - if (env->regwptr[UREG_I1]) { + if (env->regwptr[WREG_O1]) { target_sigset_t target_set; sigset_t set; =20 @@ -474,19 +445,19 @@ void sparc64_set_context(CPUSPARCState *env) __get_user(env->gregs[5], (&(*grp)[SPARC_MC_G5])); __get_user(env->gregs[6], (&(*grp)[SPARC_MC_G6])); __get_user(env->gregs[7], (&(*grp)[SPARC_MC_G7])); - __get_user(env->regwptr[UREG_I0], (&(*grp)[SPARC_MC_O0])); - __get_user(env->regwptr[UREG_I1], (&(*grp)[SPARC_MC_O1])); - __get_user(env->regwptr[UREG_I2], (&(*grp)[SPARC_MC_O2])); - __get_user(env->regwptr[UREG_I3], (&(*grp)[SPARC_MC_O3])); - __get_user(env->regwptr[UREG_I4], (&(*grp)[SPARC_MC_O4])); - __get_user(env->regwptr[UREG_I5], (&(*grp)[SPARC_MC_O5])); - __get_user(env->regwptr[UREG_I6], (&(*grp)[SPARC_MC_O6])); - __get_user(env->regwptr[UREG_I7], (&(*grp)[SPARC_MC_O7])); + __get_user(env->regwptr[WREG_O0], (&(*grp)[SPARC_MC_O0])); + __get_user(env->regwptr[WREG_O1], (&(*grp)[SPARC_MC_O1])); + __get_user(env->regwptr[WREG_O2], (&(*grp)[SPARC_MC_O2])); + __get_user(env->regwptr[WREG_O3], (&(*grp)[SPARC_MC_O3])); + __get_user(env->regwptr[WREG_O4], (&(*grp)[SPARC_MC_O4])); + __get_user(env->regwptr[WREG_O5], (&(*grp)[SPARC_MC_O5])); + __get_user(env->regwptr[WREG_O6], (&(*grp)[SPARC_MC_O6])); + __get_user(env->regwptr[WREG_O7], (&(*grp)[SPARC_MC_O7])); =20 __get_user(fp, &(ucp->tuc_mcontext.mc_fp)); __get_user(i7, &(ucp->tuc_mcontext.mc_i7)); =20 - w_addr =3D TARGET_STACK_BIAS+env->regwptr[UREG_I6]; + w_addr =3D TARGET_STACK_BIAS + env->regwptr[WREG_O6]; if (put_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]), abi_ulong) !=3D 0) { goto do_sigsegv; @@ -534,7 +505,7 @@ void sparc64_get_context(CPUSPARCState *env) target_sigset_t target_set; sigset_t set; =20 - ucp_addr =3D env->regwptr[UREG_I0]; + ucp_addr =3D env->regwptr[WREG_O0]; if (!lock_user_struct(VERIFY_WRITE, ucp, ucp_addr, 0)) { goto do_sigsegv; } @@ -580,16 +551,16 @@ void sparc64_get_context(CPUSPARCState *env) __put_user(env->gregs[5], &((*grp)[SPARC_MC_G5])); __put_user(env->gregs[6], &((*grp)[SPARC_MC_G6])); __put_user(env->gregs[7], &((*grp)[SPARC_MC_G7])); - __put_user(env->regwptr[UREG_I0], &((*grp)[SPARC_MC_O0])); - __put_user(env->regwptr[UREG_I1], &((*grp)[SPARC_MC_O1])); - __put_user(env->regwptr[UREG_I2], &((*grp)[SPARC_MC_O2])); - __put_user(env->regwptr[UREG_I3], &((*grp)[SPARC_MC_O3])); - __put_user(env->regwptr[UREG_I4], &((*grp)[SPARC_MC_O4])); - __put_user(env->regwptr[UREG_I5], &((*grp)[SPARC_MC_O5])); - __put_user(env->regwptr[UREG_I6], &((*grp)[SPARC_MC_O6])); - __put_user(env->regwptr[UREG_I7], &((*grp)[SPARC_MC_O7])); + __put_user(env->regwptr[WREG_O0], &((*grp)[SPARC_MC_O0])); + __put_user(env->regwptr[WREG_O1], &((*grp)[SPARC_MC_O1])); + __put_user(env->regwptr[WREG_O2], &((*grp)[SPARC_MC_O2])); + __put_user(env->regwptr[WREG_O3], &((*grp)[SPARC_MC_O3])); + __put_user(env->regwptr[WREG_O4], &((*grp)[SPARC_MC_O4])); + __put_user(env->regwptr[WREG_O5], &((*grp)[SPARC_MC_O5])); + __put_user(env->regwptr[WREG_O6], &((*grp)[SPARC_MC_O6])); + __put_user(env->regwptr[WREG_O7], &((*grp)[SPARC_MC_O7])); =20 - w_addr =3D TARGET_STACK_BIAS+env->regwptr[UREG_I6]; + w_addr =3D TARGET_STACK_BIAS + env->regwptr[WREG_O6]; fp =3D i7 =3D 0; if (get_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]), abi_ulong) !=3D 0) { --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040299; cv=none; d=zoho.com; s=zohoarc; b=e01hgpL3hUggkLy7jL38CrzDDAKKJT+KvJ7lTDgdHjH1p+xRlfWm4qDbhYo1zyYow8mX9kgdPNACLBVOT3HU/wyZvtyJhr/bXQky+wZkWzijM5JWRV1O3QOi26jXDr4+6Ijm5t2SZL9UHsUbwgga10/d5kd1dvRDcBrSmOMiCIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040299; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=XRFH5cdPSAgNEt1BQCmYoOshHVpFTmX+EPnlR0Bd3jE=; b=QeJe8GWmqh7p4K9Ck/L6WEfIWIgLxp0yCoBjGxxA4ZYoNJpYVrcffuTHPnjcVRzvxH6WYs7rt1hsTlVCOTiaMKIiNMoBoAqNU+WypwOrnaVi6aOp37u6yHNIpN845WW7OCDPE7E0eBsjJawcpfxUVtScYQNqSm2y9M+apRF9eyg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040299591740.0697449722543; Wed, 6 Nov 2019 03:38:19 -0800 (PST) Received: from localhost ([::1]:56410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJdh-00018z-O3 for importer@patchew.org; Wed, 06 Nov 2019 06:38:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37893) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZE-0003pP-Qt for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZD-0007Vu-O2 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:40 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:35532) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZD-0007Sh-HY for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:39 -0500 Received: by mail-wr1-x441.google.com with SMTP id p2so101342wro.2 for ; Wed, 06 Nov 2019 03:33:39 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:37 -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; bh=XRFH5cdPSAgNEt1BQCmYoOshHVpFTmX+EPnlR0Bd3jE=; b=P1J0U3fDOqGZZKMiIN+Em3ax0zOPZd2ojUNW47Za3sM5GMAZIRiq69oj4GJZ04ds25 C2OYvPF/F1Gbpu31RWlV55bgdhIMhWZJC+J95rQW8KfYkqCtL8MsyN1uzjSWFUs8MXg1 E8wnAsT/yuvxEFVoVwDTa/75iOLFRcleg2NpXnt93Z5HE1C9c+/lDre53G9lQytEVcjf atAyImxEOqXlOZXDDgSoBSSGZWIud5afUcLE+XlVm/+BABLzFObVKCsk4pOyzBSYxO8s tabugns0ZwpjGEZpu1WEWQJHNoOs63XakNfkUuJDmVWIAn2+9BprRdFdb7+6q6yZO/cG 7LSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XRFH5cdPSAgNEt1BQCmYoOshHVpFTmX+EPnlR0Bd3jE=; b=la5G3W/qc3TFARK1s5WdvnSgpqjxA8X6UXhzSj7eNNYJUMsYySr6eGu0s7yuzzsqPO 9RKMswYbbAOOtJexgVAKRE9XfybDe61x0SyR88c3dOy+syw6uM+QQclY4kJoe3IKm3+s LSLmAGTRpBHoMV7j3HeFXoqNg9glM+ZoQw+79i1kUCA/KYRC6/jzn1gGuTVHAq5KkKoz 2I8Zyo5bhvmj/UxdU1WjawGZACHoQWW5V/ICFwiWqnXbjTTFoqZim9Q9f3DnOLujh/p7 N+ceFOoikKDriTVXrF/GaNQQj/E382gqe2d/S2j7VsVK86My90XTlppj/rECbjQ4brq+ RmvQ== X-Gm-Message-State: APjAAAVwuzUFbebpoYNm44S3xmBLlafpV0UH5jLoaLQUMslw/VExjO2u 8XaDx4z+Popall2jM85yKLrGjuubJooRag== X-Google-Smtp-Source: APXvYqxGgYa82Vp6tL7KOoaOkVSdrPgbQA04iN3YmxrhCSivGL9d+Z+aIAcbuTIV1KsVdTRe/loj5A== X-Received: by 2002:adf:f585:: with SMTP id f5mr2190612wro.272.1573040018179; Wed, 06 Nov 2019 03:33:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 06/12] linux-user/sparc: Use WREG_SP constant in sparc/signal.c Date: Wed, 6 Nov 2019 12:33:12 +0100 Message-Id: <20191106113318.10226-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" s/UREG_FP/WREG_SP/g This is non-obvious because the UREG_FP constant is fact wrong. However, the previous search-and-replace patch made it clear that UREG_FP expands to WREG_O6, and we can see from the enumeration in target/sparc/cpu.h that WREG_O6 is in fact WREG_SP, the stack pointer. The UREG_SP define is unused; remove it. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191025113921.9412-7-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index aac37da239..e05693f204 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -104,9 +104,6 @@ struct target_rt_signal_frame { qemu_siginfo_fpu_t fpu_state; }; =20 -#define UREG_FP WREG_O6 -#define UREG_SP WREG_I6 - static inline abi_ulong get_sigframe(struct target_sigaction *sa,=20 CPUSPARCState *env, unsigned long framesize) @@ -201,7 +198,7 @@ void setup_frame(int sig, struct target_sigaction *ka, goto sigsegv; =20 /* 3. signal handler back-trampoline and parameters */ - env->regwptr[UREG_FP] =3D sf_addr; + env->regwptr[WREG_SP] =3D sf_addr; env->regwptr[WREG_O0] =3D sig; env->regwptr[WREG_O1] =3D sf_addr + offsetof(struct target_signal_frame, info); @@ -255,7 +252,7 @@ long do_sigreturn(CPUSPARCState *env) sigset_t host_set; int i; =20 - sf_addr =3D env->regwptr[UREG_FP]; + sf_addr =3D env->regwptr[WREG_SP]; trace_user_do_sigreturn(env, sf_addr); if (!lock_user_struct(VERIFY_READ, sf, sf_addr, 1)) { goto segv_and_exit; --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040648; cv=none; d=zoho.com; s=zohoarc; b=E0boR6yf0FpXL3os688YYCAYZ6FR4viltC3u0eP92PIogytyXk9wZJ9PgwdKqRqytqdnjx+p0DuEI1ehX6R60fzzGYL75LxD98f2mMt3gc7sH07jfCB8EJsz6OE91QLN3bHbShWAjQWXQP3pmXYwOr8efMEEuP9iu8WSLkZwRVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040648; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=IVSeU2YymNYXOyhPXUxygRNjnXLwpMxT3U8QoAvH9WU=; b=bUEwxrfSK8mMhUYR4FHOX9ULezr7grgwBQ+G/ucMiAPt4ksAXFa7qmsGFZ51cbUJIPRAKdakEyyfMQcMp20b4CRepengxI2Mgml4TKJsnjuiVgC1184IhuuxVQsoCnqm3TCb68gAgglruIXiaX2u7F4oJnmJeyAWO7DOuOXvF+M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040648343854.1595016132542; Wed, 6 Nov 2019 03:44:08 -0800 (PST) Received: from localhost ([::1]:56504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJjL-0007h0-0f for importer@patchew.org; Wed, 06 Nov 2019 06:44:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37908) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZF-0003r6-W5 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZE-0007XO-T4 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:41 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZE-0007Wz-LS for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:40 -0500 Received: by mail-wr1-x441.google.com with SMTP id a15so25308597wrf.9 for ; Wed, 06 Nov 2019 03:33:40 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:39 -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; bh=IVSeU2YymNYXOyhPXUxygRNjnXLwpMxT3U8QoAvH9WU=; b=zuhqa6i1JcfxMozKdU9Vz39Ff8WWwcfwM7HuPl8NWOxwyGxFIMX2v07aLdiOKDrYK6 Bw1eMEzcEcsrl7CudvQG0CQMDwgl8xpj3Idshc6cnO9EJ0IuXk40kQEy92OtVKYMR5fD iZBCuh65FE6NSwkkB0MpYTRvjRUZlMpcKxA1HE7XCnLcSKlZJoHEvhgQXKsWGvFaWzvM +R8HLqs7xuFRMWX4gd8aV2I9kiL+c51F6Khf8OWcLQxOeB7kKHBBN8U3o+Habzq5VYVg Alui0h2qyAHrrTBqz7f5nPWa3Rr4xoK+ebtrBt4RNXZIrJ4bMz3WTDrc+5TAI6GRurQw xFIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IVSeU2YymNYXOyhPXUxygRNjnXLwpMxT3U8QoAvH9WU=; b=AubpekPJWs3NB7BhAPAkGS6IFbc/If/ct+yvExDYlDIwaG3rVKfU6HVutLNKh2kAbA GkS0COgto3xyngCL34mPaKyInBT4k2Iaad7UCMwcDJgAHDZb1CpQg6Ph9wxX1roKO4MI oRLMXzNmG72ocCb2nhaybckSa/UKv11f2V+w5qj/10Ct5BNIT3lfeOw35TBaVSxkmT7t 94/gi0JIaaAMvQZDwxu75utkfxu+NK+PHMicyiY0oSi5QoDLOOx4vhVQ/i93fE5ZTRhp R08/THUifEh622RYkhPDBm40o5PzWsfqUwZXUMcRxojgJ23Rh+BtczriFoI2zkneG3Dq ExxA== X-Gm-Message-State: APjAAAW5fRE0TpqAUKPmyfPQuulh/XLWxTTZWgdcxNam1m0b/sEqpXDE KamOvlQzhStnqWIshfAg+1PZW6Wk3IPInw== X-Google-Smtp-Source: APXvYqwIwmJLNCDSkOJrMOIM/fZTbs32qRHkyvdAm5nBOBHpwlGREKBoMJiQ8J/GfDbVOTDi6udZtQ== X-Received: by 2002:a5d:55ce:: with SMTP id i14mr2146865wrw.169.1573040019516; Wed, 06 Nov 2019 03:33:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 07/12] linux-user/sparc: Fix WREG usage in setup_frame Date: Wed, 6 Nov 2019 12:33:13 +0100 Message-Id: <20191106113318.10226-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use WREG_I0 not WREG_O0 in order to properly save the "ins". The "outs" were saved separately in setup___siginfo. Signed-off-by: Richard Henderson Message-Id: <20191025113921.9412-8-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index e05693f204..238d0ba00c 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -192,7 +192,7 @@ void setup_frame(int sig, struct target_sigaction *ka, __put_user(env->regwptr[i + WREG_L0], &sf->ss.locals[i]); } for (i =3D 0; i < 8; i++) { - __put_user(env->regwptr[i + WREG_O0], &sf->ss.ins[i]); + __put_user(env->regwptr[i + WREG_I0], &sf->ss.ins[i]); } if (err) goto sigsegv; --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040498; cv=none; d=zoho.com; s=zohoarc; b=T/fjlUbzh7FjP7AGzce7lqT/QU/zMq65KvM8onm2kQmWYJptbJvrU0bkw+JIs6HCw9jMU1OEqMIQBq5ukKiPtLJxuzdv65s1ql1AiERxwCfiOcKkgpG3bVQg0IHn2h+b6jqvAhs+O+MuXzJ8MH1hvUQaRsI4JEv22HR0VBF/e5U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040498; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=y3Wn+08sAN9VokvpvlBwbpJiSQsLtcSXLgAihEQXJkk=; b=Kr6h/2eTOXOqS35lrHvKaIvde/HdbIxJcQVGI/duQhx8wZuR1d+KYZJjFlzMYwJBx9ZddAgHx8BDfW00MPuP4k9IlJdJv2oECOap3RrSWeuU1G5suWvRfq41Vd9WcDOrWeYAF8lUCT6bG4uocic/QjVMCWa2/4e4EaR5TVvr8EM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040498865767.5582665519204; Wed, 6 Nov 2019 03:41:38 -0800 (PST) Received: from localhost ([::1]:56454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJgs-0004vX-Lv for importer@patchew.org; Wed, 06 Nov 2019 06:41:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37922) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZH-0003vL-9G for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZG-0007Xt-5v for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:43 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:42881) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZF-0007XZ-WB for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:42 -0500 Received: by mail-wr1-x442.google.com with SMTP id a15so25308657wrf.9 for ; Wed, 06 Nov 2019 03:33:41 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:40 -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; bh=y3Wn+08sAN9VokvpvlBwbpJiSQsLtcSXLgAihEQXJkk=; b=vizkZqciyORoUPekFYkVrRLuEtCWJoBGDpDvfORmyh2xOd52JUWYURK1ffc2mBqRl+ mJiB7fNIpSoch6xjSY55tFFN7Bu4sc+gZVxt0dHkECRaqLvojqKtJwKYRwzST9EbndPM z8efbz4nfKqMYLoub1Mu0+XA+RYKsznbiUtrAPNxngrWxfcSD3a63QeWDAE8Osg/QG6W XjT72QRlXHYVvtv5cJIIhFmbG4XgzxtSJNWYo6fbFNbY1QXiUVrKU4+JxXjvHEQWBO59 nw98OPqHOp3NiEMHu8ihME3jcmuR+A74beGCwvDDDcuulXWsj9ZMnsaKqUt0uNOf4a41 pJSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y3Wn+08sAN9VokvpvlBwbpJiSQsLtcSXLgAihEQXJkk=; b=l6Aq74mZqxEhG+kiKnO+G76W9PcDA/N/STOcwwwNuiGGxOD5h+7bY0uvbCz3QnUpgG d0CoHHYuWP45uVPTaR/Ob0f00bbEKMUTPQc8oJUCBH3dyVFCeu9D6R3hzGsi/oPudLYZ i8u04E85icXycQZtP6oThDTfEWOD497u74R9jNt4ADOvZ5mviOKfhKAKUTAbiSj4zcnL 2kfx7wQs0sn+kl81bD8JbWMmivjkMOpZNivFrlRBaft4XxbKejjv0Fzji/UxWzOM45h/ KxakQ4q4LJ0+rphiFbW2OzHhufKURgvBLw+HAU7EG2MseF38ubrOXE1DVs568qH8NZGa 4bMA== X-Gm-Message-State: APjAAAXLGAyIR+NhD178cESYkJ0Yx3c7sBXAJqtp1TlkIIc5sJsMC9X9 iXnokIhqeBltTSxgfgTjFdF9pdwelS2qtQ== X-Google-Smtp-Source: APXvYqxBQpCyV1vgZemRU9LBPK2RaetAt52fHULjZ6nPY1rUOcNfxiSlgVuMNrYbD7oKqSBzrTttww== X-Received: by 2002:a5d:674d:: with SMTP id l13mr2287358wrw.170.1573040020767; Wed, 06 Nov 2019 03:33:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 08/12] linux-user/sparc64: Fix target_signal_frame Date: Wed, 6 Nov 2019 12:33:14 +0100 Message-Id: <20191106113318.10226-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instructions are always 4 bytes; use uint32_t not abi_ulong. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191025113921.9412-9-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 238d0ba00c..d796f50f66 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -87,7 +87,7 @@ struct target_signal_frame { struct sparc_stackf ss; __siginfo_t info; abi_ulong fpu_save; - abi_ulong insns[2] __attribute__ ((aligned (8))); + uint32_t insns[2] QEMU_ALIGNED(8); abi_ulong extramask[TARGET_NSIG_WORDS - 1]; abi_ulong extra_size; /* Should be 0 */ qemu_siginfo_fpu_t fpu_state; @@ -98,7 +98,7 @@ struct target_rt_signal_frame { abi_ulong regs[20]; sigset_t mask; abi_ulong fpu_save; - unsigned int insns[2]; + uint32_t insns[2]; stack_t stack; unsigned int extra_size; /* Should be 0 */ qemu_siginfo_fpu_t fpu_state; --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040500; cv=none; d=zoho.com; s=zohoarc; b=CvxSAsDGO/HL3TKUq2SHw/X9j5ovr4CvljKJqdkLO5Y6bh6obslNO77ayIXWePkjSBwcDTRbSZZMxUmyZF4Tq24RwRqXuuqZqgEUZhpwt0UPUiduCs2afMJ2dKNeN+2QOSVCa7tJFODqt3GWldhmz7LLwxwdGNRDSX6gr90sTVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040500; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gK8d2UmiWBT3h0lSEqqhxht5U+EPSU1YoDxkWG/UNhU=; b=aAWdaVbqR/MUIOIrBllYMZScQ16ln1v9FZZsOhZLeCYAykqeOPHmyFXUMhkIaqTNslcEgRDOWfBiL3LNbzhrhzfGdzl2N2vSBlGxWWtA2Teeq5ENTVjGf7AR4wR1TBRWewDjs2PpOD2fkcPGPGuZE+hJebe9dYOhYWadm2mTdvY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040499936635.9570640242657; Wed, 6 Nov 2019 03:41:39 -0800 (PST) Received: from localhost ([::1]:56450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJgs-0004u9-7L for importer@patchew.org; Wed, 06 Nov 2019 06:41:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37952) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZJ-0003yK-Gx for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZH-0007YV-HH for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:45 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36037) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZH-0007Y3-9n for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:43 -0500 Received: by mail-wr1-x441.google.com with SMTP id w18so25348794wrt.3 for ; Wed, 06 Nov 2019 03:33:43 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:41 -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=gK8d2UmiWBT3h0lSEqqhxht5U+EPSU1YoDxkWG/UNhU=; b=Q6INsJ9JMKuYTx6wz/OO2a2ABr8bk2xueM9PvhvqlxMsPClKrJNXzrg71Xp97brHWW MikOiIFy4DD+RuNF1ApfXngCgKE3oOtLPmFLZteHYegI0ZC/XsB4lCNyLCUP6AjgGapT EfydUwWZUpJUbri3FrIOMadD8yarWk7DLevFJH4t3lg3E1Ydvf9N27t+TYtGjMb0AkW4 iBLUXoh/ZVh/xZEiMi47sVS4QrWj5iNvzjHEFkfFjehyKyxrPkhidKWMti8AhqBKKDqU XFS5OAcM1ay37PotrbcH8d0rjY5EeiMZumdW53HmjiTRcgA2NoPKsf6kh9b9Pjkzo+QU 9iPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gK8d2UmiWBT3h0lSEqqhxht5U+EPSU1YoDxkWG/UNhU=; b=PhrRzMJZYq6iM8NxsX5GrgMwYCQ6YxIM3IjuV0gWoiwogGJnK6lp8QVzvVgfwcNbE9 d/54mSP5wA77f9hkp63eYRArm5zlXo547yWxn+f7AlsZSiYkEDnidDOIeDwdQoMmR8pZ 4xM+yeYid/gboROEayOOcR/E7SS1WEMJfO8ap7hLjX+iXEiX1wCjaYRRGGeDYAgE7P4J FiN/jjHX+VCMTOPfZVJ/GEUclTMmdDWJZhWW7cFOMgatQMgsbpWMZteqOyF7wqavSlSQ mqwte9ZhuZ/i2W8bbNsb/6x7VeNyucI4z9dmyPNSQ0l/W0fexvmpQ6jkhaAk5KkLhxpv wlYw== X-Gm-Message-State: APjAAAUOP4PwxOyaaezsfpqYl8zOLUWErKfjlnOj13qTlafOTdZ4S/ft M0HWsgt62GyFYxDORZ0hcCw3RB59z+znOw== X-Google-Smtp-Source: APXvYqxxhSKnsT32FVlTXxjkpYgpeWOql9Hyd3E907iBgscS2h4/djZK4yGdFp6KIiO8kGFOxc7Ajw== X-Received: by 2002:adf:f452:: with SMTP id f18mr2335958wrp.264.1573040021991; Wed, 06 Nov 2019 03:33:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 09/12] linux-user: Rename cpu_clone_regs to cpu_clone_regs_child Date: Wed, 6 Nov 2019 12:33:15 +0100 Message-Id: <20191106113318.10226-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) We will need a target-specific hook for adjusting registers in the parent during clone. To avoid confusion, rename the one we have to make it clear it affects the child. At the same time, pass in the flags from the clone syscall. We will need them for correct behaviour for Sparc. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191025113921.9412-10-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/aarch64/target_cpu.h | 3 ++- linux-user/alpha/target_cpu.h | 3 ++- linux-user/arm/target_cpu.h | 3 ++- linux-user/cris/target_cpu.h | 3 ++- linux-user/hppa/target_cpu.h | 3 ++- linux-user/i386/target_cpu.h | 3 ++- linux-user/m68k/target_cpu.h | 3 ++- linux-user/microblaze/target_cpu.h | 3 ++- linux-user/mips/target_cpu.h | 3 ++- linux-user/nios2/target_cpu.h | 3 ++- linux-user/openrisc/target_cpu.h | 4 +++- linux-user/ppc/target_cpu.h | 3 ++- linux-user/riscv/target_cpu.h | 3 ++- linux-user/s390x/target_cpu.h | 3 ++- linux-user/sh4/target_cpu.h | 3 ++- linux-user/sparc/target_cpu.h | 3 ++- linux-user/tilegx/target_cpu.h | 3 ++- linux-user/xtensa/target_cpu.h | 4 +++- linux-user/syscall.c | 4 ++-- 19 files changed, 40 insertions(+), 20 deletions(-) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cp= u.h index a021c95fa4..cd012e0dc1 100644 --- a/linux-user/aarch64/target_cpu.h +++ b/linux-user/aarch64/target_cpu.h @@ -19,7 +19,8 @@ #ifndef AARCH64_TARGET_CPU_H #define AARCH64_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->xregs[31] =3D newsp; diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index ac4d255ae7..37ba00cf41 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -19,7 +19,8 @@ #ifndef ALPHA_TARGET_CPU_H #define ALPHA_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUAlphaState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUAlphaState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->ir[IR_SP] =3D newsp; diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index 3f79356a07..6e2ba8ad4b 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -41,7 +41,8 @@ static inline unsigned long arm_max_reserved_va(CPUState = *cs) } #define MAX_RESERVED_VA arm_max_reserved_va =20 -static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->regs[13] =3D newsp; diff --git a/linux-user/cris/target_cpu.h b/linux-user/cris/target_cpu.h index 2309343979..eacc4d8d13 100644 --- a/linux-user/cris/target_cpu.h +++ b/linux-user/cris/target_cpu.h @@ -20,7 +20,8 @@ #ifndef CRIS_TARGET_CPU_H #define CRIS_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUCRISState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUCRISState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->regs[14] =3D newsp; diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index 1c539bdbd6..f250770790 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -19,7 +19,8 @@ #ifndef HPPA_TARGET_CPU_H #define HPPA_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUHPPAState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->gr[30] =3D newsp; diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h index ece04d0966..1fadbf57c3 100644 --- a/linux-user/i386/target_cpu.h +++ b/linux-user/i386/target_cpu.h @@ -20,7 +20,8 @@ #ifndef I386_TARGET_CPU_H #define I386_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUX86State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUX86State *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->regs[R_ESP] =3D newsp; diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h index bc7446fbaf..57b647bc07 100644 --- a/linux-user/m68k/target_cpu.h +++ b/linux-user/m68k/target_cpu.h @@ -21,7 +21,8 @@ #ifndef M68K_TARGET_CPU_H #define M68K_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUM68KState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUM68KState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->aregs[7] =3D newsp; diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/tar= get_cpu.h index 73e139938c..e9bc0fce65 100644 --- a/linux-user/microblaze/target_cpu.h +++ b/linux-user/microblaze/target_cpu.h @@ -19,7 +19,8 @@ #ifndef MICROBLAZE_TARGET_CPU_H #define MICROBLAZE_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUMBState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUMBState *env, target_ulong news= p, + unsigned flags) { if (newsp) { env->regs[R_SP] =3D newsp; diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index 02cf5eeff7..8601f712e0 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -19,7 +19,8 @@ #ifndef MIPS_TARGET_CPU_H #define MIPS_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUMIPSState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUMIPSState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->active_tc.gpr[29] =3D newsp; diff --git a/linux-user/nios2/target_cpu.h b/linux-user/nios2/target_cpu.h index 5596c05c9c..fe5de7a9e3 100644 --- a/linux-user/nios2/target_cpu.h +++ b/linux-user/nios2/target_cpu.h @@ -20,7 +20,8 @@ #ifndef NIOS2_TARGET_CPU_H #define NIOS2_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUNios2State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUNios2State *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->regs[R_SP] =3D newsp; diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_= cpu.h index 32ff135089..309cf3eeb7 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -20,7 +20,9 @@ #ifndef OPENRISC_TARGET_CPU_H #define OPENRISC_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong news= p) +static inline void cpu_clone_regs_child(CPUOpenRISCState *env, + target_ulong newsp, + unsigned flags) { if (newsp) { cpu_set_gpr(env, 1, newsp); diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h index c4641834e7..028b28312c 100644 --- a/linux-user/ppc/target_cpu.h +++ b/linux-user/ppc/target_cpu.h @@ -19,7 +19,8 @@ #ifndef PPC_TARGET_CPU_H #define PPC_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUPPCState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUPPCState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->gpr[1] =3D newsp; diff --git a/linux-user/riscv/target_cpu.h b/linux-user/riscv/target_cpu.h index 90f9a4171e..26dcafab1c 100644 --- a/linux-user/riscv/target_cpu.h +++ b/linux-user/riscv/target_cpu.h @@ -1,7 +1,8 @@ #ifndef RISCV_TARGET_CPU_H #define RISCV_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPURISCVState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPURISCVState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->gpr[xSP] =3D newsp; diff --git a/linux-user/s390x/target_cpu.h b/linux-user/s390x/target_cpu.h index aa181ceaee..0b19e42f75 100644 --- a/linux-user/s390x/target_cpu.h +++ b/linux-user/s390x/target_cpu.h @@ -19,7 +19,8 @@ #ifndef S390X_TARGET_CPU_H #define S390X_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUS390XState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUS390XState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->regs[15] =3D newsp; diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h index b0be9a2c1b..857af43ee3 100644 --- a/linux-user/sh4/target_cpu.h +++ b/linux-user/sh4/target_cpu.h @@ -19,7 +19,8 @@ #ifndef SH4_TARGET_CPU_H #define SH4_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUSH4State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUSH4State *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->gregs[15] =3D newsp; diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index b30fbc72c4..029b0fc547 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -20,7 +20,8 @@ #ifndef SPARC_TARGET_CPU_H #define SPARC_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUSPARCState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUSPARCState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->regwptr[22] =3D newsp; diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index d1aa5824f2..0523dc414c 100644 --- a/linux-user/tilegx/target_cpu.h +++ b/linux-user/tilegx/target_cpu.h @@ -19,7 +19,8 @@ #ifndef TILEGX_TARGET_CPU_H #define TILEGX_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUTLGState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUTLGState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->regs[TILEGX_R_SP] =3D newsp; diff --git a/linux-user/xtensa/target_cpu.h b/linux-user/xtensa/target_cpu.h index e31efe3ea0..84f67d469e 100644 --- a/linux-user/xtensa/target_cpu.h +++ b/linux-user/xtensa/target_cpu.h @@ -4,7 +4,9 @@ #ifndef XTENSA_TARGET_CPU_H #define XTENSA_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUXtensaState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUXtensaState *env, + target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[1] =3D newsp; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f6751eecb7..93749014e4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5719,7 +5719,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, /* we create a new CPU instance. */ new_env =3D cpu_copy(env); /* Init regs that differ from the parent. */ - cpu_clone_regs(new_env, newsp); + cpu_clone_regs_child(new_env, newsp, flags); new_cpu =3D env_cpu(new_env); new_cpu->opaque =3D ts; ts->bprm =3D parent_ts->bprm; @@ -5798,7 +5798,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, ret =3D fork(); if (ret =3D=3D 0) { /* Child Process. */ - cpu_clone_regs(env, newsp); + cpu_clone_regs_child(env, newsp, flags); fork_end(1); /* There is a race condition here. The parent process could theoretically read the TID in the child process before the = child --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040411; cv=none; d=zoho.com; s=zohoarc; b=nDKc2DNwy+Ftt/fXRMGfoLveAzTHPD4Fl57CYSI8aL5jmlnMAIBOkz7N9vZnCg0VY26Y3VDtXuDcUZBhE4h+PdrwdyVbTwPjx8WwdsrEMGNff/28U+5VZakmjSNgPVbSQDNM0kK1A4fvPTSWS7WJ68TXdQlBSrWsKaMgb5teavM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040411; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wugc25C0qaoSEGWNFWHf1zt/qP9CJkEKha5hGMZVoIA=; b=ZP0X9VKMwkdjbHUxp7j/7SWMKrOUQOQAZx3TPMuMhJ5q5XRyGuGorET8pjzIoTFfvCrwk4+TlueL/ktCKcFRKbTZ4+vqce1FrsrQ0mi52vApU+KTkV0menXATJgdxH3LqIuqotYC7LC+fWQsehbxRjatgHNnfeQF2uBL/ZOnPsk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040411251671.5446198085373; Wed, 6 Nov 2019 03:40:11 -0800 (PST) Received: from localhost ([::1]:56416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJfV-0002br-LV for importer@patchew.org; Wed, 06 Nov 2019 06:40:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37967) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZM-00042i-Ne for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZI-0007Z8-Mz for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:48 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:41512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZI-0007Yi-Fa for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:44 -0500 Received: by mail-wr1-x443.google.com with SMTP id p4so25302216wrm.8 for ; Wed, 06 Nov 2019 03:33:44 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:42 -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=wugc25C0qaoSEGWNFWHf1zt/qP9CJkEKha5hGMZVoIA=; b=YgGJHZVv5Xx4DzIBMm/RDcG5Yd0NI4ED9025ayqOx7Z8NLF5OAWgQgwloo2iZHkcQc pKM97hHREhSeuKE7Dhh9KekciKR4BojU2i26gu1jdD3ih/xg0/RG/Dhi5kQt9K6ZxZ2e 7WuFs3nG0iEw3E9gDD0W4L4QkPy+jwJPMHbBhOpOng0WtIMzgQ4MpdIUf3R9zczvIBHi e/23m8+3Fyg7WQ8Il0S77CkAxl/Q/5r1PSXUrlgBL2pvqm1Qnjex8/7R3nsaa/zefrTY +Z+m0io4Dc7t72vUwVSIVOwUyCA2/ffl+0oK08H0W+A2DM0rC9gg481rHAoLJCg8W00m RaVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wugc25C0qaoSEGWNFWHf1zt/qP9CJkEKha5hGMZVoIA=; b=apOWhPLg8rjEHL1GDVOkDxh0Walxv479vaeeiOYMH0cNIyQxKltr3/jgZHMDEF3Oc2 /ItAfv9RdCsxifX3M7zVQhpAxSj3rIPtuUbELLjvAmb2CGLQgGJVG6LxRydX1HuaVIIB 5B85V05qm+19KvNdqRnZVHC8lWyZrkQpS9ULv6cFwx/iPYfxq13R+4502BSf8w/6zZfT UaFuZECURfSxjDmhXhT+0+ctkwRwBHY9h8uoZ8BT43oG3Kwq7s1w91dm/K8ITmwHpKDQ LPINv04ECPC1b+avePRrgyeJtxeahbiQ/SDkoxSUKq+kpjC96RDPWcU2wdl1VPNVSH0a gAEg== X-Gm-Message-State: APjAAAWinnT6T0DxxBBAxnvjluyTVRDPGqUY/QnyCzARRjW2R2wswnpZ j8/hAFV4Ok9THZinRkwN8V7k+pNIHs353w== X-Google-Smtp-Source: APXvYqwYJweh5KZXFqPmdNODjMvH8fv92x6de4F5HCHnfAHqLSMTnkLKYpWbp4lmGezB1QTffO2w7A== X-Received: by 2002:adf:f585:: with SMTP id f5mr2191064wro.272.1573040023134; Wed, 06 Nov 2019 03:33:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 10/12] linux-user: Introduce cpu_clone_regs_parent Date: Wed, 6 Nov 2019 12:33:16 +0100 Message-Id: <20191106113318.10226-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) We will need a target-specific hook for adjusting registers in the parent during clone. Add an empty inline function for each target, and invoke it from the proper places. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191025113921.9412-11-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/aarch64/target_cpu.h | 4 ++++ linux-user/alpha/target_cpu.h | 4 ++++ linux-user/arm/target_cpu.h | 4 ++++ linux-user/cris/target_cpu.h | 4 ++++ linux-user/hppa/target_cpu.h | 4 ++++ linux-user/i386/target_cpu.h | 4 ++++ linux-user/m68k/target_cpu.h | 4 ++++ linux-user/microblaze/target_cpu.h | 4 ++++ linux-user/mips/target_cpu.h | 4 ++++ linux-user/nios2/target_cpu.h | 4 ++++ linux-user/openrisc/target_cpu.h | 4 ++++ linux-user/ppc/target_cpu.h | 4 ++++ linux-user/riscv/target_cpu.h | 4 ++++ linux-user/s390x/target_cpu.h | 4 ++++ linux-user/sh4/target_cpu.h | 4 ++++ linux-user/sparc/target_cpu.h | 4 ++++ linux-user/tilegx/target_cpu.h | 4 ++++ linux-user/xtensa/target_cpu.h | 4 ++++ linux-user/syscall.c | 2 ++ 19 files changed, 74 insertions(+) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cp= u.h index cd012e0dc1..6cc02e7dcd 100644 --- a/linux-user/aarch64/target_cpu.h +++ b/linux-user/aarch64/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUARMState *env= , target_ulong newsp, env->xregs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) { /* Note that AArch64 Linux keeps the TLS pointer in TPIDR; this is diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index 37ba00cf41..dd25e18f47 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUAlphaState *e= nv, target_ulong newsp, env->ir[IR_A3] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls) { env->unique =3D newtls; diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index 6e2ba8ad4b..2747211b24 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -50,6 +50,10 @@ static inline void cpu_clone_regs_child(CPUARMState *env= , target_ulong newsp, env->regs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) { if (access_secure_reg(env)) { diff --git a/linux-user/cris/target_cpu.h b/linux-user/cris/target_cpu.h index eacc4d8d13..74ead55c81 100644 --- a/linux-user/cris/target_cpu.h +++ b/linux-user/cris/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUCRISState *en= v, target_ulong newsp, env->regs[10] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUCRISState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls) { env->pregs[PR_PID] =3D (env->pregs[PR_PID] & 0xff) | newtls; diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index f250770790..71654b3cd4 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -32,6 +32,10 @@ static inline void cpu_clone_regs_child(CPUHPPAState *en= v, target_ulong newsp, env->iaoq_b =3D env->gr[31] + 4; } =20 +static inline void cpu_clone_regs_parent(CPUHPPAState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls) { env->cr[27] =3D newtls; diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h index 1fadbf57c3..0b44530854 100644 --- a/linux-user/i386/target_cpu.h +++ b/linux-user/i386/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUX86State *env= , target_ulong newsp, env->regs[R_EAX] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUX86State *env, unsigned flags) +{ +} + #if defined(TARGET_ABI32) abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr); =20 diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h index 57b647bc07..c3f288dfe8 100644 --- a/linux-user/m68k/target_cpu.h +++ b/linux-user/m68k/target_cpu.h @@ -30,6 +30,10 @@ static inline void cpu_clone_regs_child(CPUM68KState *en= v, target_ulong newsp, env->dregs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUM68KState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls) { CPUState *cs =3D env_cpu(env); diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/tar= get_cpu.h index e9bc0fce65..ce7b22ece7 100644 --- a/linux-user/microblaze/target_cpu.h +++ b/linux-user/microblaze/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUMBState *env,= target_ulong newsp, env->regs[3] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUMBState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUMBState *env, target_ulong newtls) { env->regs[21] =3D newtls; diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index 8601f712e0..758ae4d933 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUMIPSState *en= v, target_ulong newsp, env->active_tc.gpr[2] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUMIPSState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls) { env->active_tc.CP0_UserLocal =3D newtls; diff --git a/linux-user/nios2/target_cpu.h b/linux-user/nios2/target_cpu.h index fe5de7a9e3..50f0381067 100644 --- a/linux-user/nios2/target_cpu.h +++ b/linux-user/nios2/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUNios2State *e= nv, target_ulong newsp, env->regs[R_RET0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUNios2State *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUNios2State *env, target_ulong newtls) { /* diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_= cpu.h index 309cf3eeb7..74370d67c4 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -30,6 +30,10 @@ static inline void cpu_clone_regs_child(CPUOpenRISCState= *env, cpu_set_gpr(env, 11, 0); } =20 +static inline void cpu_clone_regs_parent(CPUOpenRISCState *env, unsigned f= lags) +{ +} + static inline void cpu_set_tls(CPUOpenRISCState *env, target_ulong newtls) { cpu_set_gpr(env, 10, newtls); diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h index 028b28312c..76b67d2882 100644 --- a/linux-user/ppc/target_cpu.h +++ b/linux-user/ppc/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUPPCState *env= , target_ulong newsp, env->gpr[3] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUPPCState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUPPCState *env, target_ulong newtls) { #if defined(TARGET_PPC64) diff --git a/linux-user/riscv/target_cpu.h b/linux-user/riscv/target_cpu.h index 26dcafab1c..9c642367a3 100644 --- a/linux-user/riscv/target_cpu.h +++ b/linux-user/riscv/target_cpu.h @@ -11,6 +11,10 @@ static inline void cpu_clone_regs_child(CPURISCVState *e= nv, target_ulong newsp, env->gpr[xA0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPURISCVState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPURISCVState *env, target_ulong newtls) { env->gpr[xTP] =3D newtls; diff --git a/linux-user/s390x/target_cpu.h b/linux-user/s390x/target_cpu.h index 0b19e42f75..7cd71e2dba 100644 --- a/linux-user/s390x/target_cpu.h +++ b/linux-user/s390x/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUS390XState *e= nv, target_ulong newsp, env->regs[2] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUS390XState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUS390XState *env, target_ulong newtls) { env->aregs[0] =3D newtls >> 32; diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h index 857af43ee3..5114f19424 100644 --- a/linux-user/sh4/target_cpu.h +++ b/linux-user/sh4/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUSH4State *env= , target_ulong newsp, env->gregs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUSH4State *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls) { env->gbr =3D newtls; diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 029b0fc547..8ff706adce 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -37,6 +37,10 @@ static inline void cpu_clone_regs_child(CPUSPARCState *e= nv, target_ulong newsp, #endif } =20 +static inline void cpu_clone_regs_parent(CPUSPARCState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) { env->gregs[7] =3D newtls; diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index 0523dc414c..316b7a639c 100644 --- a/linux-user/tilegx/target_cpu.h +++ b/linux-user/tilegx/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUTLGState *env= , target_ulong newsp, env->regs[TILEGX_R_RE] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUTLGState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUTLGState *env, target_ulong newtls) { env->regs[TILEGX_R_TP] =3D newtls; diff --git a/linux-user/xtensa/target_cpu.h b/linux-user/xtensa/target_cpu.h index 84f67d469e..0c77bafd66 100644 --- a/linux-user/xtensa/target_cpu.h +++ b/linux-user/xtensa/target_cpu.h @@ -16,6 +16,10 @@ static inline void cpu_clone_regs_child(CPUXtensaState *= env, env->regs[2] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUXtensaState *env, unsigned fla= gs) +{ +} + static inline void cpu_set_tls(CPUXtensaState *env, target_ulong newtls) { env->uregs[THREADPTR] =3D newtls; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 93749014e4..96cf9deb3d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5720,6 +5720,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, new_env =3D cpu_copy(env); /* Init regs that differ from the parent. */ cpu_clone_regs_child(new_env, newsp, flags); + cpu_clone_regs_parent(env, flags); new_cpu =3D env_cpu(new_env); new_cpu->opaque =3D ts; ts->bprm =3D parent_ts->bprm; @@ -5816,6 +5817,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, if (flags & CLONE_CHILD_CLEARTID) ts->child_tidptr =3D child_tidptr; } else { + cpu_clone_regs_parent(env, flags); fork_end(0); } } --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040625; cv=none; d=zoho.com; s=zohoarc; b=BUfke7pZqgTYE13d6+9y3tyHZUlQvQtXQfADyrpuW05mJvtJ62Y5O1w2BmaekFLeZTY5L/G1mx4ThkL50ydS5zA2Ksc6rhBYzHVwXBdbRomC83KgKVKL2aqwayPAAf2WmoN+da5VR6vURhg3bFgYiAbbxvnj7D/43qH222vXzZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040625; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=sbKKp8L4DTtLJPEKrjfc6knlBHmQBSkQGz/jGwEjATY=; b=QtSf304OfmeclarkEaow+/DvKrmqiOEzt1kUn24HVFNYn3ngdwSRtZi7LujUBRVl0qpLTT3yoyxydMJ3fYHhMNeDk5VsAfGE5isxyHCDEA7veOxCIjoBaYxOHcYYzeatxtZpqK3TvMQTAMQYpDNUG0/cIezwQoMNa59EgQwFfMI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040625460267.2499766863101; Wed, 6 Nov 2019 03:43:45 -0800 (PST) Received: from localhost ([::1]:56500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJiy-0007XG-Cx for importer@patchew.org; Wed, 06 Nov 2019 06:43:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37999) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZP-000457-3f for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZM-0007aR-Oo for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:50 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:36040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZM-0007Zf-HW for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:48 -0500 Received: by mail-wr1-x443.google.com with SMTP id w18so25349001wrt.3 for ; Wed, 06 Nov 2019 03:33:48 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:43 -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; bh=sbKKp8L4DTtLJPEKrjfc6knlBHmQBSkQGz/jGwEjATY=; b=WABOzADHchxJEGyitvP+N0YSkKanAt2OEt4DwBQGeyv9E/strudqoGBJhTS+fAzjOD dlAC6BDK1tUavFyNN208UYl0bcIjwByA6Buh6/W0wcl7fZ9HMbJ4YfSYfYfoVPnGsUvT NzzbGG62RLSAboY4rKiYTQU/eq5PlrvACmr1uVf14/OwVvAAx91X9LrqOmdpDdO0+21q Mwh+Px8GsLgrajH0PLlD6DhERIfBhJPkZa1QFnyvXUgmJzczh2f8F636PZ6qkAVPf5zg akF+Z7lL5P6cDiVeb7Nn6EtfXBbJ2uARrvGXeyH4/R2dy6xEYFVARhjALf+6xLr5CHNB Y6Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sbKKp8L4DTtLJPEKrjfc6knlBHmQBSkQGz/jGwEjATY=; b=D8J0E6+UPIGPv+UKqy95q5J0CcNtONN0K0NXlcSRsT7FkQuDaPEKON5T9fefiEEIHE 63pZKTgHsvcnTQGTj8IOy78mYWmvt3ycA/pjExFFB6ULFbIV1uurklcHrK+I3dtu3iX+ e5c+cUd9C2l8pAHdXA5CJ+NfX9H3Icu3RaBmFQRF6azHdnUknpGz5giU3J2JYlcZAP8M K3MtaY3w/ICosnzOf3PtLUJXSoNrDYHXYDPqfH7jSVxTU3M15Udyq/UAZ7bE6d9GQWEi 2ZPyxQ95q0YOFT+g3tDfDlCSIPOyhKbxZXIKaqWMX6olnXpilknWOnz+tRhhAXFGWat7 U7uQ== X-Gm-Message-State: APjAAAXGBCyWRNsecGSXKgt9ANZ4wYe77bX2hpoaSlou904FOA0XaCB1 Sc1dK3uhcrBiENvdknKhg4pyM3xePeKW5Q== X-Google-Smtp-Source: APXvYqwVtb7LNUCQPiUoL6hx3Ob4C5Y/z11N9exjvy5mWuU0V3SSWU/RJk6WMagveTWRjWjmpfArHw== X-Received: by 2002:a5d:5686:: with SMTP id f6mr2239807wrv.231.1573040024513; Wed, 06 Nov 2019 03:33:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 11/12] linux-user/sparc: Fix cpu_clone_regs_* Date: Wed, 6 Nov 2019 12:33:17 +0100 Message-Id: <20191106113318.10226-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We failed to set the secondary return value in %o1 we failed to advance the PC past the syscall, we failed to adjust regwptr into the new structure, we stored the stack pointer into the wrong register. Signed-off-by: Richard Henderson Message-Id: <20191025113921.9412-12-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/target_cpu.h | 47 ++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 8ff706adce..14b2158969 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -23,22 +23,51 @@ static inline void cpu_clone_regs_child(CPUSPARCState *env, target_ulong n= ewsp, unsigned flags) { - if (newsp) { - env->regwptr[22] =3D newsp; - } - /* syscall return for clone child: 0, and clear CF since - * this counts as a success return value. + /* + * After cpu_copy, env->regwptr is pointing into the old env. + * Update the new cpu to use its own register window. */ - env->regwptr[0] =3D 0; -#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) - env->xcc &=3D ~PSR_CARRY; + env->regwptr =3D env->regbase + (env->cwp * 16); + + if (newsp) { + /* When changing stacks, do it with clean register windows. */ +#ifdef TARGET_SPARC64 + env->cansave =3D env->nwindows - 2; + env->cleanwin =3D env->nwindows - 2; + env->canrestore =3D 0; #else - env->psr &=3D ~PSR_CARRY; + env->wim =3D 1 << env->cwp; #endif + /* ??? The kernel appears to copy one stack frame to the new stack= . */ + /* ??? The kernel force aligns the new stack. */ + env->regwptr[WREG_SP] =3D newsp; + } + + if (flags & CLONE_VM) { + /* + * Syscall return for clone child: %o0 =3D 0 and clear CF since th= is + * counts as a success return value. Advance the PC past the sysc= all. + * For fork child, all of this happens in cpu_loop, and we must not + * do the pc advance twice. + */ + env->regwptr[WREG_O0] =3D 0; +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) + env->xcc &=3D ~PSR_CARRY; +#else + env->psr &=3D ~PSR_CARRY; +#endif + env->pc =3D env->npc; + env->npc =3D env->npc + 4; + } + + /* Set the second return value for the child: %o1 =3D 1. */ + env->regwptr[WREG_O1] =3D 1; } =20 static inline void cpu_clone_regs_parent(CPUSPARCState *env, unsigned flag= s) { + /* Set the second return value for the parent: %o1 =3D 0. */ + env->regwptr[WREG_O1] =3D 0; } =20 static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) --=20 2.17.1 From nobody Wed Apr 24 04:06:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1573040799; cv=none; d=zoho.com; s=zohoarc; b=d+cJcM2Xeyue/ybVZhdh9QR+QlQ7/xujS9zbaZ4n42oAQeYWZ/FDBhTFB++TSylQEsUPSI7ikgzmaDnr+K8M9PM7lckXRDoB/qLcTWMGhudaWJL1e1hp6odBAPJoJVkIbp4Re5yn27Rx+T6bLzH0vT9DIhT/FvdNm2do2GPg1nQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573040799; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=YkY1QSHXx8tcEh42Bbj6ykJYD8SvmEqcbVRa0x3ucZs=; b=XuJB27MwTPrE+KcUyDzD6C8KBoJYygHITc/QJD+XzU6MSjWWFslzWH3aNaUBAoQW++F0kuxiyqxCIkvz3QC7EobYNaGoXkO8d6o8/T3KtkshOTruj1E8BGPlo9/8hYMvBOfDHJEnduRC09cEcbJiODpthiWR0tF3won1m/cLQAI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573040799178566.3384895846841; Wed, 6 Nov 2019 03:46:39 -0800 (PST) Received: from localhost ([::1]:56544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJll-0002PY-IZ for importer@patchew.org; Wed, 06 Nov 2019 06:46:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSJZP-000458-31 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSJZM-0007aY-Pj for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:50 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSJZM-0007Zi-JP for qemu-devel@nongnu.org; Wed, 06 Nov 2019 06:33:48 -0500 Received: by mail-wr1-x441.google.com with SMTP id j15so4669808wrw.5 for ; Wed, 06 Nov 2019 03:33:48 -0800 (PST) Received: from localhost.localdomain (31.red-176-87-122.dynamicip.rima-tde.net. [176.87.122.31]) by smtp.gmail.com with ESMTPSA id q124sm1776907wme.13.2019.11.06.03.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 03:33:45 -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; bh=YkY1QSHXx8tcEh42Bbj6ykJYD8SvmEqcbVRa0x3ucZs=; b=RRii2qO01P4d996eFNKftljSnF0hFDrKtvwW8xabNlr1GvNP1cUEVVoUP1f39hQbHx QRV+o4q2pkap50DTD7Mvml4q72Di7afet65XytMpvbZUl25pnbq2TtdniJq8EqXMORpJ JImXVr0SMJB7NZZa1yxunrK4jNXFIku7QIOMricijBVSjQa/5IUZim21vovapFH42W8q 9esCUGG0lVu+SVwXTAnpdyZx1wa3adk9NJ4fJu1YogIfH8NxvvNQzivkJzds1TV71+mU 1dsmgw8qzC2+lxhLCpHcer5XnMgOpft/XaZy05OggRxrQWFT14WQkGGDqgPNydemeWO6 7fFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YkY1QSHXx8tcEh42Bbj6ykJYD8SvmEqcbVRa0x3ucZs=; b=cZoAuM7A3qPhe+n/IQyYMur0bUt9S9TlceEODM0pGnOAjJkbd4FYAuBL6sxThRqFxE 95Bgdr1YdWX6NsQwimuaNraJJbAwyjoFZx28iA3vGB9bOeuDdCaGu0DHXxHhAO50amnh +ZsIdvogHuQBqp+a9rApc+X/pbUdnRYa7WwZpRcyBijrIta0j9j241RACkKqVSdij9tW dFahjXdERQY1ETA99NsnlUTx6f0i4RW7EwY2euykNA5Xw54HrHL9FMnsGzLRSRv1bkAg gQPD/kWsFDM+WtcQdNWDVuFPH8SB2MRDrPbInDFhD0A/2VeE5DCWczHBddMvjFlGmfft +RCA== X-Gm-Message-State: APjAAAVlcf73SkMMC7unWwpLPR1fgVo7VvIrZE8Xjk9jmRCO4zG88t/K WwUTQN9YHpEL8Or3FK7yoSczGQJrGkYaFA== X-Google-Smtp-Source: APXvYqzgD/s1gdInRtGdc+W1FrH6TKTKxzV7y49BmgqOXB3P33d6qDQhC/IEpRdAWPjpKrUdloa7qQ== X-Received: by 2002:adf:ee10:: with SMTP id y16mr2158630wrn.67.1573040025980; Wed, 06 Nov 2019 03:33:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 12/12] linux-user/alpha: Set r20 secondary return value Date: Wed, 6 Nov 2019 12:33:18 +0100 Message-Id: <20191106113318.10226-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106113318.10226-1-richard.henderson@linaro.org> References: <20191106113318.10226-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This value is not, as far as I know, used by any linux software, but it is set by the kernel and is part of the ABI. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191025113921.9412-13-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/alpha/target_cpu.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index dd25e18f47..ad408ab5cc 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -27,10 +27,19 @@ static inline void cpu_clone_regs_child(CPUAlphaState *= env, target_ulong newsp, } env->ir[IR_V0] =3D 0; env->ir[IR_A3] =3D 0; + env->ir[IR_A4] =3D 1; /* OSF/1 secondary return: child */ } =20 static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flag= s) { + /* + * OSF/1 secondary return: parent + * Note that the kernel does not do this if SETTLS, because the + * settls argument register is still live after copy_thread. + */ + if (!(flags & CLONE_SETTLS)) { + env->ir[IR_A4] =3D 0; + } } =20 static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls) --=20 2.17.1