From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B376BC433DB for ; Fri, 15 Jan 2021 23:18:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2C1A3239ED for ; Fri, 15 Jan 2021 23:18:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C1A3239ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0YMf-0007Dk-2U for qemu-devel@archiver.kernel.org; Fri, 15 Jan 2021 18:18:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0YA1-00038Y-Fs for qemu-devel@nongnu.org; Fri, 15 Jan 2021 18:05:41 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:46096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0Y9z-0002i0-45 for qemu-devel@nongnu.org; Fri, 15 Jan 2021 18:05:41 -0500 Received: by mail-pg1-x52a.google.com with SMTP id c22so6929129pgg.13 for ; Fri, 15 Jan 2021 15:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ebnzjwVguKxw/csjqUv7Px25j/JIheXeopz65cUiHwE=; b=qeD77m998Bq3PbnJG6m3ie0UaldOxlQw+RpUZ+AnUBE1dH+F9tr8s0+izPpacW/dP8 U6ltIZ4CulAw5tl/WaNXsCn2KZjv8eEsD6VmHffzEZ1jsMarcXBqQxyBRUMg4SrtearW rAvLuOI9bBNyjfBS5QXtex1v9RenAPxUgq2R7nM01WCQeJba8o+gsttr5yZ9RaERJlpt 739AoRwfELIhAeSG3lAYP1HPpvaEIltEOI4uQVbk9wJff9sPC56pt2x+UGMVpLbEhy1S S+CmzXZeuNPRFwRE9Dtm9pMt8+6RbmGkhJVifJOkN5B+JYfcsmDXiwkBubtq3UtDzT57 2n9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ebnzjwVguKxw/csjqUv7Px25j/JIheXeopz65cUiHwE=; b=M7UudhnBkNiqHIHlSXSZ8z+rnBYsggUCNQpl/16NRgBHfUq8KiBTxIRhGvWj0mChSJ C3YnCqDZCei+yIX6cP8f38vKEiloMsaGJmtkTIBtIeZoyWwp0dur2Bi2+/DTe7hbi0x8 n4ped74c9k4Ik3j0mfDVYT+HFpDUu5DUHgPd28HUEr3eIncXX3fQGMprvW4bKjqUROaf aD3mw2wLOtQ7tcXNiJuuDWWSxachZ1oSBhk59r1EI4HipmPQTW6htehGImETws3amhLO gTpNo3Vw7ONfvJd3fkPzhAkt5/lNw9sf1CDjsszxy0FbOz5QxzJoaoMyZGHSLORZucO8 tfgQ== X-Gm-Message-State: AOAM531KtR1U8uf99fz+gELmFiuJq7eapE1SnM0DrQDx+0QjpdIZdq0N GnsRoahlFAyeHeWQjy/3EuXCuw== X-Google-Smtp-Source: ABdhPJyqMcg48xApzqn/CTz/KHfhz5fSP5DstEz6Hl/SvOxZYqvVzSAVC0MTx7ao7A3J6XHIl3MJbg== X-Received: by 2002:aa7:8b51:0:b029:1ae:687f:d39b with SMTP id i17-20020aa78b510000b02901ae687fd39bmr15010298pfd.50.1610751936416; Fri, 15 Jan 2021 15:05:36 -0800 (PST) Received: from [10.25.18.3] (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id a7sm703686pfb.95.2021.01.15.15.05.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Jan 2021 15:05:35 -0800 (PST) Subject: Re: [PATCH] cpu_exec_step_atomic: update the cpu running flag To: Douglas Crosher , qemu-devel@nongnu.org References: From: Richard Henderson Message-ID: Date: Fri, 15 Jan 2021 13:05:32 -1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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, NICE_REPLY_A=-0.001, 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: pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/21/20 9:42 PM, Douglas Crosher wrote: > > The cpu_exec_step_atomic() function is called with the cpu->running > clear and proceeds to run target code without setting this flag. If > this target code generates an exception then handle_cpu_signal() will > unnecessarily abort. > > For example if atomic code generates a memory protection fault. > > This patch at least sets and clears this running flag. > > The related code paths look rather convoluted and it is not immediately clear > that this patch comprehensively addresses the issue, but it might at least > direct people to a problem, and it might be an incremental improvement, and it > gets some code running here. The patch adds some assertions to help detect > other cases. > > Signed-off-by: Douglas Crosher Sorry this got overlooked, but better late than never. Yes, this looks right, thanks. Queued to tcg-next. r~