From patchwork Fri Oct 1 15:33:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515039 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp911467jaf; Fri, 1 Oct 2021 08:37:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIjGzKXoSfOwglhdMl3181muWSoJp82upxDBPMd2Nj/eDEEekFhCN2L4TqfOsyR1qXj8sT X-Received: by 2002:a67:f294:: with SMTP id m20mr5009550vsk.58.1633102661742; Fri, 01 Oct 2021 08:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102661; cv=none; d=google.com; s=arc-20160816; b=PaIdXXpbEybKbi5VYL3I3OogeXIrCmJHJlBW7b+4Xp+tpVni6GmlUgDFTo+/GpV2Gn 9SeOfFmByV3w/zli8X4VjA1q4+88SMhWXKN+/AWELWfPflpWgmkB4uUiX+EJd8B4kKTR 49idXolvmYsrMaNNgaU+otWHw8Zz/VUuw6JOcub6mXEtsKVxKN/Rhz1sTP3JM/BHOX+d pn3YesX4Ed0o0MrTm3aBT1RbIxQzFKgrmJythKkh7ujFFtsVOSMgyp1iytahHflHTW2m 3cqS3W1cRow1dQZsIOdMW+xIEpdq+s/jMnfVJuAFJ7fslMxDLY6Mof5ZFkqw1A1D+BKw Assw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=unOqLzAPd6poy21NosqfBpvujG84W8QKJdncOwMlFts=; b=uv8sC8s7q6t8bsdaI4jf7KPErnDzAyu+Hg1oViABnjDREaMWceGDZZPGzs3ZHCRZGp /5exgMm3CBWpBJIGZOa7DOfT3e0b+xkfGnLodDbVPnFzRQuTU8oaFIo2fBaMjVNe9FaP uXsdzdwfZVv0v/WpOeV4ZPqOd1SMEPyrITnh8xH1bL29cMVeZJCGSKlnx7owJ+V8nT8J yF29S3hYA2zQPIjowvogNnEWulJBwuFMNnbYDIoPI7MsnqqjnIPNTWYEWFSUMr8cqJ2K lXEUtMqAxkkA5uetBpDv1VGBCehZ0bJgzvRHzKf4kgm7lIS2RCeGWO0Y4axGDj/ld/bY pCHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XMDSSMcT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p17si1815419vsf.92.2021.10.01.08.37.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:37:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XMDSSMcT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKbV-0002xk-6V for patch@linaro.org; Fri, 01 Oct 2021 11:37:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKXx-0006Tl-6B for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:01 -0400 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:39427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXp-0007eX-CU for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:00 -0400 Received: by mail-qk1-x735.google.com with SMTP id f130so9503421qke.6 for ; Fri, 01 Oct 2021 08:33:51 -0700 (PDT) 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=unOqLzAPd6poy21NosqfBpvujG84W8QKJdncOwMlFts=; b=XMDSSMcTds/NDUiSONIDw+OjL8I5PWKMfrVbDQN+35fiyW1d63n+5QkTPLAGnk24lV 2G0w8GQIB5meuGSFfVOzK8Jq/q8yOR5ekWgHBjHWAdhoyUbFvnUKYv+P6RyZz+wlwMh8 OarvrZe+oeKtdOJCrKFuiTiHdBGpR/4ccvGnwGGRr9KpfenpQ2rFNvFHaex23Fq+SffK kjJ8HG81scG3QplEWgQUnem/QRBvahuuj+qFC5NoD2qkjne+mpVG78lgiOitkoac1+TX 5n04tWhDDxMSfcpEqJX16/C4Gup+d7N79ubjiQmBeaPciG1DdT5gxX1sMXVPrcqJ8+w/ +xkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=unOqLzAPd6poy21NosqfBpvujG84W8QKJdncOwMlFts=; b=qbFcJOQq0D+kUmfwXKbxhOuCxDWw/NzJ+oO+0nujIS06gFHs309TL7CG4PMVXWAqKK 33/0ctNed0emqp2tWlebCYdUx8zXsMFlaEcyol9RthNjA0v7i7+JvvNhC6EPNxGgob4+ dy45yhHIMCyWb2wJV4G3hDYi5PUeMDBy0RhO+UVOOKIvAJGA5vFbbIwm9Vou9TD34R5u 9poDkDDWNYZrsw/ijsgF9JDpOsv1B6GKnCFCjSZlzYAhtSWrF2vRvUvumXHK2L/OtJuc EdF9a7N7ZyX2UC5TsIqTvhSgBOKr4xMocSCVIowuQeM71E/Pp1nsrKfRiU7s3X5BIYzs CV0g== X-Gm-Message-State: AOAM533Cv4F2u9n0oSOIuplCj+YfHON8+CwudZKWAKP0MyA2gEBtXdfD 30EXp/tkT6eNMd74HwoP2+c7hY8b3tf0rw== X-Received: by 2002:a37:9606:: with SMTP id y6mr10103269qkd.13.1633102431417; Fri, 01 Oct 2021 08:33:51 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/2] tests/docker: Remove fedora-i386-cross from DOCKER_PARTIAL_IMAGES Date: Fri, 1 Oct 2021 11:33:38 -0400 Message-Id: <20211001153347.1736014-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::735; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x735.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, Thomas Huth , crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The image was upgraded to a full image in ee381b7fe146. This makes it possible to use docker-test@image syntax with this container. Cc: Thomas Huth Cc: Alex Bennée Signed-off-by: Richard Henderson --- tests/docker/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index ff5d732889..0806c6f726 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -184,7 +184,7 @@ DOCKER_PARTIAL_IMAGES += debian-riscv64-cross DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross DOCKER_PARTIAL_IMAGES += debian-tricore-cross DOCKER_PARTIAL_IMAGES += debian-xtensa-cross -DOCKER_PARTIAL_IMAGES += fedora-i386-cross fedora-cris-cross +DOCKER_PARTIAL_IMAGES += fedora-cris-cross # Rules for building linux-user powered images # From patchwork Fri Oct 1 15:33:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515036 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp909006jaf; Fri, 1 Oct 2021 08:35:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz02WZZts0qFxxE+PBH4tlbqUoRpkIn0YZ6mI1/jzcfFpT7lHAvmcER513geF6O8lPkunVz X-Received: by 2002:a67:f5d2:: with SMTP id t18mr4779639vso.55.1633102507671; Fri, 01 Oct 2021 08:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102507; cv=none; d=google.com; s=arc-20160816; b=xUAadTlP2+f6SFwIqyGepbx0RWFqpgeSR+de2YLhhk7BLObq18AiQ3yXlstxe50o/v cVsgaPLtOoeaaYN8+NIhw0FV20tl2n8wQPey7nSuuPy7//U1XS5Y31DlhN5+eWMOcIWU 22gPTOqu1snmjE71d/+4dHFsH2DZ4Zj8zJ0Jgm+27hIPNLnlC5V/EvPM5F++rZ1aRPFf kI5enGmQN+ryA7rGVAiMiR+A85xsnawq8r0sEAM32BMYI8xosuznsWRz1N3tueusV1VO j153rTAvi4A0UgJ9abd2oqrXDYci1q9NVywtfK3twRkEDsy6Bq/UbtrT0D1Yhzlx8xo+ RW/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=77S8PHNNwp8gzL3C6UYKL3B8n68oD4JCUCVjCK3xRFU=; b=zv9mYRmMMeDtxdSvP9EKlh10ZfM2S8GjjwVDoVtI39ZkUVHUvng9Wiyp6KmnqkOdf5 W9ZS6nKn2d1sJfiEEDjwgOFnFnUxfDWHTqtLvx76ZlagHIlHMZjnqFwJri7NgjaHpFFi e9a7JVJGfMDo8deN/JJFqq/g+XSh0w90xRq3/j4D4VfAvgKHx40DgATp32ZSbj1kaHSN I6pUtifPDPW9YlF1XbRM6t6hYD7EagLWPNyVU45L3L+iAwN2pnCabJl5TAfwvelFQ0xT mEfMqCBMmKttbANlIJHBuXuMxJr6Yq5O65/OyUywBME2OWJcqDRQH0OUBOZJs7wdUN3o tPJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PxP9QKmV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f9si3851810uam.231.2021.10.01.08.35.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PxP9QKmV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKZ1-0006PG-2S for patch@linaro.org; Fri, 01 Oct 2021 11:35:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKXs-0006Ii-2P for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:33:56 -0400 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:36803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXq-0007gX-7e for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:33:55 -0400 Received: by mail-qt1-x82b.google.com with SMTP id l13so9319484qtv.3 for ; Fri, 01 Oct 2021 08:33:53 -0700 (PDT) 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=77S8PHNNwp8gzL3C6UYKL3B8n68oD4JCUCVjCK3xRFU=; b=PxP9QKmVaDWj+uaYhx0NqN3D+jNsTE1j9dODCmn//aCuUMjSyNjpJfxGLe3S9MCvkx 2lm/HfzpWTD6h0EQdeo5xtE/BQVtpTo1NXrVGaSZt2NP4y17lcCz3c7eDFqfjU8rAhtZ 2S7pd0ubDlJD/OcuU0cWAJoqhSc1AIlkaVKHzEvBDPPoJGVNgv7Tmq8waW2eFIjGZK62 2KmOh2rJMv8itqHW3A0nMNzcdTqz7MdSGs9WCdqo45FzFLCEHSU8A0LQrW0cD3Cep+Jn o+jvlRHJM3bYBuSR/sBe8xvnlOwoQRyXepzgJDL7ILJjV75Fpio+N+Ms49a65/pvxqaQ F95w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=77S8PHNNwp8gzL3C6UYKL3B8n68oD4JCUCVjCK3xRFU=; b=B8TURckuq14xEJYwV6ssoN84V09krsAF7hHpijW8hCu74wqgwRmMPQ5MpKEenAL1+v pCddS06oSZwHG+6ApuNwzLVaDtc9ozotsCnac0iKPSl8ZGK+DFE7o9eczmskmwZ3Kelz WzA2+xv8B4KzO9qHWlomSBilI3NJ6WlT/7A7bNpZu+ioAo+EdrU2tR4UGeDocR9Rq8yO pqz+Bwk7rjBfBLls9qKWPNUuO01MKwWyQw02uFj3qm3+RVdaBOLcGPteyQc/qrn542m7 bsNOgfKQN+IQuYgpnjwPwxoUXBlZE8YX1B+zQAT/EwuRYc2bv0a5sINslVhG9xM4dcmS j2nA== X-Gm-Message-State: AOAM533t7t9cl381d5OqYM7aEMxEwcpXkGr0/+dXsIz35sHEJs7X6HWo wCVSWDE84HV929idql1jBeEoKTEQFb/DCw== X-Received: by 2002:ac8:7769:: with SMTP id h9mr13916374qtu.156.1633102433287; Fri, 01 Oct 2021 08:33:53 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/2] tests/docker: Fix fedora-i386-cross Date: Fri, 1 Oct 2021 11:33:40 -0400 Message-Id: <20211001153347.1736014-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x82b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , crwulff@gmail.com, laurent@vivier.eu, "Richard W . M . Jones" , Paolo Bonzini , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" By using PKG_CONFIG_PATH instead of PKG_CONFIG_LIBDIR, we were still including the 64-bit packages. Install pcre-devel.i686 to fill a missing glib2 dependency. By using --extra-cflags instead of --cpu, we incorrectly use the wrong probing during meson. Cc: Alex Bennée Cc: Paolo Bonzini Cc: Daniel P. Berrangé Cc: Richard W.M. Jones Signed-off-by: Richard Henderson --- tests/docker/dockerfiles/fedora-i386-cross.docker | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/tests/docker/dockerfiles/fedora-i386-cross.docker b/tests/docker/dockerfiles/fedora-i386-cross.docker index dbb8195eb1..820740d5be 100644 --- a/tests/docker/dockerfiles/fedora-i386-cross.docker +++ b/tests/docker/dockerfiles/fedora-i386-cross.docker @@ -17,12 +17,13 @@ ENV PACKAGES \ glibc-static.i686 \ gnutls-devel.i686 \ nettle-devel.i686 \ + pcre-devel.i686 \ perl-Test-Harness \ pixman-devel.i686 \ zlib-devel.i686 -ENV QEMU_CONFIGURE_OPTS --extra-cflags=-m32 --disable-vhost-user -ENV PKG_CONFIG_PATH /usr/lib/pkgconfig +ENV QEMU_CONFIGURE_OPTS --cpu=i386 --disable-vhost-user +ENV PKG_CONFIG_LIBDIR /usr/lib/pkgconfig RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt From patchwork Fri Oct 1 15:33:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515037 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp909053jaf; Fri, 1 Oct 2021 08:35:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBD5iEklUGGPnk77cWlXPYIpf/ylVHURBhXK5xWNJAWI+3XxVaS7GER0T8frKbtTSeQo/O X-Received: by 2002:a05:620a:6a3:: with SMTP id i3mr10139760qkh.483.1633102510522; Fri, 01 Oct 2021 08:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102510; cv=none; d=google.com; s=arc-20160816; b=0rPI+DKgjdLrNroGm+LgZ22zxBC0STEoZA5pAIhxeyRO5tlvWuXP7Scnx10tyFynm2 SnjMHn4QJk4DSdVPDfu/iK36S7t6I0KK1ZmBlq9Oqh8sNeNkXumvyrTqPTyLAyp3H5MV mL65yr3VsHmO5DOh8SGT62cmVAjF7pO+j6MC+IilvwkuZ5UaxYs/GvFRu7k/JEFj0vkk dD2a+7EcDX2V6gDyM12tuZQMcFLm68jMNL9HNa7YmeA3VbLDeyZAfZ2XaYK1dA228uRL OthfhuelvrzbjDk50p+BrwLv8T1Qi/vsL1MHZbzeRpI35vgDsoxmsfJjEoxPExW55UvL L3Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rbJQ1EEbZk0qe1nOE3Vk16NPZokQglkfGktmCQn6pKM=; b=ZTTqlO95gU+d0snP0tTypCQGdcu9acvPUvDW0Nvdg34uCOGpB3Ce4eIVWLkd9GLvPx AvSsPwAukPqyqCcWI58RmdmmJO6NKVcLc2arr0oVwJmERcdA1z/Ch1JgXu6p+IUkVMRB jN90vJLDq/FPNLiZxgumbCGGViClzEVO6zpYveLRMOg94Up6Xxxpvh/U3fo149YAlLXT DUoWaxUdx/LQpMnovoY3ois/xc31b0hf9fqpyO4iWEgiTCla7G+CZOKhTip6BzRQg4xS VfmjQeOW25KjQi0u53k0PNJa84vSig35GiAIXGDkd9PdHh8tO9HZzZ9uWKZj+ZEh3bXy XV1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tiDuFxBe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w16si4569195vsi.419.2021.10.01.08.35.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:35:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tiDuFxBe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKZ3-0006SI-Sy for patch@linaro.org; Fri, 01 Oct 2021 11:35:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKXt-0006MM-WC for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:33:58 -0400 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:33752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXr-0007gx-8d for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:33:57 -0400 Received: by mail-qt1-x833.google.com with SMTP id x9so9371250qtv.0 for ; Fri, 01 Oct 2021 08:33:54 -0700 (PDT) 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=rbJQ1EEbZk0qe1nOE3Vk16NPZokQglkfGktmCQn6pKM=; b=tiDuFxBeJ8Y6l2XoL46Aw0KK3bziDZIBnwpCSNOzN1CVg2jzenHx+v0o45/JEdT04s Ql2hPPV5ICNSXUsgqHbMdlOEnmVMoNowctJmlaWVf/P7JaJHvrSZl+7q16gT7I4uv/SH bQ+D2291EUXvv/i58mIXjPrDGiq5O05KxwDcOE5cWs3U50jW9q8NPhQmXSSZilbC6d80 WjgfjeS7oD0qXYitmMPJUTKmhMGLd/fGtGov2AoaOpDWdddNM7YhQHKJx4CLvilIvExJ /bgLAJzyf/Byhf9g7wlVOr+WKjv8PhGgKr25vG1uTtxucH+99CmfJvx+k40nTnzbWkNc 0yVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rbJQ1EEbZk0qe1nOE3Vk16NPZokQglkfGktmCQn6pKM=; b=vl332tJx8C0oFGHqdgD1A418wVdJ6uGLWg1vVMv2NJDUbY03r0JNb4sg3CZqAw5f7K 6goASYHlqSNMHZVuR/8V60/iBpepV6CWevwCzcsgJGTcAG094fk8aoN55jKO0umwJu3+ YgJzNeU+dWEbuEFCRDy9DeaxcASN6t8hU70a2DrvyGb6iUQJt//jGjjaa8moB07pRHAV mq62yu/ReRpaJdP8zwhleZr3KkFRsgVbBTB8DX6MPAfHZ4CAyKxWemkAjvQ71o45BBag iHdTrjPQ1CH0DqLgm+ryeXebXNKifxrXxoYalh40AqW88HRMinOYqrJz5X01gnS6Ts2m k0nw== X-Gm-Message-State: AOAM531bm9DCHkjUWPRIckmMffzetQtiwzjAU7aU8ApMaljTjJmdZzzR cR4OXGsZi0Xi1zJ2z3FJL06wP70nG4Y1hw== X-Received: by 2002:a05:622a:1886:: with SMTP id v6mr5179950qtc.244.1633102434273; Fri, 01 Oct 2021 08:33:54 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/9] linux-user/nios2: Fixes for signal frame setup Date: Fri, 1 Oct 2021 11:33:41 -0400 Message-Id: <20211001153347.1736014-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x833.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, Peter Maydell , crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not confuse host and guest addresses. Lock and unlock the target_rt_sigframe structure in setup_rt_sigframe. Since rt_setup_ucontext always returns 0, drop the return value entirely. This eliminates the only write to the err variable in setup_rt_sigframe. Always copy the siginfo structure. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20210924165926.752809-19-richard.henderson@linaro.org> Reviewed-by: Alex Bennée --- linux-user/nios2/signal.c | 49 ++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 29 deletions(-) -- 2.25.1 diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index a77e8a40f4..adbffe32e3 100644 --- a/linux-user/nios2/signal.c +++ b/linux-user/nios2/signal.c @@ -42,7 +42,7 @@ struct target_rt_sigframe { struct target_ucontext uc; }; -static int rt_setup_ucontext(struct target_ucontext *uc, CPUNios2State *env) +static void rt_setup_ucontext(struct target_ucontext *uc, CPUNios2State *env) { unsigned long *gregs = uc->tuc_mcontext.gregs; @@ -75,8 +75,6 @@ static int rt_setup_ucontext(struct target_ucontext *uc, CPUNios2State *env) __put_user(env->regs[R_GP], &gregs[25]); __put_user(env->regs[R_EA], &gregs[27]); __put_user(env->regs[R_SP], &gregs[28]); - - return 0; } static int rt_restore_ucontext(CPUNios2State *env, struct target_ucontext *uc, @@ -135,8 +133,8 @@ static int rt_restore_ucontext(CPUNios2State *env, struct target_ucontext *uc, return 0; } -static void *get_sigframe(struct target_sigaction *ka, CPUNios2State *env, - size_t frame_size) +static abi_ptr get_sigframe(struct target_sigaction *ka, CPUNios2State *env, + size_t frame_size) { unsigned long usp; @@ -144,7 +142,7 @@ static void *get_sigframe(struct target_sigaction *ka, CPUNios2State *env, usp = target_sigsp(get_sp_from_cpustate(env), ka); /* Verify, is it 32 or 64 bit aligned */ - return (void *)((usp - frame_size) & -8UL); + return (usp - frame_size) & -8; } void setup_rt_frame(int sig, struct target_sigaction *ka, @@ -153,26 +151,25 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, CPUNios2State *env) { struct target_rt_sigframe *frame; - int i, err = 0; + abi_ptr frame_addr; + int i; - frame = get_sigframe(ka, env, sizeof(*frame)); - - if (ka->sa_flags & SA_SIGINFO) { - tswap_siginfo(&frame->info, info); + frame_addr = get_sigframe(ka, env, sizeof(*frame)); + if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) { + force_sigsegv(sig); + return; } + tswap_siginfo(&frame->info, info); + /* Create the ucontext. */ __put_user(0, &frame->uc.tuc_flags); __put_user(0, &frame->uc.tuc_link); target_save_altstack(&frame->uc.tuc_stack, env); - err |= rt_setup_ucontext(&frame->uc, env); + rt_setup_ucontext(&frame->uc, env); for (i = 0; i < TARGET_NSIG_WORDS; i++) { __put_user((abi_ulong)set->sig[i], - (abi_ulong *)&frame->uc.tuc_sigmask.sig[i]); - } - - if (err) { - goto give_sigsegv; + (abi_ulong *)&frame->uc.tuc_sigmask.sig[i]); } /* Set up to return from userspace; jump to fixed address sigreturn @@ -180,19 +177,13 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, env->regs[R_RA] = (unsigned long) (0x1044); /* Set up registers for signal handler */ - env->regs[R_SP] = (unsigned long) frame; - env->regs[4] = (unsigned long) sig; - env->regs[5] = (unsigned long) &frame->info; - env->regs[6] = (unsigned long) &frame->uc; - env->regs[R_EA] = (unsigned long) ka->_sa_handler; - return; + env->regs[R_SP] = frame_addr; + env->regs[4] = sig; + env->regs[5] = frame_addr + offsetof(struct target_rt_sigframe, info); + env->regs[6] = frame_addr + offsetof(struct target_rt_sigframe, uc); + env->regs[R_EA] = ka->_sa_handler; -give_sigsegv: - if (sig == TARGET_SIGSEGV) { - ka->_sa_handler = TARGET_SIG_DFL; - } - force_sigsegv(sig); - return; + unlock_user_struct(frame, frame_addr, 1); } long do_sigreturn(CPUNios2State *env) From patchwork Fri Oct 1 15:33:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515038 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp911469jaf; Fri, 1 Oct 2021 08:37:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRV9wK3aekYjn7NdXUqLJJ8uTad0aOgWDD5A5WfSnXzk1cglJvGr3RSEOmhZRCmnnVo1tF X-Received: by 2002:a05:6e02:12cf:: with SMTP id i15mr9579661ilm.138.1633102660626; Fri, 01 Oct 2021 08:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102660; cv=none; d=google.com; s=arc-20160816; b=qx0RUdKtUWYtIXL+QyyTBexSR0m4DOsuy+pjiz9qrbfusXokuoY9ZW/PCDzoFhStyh BPUiR3S6/9bdi0XiUb88C5vD8R4GfaQy8aazbttouuj4oxzMn5TGXY7lfWvTcIDFanwr O9jAi85W+k5gXj+9T66kftqCWQ7enkwHR/ynNx7FoRGarQi5xRSAapiyTrNiLqusI0/s wYP7HFyZgwKuZWj243tUMRO8dQCm+3jFayYim0ixN5YvELUuXzRQRo00gf0Uv/i+P/Xg 4nswEAVOm8rEdP5Q/j1P7E1Ygw9+ssT+MAJSuDm8Xst8yvVnCFA5lAXY8T1+wJla1aMS tmIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=EV1fPTa0lXnvbJma6gub7tRNpsvH6qdwOzVJWph7xd4=; b=of6WzVcaqRT+Oj018MgB5D7HpUOvoB5bNSTN/2C0wH+Tyhh83nyN02xXjQ0yGmDOWm sjHaKFIq0RGQTayR4sLn0fYMoHX6nwVsDmD5dKlRLXuwvGcCIoVRgt/DY4BI59iGrCpQ hUWG1PHiz2zEZpa22aEXObLIKZeW/0YJ/GNLAeCaLMcDmfgx3TGgBcj0WB7hfZj3lXIK M/cnGcxWzXYDu5ey1Vn4OrCgcXew7W56JHImeVoOlQY6nGkAGCuRxKCjNYzno7dt3rZz lOipQms9i84UUBIf+ER+uU3jnIGEA0LizQffHvr8r4ZdGcmGQKnk0PcYbLyDN7pqcQt9 vRZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=v9bMNXM6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p10si9633485ilo.160.2021.10.01.08.37.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=v9bMNXM6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKbU-0002ue-3u for patch@linaro.org; Fri, 01 Oct 2021 11:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKXv-0006P2-Ds for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:33:59 -0400 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:46761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXr-0007i5-W7 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:33:59 -0400 Received: by mail-qt1-x830.google.com with SMTP id e16so9263484qte.13 for ; Fri, 01 Oct 2021 08:33:55 -0700 (PDT) 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=EV1fPTa0lXnvbJma6gub7tRNpsvH6qdwOzVJWph7xd4=; b=v9bMNXM6XE5BqGoZDAZbvUG69jnAhfBlG2ZzFH4dd1ockfWFS7ToooVGvWexlPYBIM iE+oxzBBgeQtvLtPUIeTWFkVieCoDHtNltX7uZ3/xEm0kgQSvrHio/0Q2j4fZWZb5WM+ Shpg6TRcy+A5SyyTuXVTxGDrW1D2hFPe1m2O6uyRvH1S1HteHzh0YxsWm/XqUBkQVUwh 5qQGqfYKA4QMh2RFNpc7vkLJMno1ulwSXrCBdjrhTyAkN3Zg2DoyKa3kTvP3/hHtdCxf uhlsKwyMrWV4Co6SwU2nzF3xgQJ8/wDY8mf9TdaVHVTdWRUyPcEnVbS2VxA41zN2Hpuw tv1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EV1fPTa0lXnvbJma6gub7tRNpsvH6qdwOzVJWph7xd4=; b=zVs0EDLxI1i7jmx2qWG/H89Ko2XhCOz9ZUfbgK8agLkz62cQ9DuI8cy+vhTfK6mzRW UleiQlZwdSX+JOp/DQUPeIoh8+lGc8HpdaiJeJFfDy48tRCAeL2V58C04l95ehMlH/Y9 /j8jAqJDRtsaW2V1JYPWErj8vVcDHnV7QBWC18i8nXEGAOCh39l37T4bQB/DltxiElzQ HDG5LS33DXXdwEHXpegJjgkfaQwj0WjY5dNEc+G3H8ArRB2Aas3pJBvWEzRARPTyupZ1 Wf4SZLdNWiQk8mZ6Q2UgleOUvHY4zNE+ZiIJVOei1mUrYl6Srq4sPSwUh6DnaV0mYY4+ yzEg== X-Gm-Message-State: AOAM530cuaDowLBrr8r9f2lezm0+z5fTeNY7wE2DAIhRPdoLtK+B9L+S mjopuql5b62Bb1NNjqlRdQj+gfG8xdPVEg== X-Received: by 2002:ac8:6e8f:: with SMTP id c15mr13715605qtv.179.1633102435078; Fri, 01 Oct 2021 08:33:55 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/9] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE Date: Fri, 1 Oct 2021 11:33:42 -0400 Message-Id: <20211001153347.1736014-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::830; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x830.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Arm will no longer be the only target requiring a commpage, but it will continue to be the only target placing the page at the high end of the address space. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/elfload.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5f9e2141ad..dc4ababedd 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -388,11 +388,11 @@ enum { /* The commpage only exists for 32 bit kernels */ -#define ARM_COMMPAGE (intptr_t)0xffff0f00u +#define HI_COMMPAGE (intptr_t)0xffff0f00u static bool init_guest_commpage(void) { - void *want = g2h_untagged(ARM_COMMPAGE & -qemu_host_page_size); + void *want = g2h_untagged(HI_COMMPAGE & -qemu_host_page_size); void *addr = mmap(want, qemu_host_page_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0); @@ -2160,8 +2160,8 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, return sp; } -#ifndef ARM_COMMPAGE -#define ARM_COMMPAGE 0 +#ifndef HI_COMMPAGE +#define HI_COMMPAGE 0 #define init_guest_commpage() true #endif @@ -2361,7 +2361,7 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr, } loaddr &= -align; - if (ARM_COMMPAGE) { + if (HI_COMMPAGE) { /* * Extend the allocation to include the commpage. * For a 64-bit host, this is just 4GiB; for a 32-bit host we @@ -2372,14 +2372,14 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr, if (sizeof(uintptr_t) == 8 || loaddr >= 0x80000000u) { hiaddr = (uintptr_t) 4 << 30; } else { - offset = -(ARM_COMMPAGE & -align); + offset = -(HI_COMMPAGE & -align); } } addr = pgb_find_hole(loaddr, hiaddr - loaddr, align, offset); if (addr == -1) { /* - * If ARM_COMMPAGE, there *might* be a non-consecutive allocation + * If HI_COMMPAGE, there *might* be a non-consecutive allocation * that can satisfy both. But as the normal arm32 link base address * is ~32k, and we extend down to include the commpage, making the * overhead only ~96k, this is unlikely. @@ -2400,7 +2400,7 @@ static void pgb_dynamic(const char *image_name, long align) * All we need is a commpage that satisfies align. * If we do not need a commpage, leave guest_base == 0. */ - if (ARM_COMMPAGE) { + if (HI_COMMPAGE) { uintptr_t addr, commpage; /* 64-bit hosts should have used reserved_va. */ @@ -2410,7 +2410,7 @@ static void pgb_dynamic(const char *image_name, long align) * By putting the commpage at the first hole, that puts guest_base * just above that, and maximises the positive guest addresses. */ - commpage = ARM_COMMPAGE & -align; + commpage = HI_COMMPAGE & -align; addr = pgb_find_hole(commpage, -commpage, align, 0); assert(addr != -1); guest_base = addr; From patchwork Fri Oct 1 15:33:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515041 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp911885jaf; Fri, 1 Oct 2021 08:38:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxImYXI537Zp4CyJcgArZaQEXzqXfxEyXFrk5Wb79a8u8mGDUOy2RC2XV1M7w4dsk+spICh X-Received: by 2002:a05:600c:214c:: with SMTP id v12mr5269474wml.179.1633102689107; Fri, 01 Oct 2021 08:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102689; cv=none; d=google.com; s=arc-20160816; b=oDjzknxhU4BKrWivt+23iN5A/kdgYi/JxcKy/rokIo/OAQ0PgmnMOfWI44l1hvgbY3 ATUF8YN/UN3ehGAWmCwima2kNUXXgRJnhYucV42r49W08HBjM1FJ6UlWG2lvCH2A5oVC o6hLTnqxd7LC+SZKzqbm3vOwNQnbHdMn2Cp+arPDdtws1H8cVs8NNhuQO0e0dfdOpZCU YMpk2i1tBL/4RIYUErRJkyvjGwOCSTfPf2r9Ct3S6SOeU4FTG0IUH6sAvBO5z7bTavcm sdQ9YYj20bXFZVe/SziPBfxqUcme1mk1yL4+HrpyKwYbFMRwmV+esWqVhF/t/+Nnomfj Dj7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=UkwyzfCxusU0W+ltEdkm6R5Th1JFOdsQsNyNBLHWyyc=; b=w7u5C8SFcBSnzkMX/H2tDkLP1bwfB+mx65fzTpaR1aQ6uZegl47bX5zFzsiKQPuwSS omsR2+ene9TUvTirXNXaLJztwTIfbFunc5QX9BOfux7npwSI5LBlvTClRyVa2dw1fanE nyUHBzK23np6CDhhiRueJ4kB7tsSb70SLJPC/Q8jdKNsk0DpyFz+iFIM0nUpJPxnPlew tJ1Uin+Z+3R9OWXk24XnoRJBZEw+i77EDZa5W4ktKMrTcPbt1UCZYD0ZQqg02YKth6Eo tmMuxFABA9MgiuPDIWflZyw9znR5hGGBrOmeCVXOxokjTgA+BAuOmgTU6S53rIVVaUCb qKbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vr3ItEn2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a4si10173807wri.180.2021.10.01.08.38.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:38:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vr3ItEn2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKbw-0004d3-1V for patch@linaro.org; Fri, 01 Oct 2021 11:38:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKXx-0006UM-RQ for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:02 -0400 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:35465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXs-0007ip-UD for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:00 -0400 Received: by mail-qt1-x82f.google.com with SMTP id c20so9317586qtb.2 for ; Fri, 01 Oct 2021 08:33:56 -0700 (PDT) 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=UkwyzfCxusU0W+ltEdkm6R5Th1JFOdsQsNyNBLHWyyc=; b=vr3ItEn25M6gtHY7D/iM6n7389A+DWuBtFMcujxVv37R+q8U9hUmB8uSmfTrHPX3Nn 4w3lD+g6v21z08YBZiw4FeC+XOceJvZxdoj/g7A1zzUCUp2JAvTHEsuqtwdxvLmun0vA 1TzY0YOR5wvLwclzkW4MyC6/8KHJ8KMftRSdbHlgGR4y6pPw0KCRd7ZxtH1prJqKf5D1 Zb+hNin9A8PwpZj7Fz83r/ovjh3W6GTFRF97WRYPi9aqqBHX7MG4RNmZzOBxW7jT4e2W B+7piMPclWj6itkMrn82sO2QvacjJD5jtMpbOqjVQHyBHUPOFjn+aJcgLo6sjFMWrE2G 93kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UkwyzfCxusU0W+ltEdkm6R5Th1JFOdsQsNyNBLHWyyc=; b=aluNbyyCg6jaDaa4yscVngDDcGINDP6fatsGA2gFLmZAi45adqNwljbLqxAFDFwOdl Ecmy6fhePvOqV2Pkd6Qv5FSMiZWjy/3pzLHBaQ+8NM7Aky98kjY0eXCOKwMnhWMOY3RY FDn7RhngkxxVtsO1aTATatexs0saXdHC3/9Im5eMusyu/Mn3SCr5LXsa6k1F3ZapGwMT Ydq9TM3uulfxwtbTqnK17BfcSE9ScMs40rc3t/PISpXjQf0AK8+gycMRna6YMMlvFp1B dCAI8wyEiv5D7FYAUJrIz45hmeLMylsNP/+VrhIIxNxD56SRNKn8x0ozuNUf118w4Xw2 7xxg== X-Gm-Message-State: AOAM532rz4TGaTkYqF1VVoWyzU4g9zvh6Wuw2nnVCmcOxnPNRIuoeUAx QNZRVmGEvcUG9XhqAFF4+OxYAVn81cUozA== X-Received: by 2002:ac8:4c99:: with SMTP id j25mr13878237qtv.191.1633102435972; Fri, 01 Oct 2021 08:33:55 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/9] linux-user/nios2: Map a real kuser page Date: Fri, 1 Oct 2021 11:33:43 -0400 Message-Id: <20211001153347.1736014-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x82f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The first word of page1 is data, so the whole thing can't be implemented with emulation of addresses. Use init_guest_commpage for the allocation. Hijack trap number 16 to implement cmpxchg. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 50 ++++++++++++++++++++++++++++++++++++- linux-user/nios2/cpu_loop.c | 50 ++++++++++++++++++++----------------- target/nios2/translate.c | 9 ------- 3 files changed, 76 insertions(+), 33 deletions(-) -- 2.25.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index dc4ababedd..206f7d511e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1099,6 +1099,47 @@ static void init_thread(struct target_pt_regs *regs, struct image_info *infop) regs->estatus = 0x3; } +#define LO_COMMPAGE TARGET_PAGE_SIZE + +static bool init_guest_commpage(void) +{ + static const uint8_t kuser_page[4 + 2 * 64] = { + /* __kuser_helper_version */ + [0x00] = 0x02, 0x00, 0x00, 0x00, + + /* __kuser_cmpxchg */ + [0x04] = 0x3a, 0x6c, 0x3b, 0x00, /* trap 31 */ + 0x3a, 0x28, 0x00, 0xf8, /* ret */ + + /* __kuser_sigtramp */ + [0x44] = 0xc4, 0x22, 0x80, 0x00, /* movi r2, __NR_rt_sigreturn */ + 0x3a, 0x68, 0x3b, 0x00, /* trap 0 */ + }; + + void *want = g2h_untagged(LO_COMMPAGE & -qemu_host_page_size); + void *addr = mmap(want, qemu_host_page_size, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0); + + if (addr == MAP_FAILED) { + perror("Allocating guest commpage"); + exit(EXIT_FAILURE); + } + if (addr != want) { + return false; + } + + memcpy(addr, kuser_page, sizeof(kuser_page)); + + if (mprotect(addr, qemu_host_page_size, PROT_READ)) { + perror("Protecting guest commpage"); + exit(EXIT_FAILURE); + } + + page_set_flags(LO_COMMPAGE, LO_COMMPAGE + TARGET_PAGE_SIZE, + PAGE_READ | PAGE_EXEC | PAGE_VALID); + return true; +} + #define ELF_EXEC_PAGESIZE 4096 #define USE_ELF_CORE_DUMP @@ -2160,8 +2201,13 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, return sp; } -#ifndef HI_COMMPAGE +#if defined(HI_COMMPAGE) +#define LO_COMMPAGE 0 +#elif defined(LO_COMMPAGE) #define HI_COMMPAGE 0 +#else +#define HI_COMMPAGE 0 +#define LO_COMMPAGE 0 #define init_guest_commpage() true #endif @@ -2374,6 +2420,8 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr, } else { offset = -(HI_COMMPAGE & -align); } + } else if (LO_COMMPAGE) { + loaddr = MIN(loaddr, LO_COMMPAGE & -align); } addr = pgb_find_hole(loaddr, hiaddr - loaddr, align, offset); diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 5c3d01d22d..de0fc63e21 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -76,6 +76,32 @@ void cpu_loop(CPUNios2State *env) force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLTRP, env->regs[R_PC]); break; + + case 16: /* QEMU specific, for __kuser_cmpxchg */ + { + abi_ptr g = env->regs[4]; + uint32_t *h, n, o; + + if (g & 0x3) { + force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN, g); + break; + } + ret = page_get_flags(g); + if (!(ret & PAGE_VALID)) { + force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, g); + break; + } + if (!(ret & PAGE_READ) || !(ret & PAGE_WRITE)) { + force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_ACCERR, g); + break; + } + h = g2h(cs, g); + o = env->regs[5]; + n = env->regs[6]; + env->regs[2] = qatomic_cmpxchg(h, o, n) - o; + env->regs[R_PC] += 4; + } + break; } break; @@ -86,29 +112,7 @@ void cpu_loop(CPUNios2State *env) queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case 0xaa: - switch (env->regs[R_PC]) { - /*case 0x1000:*/ /* TODO:__kuser_helper_version */ - case 0x1004: /* __kuser_cmpxchg */ - start_exclusive(); - if (env->regs[4] & 0x3) { - goto kuser_fail; - } - ret = get_user_u32(env->regs[2], env->regs[4]); - if (ret) { - end_exclusive(); - goto kuser_fail; - } - env->regs[2] -= env->regs[5]; - if (env->regs[2] == 0) { - put_user_u32(env->regs[6], env->regs[4]); - } - end_exclusive(); - env->regs[R_PC] = env->regs[R_RA]; - break; - /*case 0x1040:*/ /* TODO:__kuser_sigtramp */ - default: - ; -kuser_fail: + { info.si_signo = TARGET_SIGSEGV; info.si_errno = 0; /* TODO: check env->error_code */ diff --git a/target/nios2/translate.c b/target/nios2/translate.c index a759877519..f9abc2fdd2 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -795,15 +795,6 @@ static void nios2_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) dc->base.pc_next = pc + 4; /* Decode an instruction */ - -#if defined(CONFIG_USER_ONLY) - /* FIXME: Is this needed ? */ - if (pc >= 0x1000 && pc < 0x2000) { - t_gen_helper_raise_exception(dc, 0xaa); - return; - } -#endif - code = cpu_ldl_code(env, pc); op = get_opcode(code); From patchwork Fri Oct 1 15:33:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515043 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp915076jaf; Fri, 1 Oct 2021 08:41:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziVEsuwLt2bGnHaPhym7H2hftTRnxsxgQOpth+Bp/CESThZagFEXTu1/JD5x+ZbcaRYZWa X-Received: by 2002:a67:3388:: with SMTP id z130mr5051822vsz.34.1633102898287; Fri, 01 Oct 2021 08:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102898; cv=none; d=google.com; s=arc-20160816; b=C2aEgAQxpFoxu6IBV/5lrlnz4qgCOua1waQhQlJMy3Lz+cfjJfvmpuev+yPnJ4wL1W QMqAFokwQcdrVgNVW7rDT3WKzK3Zla97DR1/qgf+pEXc9djfChVm4ApOMbC3Ryx28TiD 5fBFVpu+1qq/adY91BwJrSD0OtfkROA1sdBDgJ17/GnvRvovdaCqPP/a/j9r7SQWYC9c E4lDL20Env360vNsSK4uFZA49Z4wkqeV5xhFFnT7oW+i2AW2JJTbmmUCgUStels38pV4 6LKJ5Qs2S3+tJan226PqJq3eo42uvuu2rSTkLdd0DQs68noou/h4C4dx6o6Ev10YCxSU mJqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=F9yEwPrmR9xpxjbUMZcvWlIm4BrVKkXnEjUbM9qs6VM=; b=rGRGUzNlHAhiRSKfCXeqHS7WKO1mp1c3BOKddpkVH7etQTO0BPrXs7a1HrZGicgjVo Xb00DLSv8IFZ+elRojWyrv+aUAywgreoQHsOISQ3U+0m9BqLnpMmB+DfzWYMSuwLGFJ+ HjBGwdYOFZUjVIXNSNvy3uHImnx6bsi/Gvy4SkbzS5Mfh19msQYk29IChbN5hTjdkQPZ S1MogHoyfTK/erLt+uZIdHC4zmhLdqTtTk/63/CC6XFyn5glOtct3QdkzJaOz2/PZ5r/ Iaw497pDyPKPf6FrIHpJIYfg1stj5zMfgstquzUgWUZcMxnSyAGP7sebMt2p1h3hBDrZ aUpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=o5YqmOZ8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h22si6462756vsu.215.2021.10.01.08.41.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=o5YqmOZ8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKfJ-0001KB-IV for patch@linaro.org; Fri, 01 Oct 2021 11:41:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKY1-0006fM-LT for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:05 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:41945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXt-0007k7-Lu for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:05 -0400 Received: by mail-qk1-x72a.google.com with SMTP id m7so9492388qke.8 for ; Fri, 01 Oct 2021 08:33:57 -0700 (PDT) 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=F9yEwPrmR9xpxjbUMZcvWlIm4BrVKkXnEjUbM9qs6VM=; b=o5YqmOZ8FQBpCsn3z4vAOehwAN/laf9MPTJhYFBaERaLSGNW5YWCYzLnKFmjDVJBpY nhDH4Pu1UY+3kJS8mpObw5e8sfY9wSKtnW+Nilgr+M7wVFAqjXhaaoLgnN+gV703rkPw uaSDs9KpDJ1b8X4dkMUnhB9snJKW4Z7NPgvb4cjUfr6UgvcfxZ5vJhS6lqA8bI/iVzLw BJGTkZt2tHPkYoW2Iupse/ws8qDhQKvkBz9MLwXp1abzRblh44nwp1RpI3rBnQVidhAf 0RSM/OJ4+qWhN9zLTEJcrTblQry22ni/xKp/jdZfMXTuFeaz6r4CQxQBywU9R5RzrS82 gjRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F9yEwPrmR9xpxjbUMZcvWlIm4BrVKkXnEjUbM9qs6VM=; b=NSO9LaACfSIX2rYiq+BZXVR+4BI8O5gYfUF/zfysxdiEdEY8L+KIAIjctTXTmqeDdf 1MSoC1Zrq7DxcfLTQcl5y9SU0zCCSId/jxhPFjXIrxPRvB1vrYIh6adNKKsZPUeS4nP2 refU1DAzTy992inZd4vbdYTZOiJAoaOJVsY+yf8rxva0s4I3Z/ETLax3ssrzvYwYWwi2 evoEGnkIw5piNwg45OBnO8u0W6aU5F4Qwf373a8UpG/knCFihvR+N6pi5odlMrk95RWX dFnbWEnqYrz7sSjQSXiBmPlShEWK5DIh0xe9FYu5UE4wcrJiOzXKupdF9c52I8orTj0N coiw== X-Gm-Message-State: AOAM530Fkti5a5nBgaiTGimFYlLIcaptz90NK4VE34zTChSunCDhGWOg zlLbyuCQ+vKwGjsfZ0AN9YSWkBUo9hxXlw== X-Received: by 2002:a37:a20a:: with SMTP id l10mr10193543qke.273.1633102436730; Fri, 01 Oct 2021 08:33:56 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/9] linux-user/nios2: Fix EA vs PC confusion Date: Fri, 1 Oct 2021 11:33:44 -0400 Message-Id: <20211001153347.1736014-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The real kernel will talk about the user PC as EA, because that's where the hardware will have copied it, and where it expects to put it to then use ERET. But qemu does not emulate all of the exception stuff while emulating user-only. Manipulate PC directly. This fixes signal entry and return, and eliminates some slight confusion from target_cpu_copy_regs. Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 5 +---- linux-user/nios2/signal.c | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index de0fc63e21..1e93ef34e6 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -155,9 +155,6 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs) env->regs[R_SP] = regs->sp; env->regs[R_GP] = regs->gp; env->regs[CR_ESTATUS] = regs->estatus; - env->regs[R_EA] = regs->ea; - /* TODO: unsigned long orig_r7; */ - - /* Emulate eret when starting thread. */ env->regs[R_PC] = regs->ea; + /* TODO: unsigned long orig_r7; */ } diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index adbffe32e3..20b65aa06e 100644 --- a/linux-user/nios2/signal.c +++ b/linux-user/nios2/signal.c @@ -73,7 +73,7 @@ static void rt_setup_ucontext(struct target_ucontext *uc, CPUNios2State *env) __put_user(env->regs[R_RA], &gregs[23]); __put_user(env->regs[R_FP], &gregs[24]); __put_user(env->regs[R_GP], &gregs[25]); - __put_user(env->regs[R_EA], &gregs[27]); + __put_user(env->regs[R_PC], &gregs[27]); __put_user(env->regs[R_SP], &gregs[28]); } @@ -122,7 +122,7 @@ static int rt_restore_ucontext(CPUNios2State *env, struct target_ucontext *uc, __get_user(env->regs[R_GP], &gregs[25]); /* Not really necessary no user settable bits */ __get_user(temp, &gregs[26]); - __get_user(env->regs[R_EA], &gregs[27]); + __get_user(env->regs[R_PC], &gregs[27]); __get_user(env->regs[R_RA], &gregs[23]); __get_user(env->regs[R_SP], &gregs[28]); @@ -181,7 +181,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, env->regs[4] = sig; env->regs[5] = frame_addr + offsetof(struct target_rt_sigframe, info); env->regs[6] = frame_addr + offsetof(struct target_rt_sigframe, uc); - env->regs[R_EA] = ka->_sa_handler; + env->regs[R_PC] = ka->_sa_handler; unlock_user_struct(frame, frame_addr, 1); } From patchwork Fri Oct 1 15:33:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515046 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp918677jaf; Fri, 1 Oct 2021 08:45:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1SpKri9wQCXbekosuXur7RNPkhq5QZHF2oZFHNBzDV4jAqYksXQnQFzwSQdO7llhg51Gv X-Received: by 2002:adf:fa0d:: with SMTP id m13mr13515238wrr.418.1633103125696; Fri, 01 Oct 2021 08:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633103125; cv=none; d=google.com; s=arc-20160816; b=c/lNmM3jK1MiCKRcGOxo1uqRd809iTfA8r3iT81WCP68GzLk1L0PeoiE2uco4+yyN0 BASlsiuUpLs9ui+37Cx4OFcYlEKfQJsEoVjaLOMvZ1RdStndA7xHAi88xTaa+8Hda7Jl jok9wFqry8IuLrFMqe2pNxerb+RNHWiKu3zjt1mrNK+srOioaCoI/sRkxBp4fuKPLE+S qq2VIeAWAtIn8SaXK9HMCapi1HYOdY1X33VU1EE+PI8AEEVJ7eqjyphkoygU4/dviq9Q hjNlNPqU9f2SAV5+29GqMqOpngv4JIf7z3aJt1ohEXbbKwbFP/aYFuxMvXRDNwxp/Gjq /Qvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=k/SnMn3cz6aHPIbcUbwKN2ElGsSac37gMdkQcSMJ6WQ=; b=ntTl9834N1O7EqTIaEws4CJASnXIuD/M37Fe65OSoEJMAzAjA4jeyIp9DsvvjZVWTy rlaknNATzyPo7X8w/SqrpKRcnrlGegLkVuBQIigf3pTPjrfEUxhSb4bhX+a3c5OW3fX/ zt+qXmagH9XJJIDpKb25FqP3BVICnBxVyztFLi5aY965f14EW3OUmzyFco+wGDR8BxzR 188cmUnlaY7qe+EkIi1rkQ+zunZyMVlp+PDNigChvqPozzFj/dahL/QVewFnEv2pmFR4 AGwCdSrfqs8Bpg8Y3eUfuFn/hF8ndPbC4E6idW6OsOsVhBPU0kD8oCFkBsSDtU1Glhkk Ahew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Wn6xzyjB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n17si6188532wro.290.2021.10.01.08.45.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Wn6xzyjB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKiy-0006At-M7 for patch@linaro.org; Fri, 01 Oct 2021 11:45:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKY4-0006pv-N1 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:08 -0400 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:42888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXu-0007kZ-Kv for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:08 -0400 Received: by mail-qt1-x830.google.com with SMTP id f15so9302057qtv.9 for ; Fri, 01 Oct 2021 08:33:58 -0700 (PDT) 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=k/SnMn3cz6aHPIbcUbwKN2ElGsSac37gMdkQcSMJ6WQ=; b=Wn6xzyjBTdCRQX4O4ZN+01a/+yBTD9I06VQ/C7SBr4Lb/pdaHgPbMkl/cT2EgaS1TJ uTMnwQIt7CGmRYN2oEiWQOHz7bCWIHDDvc8MMyUUGVBPYs3aIJv3TxHA0w4o80wTQLBG U+Wcbmm3L31gsLjGH/rdpFCAD/dKDcar2BAlMBY7ExNkOgwPjd+NB7Wk0/cb0hp1Uw6n rk8KiJvWwYmkl9NA66ya3/ghK6dzwY6pDaIHCVDZ1TrN9KH2WjeyIPs4Dd3xCUwUcP4R MHeoXdPN2w1uKvkTZfHa6tFBL74rneVAvVA9+HvaLlKgoM/jhrJBlUrgj+tDbd3YaroO bzMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k/SnMn3cz6aHPIbcUbwKN2ElGsSac37gMdkQcSMJ6WQ=; b=NqoCYUuX2qGmyHj1k7dx8z4vJswYRBP0u3IANskUPcPvfPK6pZxrxtzoicKMR3TrNg cUjRUbZdmQdB/EfcEVDKvon9Kix+RtfX2TJ8oA4wCiJvIqZei1AEWBZM7duz+LQi56W+ d34ITNJB91Ez99ZHVgjmZz+6yfDT9BV6M7gUoKjfoO8Yt3qreSrsL5gGmmcQmGLbxjgB SFY+PGiYdKT4CK5Rz+2Fy3E1hyYM7WeY3ElEZ1Ojj5TyaED9kTB9z2TOobhdzIwS1SWF VlkSoxajFIYJ2N1KHBsKn5P44dj3P3l85BJOrWudCjCB5+74dSwPnzfZYU55W++UjL1t MYoA== X-Gm-Message-State: AOAM532dFpGGj5mTZMaYFv2u/nTqQbpGi/v1xwi5B/EDTeHUx3v+O25A LiuJYifOG+5u19afccLNFt407KFtr52W0A== X-Received: by 2002:ac8:138c:: with SMTP id h12mr13236328qtj.357.1633102437778; Fri, 01 Oct 2021 08:33:57 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/9] linux-user/nios2: Fix sigmask in setup_rt_frame Date: Fri, 1 Oct 2021 11:33:45 -0400 Message-Id: <20211001153347.1736014-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::830; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x830.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not cast the signal mask elements; trust __put_user. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/nios2/signal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.25.1 diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index 20b65aa06e..80e3d42fc9 100644 --- a/linux-user/nios2/signal.c +++ b/linux-user/nios2/signal.c @@ -168,8 +168,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, target_save_altstack(&frame->uc.tuc_stack, env); rt_setup_ucontext(&frame->uc, env); for (i = 0; i < TARGET_NSIG_WORDS; i++) { - __put_user((abi_ulong)set->sig[i], - (abi_ulong *)&frame->uc.tuc_sigmask.sig[i]); + __put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i]); } /* Set up to return from userspace; jump to fixed address sigreturn From patchwork Fri Oct 1 15:33:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515042 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp914291jaf; Fri, 1 Oct 2021 08:40:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf3GOXVmA6mkbdOnZm1uyV7zjqiI/sb1cenEmLUenjA00wGhDG2rJ3oxf5OvUyrzk+NUBo X-Received: by 2002:a67:c908:: with SMTP id w8mr4678272vsk.2.1633102845501; Fri, 01 Oct 2021 08:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102845; cv=none; d=google.com; s=arc-20160816; b=TwcRGKdKMeEPYv67gi4G7lOm/I+7fkxOqzMhT8td4qHOAbZUrV6+gee+sNhr6HX3ap 4YmzxTIAfUBwTn1oWsobTvPCKU/4Deq5GhWTqGJjqbz9LOWL/llAo+wzK+E8aru2LT7v bjM41Bw0hHzVOFTKjeGsK5wkUBeWlOms7Js8Y38dXHpjamAn31IfRBqwWLrQnOtUEwn+ tkfl1DcXcodO0RFJatyyXvU6g7RNQBFhIjwJFORSdvHiEMyaGA45igatyeVbIhG/NnvJ ebY4q/wODBnXsO41wD2H0O6hkcuaWW1oAkiZsFllv/zowBjZV2Dwl4aam+48VpHj71w/ m3Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=gXXC2XsHwTZReF8hOMB+sB2b5Bdxnek1fsOyxb7DiMI=; b=G59Hr1TeTyx0+6Rch9sHuelhjR03JXXSEJDrXf2hJGorrkA/D5fPm+Mgr5Mh0zpryl 4sF0fznFoN1t2wehsi7yzvU2XJB6AUNBAvzIFXE35z6OyNdSqxdD5GeFC7pN6apzOYmO qziiRmjwNEHgZr3xXSr/Z/Efee6YG8Zwe6dYt8BDea+mcd64jvbKdIbfCuvsd+cgLC5H Pm/2mXic8qTSUZt5NlLZBdRNmg1Tz7kaAYcJBTOhvg7IYC/QatWvPv68ZZa2OXx2zlkB 3lnaFuOTIHYpdZt1mslG9MXp7oFaszwGvbnvdyPm0dVE09vo5pzVabgImdC1m3DjOWXC b1Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IDiXIR43; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b4si4430610uaw.20.2021.10.01.08.40.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:40:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IDiXIR43; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKeS-0000C2-HV for patch@linaro.org; Fri, 01 Oct 2021 11:40:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKY3-0006jb-11 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:07 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:41817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXv-0007lY-Ng for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:06 -0400 Received: by mail-qt1-x834.google.com with SMTP id t2so9291266qtx.8 for ; Fri, 01 Oct 2021 08:33:59 -0700 (PDT) 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=gXXC2XsHwTZReF8hOMB+sB2b5Bdxnek1fsOyxb7DiMI=; b=IDiXIR43FotQVnwcSqS87BOBZGCrbx9CkNdw9LmgnMXfbptOwA5D477gSaARsPrHxU +/h/1HR6S7P6d3T0F70+0/Zg3XB6GyMAg3iIgMusaRSrjs0RoHNOrXSGTR8SBqBlnv/I M+2Jz8DycyY0O6nTowEoNTQclxd/eJjuq6rOgjzkTontiP9a6lKnZpekX/CSjeMFwsmK Cib2briqVnPuLAAqDcYrJPzAAPrdDHT0T6moG9b3MwPyf1lTPeJEZOwjkZ3hHIyFByAo zdbe2GFhu/IQ1VNn0e80riXZJmWZjtvs6yhbX6W5sAfrW/9eJcEamWXAOv2aQF0IRehZ /lNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gXXC2XsHwTZReF8hOMB+sB2b5Bdxnek1fsOyxb7DiMI=; b=zeS6gezIb6ggJ1dPzKsIxdIf85QXy2rcnVHxVat8w3SfJq7y5OTjkLmpKarjFg0erG h5gOKqRq9M341jz0m8IN/QOpNeNbhXxg6w5M0iZGgP+ArZvzYrXKMvPANCnT0wkMbaEM 4RaNli6pRWIPHXaZK8zceuFgNgE4NtiMrabW711oJKz9SkS1QBODoe7ANnEdQpu8R8ho PM7uowGcR2bhbH3Ie//oe1ksJE8Kx3FKFrri5eCXhJ2u6npYLkIOTutxktPOhWNivcj8 HSXwQSm0Zv6X0xLi25jqM/esiUxkD0hiJ2MZnC6rW+LlQVZOlSafdrF1gex1Gf0Fgeod wrGg== X-Gm-Message-State: AOAM531z5yU37MFdJ9xOT9MsqNR1QV1+cOswYpBhAliOrWv3ey/NCEsK 7RN6JfrelFmS2xT1hcrtL2gVjuX52ZRIbw== X-Received: by 2002:ac8:4d8b:: with SMTP id a11mr13338151qtw.51.1633102438762; Fri, 01 Oct 2021 08:33:58 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 8/9] linux-user/nios2: Use set_sigmask in do_rt_sigreturn Date: Fri, 1 Oct 2021 11:33:46 -0400 Message-Id: <20211001153347.1736014-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x834.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Using do_sigprocmask directly was incorrect, as it will leave the signal blocked by the outer layers of linux-user. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/nios2/signal.c | 2 +- linux-user/signal.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) -- 2.25.1 diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index 80e3d42fc9..517cd39270 100644 --- a/linux-user/nios2/signal.c +++ b/linux-user/nios2/signal.c @@ -205,7 +205,7 @@ long do_rt_sigreturn(CPUNios2State *env) } target_to_host_sigset(&set, &frame->uc.tuc_sigmask); - do_sigprocmask(SIG_SETMASK, &set, NULL); + set_sigmask(&set); if (rt_restore_ucontext(env, &frame->uc, &rval)) { goto badframe; diff --git a/linux-user/signal.c b/linux-user/signal.c index 2038216455..5ec63cd092 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -252,7 +252,6 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset) return 0; } -#if !defined(TARGET_NIOS2) /* Just set the guest's signal mask to the specified value; the * caller is assumed to have called block_signals() already. */ @@ -262,7 +261,6 @@ void set_sigmask(const sigset_t *set) ts->signal_mask = *set; } -#endif /* sigaltstack management */ From patchwork Fri Oct 1 15:33:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515044 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp915565jaf; Fri, 1 Oct 2021 08:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjyFiDq16kmbohr3nKfKjHhEdvQTq9wXTxsJvyGDlKt/g1rak9nwSpMIL4r1p8merhpJxv X-Received: by 2002:ab0:31d6:: with SMTP id e22mr10319318uan.99.1633102930412; Fri, 01 Oct 2021 08:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633102930; cv=none; d=google.com; s=arc-20160816; b=Gf1hnE9gnmz8T0bBIr9uSWkdX0ICLgSepaGXPkxSJ7x544qAq9rpRX2UiaD+VW0+vZ QsqHDW76Ka7iFCLIUSSbLuZ1JnaigakzcnCJktXR7DcHXQSHnXlaaly1+S3dIG7aGo6V tWHEm6cfsALhQWDHtf8IPQlWBIS4IqEN3X+R8U6WB4CiL/YuEOmLJL7pkfzWE87WiN9C sAvKSBBdc9lQgNW7vOYUsifAi6eI8wHeqHAxacW4xEc6QadDxDiyqgg7oS6s3a12xeWM v9oqrtPnHL7Zc/yxjA79A6X5zOvMT8LSE6uyXe6xLpAq35BNq/GyUSVxLGaIUv8GClf8 ow4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Ty9oWbKVOJOBomZhBTDMFXJ5kVE2f+VzbHAS7qTOPJk=; b=ioKbOJthrFtR9f0jp1YPfG5yIAvsDvjnV06/KcHVhieidaM1JhgiVYt6CteruZwzmo iQXVAu2tZhwowsTrEBLrn0xqTIUotCWMpoaD5IGiqW+APtBgmgh8P0aa21EgS11JEo0w 1d1UW26CT6P3BSxCHL1yC1WZGYPW5jg/0FN52uKP0CVUyIjuRTcxBLblsU/sWiAplgMT dRXoVpKfX59wfJuo4Uq/IY6PNh6nVCJ5Y9Kk2D0C42mRhxPrVeMog0w5dwtGBz68S4dt Fn2ULnErpNXu82kihd+wTokWJhV+jH7bj3vVJp5YtWyy6noE01ZO9ept6+n4Fxi31pS+ /lfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tVpl60hi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y65si437354vkc.1.2021.10.01.08.42.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 08:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tVpl60hi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWKfp-0001dj-Lp for patch@linaro.org; Fri, 01 Oct 2021 11:42:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWKY4-0006pE-J9 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:08 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:43831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWKXw-0007mW-K8 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 11:34:08 -0400 Received: by mail-qk1-x72f.google.com with SMTP id 138so9479688qko.10 for ; Fri, 01 Oct 2021 08:34:00 -0700 (PDT) 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=Ty9oWbKVOJOBomZhBTDMFXJ5kVE2f+VzbHAS7qTOPJk=; b=tVpl60him62RPDaU2zi63+ORUV+IjjTy9W5qc37q7vK7jH8NuwiVhYX0QWp6HyuVJm 6iph14sfd9e9iFvCl07TUGislyUAuFijWPMoi68/OK2Cj9x4o8tJXk6jcl16bkHyYMwo UDyNjgTo6jn0aaiXc+SPWuRUnwY3YMCTfL9JmVfaSBjAuTiWy+FUblOzGu6uZvwMmIEL v0YoJrQEePhOvDFiqr+EbQxw6QaWBK3dHWntTOIBkwPaayZoG15ttb5kq7liYTsU2zUC 3QVRe4L9WMBus9pO8XThpDO9OaVF6pUc0r+31E5bKeJda5/l5N/x57u4H19LESkhgfPr Np1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ty9oWbKVOJOBomZhBTDMFXJ5kVE2f+VzbHAS7qTOPJk=; b=IqRFGKhuyEyN1ybM4PJklmoVUkpf3u+sXGs99756brSvVgR3Sw3b8i+ch4BHynrX9x FvCm8ZRsiO1oIMJtsEUpidfJ3eDGLDD37f6kNkHV7B+WJEK/kF9iCWqKnBeJ1sAF0GnC Lz6CdxyKlCXqOd74FY6EaVfAdMf7qM2zXb8hEcRqJbps58Vc0ZBNzgTr+DQx9ZWqIGH/ Ylit5yyy5+xBqXKuK0EDbvD75mdafr/rNdo0xiX0spcebNJLp3v3R71TcgNfqsaB7iXJ 1ePWYnsXRaHCtqBeujEMIRBo4WZivGiSKwj4FLm+wpKFIRbH42Sn4wzUMXspruwPJhi6 o5iw== X-Gm-Message-State: AOAM533sVbXnV2C+LEIK5nNaUrwVH4zJlLV0Jx5wgqOugDg5tX3U2ycQ pCjX2Rf6QRxP2sqlFHCLKIIe7y0AdmjyQQ== X-Received: by 2002:a37:6350:: with SMTP id x77mr10162330qkb.356.1633102439674; Fri, 01 Oct 2021 08:33:59 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id x8sm3484823qtv.5.2021.10.01.08.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:33:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 9/9] tests/tcg: Enable container_cross_cc for nios2 Date: Fri, 1 Oct 2021 11:33:47 -0400 Message-Id: <20211001153347.1736014-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001153347.1736014-1-richard.henderson@linaro.org> References: <20211001153347.1736014-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: marex@denx.de, crwulff@gmail.com, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tests/tcg/configure.sh | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.25.1 diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 1f985ccfc0..62ca1e2cae 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -59,6 +59,7 @@ fi : $(cross_cc_mips64="mips64-linux-gnuabi64-gcc") : $(cross_cc_mipsel="mipsel-linux-gnu-gcc") : $(cross_cc_mips="mips-linux-gnu-gcc") +: $(cross_cc_nios2="nios2-linux-gnu-gcc") : ${cross_cc_ppc="powerpc-linux-gnu-gcc"} : ${cross_cc_cflags_ppc="-m32"} : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"} @@ -153,6 +154,11 @@ for target in $target_list; do container_image=debian-mips-cross container_cross_cc=mips-linux-gnu-gcc ;; + nios2-*) + container_hosts=x86_64 + container_image=debian-nios2-cross + container_cross_cc=nios2-linux-gnu-gcc + ;; ppc-*|ppc64abi32-*) container_hosts=x86_64 container_image=debian-powerpc-test-cross