From patchwork Tue May 19 02:53:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186912 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp3447837ilb; Mon, 18 May 2020 19:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNB100YMkUO3SNhENZmO/nr0wNS8quKDplqljJ1Xd0zZKUiB/MvHsO/kazqPhaoHyFyQ6N X-Received: by 2002:a37:9dc5:: with SMTP id g188mr18219753qke.193.1589857065800; Mon, 18 May 2020 19:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589857065; cv=none; d=google.com; s=arc-20160816; b=nM73lbHzekGYuVgPtnq5Xn6cg75k3fGCaktbQzExUbTDbyXFYo60vRcHatM9b/QaFe phu7mVrKi6cSpdHduveh5Zf2L6WacjSmklTtxMQxedjOpDPINOtyjpkGztlnfFqVZMAl wXUTbnaeYbcBQ7tRRXUZ6ixCJLsDad67TsYwHuQQBqXdY82tfNsPnAhchyVZ4AK0KvQB nhsaiRcf2rEmqlok1xVOGpWFzAXpmlEtgVOJ22tPsQXMGBI6OMqFTy+Le0+ps2e3BQ1w i+omDUcmxRzVERVMo7ErMN3zkJyopCcUzfgLC4PmxrnDm7NoBmZXATU9U6QGpjgJUpBv EgWQ== 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 :dkim-signature; bh=tqkKmnd9c2hIbo2X4DhmexDNHIE6TrbObnYZ+jtrN9c=; b=gC9PUNR33EdZ8hu/4YOLmHoefT9o7Bjs7tUJ4T7/NQu0OB/WXt7hZhMBkLasUas7AC apOWoHZGQ+ikRN3hb5mArgKolJ12jwzRWtu2+exU+m7uuG0PaMuiDB4k49pkMf79N5Z2 OMQYtpTGpHx9Cb4ssU9WsJg1AdJfMeHlDZNfN8zx90WJ0BoI/RUCCS/MRqGhMSqt7ZOK tmcrkNADPfPWPeQa6bTt0p9I27h2nsqNKeoNli9C36jw2WFTUvXbZxwBNrnzLy3q3ctY OXeyp8sLQ2g89Cpnk4x8eskaS726/VSqEj0Zw0hPZKfqvWXNo4OTmWsZdSVOvo+X+FEx /duA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xkIkTWl4; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 35si3596346qtg.242.2020.05.18.19.57.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 May 2020 19:57:45 -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=xkIkTWl4; 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]:44238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jasRt-00047c-CD for patch@linaro.org; Mon, 18 May 2020 22:57:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jasOV-0005Sl-SW for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:15 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:40971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jasOU-0002SE-T2 for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:15 -0400 Received: by mail-pg1-x532.google.com with SMTP id r10so5732454pgv.8 for ; Mon, 18 May 2020 19:54:14 -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 :mime-version:content-transfer-encoding; bh=tqkKmnd9c2hIbo2X4DhmexDNHIE6TrbObnYZ+jtrN9c=; b=xkIkTWl4Q062EuTllCJkfwEWdjAjxDrFfB2GevVVsqalJMQs17ZATA7K94MxLyiUvf 9Bbg9LgmwxKBGS9+EGr8MRYlVKYgjuq+0cH/LN8jRTkXZDHEVSLbGg4HIpsjPnK5AKj/ wVVK+QfHJMFhRKh1MQJLNfyBs3QnMDhv7R0iGt6xpXYGI9I00nfgcCb/NXbieXjzxmEH 2g08I2PluK+ZeUwGsMsmteBtYTVcuyV8oEzs+Sxrx4R0pKs3PbgeiCL85M1Gay6hjzxg d6rwTydLRBa4Cph6HzRWLldnDawKWZNE/rGn1PF4UBa/F2zkmQuUFb1J73weHNWK3vcp 5fjg== 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:mime-version:content-transfer-encoding; bh=tqkKmnd9c2hIbo2X4DhmexDNHIE6TrbObnYZ+jtrN9c=; b=sby51huspMvWNkgt+sICaOwiJdwWwyQhJWRK4W6t0hSNW7eq4leQkx99Ey1O2OQM+z sElU95f5XsGKFvt/2gwObxbhBDVrSaZOoILg63zToFjnSmszX78lIgxDw8/lJ6e6wJFm HkacHRLekzK1IGmYicipGzKylgXXZgwYULXQ2tRVrIqpc5sJoFCUOxBVAW20LW/reJzZ MJuQYGeWpKNINEF3kDxYA7rqIb6XXaTbgBtuDAOBLOn89aMOS3x16xgaNRSnrOj3uio2 xF7rwJh9jqVGYpZUd6t0QkiOh/JRxjYaXvZpae/FCsNh7od7YEsAaYWFqbYZCSwrZloF sHfg== X-Gm-Message-State: AOAM531BGWscQmd0b2zU3UjoCx2+1OkwfLq/GOv82g2nYRNOhfaN5jWb EC52/JH6Ctg+e+KvKSuoe88oH5mzUTU= X-Received: by 2002:a05:6a00:804:: with SMTP id m4mr13258262pfk.89.1589856853269; Mon, 18 May 2020 19:54:13 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id a2sm8772418pgh.57.2020.05.18.19.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 19:54:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [RISU v2 12/17] Simplify syncing with master Date: Mon, 18 May 2020 19:53:50 -0700 Message-Id: <20200519025355.4420-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519025355.4420-1-richard.henderson@linaro.org> References: <20200519025355.4420-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not pass status like RES_BAD_IO from apprentice to master. This means that when master reports i/o error that we know it came from master; the apprentice will report its own i/o error. Signed-off-by: Richard Henderson --- reginfo.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.20.1 Reviewed-by: Alex Bennée diff --git a/reginfo.c b/reginfo.c index c37c5df..31bc699 100644 --- a/reginfo.c +++ b/reginfo.c @@ -90,10 +90,9 @@ RisuResult recv_and_compare_register_info(void *uc) } if (header.risu_op != op) { - /* We are out of sync */ - res = RES_BAD_IO; - respond(res); - return res; + /* We are out of sync. Tell master to exit. */ + respond(RES_END); + return RES_BAD_IO; } /* send OK for the header */ @@ -115,7 +114,7 @@ RisuResult recv_and_compare_register_info(void *uc) } else if (op == OP_TESTEND) { res = RES_END; } - respond(res); + respond(res == RES_OK ? RES_OK : RES_END); break; case OP_SETMEMBLOCK: memblock = (void *)(uintptr_t)get_reginfo_paramreg(&apprentice_ri); @@ -133,7 +132,7 @@ RisuResult recv_and_compare_register_info(void *uc) /* memory mismatch */ res = RES_MISMATCH; } - respond(res); + respond(res == RES_OK ? RES_OK : RES_END); break; default: abort();