From patchwork Wed Apr 28 19:33:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 428616 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp929376jao; Wed, 28 Apr 2021 12:45:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD5MODJ5Fr8grDD5wWgISj3kkw/iEvbgtkgRnujIyvVDSA/kRehf+SoEUq7bYAvcGydPYg X-Received: by 2002:a6b:7b45:: with SMTP id m5mr25764220iop.97.1619639116857; Wed, 28 Apr 2021 12:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619639116; cv=none; d=google.com; s=arc-20160816; b=pvf8dozpO9hxRzYywNO+0CGSgjeuwXPAFGt9HrapWyJKrOgzMwXaAb/gDONWD/YGvO pZxanwP3W0EXGOihoiHdRYLRIZYK+veo4h3WPoaPbM+IPqRQ8K/HsgZjr6+itIy/47zP ChEDOtMCftN5D9N2jv6sNHprKHD07XwH2RpeYXRE+Rx5nuGpmH13NEsb1PaeSESpIALD MRh46xb6BPPQPyEP0cAWtfvUXEoqRmj8QY4sraFzYvNGo9cAWNnx7ssiso7EeXt9waAN hsU5H7eLMbrc2N5+oaMNCHdMi1/KAAnjYOngvpYMiZI8aN73cS86y/RT3ZlWJaKjPCKS Gr0Q== 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=N/2oVwTgtFzi/+6uPZ9HD/sYjxDk5kmDDtru0pgwsuU=; b=yrobtu0eq5Lsj59WrDM2nV3T1tyHEo0T4ZycXqVET60Gus5OmBw2RROCsa40FJdJhD slI9FFX8GZgM2TFzGsKEnFR352lzkOPsMSec8rz9mCaC5S2Q0iO+v7bPi4FG4+QItbVk RdAMe5VXCWc3ppgtuKUpAoe5g9aDbLylkJodPXWbaxZ2MxZTUEaU4+GcdVupr5/QUR+R P55AU0tEKBPEdklgf5SjXcYARmmib9pp+p+xYKhmyOtaMfscRaKrt21h2dWFOu1/Kf5K pRCTeTAK3kpEFuKeOGVY+yc7+BuzALhvH+VAZbM2+W8R1yeplwdNjIxoiMo4OWqjqoBu EFew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TObIAaV5; 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 h10si966148ioe.38.2021.04.28.12.45.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Apr 2021 12:45:16 -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=TObIAaV5; 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]:44046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbq7Y-0007SJ-9T for patch@linaro.org; Wed, 28 Apr 2021 15:45:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbpwv-0005sI-FQ for qemu-devel@nongnu.org; Wed, 28 Apr 2021 15:34:17 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:39441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbpwr-0004cC-SG for qemu-devel@nongnu.org; Wed, 28 Apr 2021 15:34:17 -0400 Received: by mail-pl1-x62b.google.com with SMTP id s15so5014161plg.6 for ; Wed, 28 Apr 2021 12:34:13 -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=N/2oVwTgtFzi/+6uPZ9HD/sYjxDk5kmDDtru0pgwsuU=; b=TObIAaV5V0JHvtPwBUbYZtw815b+i3Mh1i+lfPpQmdtDJ0GDN89wzDcB8Vi89ZVg/c N+p3OZBGn7GWPpCEx7Y3wjdaTmWSMNnlMJm9mAROFUACooTdHT/Ndy1dCTz0pKt8jDY9 dLg6hMxe8k5S7hDO+OGV8850fYAD3uZzaRW2vT7H+BA8MsJYohjGUY4lhg6ql3t7c6Tf TKgYHBgtA+9MeStfGEALR0MyYyyLjlfdTNMThRynFUXlBNKqfRNpJGOYj4rmfsLhRdfK +9C3s6lwIXKiL18vtAAy/QsNZTFYbwE9MfeUJNMnkmA1DyTFqWijoRXe7NMKxKrfmg1S jszg== 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=N/2oVwTgtFzi/+6uPZ9HD/sYjxDk5kmDDtru0pgwsuU=; b=pkEAFBCYq1XMGcWO6K9K6a6kbEdPv4TIRdfJ3Tqf9j95ze1fDc3bMVFkZD5fOnmx9Q ouCO/dMNb7i0EVDeHwVCHG0lu9X5EzT+g7+6BJmPmme0UDbJRiumk4InvSSqudKYgWeS GSwga0GBQYe/ma5XR366Cv/ZrDoZfRkUfatmjrTtYuc69UiqrVeSpcbwT6qLjxlRsh0m 0qU2jOlmKFhLNnShUmqT/uqcZR7xN+OheI3BAh4K/qgKbe+YcCaVQFcQEuKqIGBgEDEF aSCV7Ze80m3DQB/GZOyaCKLN0F6MyCOAobFnkwJwHuyzRHNYbkTOd50VV4nBaUe3cToi D15Q== X-Gm-Message-State: AOAM533vXN7FoCqdilGFMEBfBArCZOYHB89fwJ80MYruX0etDwmFd7n7 f3kIuLa+qCDDfuj7XA7RXrnMyatoSYCYkw== X-Received: by 2002:a17:902:c244:b029:ed:4d5a:cdaf with SMTP id 4-20020a170902c244b02900ed4d5acdafmr12989731plg.5.1619638452527; Wed, 28 Apr 2021 12:34:12 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id h21sm403725pfo.211.2021.04.28.12.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 12:34:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 05/15] linux-user/s390x: Fix trace in restore_regs Date: Wed, 28 Apr 2021 12:33:58 -0700 Message-Id: <20210428193408.233706-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210428193408.233706-1-richard.henderson@linaro.org> References: <20210428193408.233706-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -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: thuth@redhat.com, qemu-s390x@nongnu.org, cohuck@redhat.com, laurent@vivier.eu, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Directly reading sc->regs.psw.addr misses the bswap that may be performed by __get_user. Signed-off-by: Richard Henderson --- linux-user/s390x/signal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 Reviewed-by: David Hildenbrand diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index e455a9818d..dcc6f7bc02 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -232,16 +232,17 @@ give_sigsegv: static void restore_sigregs(CPUS390XState *env, target_sigregs *sc) { + target_ulong prev_addr; int i; for (i = 0; i < 16; i++) { __get_user(env->regs[i], &sc->regs.gprs[i]); } + prev_addr = env->psw.addr; __get_user(env->psw.mask, &sc->regs.psw.mask); - trace_user_s390x_restore_sigregs(env, (unsigned long long)sc->regs.psw.addr, - (unsigned long long)env->psw.addr); __get_user(env->psw.addr, &sc->regs.psw.addr); + trace_user_s390x_restore_sigregs(env, env->psw.addr, prev_addr); for (i = 0; i < 16; i++) { __get_user(env->aregs[i], &sc->regs.acrs[i]);