Message ID | 20191014160404.19553-28-peter.maydell@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="fnNV9lQG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46sP9f44vfz9sPT for <incoming@patchwork.ozlabs.org>; Tue, 15 Oct 2019 03:27:50 +1100 (AEDT) Received: from localhost ([::1]:53252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1iK3CF-0008At-T8 for incoming@patchwork.ozlabs.org; Mon, 14 Oct 2019 12:27:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37038) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1iK2qB-0004Oh-GT for qemu-devel@nongnu.org; Mon, 14 Oct 2019 12:05:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1iK2qA-0007Yy-Ah for qemu-devel@nongnu.org; Mon, 14 Oct 2019 12:04:59 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:34927) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1iK2qA-0007Y7-4l for qemu-devel@nongnu.org; Mon, 14 Oct 2019 12:04:58 -0400 Received: by mail-wm1-x343.google.com with SMTP id y21so17309012wmi.0 for <qemu-devel@nongnu.org>; Mon, 14 Oct 2019 09:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=OCgOaHwxCv0IbpTF8r+Cdvboj+Te5f+2dZxg5QmbFwY=; b=fnNV9lQG02kvxBczkbpP6nZHP0KzBoJ3i6BwxKIkgWuUtA7QjfN3PoJXrZTjEXmpZD oxiYPvBG52+5G69zlAT6VoUDrDtofgfsPF7uCjYyAEIO3Ntv8cdAsgbcGGARZNQLXHTL btHfmFqJL70pKnqsdc7BcvuPqCznmoXpxZMWETlOA9mpdU64Wv7bqr1Hi+c+4ML9VSzX f40vRa4Gd4e+a1B+6YBvu4RIpPKwEKYE1wAKqmLVNEtOVmAV7HuvbHhILKoy8m5cyEgm cFJLROHwSW/gRdTO7rPVmE6y5gBg3k8O+1iQGEW1Hgqns9pwp7RLCmzH3CTqTRm0CH5g BTbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OCgOaHwxCv0IbpTF8r+Cdvboj+Te5f+2dZxg5QmbFwY=; b=RiOyQqjiNKbpizEtY0erFhwUVGJ7x4M5DmCBg3u4TKfC6HGXv1RM7vQt9fjCxNgjuD 0Qm3e/uKvpXO27JRPaQc082/T5CmcB63HFrqTIYdIjJl6nQ1MqJ4eXBLJHgKuP9lNc1V jR/4wQTf7pefQ3mFTSJVHBFYNtLJ/+6XDArqvfLRyP7P1iRWcsl6IGP+hLlErHkkCquT Jc/vqCm/zN3hQC3PJ74sn+lY29R87xpfsA3rh5iFchzhn1fiIKTesTR5UDQbJmG8a2G3 Fht93JbKpHvwswONJ/cv1UGIsoJmtNgjUjql8EkwsaTBvRaoHoCOcTuGtHgFBokLrxjn WYKA== X-Gm-Message-State: APjAAAXEE8JlcPS1mwrD9ud7p6A7BWvkYHo0xK6VEPJKV/7NaafGY/aN Pw03cAB1kXbvfd7qm9Pmy+Em7IVD7Rt+iQ== X-Google-Smtp-Source: APXvYqw8zf2dUVMThtymXMvF18Qr5PO0eGF7rikiJV3yUlf8hE6FqEzCqG7Lmkt+9W+sN0QsojntHA== X-Received: by 2002:a7b:caa9:: with SMTP id r9mr14869686wml.133.1571069096769; Mon, 14 Oct 2019 09:04:56 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 5sm18029779wrk.86.2019.10.14.09.04.55 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 09:04:56 -0700 (PDT) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL 27/68] target/arm/arm-semi: Correct comment about gdb syscall races Date: Mon, 14 Oct 2019 17:03:23 +0100 Message-Id: <20191014160404.19553-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191014160404.19553-1-peter.maydell@linaro.org> References: <20191014160404.19553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
[PULL,01/68] linux headers: update against v5.4-rc1
|
expand
|
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 51b55816faf..302529f2278 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -217,10 +217,21 @@ static target_ulong arm_gdb_syscall(ARMCPU *cpu, gdb_syscall_complete_cb cb, gdb_do_syscallv(cb, fmt, va); va_end(va); - /* FIXME: we are implicitly relying on the syscall completing - * before this point, which is not guaranteed. We should - * put in an explicit synchronization between this and - * the callback function. + /* + * FIXME: in softmmu mode, the gdbstub will schedule our callback + * to occur, but will not actually call it to complete the syscall + * until after this function has returned and we are back in the + * CPU main loop. Therefore callers to this function must not + * do anything with its return value, because it is not necessarily + * the result of the syscall, but could just be the old value of X0. + * The only thing safe to do with this is that the callers of + * do_arm_semihosting() will write it straight back into X0. + * (In linux-user mode, the callback will have happened before + * gdb_do_syscallv() returns.) + * + * We should tidy this up so neither this function nor + * do_arm_semihosting() return a value, so the mistake of + * doing something with the return value is not possible to make. */ return is_a64(env) ? env->xregs[0] : env->regs[0];