From patchwork Tue Mar 15 08:43:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 551430 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp3288649mag; Tue, 15 Mar 2022 02:22:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8dLS22sneY3H1wrMd1Qxc0rlqlPm+iANIEZJJjnXv83YEDvdQEayWyPCGA1nwPTvv29Gc X-Received: by 2002:a05:620a:1929:b0:67d:74f0:a957 with SMTP id bj41-20020a05620a192900b0067d74f0a957mr13466929qkb.743.1647336165853; Tue, 15 Mar 2022 02:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647336165; cv=none; d=google.com; s=arc-20160816; b=l0xwWVui7zHdU71REID+wKMoZKCruVFAY7Hh2bjRPOxm8vDyKPZFcDcNSZiSwTDBZe uYFAbsCwseDPzZc68nEYgB+Inu+Y65Chq6it/5tMaZvCfCThTwCz+J9pBhUKL0OhW87M DhBACp2yvsQ6ukSg2KLCU9yS3iwiS2NXDegIH8qZc0g9p8/QKdMNN/CbKb8N0DbbWZjX 1xOH3Xgk7rYzuAvJg4gaz5f40CvnNr/wkW55l6OLuTRtdo+vguwc67jXMxTdIDLFHWDs IigjVOzIZHYeTSzFzNkD3jj1hVRlF62aFKOgIhwslE5eJUNUigsPHMmEwJNxgYxuqIWX 3jZg== 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=okcfQUsJbvGgBubMBl231SWHxFIIoHPnrQLrMT7DxsE=; b=pCDP9cIg18ZHx+0qIZeHE2nszDVoBVij2eYHeip1CT2WakG1MdAbPpjn8l8N9el1qU hDf63qIz/VxoxT8WCBF6SpucoT+S1ERqiAqbLxitHJT96KuMk+JsczJVYpcF7Zp8CrPt RCtxz0KsPG+PFqeOzBFrYWoBKahp1fHCj/To9LAT88J9j4AtMJq66skdRq8p3bcT+oOU eqx4flj/Q2gNLe/yy06G0cj6eZtAiv32zi0kkhZs3+ENAc6kIAUYtdd4y63dP0hYg+bd phK9dPJSuduTI7ih3a2bUDyZ0eTydureRtSD8/OjNWQEyOoXQy7zeH07g/NgwEb8zuBD KBPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lUPJpge9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q13-20020a056214194d00b00435b9b8e8f6si9656012qvk.368.2022.03.15.02.22.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Mar 2022 02:22: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=pass header.i=@linaro.org header.s=google header.b=lUPJpge9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU3O9-0001xD-Dw for patch@linaro.org; Tue, 15 Mar 2022 05:22:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU2lt-0008R3-9F for qemu-devel@nongnu.org; Tue, 15 Mar 2022 04:43:13 -0400 Received: from [2607:f8b0:4864:20::436] (port=42912 helo=mail-pf1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nU2lr-00052X-M0 for qemu-devel@nongnu.org; Tue, 15 Mar 2022 04:43:12 -0400 Received: by mail-pf1-x436.google.com with SMTP id g19so18515948pfc.9 for ; Tue, 15 Mar 2022 01:43:11 -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=okcfQUsJbvGgBubMBl231SWHxFIIoHPnrQLrMT7DxsE=; b=lUPJpge9TcgreAVQ6BHdy1CA6kCDx0PFwnD+tVU7/3pNBwexqEF+4RT2kt+1zHOG4X X743szgHzLhogNqoecjuV6OOrTsNVa4wu1GVn8c0GVD9aHtJpKAJiyNfb9ZssS9lwFa4 CgfvMLkGX9dZGjEeFuKGDYKP9/4Eyh/0McO018SWXL36GQFWM+8EU9CAi3+jGgzQxhAu c1ifJI3DDD39yXLgnRT7I3dx9S/z6Spg1qANro+OJG2lggSKyKDgB9jUO1gB6JTq1cR3 yoZiZUIzTp59ZcbHWPXDL/r7xc9+nrrLXjyQtUdCVMOAXOMDCHpGyoEMkJ4PoGWQsF1D a1nA== 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=okcfQUsJbvGgBubMBl231SWHxFIIoHPnrQLrMT7DxsE=; b=Q7cHlxME7eofoUsgaWUNS/+TIIUXOwfufhiHfPrzR4ihTZcr/cvdl00/oTdcgCCEuq 87Ospv0QpXAYwgMNTbGTsRddrwV9Wcx/D97rGrJCzHIZUx2tVCjI7Szs6UHkaKze7qw6 dFhSJX/Gk1KYdKt9GiAFNQDHlHA+Q1R/JorwFKovlSrPI91OCf0dA8a5rS1UmTP7ACFH 59mS4BPLW/O61lPWNCBky4RXLIf5FeTnja/4TQyGl5bWnr45ZoSrZ0dk3G67E5LgjurU MfhIQFSGiAWX09PJSi51Djtpo3A5Vh4R6KRaNdoNSbKdzFOqpRnqxJk1h5tfbR+HVCIF nuKA== X-Gm-Message-State: AOAM530yvg59YGPIFtDPECQ/bybrzRSmvYo6yHm1mb0icK9EPL0l/6b0 wLBJgk+Cld9rlSYDeE24r+/PhFhLfvFlfA== X-Received: by 2002:a62:7981:0:b0:4f7:9e4:96e4 with SMTP id u123-20020a627981000000b004f709e496e4mr27966954pfc.4.1647333790290; Tue, 15 Mar 2022 01:43:10 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id ob13-20020a17090b390d00b001becfd7c6f3sm2233762pjb.27.2022.03.15.01.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 01:43:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/5] linux-user/alpha: Fix sigsuspend for big-endian hosts Date: Tue, 15 Mar 2022 01:43:04 -0700 Message-Id: <20220315084308.433109-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220315084308.433109-1-richard.henderson@linaro.org> References: <20220315084308.433109-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::436 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" On alpha, the sigset argument for sigsuspend is in a register. When we drop that into memory that happens in host-endianness, but target_to_host_old_sigset will treat it as target-endianness. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b9b18a7eaf..ecd00382a8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9559,7 +9559,8 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, { TaskState *ts = cpu->opaque; #if defined(TARGET_ALPHA) - abi_ulong mask = arg1; + /* target_to_host_old_sigset will bswap back */ + abi_ulong mask = tswapal(arg1); target_to_host_old_sigset(&ts->sigsuspend_mask, &mask); #else if (!(p = lock_user(VERIFY_READ, arg1, sizeof(target_sigset_t), 1)))