From patchwork Mon Jul 30 20:15:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 951274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="dgwV4NX2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41fW996KFmz9s1x for ; Tue, 31 Jul 2018 06:18:21 +1000 (AEST) Received: from localhost ([::1]:55693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkEcV-0001Oj-FY for incoming@patchwork.ozlabs.org; Mon, 30 Jul 2018 16:18:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkEaO-0000Tf-CN for qemu-devel@nongnu.org; Mon, 30 Jul 2018 16:16:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkEaN-00023y-Jc for qemu-devel@nongnu.org; Mon, 30 Jul 2018 16:16:08 -0400 Received: from mail-ua0-x22a.google.com ([2607:f8b0:400c:c08::22a]:36032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkEaN-00023p-FQ for qemu-devel@nongnu.org; Mon, 30 Jul 2018 16:16:07 -0400 Received: by mail-ua0-x22a.google.com with SMTP id c12-v6so8731679uan.3 for ; Mon, 30 Jul 2018 13:16:07 -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; bh=s0ybYs5serVVxaH+rCR3jeBEp8O8+SG5Hy+WdRLMe3c=; b=dgwV4NX2sZKw1KC1qeNzOqOMsxgQ/7j0iKU1FxvEVQP+yc80CkE9wvsFDr02hH0AUl gF+Tmr9tQ53qWDIRSivRABObnl8a4eigYMmgbrCer7nGD1nzY/9ylfQ4j+Mh6eHHZQKO kzdjfFfVJPru+OBjKEGg0UDyg6PJl6xYStzyM= 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; bh=s0ybYs5serVVxaH+rCR3jeBEp8O8+SG5Hy+WdRLMe3c=; b=jFrBsOp6/MBkl5wubWsA1ESUaQTuU5pW8CB/EGf2zzTrzw6nwisrGWfZ3jvpxv2hJS Zw2uh4o+JsGaKHej2JHl7GzO93o8r7n521vtXQXJa9H65DLZrYA3tXa/OfU/WT4teFny X90t4mHqfNduxFFk9uG6hL6OnyOuLUYzII7tepPPV9BMxAwQfARMZpjTFZeKvkZRT1Kz 9VbUP+VbG+MncLVBbxJtVlaVHP4sEwsSaZK6ylez5lGK2hV9zIDJmLZWRQSgU77ff4qN bkiaYkp6Ic58SasSUFR3C4erWxM6juOLoNVjjByxiQzdEYQR9cDEO9iNNQh2JDVHLaxf Fz4A== X-Gm-Message-State: AOUpUlHM84yA1uYU+/ci5DeLEiqZqfLGY/fBaG1xWI5pd9zei0sbbLAu ay78edt+BrUWj3uaChYLpSzT3NdrUBg= X-Google-Smtp-Source: AAOMgpcduKNBwiT15BfNs31TmMuFt7eKjxIrihgjMlIQIFUZ4IFdhvKlIn4T5H2zBRUFo/FP0WxxGQ== X-Received: by 2002:ab0:1407:: with SMTP id b7-v6mr13178040uae.200.1532981766623; Mon, 30 Jul 2018 13:16:06 -0700 (PDT) Received: from cloudburst.twiddle.net ([190.166.236.188]) by smtp.gmail.com with ESMTPSA id x12-v6sm2542448uaj.48.2018.07.30.13.16.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 13:16:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 30 Jul 2018 16:15:53 -0400 Message-Id: <20180730201553.32423-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730201553.32423-1-richard.henderson@linaro.org> References: <20180730201553.32423-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::22a Subject: [Qemu-devel] [PATCH 4/4] linux-user/sparc: Flush register windows before clone X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.cave-ayland@ilande.co.uk, alex.bennee@linaro.org, laurent@vivier.eu, atar4qemu@gmail.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As seen as the very first instruction of sys_clone in the kernel. Ideally this would be done in or before cpu_copy, and not with a separate explicit test vs the syscall number, but this is a more minimal solution. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 91f714afc6..fe83f25686 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -169,6 +169,9 @@ void cpu_loop (CPUSPARCState *env) case 0x110: case 0x16d: #endif + if (env->gregs[1] == TARGET_NR_clone) { + flush_windows(env); + } ret = do_syscall (env, env->gregs[1], env->regwptr[0], env->regwptr[1], env->regwptr[2], env->regwptr[3],