Message ID | 20231018233134.1594292-4-richard.henderson@linaro.org |
---|---|
State | Accepted |
Commit | 3b894b699c9a9c064466e128c18be80a3f2113bc |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1258431wro; Wed, 18 Oct 2023 16:33:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeBfXaWnuAPhD5dgQvaDLoOw3SRgNtapE6DAIeo+/Q79xGMZcu42f0zzBwgHL5zXPNzV9/ X-Received: by 2002:a05:620a:570:b0:775:d7d7:d049 with SMTP id p16-20020a05620a057000b00775d7d7d049mr532274qkp.67.1697671989776; Wed, 18 Oct 2023 16:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697671989; cv=none; d=google.com; s=arc-20160816; b=HJX6S3OOIimX1ft8EoNB8YNzwetI2YYc304B5JQOZ41930DjHbNEZlr3+RJsqrisJX Czu7H2NhjjJVkRfN69uk/GtrpGHIJOtudPCSZL9BXsXf2WEnKaUuZlyXb1fY/8ddPXJl aOoTRM48mLNj8FV4wwlFGhEMLX2xSSvbAfgQc7R+eKSqjQnNSfhebEJL0u15ql5yIlKW 2OJBSOcqJK1ZTJfX2mappzvJW9RyeWSTQcdV74n4nbk8CMoK04kAkqpiDEIEa5s32iOW L8ihXpGHz9KxcqPIqvCsTHB2XsrZuj1IPKkplV+oD4zzhsAk3tHjGFyhf591D7CQk0JS Qb7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=2k8XNRKudZqb8EBVa8P0hTDCeDuuDeqPExqYOmBXPTU=; fh=vMw6S/E7sjhp9Rx21XLcbWs2y0eiwbKGEuZzTdn3vz0=; b=Q7MmhhZ29INGSdhf1AjxqPUQJxwX/bPhtr14Sjqj3HFS0TT0BCcVdbsly04n1fZuRW D7JW6Oow9Up2Rjc3/pAmJxbaDgm+21vkZWYsKEHgoK7CQf8Ht4rP7+MoZak5DvDjDTWh VhKmAxgOyTf5wkT0q6Es78VhRSgLXxKfE3X6Wr+8eeooeOTSPryEpSeGPiQo+f6o5xau M6FJ6VptaOmK2XwBluwpfHANPw4ckZPe5iNqnQCTh9h/QuouHG8OdFoB0NFtBLrI7wIS hLkW7laU817LeKOdQLRz+VNWbeanKUYmKZ0SHtuaHZYZ/cAVMLamOkArW35vPfXsje4f kdHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="T1HjE9s/"; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z3-20020ae9f443000000b0077587ebfdecsi713829qkl.176.2023.10.18.16.33.09 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 16:33: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=pass header.i=@linaro.org header.s=google header.b="T1HjE9s/"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1qtG0t-0003sI-Fm; Wed, 18 Oct 2023 19:31:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1qtG0r-0003bl-Tg for qemu-devel@nongnu.org; Wed, 18 Oct 2023 19:31:41 -0400 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1qtG0p-0000He-Am for qemu-devel@nongnu.org; Wed, 18 Oct 2023 19:31:41 -0400 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-581d4f9a2c5so1295454eaf.0 for <qemu-devel@nongnu.org>; Wed, 18 Oct 2023 16:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697671898; x=1698276698; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2k8XNRKudZqb8EBVa8P0hTDCeDuuDeqPExqYOmBXPTU=; b=T1HjE9s/vAwmlJdg3j4bvMnWFNEUhgxCi83qF0fciFrq4iMeXPdQnGgBWsnkUqzIUt jxzXImOc3/JpaXpX8ZAGv0QW8Ac6bjHPGpEFT5mqT3OqJM7z1vfHRZxEQywvdwTe0g9d dujdI0CtwAVUFd5vXX6HzyhwB1ba28Uxgj/UHKnYUQDE0MUy9NZHTQy/mSY6nSDcHNVj 0AgZtUL3OhC8i0U/Q81acJEpFtT9MJtzxVbAuVWXP942R8Z0vdC3dIK6E2JOn09ebdYB HbuPS7gIaOIbO532FJgyIjgLhwVp3O7q0MjQ5g21tSQxwuFqMcuqg7LZ1Feh8HsaiTpf f0Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697671898; x=1698276698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2k8XNRKudZqb8EBVa8P0hTDCeDuuDeqPExqYOmBXPTU=; b=ILyzx6GKlD1WKv+mb02rNAt2xUJv9AsZmmkeeY2tUii4tTaTaOHbEn7JE0tGTY1oG1 WLo9sagVBWrolgRsYQiih77ekYdgL5+SJ4alxLITkPSXCtIvDXxhgVjzYc29WSeh55Sd QDz95IGkrwZQ0Q6DrNc8phq6HwlpiFzjV0STpRCBEPkE+t2aWQP6KZowyT4OWQqKetLF freXX8v2+4BXNapuf/izlQlWHqRpW/tz3moDGgwSYReSdBoTtXTe/+z77C9OeTSLjnT8 S/zjL/ovEgWAXFTXShMdnU1Ns0ZjK4/gJcOYE5wGPiyUJhGyMq/Muwmh7XOGkg2WLexN 9a+g== X-Gm-Message-State: AOJu0YxtocmN/BK8fUcyUnb0nZ4cLucBJKwr205Bt2yaklzAPhWCUDS5 t9kky90tL303aAZpedhnvJPBb8OABAVVZVdJkZo= X-Received: by 2002:a05:6358:fd02:b0:143:70a1:afcd with SMTP id ui2-20020a056358fd0200b0014370a1afcdmr453415rwb.1.1697671897987; Wed, 18 Oct 2023 16:31:37 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id g9-20020aa796a9000000b006be5af77f06sm3881690pfk.2.2023.10.18.16.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 16:31:37 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Cc: Mikulas Patocka <mpatocka@redhat.com>, qemu-stable@nongnu.org, Yoshinori Sato <ysato@users.sourcefoege.jp> Subject: [PULL 03/14] linux-user/sh4: Fix crashes on signal delivery Date: Wed, 18 Oct 2023 16:31:23 -0700 Message-Id: <20231018233134.1594292-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018233134.1594292-1-richard.henderson@linaro.org> References: <20231018233134.1594292-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::c2b; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2b.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.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
[PULL,01/14] linux-user: Fixes for zero_bss
|
expand
|
diff --git a/linux-user/sh4/signal.c b/linux-user/sh4/signal.c index c4ba962708..c16c2c2d57 100644 --- a/linux-user/sh4/signal.c +++ b/linux-user/sh4/signal.c @@ -104,6 +104,14 @@ static void unwind_gusa(CPUSH4State *regs) /* Reset the SP to the saved version in R1. */ regs->gregs[15] = regs->gregs[1]; + } else if (regs->gregs[15] >= -128u && regs->pc == regs->gregs[0]) { + /* If we are on the last instruction of a gUSA region, we must reset + the SP, otherwise we would be pushing the signal context to + invalid memory. */ + regs->gregs[15] = regs->gregs[1]; + } else if (regs->flags & TB_FLAG_DELAY_SLOT) { + /* If we are in a delay slot, push the previous instruction. */ + regs->pc -= 2; } }