From patchwork Mon May 17 18:14:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 440213 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1351829jac; Mon, 17 May 2021 11:52:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv1X7kg6qV3sM8d2enHlpn6sABwjNX+lDGbCzBgC0tzurw5XeUTdmo6DOVIobQr3bn6rA3 X-Received: by 2002:a05:6638:a2c:: with SMTP id 12mr1373460jao.99.1621277532017; Mon, 17 May 2021 11:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621277532; cv=none; d=google.com; s=arc-20160816; b=x7H6Mdiu1+4TniwT6YdW5eo8FJqJaupbnHH8En/nOi+snAtBzKoU2AzUhPGPGDVj6u b0sUka6X4gdQ0AtopTSNDv+OYVreLfa8zIj2fvbbavsmFHR6TILOzL6KQ5w5AOdnMvxb wWVs4cVhZeS+/p73PxS8Ye0xa8UHhPPzqZ6RMmDat3n/M5bUaTZUaDWBk6CY4fmkiic+ kohSAzlx79bWPrm1HutGJCitjxCryM1ds4p/yUmc4DOwV87RuLurZeP/Ai//1y2G5iT9 hzG5Qm73oPtnxDrC1AUWJF/pQo1D1sdDX/W/45mwSTHlYXHOrPxMYc614yWP08yROInL T9Hw== 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; bh=fE6TmQjCnwYUvKRqprMae5Im/7A49/crteUSJSnovME=; b=vIdq//c7kn0AnmBMn0tkM7NPh8r9RZaRdMLqernV3t8cXwyjs/C5+F+9a+qVBJgPYL LKHJGWAfFZsS17DfH9Lx4YK3JozFGLkY+xj9Dlf9nFdX+yEjuoQQt1sbrr3AMs8ho19U EAovqRUjI3k9lTjn9AIj5sggreouyPx6ZO7vZUAmAwk14YsZ70LZN6R3BcYdqA8krs2Q 4h1eQPBbt2g8a5QFU41wERYDJg8GaSV7uvibymX+++gOBHrjTd1++Ewlef9J+sS/+hfl sn7PLgW/W8k+Rn9BlfEs09GwZFWk9nnUKsGnGBByHCP6xenqHtjmhmApU0hyE4tnsedc FRTw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z13si12855038ioi.0.2021.05.17.11.52.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 11:52:12 -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; 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" Received: from localhost ([::1]:41580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liiLb-0007pk-Ff for patch@linaro.org; Mon, 17 May 2021 14:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlf-0006jC-Sd for qemu-devel@nongnu.org; Mon, 17 May 2021 14:15:04 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:41665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlR-0004Uq-AQ for qemu-devel@nongnu.org; Mon, 17 May 2021 14:15:03 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MhToz-1lDTXj4AZH-00eZ5J; Mon, 17 May 2021 20:14:45 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 37/59] linux-user/s390x: Fix trace in restore_regs Date: Mon, 17 May 2021 20:14:02 +0200 Message-Id: <20210517181424.8093-38-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517181424.8093-1-laurent@vivier.eu> References: <20210517181424.8093-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ize/B7UhVuk5fK136XV9ZGQcwUo7POg7AB5w59qw3EViKPs0Y7f tmLWQwjg63gla/LWcIkhqZrP9geeOPoL+/KcnfYIfPMaARdUHy23cb2H9bS4UeW4cobcV62 LaC1Cs9pG1ohE7i6cpqRUhQUbERsA7r9PVhiUt/g2phbNP5TyLFR9avZU8brscAEssKwALh DzLBJhqhOQ16gYH/5y++w== X-UI-Out-Filterresults: notjunk:1; V03:K0:yCen9tDK/1g=:bEXNQCOH3RfvHpZ4rkKXYw U+cHC2QyEugHJ4lm1mB/V1+orrADYep/kjuIDAnTmnGheF0VzFmUTrNRvFKyAfGF1mMtOUAeg 9i+6TgY9JKWu2u4w4atO0pWEWIUVu7YZxrq93bwiZfO7LKBx3N3TaOoeNRHLD+G81UPnzZKRW SBPd4fYJtgewi8ArBIOjs3dQ6mgX8ZkK17qwpTfr+xuhndHgta6rCJkf+PgGelzQDBeI5ki+q 2OFJmwxtz/D2kKmOu7UziMAIwZqfyTiaNtK410tVqQSdF52aN3tuQnzWGoKKaaVfpHxPc6zd8 ALaaWelnNOkoYE5QBXypX6ml+mmt2lQBEHtJELfqRCn0p8Jo8Nn0Z5KtJQYryQoqWdnWCmGb7 BtvWBuiDX+oDkqS/V1LXhmkSWcDSp3tyTH088LxFroQ0u7OwWllgnywMfoL6EFdWe0m6aCydT RyZnl4ssZEEoPf/fXenrDY/FaKqbUenxhyBT29OZ7UJnPICZSDsBito6KJTuGZul8OIyq0iww d4wiPWY9elaXRHG17iDR4g= Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=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: Richard Henderson , Laurent Vivier , David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Directly reading sc->regs.psw.addr misses the bswap that may be performed by __get_user. Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand Message-Id: <20210428193408.233706-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/s390x/signal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.31.1 diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index e455a9818dea..dcc6f7bc0274 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]);