From patchwork Fri Jul 24 06:44:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247110 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2183361ilg; Thu, 23 Jul 2020 23:46:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcySKRZpU/a+YzFEX/VEWyHzPw2kGu6cfF3KtJXDpOwLheOYhdmmqziMCrw7AZ69dzxfSG X-Received: by 2002:a25:6008:: with SMTP id u8mr12299650ybb.519.1595573192268; Thu, 23 Jul 2020 23:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573192; cv=none; d=google.com; s=arc-20160816; b=ZS6rWPvtT2fhrcqMncXauSyfmgVJfofZ1dsS/D5Kr5pNAkRCLuwcnrxhDzXUW+0ITs rkMgg7WpDbU/oA4JHPIelhO7mdKxy5U4CfmR0QH1Ur7pdfErsToeRLPdhgabC0OPtukf e6vYV38l4IZN0ak4p2K9RD5YAzkDvlAKKoKFri85pUdtBI7agFM3txcHNOkl+Ixfov0y jb14KeE6OzNfpaMVWYk40xliVc+qWzZRU6xIcvRxED8cPa1Wn96SErzPshXneQp88YIa F3bsBMsCBjvGe3bZ32vyeHuNQ3nhmZbS9PTbNPSKLtrWKpkZH9TXJBdygK2RyoFMiGbC JvnA== 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=Id1YCSiSU2q2j/dgGEuAaj7qLUPGFg0y3qBG4FUdnyM=; b=k/5O6ES9r6gYXTIrZdv0cV3h7ckS2FlVMfJaumrHgq6Bz3Hb6QVwinwABShySopDHr X27joblwvJLTWirXKHTjtbejetEericRkHDrlJmy7/BC38eyhfgfIk/uEMbD0vRTWIyw JoIesiAbY6qkL3uAHmE1dKHHeFvQ95jrqp+8LPSLdxZHJvWXwcnJLBWOOFkiULvnH+eK 44vUvhlh30Wi/vkvEltOVCLar/XrnMm4aFyD11jbik/Op9il9pRC9ARp1t538ARas/H0 /XMiVOLVcDJqa6pyJpMIhXR2bvCkjdMpsPekV1N9P/WcY6K7xqvVZ1oFd4v6F3EObQYO jnCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=b2JgEyYS; 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=fail (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 s14si5898758ybc.129.2020.07.23.23.46.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:46:32 -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=fail header.i=@linaro.org header.s=google header.b=b2JgEyYS; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrTT-00040n-O9 for patch@linaro.org; Fri, 24 Jul 2020 02:46:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSG-00040J-8T for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:16 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:40980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSD-0000Ev-SB for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:15 -0400 Received: by mail-wr1-x442.google.com with SMTP id r2so2164902wrs.8 for ; Thu, 23 Jul 2020 23:45:13 -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=Id1YCSiSU2q2j/dgGEuAaj7qLUPGFg0y3qBG4FUdnyM=; b=b2JgEyYSIlJbet+lauKxt9i4DpZfuivx/B/gJVRvAmfuvzEd/PlqFX40VhuGJ5RCow XDki+qoxHFrLXxcU8oUGczNPKnPNUi4WQg6x1jTLVCRKXmiSUdSiMENCWtCN2fskiGCk Q+Dhx6AXY4MMRucaP4JOzFUkoNbVM9oJPYO3/uetqY0xkYtnDOM+gKbIDCFVI/70olH4 12fKpdOf18iZt5RS+hdCdl+HXdq0CVCb0ytNzV9L4NW3p1HC9UWuul6OGw6ot87J8PG/ GgcaxaiW4IrmtExlPr5W/Tpbtft+tyfqkaHDVqblDz56o0bOwD3MZWM4S6n4B/kY+7Co BfKQ== 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=Id1YCSiSU2q2j/dgGEuAaj7qLUPGFg0y3qBG4FUdnyM=; b=p6NpejePtmP1JoULJ8vCfM7Y7HBL0UWno6ntb4ZftPlAjmDUpdDEIu5J0CNeGlKr5P MTbz7D1OVPkaGgFFP6ltzZD0uol7IMioQNs/inLJ0EoSoNK56vqsplIJs5ALWZfkaRUA H0HpkOyPlgbVGx5lxaAoOOdsLRtiDtGWXVqx7MsmWWIUG61qJPLTaH0OikubmQNzJP1F LF35oB0Af3Fcv5IMcj2Om3MinDId9dDPuIOUydSGoTr7Ecyphm1pewcPSTXIcjcqqBSK giSnU6WyHS3bzT/r1klc8xtSP7v8m+9K+nx6DRLfNxKGf1nhrZvVOkS4JdI9+pKz5Bnv jBHQ== X-Gm-Message-State: AOAM533WI1xQrTpMXMmDgjUSi/paqPiQCiWo34FqcF5s/IugaUYfOkVI xCygjAMIyEzmHsMowVBSwkbHNA== X-Received: by 2002:adf:df85:: with SMTP id z5mr6965254wrl.267.1595573112265; Thu, 23 Jul 2020 23:45:12 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 130sm285785wme.26.2020.07.23.23.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:09 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4B39A1FF87; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 01/16] shippable: add one more qemu to registry url Date: Fri, 24 Jul 2020 07:44:54 +0100 Message-Id: <20200724064509.331-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x442.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The registry url is //qemu/ Perhaps we should rationalise that some day but for now. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200717105139.25293-2-alex.bennee@linaro.org> Message-Id: <20200722062902.24509-2-alex.bennee@linaro.org> --- .shippable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/.shippable.yml b/.shippable.yml index f6b742432e5..89d8be4291b 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -27,7 +27,7 @@ env: TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user build: pre_ci_boot: - image_name: registry.gitlab.com/qemu-project/qemu/${IMAGE} + image_name: registry.gitlab.com/qemu-project/qemu/qemu/${IMAGE} image_tag: latest pull: true options: "-e HOME=/root" From patchwork Fri Jul 24 06:44:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247111 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2183381ilg; Thu, 23 Jul 2020 23:46:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm5fqg3p2kRm/sS3V/j/tGkwhooVzCZpI9tA/m5daAqU+Umr55khnlZ/VIWS12BiYPJZ9g X-Received: by 2002:a25:ad50:: with SMTP id l16mr13429451ybe.110.1595573193538; Thu, 23 Jul 2020 23:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573193; cv=none; d=google.com; s=arc-20160816; b=YtqECoVvIUsmAqFhrUMz5ZFcF5MHjlHcPdxSC+u17k7fYm64e+LsV/AyHjR7f+Dhut JypJgyp5JbN6yg0JnQO+tcFgB8QeLh+XkRa8ovwtxO5+qy2846plIhow1NyNSRrFNF3J WdASeZCYFf9HvQ+i8w0R+ZhKMdfRMAUVLTUIvCsupqJLI87qyh4gKyHhQ9MtvQ1incVT Re2ygc5oaGBCh6XoLQr0Akhh9u2ZU5r1aAd556OByYx8MX95cpZI43gyh4GN1/LjxlbR GN/FIrO0/tIsGacSz0PRtUkGa+7i42OymdMI72qAra6nLaHdGSUmDmd60fzIi7wHghBq dLzA== 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=XVrIJpB2y9Ni5lFZGxJn8qTVzv2l9retbWFqQwZwYzA=; b=U3Y7ktBKdsyIXzJFd6bekjCbsxAa8DHcutctJgBENORuXqVZBSVuu3Ugcfu0SDbjUG NBj7OWf4HPu6hNIxZPzfJV+voNhpHwa1mlmvhw1u1tVuj7FiGTzBXjfNCKqrEQaElhra p58aWgI5Btn5dvw5cx0jnopeKfbfNxgSPps7/vfGPmBZo3pEdyvxDr+L2CahutHPKyEW Uh24KC7hP94qngxFYEtGY2yMGHoGaiWiMkBmZlyCvObaFDEG4Nqd0HiOXC0THvlF1DrC U7mSHZLspDSJhEI5zuKQdKLjfaw09qgEYKVgLyDu1xVKi7Xpd0H9q2c3iSAVdFkEL+3H 6xvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=of2nc2ak; 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=fail (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 r1si5117374ybs.458.2020.07.23.23.46.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:46:33 -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=fail header.i=@linaro.org header.s=google header.b=of2nc2ak; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrTU-00041O-VF for patch@linaro.org; Fri, 24 Jul 2020 02:46:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSG-00040Q-M4 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:16 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:40924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSE-0000FK-UV for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:16 -0400 Received: by mail-wm1-x341.google.com with SMTP id f139so7229631wmf.5 for ; Thu, 23 Jul 2020 23:45: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=XVrIJpB2y9Ni5lFZGxJn8qTVzv2l9retbWFqQwZwYzA=; b=of2nc2ak7G3R/14eKYDrekzPb0Le2mZyrw4iQ3dOsj+37n4JVMpf11bPTrvpKYl33F pvLwYEJQPvMRmNNzdyXIM7++GW4iQz3x4qhc/+nwaamGfEqBaJFRzMCXrZzeABsOY/a3 PgWRDHXrVSFrl1qWxUwk0P6UZxC9FLfSWYfX2vJlwh7bgXF8tzSQQprJTMDTY1ZeIdrp 0x6149B7vFtYGWd/9sjRCxlPCTJd8DgUvq4Bu1B3oRQnXendRWVKKnqwxNuIOyu4Pp9o pC0jREXLgIMoaxczrG55YIy4ILSF6D/lzBLRDXZJ8drdyv/PGbPxytba/Zx3q29+dlxe vQIQ== 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=XVrIJpB2y9Ni5lFZGxJn8qTVzv2l9retbWFqQwZwYzA=; b=HM5FIGHyEY5hNSdzY2/rIxFS+Wk4l41phwJaW6A3HvUGZvJI68SFBzG0L3oRdgeqFu p4AIHCphlMmGlygQdNqdw9jc7L3EEoXLvBWZWO2/qu5OgJJ/GTG2PXyH75RQr3o0k1gT xobllPphzVaAPvDR1W408CGMX1rJGg0FqYK3H39g3togi7ZuPlNDsTXcZVBrsDwu976r fdvZ49kIj8+6Awwu3pLMB/90blT4jDsOZ5LyoDzm3XilJ7/GOXQ/UOdxmBy419yRLsmp 3T4ysVLp1gCBpWIIgcf7iahfPitOJWI3HHUHgjxGWSQlHpesvu/43jgnJdLJohOGtEga svSg== X-Gm-Message-State: AOAM530cVBJfkWjxAffcg8nMxegVkZdPC56h1nNbi/MUlwt6U5oCLtZS h5ydCLibDQLrEda/sXfMhQRZhQ== X-Received: by 2002:a1c:2c0b:: with SMTP id s11mr5782235wms.48.1595573113421; Thu, 23 Jul 2020 23:45:13 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v29sm151317wrv.51.2020.07.23.23.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 612551FF8C; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 02/16] semihosting: defer connect_chardevs a little more to use serialx Date: Fri, 24 Jul 2020 07:44:55 +0100 Message-Id: <20200724064509.331-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, KONRAD Frederic , cota@braap.org, Paolo Bonzini , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: KONRAD Frederic With that we can just use -semihosting-config chardev=serial0. [AJB: tweak commit message] Signed-off-by: KONRAD Frederic Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <1592215252-26742-1-git-send-email-frederic.konrad@adacore.com> Message-Id: <20200717105139.25293-3-alex.bennee@linaro.org> Message-Id: <20200722062902.24509-3-alex.bennee@linaro.org> --- softmmu/vl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/softmmu/vl.c b/softmmu/vl.c index 34162415579..295459adc95 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4127,8 +4127,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, &error_fatal); - /* now chardevs have been created we may have semihosting to connect */ - qemu_semihosting_connect_chardevs(); #ifdef CONFIG_VIRTFS qemu_opts_foreach(qemu_find_opts("fsdev"), @@ -4277,6 +4275,9 @@ void qemu_init(int argc, char **argv, char **envp) if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0) exit(1); + /* now chardevs have been created we may have semihosting to connect */ + qemu_semihosting_connect_chardevs(); + /* If no default VGA is requested, the default is "none". */ if (default_vga) { vga_model = get_default_vga_model(machine_class); From patchwork Fri Jul 24 06:44:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247115 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2184250ilg; Thu, 23 Jul 2020 23:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy1C+5tRJXhLa1Ds+UrED+N3aKxRE1tWkCwL4isLBs4j4FixHsnK+FmUIdijLmgZmA9sOM X-Received: by 2002:a5b:449:: with SMTP id s9mr1486785ybp.465.1595573272611; Thu, 23 Jul 2020 23:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573272; cv=none; d=google.com; s=arc-20160816; b=bdB9/kofnuz4LJdSUK5GW8tJUgw97jxgBaQu74PQnRFhSBXwgPL43dK6bpWCLZT2qO pJiscWKym1ssPqH2bdBATfpy7jGzy4/n0xKjp5vqbpro+kyEVOxmFM889LP+uYC3z2L5 nLXhtBcyuCqaXuDNbQ1FzRMTDkrM1e4xc7kplfSSFEaXPvd7O0+V0pgdsIvGekY2Fv9U 1VlxxRip+FJSI6OrGV78Adc5I8bWENf2OL79Ks+1qRmpDP+/J4Av3m8ynNDU5PApHu/p BhCOrFjyPc/WBPEtGmwhyaPiiZDvV5kKSRdUR9Mr0A9jTb96bItaINVV2auEb/mmGPkp 0yZA== 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=rsXsx8FncieYCf39ndgf29iTUZcqWDqZZxZPkE3/pro=; b=zt1EwUVKeMtgre98xhpglPDAbJSzFHMbIsd2DWZHbbBDmYGDJD5lbN+evlHX7r71Mk pBz0/aMoDqXWLMN4RULt4YHvSjp51dfiq7/TopN5zaV3CYpyVPOF1JnVvGOnPXr/EgpF sT4Vh3moR2diL1XDXHpQyP8nBHxF9Gi2MdN6wY7LQShatCN6r+LAa15MvVaJ2fKoxfn4 9PkFdlM6RQSxNk2OC1JRGBP+DnxW8/EPk6toFgoBoKDpprbHB+vaLleC+tFRqY/Ej3mj 7Yv8PHwFx9f7o1cWZJeX79TBXX75LPbIRdqjK3yRcQ+bqVJORTvH0ZXdHpCiLebK6y3a My8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="hDO/lwhM"; 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=fail (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 a19si5330751ybg.332.2020.07.23.23.47.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:47:52 -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=fail header.i=@linaro.org header.s=google header.b="hDO/lwhM"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrUm-0007Z1-09 for patch@linaro.org; Fri, 24 Jul 2020 02:47:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSH-00040Z-Ez for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:17 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:39684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSF-0000Fl-V6 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:17 -0400 Received: by mail-wm1-x342.google.com with SMTP id t142so866005wmt.4 for ; Thu, 23 Jul 2020 23:45:15 -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=rsXsx8FncieYCf39ndgf29iTUZcqWDqZZxZPkE3/pro=; b=hDO/lwhMonVa+6SByA30W4yX/1mZvCsyFkHTmfLYKEOxRlHJN0y7onDCwKnOM3VLkH duGqS0EM10SmFFjez9sE+7/tGlk5QCILm4wAIsl5MPEcQIRYBGApx7yXsLcxkmzXFbF+ n5H+FAnuJeYBxhFhF1ywSljI4FcWt1fI8RSzXQjuR2BfNUxo7lAukPomSadR4do0hu++ sxktGJTVhUcAtKAZNaV9PSy969WCVfwzTdUsZFIKj0vlaEEyJVTkRPfDAmG4i46ScZdO Niry0erN/uBgRtZtgGA8GcJGgga4/5aBYqaYwYWjHAp5jUolQoj3+8HA84ail5FlEiYg AX0w== 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=rsXsx8FncieYCf39ndgf29iTUZcqWDqZZxZPkE3/pro=; b=spHe/c1OJR2GwDgulQiFStCF2LuL3qy/ZI88BHvhVYI0aDFBKFbW+JVSM7JXZyB/9J Ry1Z4/wW05wMmqSMq2SxRbQxKhM2Hfhazox/JzlssSJ4snVSxkrYygNppWT7i5S1hquy z7XGLOMbe7bj9rvNCr3l27Uz3aidM2/Df4RVGnoUGBWYOqnNzYG7knt7KPPtLqiZQUpZ omjhU1KB6uxCEkW9SH3LWFVp4EvFcnhnc7Ytj0c/wkRxbgMzRnbfLP3GMyQBd1ElpwLi bmgaExp376vun5Ia9GvVxZJiQbX8Lv96QcYkxFfQEyk77G+q2H7tKYXCdsyEQldtwJMy gX2w== X-Gm-Message-State: AOAM5304dWm1b1ZYUoEMzjI7hZESsaCfmB/Xpj5q8z5xk0AtDAdJBn02 4Pj3fviVPeCoQBq31h9vuk8i1A== X-Received: by 2002:a1c:ac81:: with SMTP id v123mr7030985wme.159.1595573114499; Thu, 23 Jul 2020 23:45:14 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c24sm172551wrb.11.2020.07.23.23.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 768181FF8F; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 03/16] semihosting: don't send the trailing '\0' Date: Fri, 24 Jul 2020 07:44:56 +0100 Message-Id: <20200724064509.331-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , KONRAD Frederic , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: KONRAD Frederic Don't send the trailing 0 from the string. Signed-off-by: KONRAD Frederic Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <1592215252-26742-2-git-send-email-frederic.konrad@adacore.com> Message-Id: <20200717105139.25293-4-alex.bennee@linaro.org> Message-Id: <20200722062902.24509-4-alex.bennee@linaro.org> --- hw/semihosting/console.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c index 22e7827824a..9b4fee92602 100644 --- a/hw/semihosting/console.c +++ b/hw/semihosting/console.c @@ -52,7 +52,9 @@ static GString *copy_user_string(CPUArchState *env, target_ulong addr) do { if (cpu_memory_rw_debug(cpu, addr++, &c, 1, 0) == 0) { - s = g_string_append_c(s, c); + if (c) { + s = g_string_append_c(s, c); + } } else { qemu_log_mask(LOG_GUEST_ERROR, "%s: passed inaccessible address " TARGET_FMT_lx, From patchwork Fri Jul 24 06:44:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247113 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2184239ilg; Thu, 23 Jul 2020 23:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb9tyGko3EtCqkPM36lwQQ6Um50S67MidVrgHhxsoepdVh1PSTS+a8tDfjrVFAJjW0hhVj X-Received: by 2002:a25:6ad6:: with SMTP id f205mr11491059ybc.76.1595573271967; Thu, 23 Jul 2020 23:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573271; cv=none; d=google.com; s=arc-20160816; b=Jl6XR20XYt43AtwJDDPJ8F6CeABlEeDcFijw2EkYDI22OAz/XZOEsCFsPrKO/p86Mp /rjXVaBq06fxPnCk9H4Ee5Z81zFkHEWSOwP3Gb0jl+i+6GOLm8RIqXvHVbHmX0eS5czh RG6IkSIyBLbkZ1daE+icj3SX5/cZ4rgUPcE0e5Gj9Mfqy6WIWxBOE6kAGfZs3UjccShQ XOH2woqdzlbni3y3sCWSBPkWg4NE5avj1bGiRiJ/RFHeBUs10UQKVq0w7Ph9HkM24Dvx p47NTDrkZjbhADIZjhhoiAIYzBYB+kIPfa0PsWjkgU3CkrDMAM9jQTUgH8xvsL7wZU8k a9Rg== 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=PghOm1+HJC0LKDphDTQ911GBY6Sy1XxnGIQ56Ai0urg=; b=tL2gsJzqxpYSdZDrOAbiI8VtzUE+wyFmPUWn402j0444Dhcp9jqLtmwhccizCCIOZ7 u/eU21yJ28d853dziVwLGT3+H4GbQyWLMseche8Dy0J9lh0UQvVEWjE9oEQ4Tf/n5H0T hCVkDaobY1zS2D/B/Xz++CBKXpiPIl/Y82mmaMMV0NW7MunXZsgTowtnnR1n/Af5TC7N qmUDber0FdAjk5OHprM/hYkuRiOosLhM+6+tp4Ak1Cvqp9Fti8d+SdOUPvzYkJmAR5Jp 15S56N0NmrTDZ9h8D9Jv7UXheeXtbavLNtxEIX80edCaACI8VJva0UEdMo/OWqt9k9Ht BvOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uD93kTMU; 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=fail (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 z6si6052922ybh.203.2020.07.23.23.47.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:47:51 -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=fail header.i=@linaro.org header.s=google header.b=uD93kTMU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrUl-0007Vq-Ab for patch@linaro.org; Fri, 24 Jul 2020 02:47:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSJ-00043T-Gk for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:19 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:43615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSH-0000HR-MT for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:19 -0400 Received: by mail-wr1-x442.google.com with SMTP id a15so7238333wrh.10 for ; Thu, 23 Jul 2020 23:45:17 -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=PghOm1+HJC0LKDphDTQ911GBY6Sy1XxnGIQ56Ai0urg=; b=uD93kTMUMIzqNhJQE3P6DjZGn2+oLx8iWdaH5ZCgvyaO+Kr0v4sAFab3bqoiVFbd3c 7J8WLwAD2MrqeFh65JiwmKlS3Df6wQpG1zLynXt6TgQJmq+C7xfXnsbwEXZV2p6ueSRF c9X9OHiTFuLs6Jt048m2etTLXAy3RYIadFh6wnrihW3mIqrwIY5ThhhaBFn4s48RzQXJ TGmGo5E7+iVpkHpwVfRR70rfRY+GU3k8HSmIDh12nWh2CKadxkW5RBbfVmnnj+yvgVwu fA5m+a/1SQ9OxRGbr22VUPHMquSzsWtKxPbpHSEFz7z5YPYSBMQJpcsYjqg+pQjacrDZ RQlg== 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=PghOm1+HJC0LKDphDTQ911GBY6Sy1XxnGIQ56Ai0urg=; b=aR87FKphyuVMLVCgM2aSsknHShQTS9gVvn73rk6GCbi5FoABunQh2agaMFuWlSaY6D Bh360rnHtYmlMZkEPDEK5QX3cuC0hSzmGuoJQWL4J3XcT1NSNhd6AjSWHoEZPzw4QPrv rAQd4O0zX9bgrbwDzY7Md+ja0n4w4ccdg97R0H6oYTKCOI+ume0Qf124FxN205ZHRK09 xtCnENsuqn4E3x6GnigFiNNaPDZ/gkDdW5dZ+4uqaLiAHTQPWe9kvJypUqIfJ5YBwB5D W9IQvzR5GlYm7PZsUxLzAx8c5cOM7Kex2OrMFE1g429fapzsYiXH87IaBINGisTKRopk aTtg== X-Gm-Message-State: AOAM533idTKNqL9RRELAYuZgRLRV470GEsSvQxAcfezV51J+Gii7/7LL mIYxBVC/J61n4gh1E1n9d+gAFIAxJAE= X-Received: by 2002:adf:aace:: with SMTP id i14mr7033687wrc.236.1595573116344; Thu, 23 Jul 2020 23:45:16 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 65sm209378wre.6.2020.07.23.23.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8F0AE1FF90; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 04/16] util: add qemu_get_host_physmem utility function Date: Fri, 24 Jul 2020 07:44:57 +0100 Message-Id: <20200724064509.331-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x442.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Christian Ehrhardt , cota@braap.org, Stefan Weil , Paolo Bonzini , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES isn't standardised but at least appears in the man pages for Open/FreeBSD. The result is advisory so any users of it shouldn't just fail if we can't work it out. The win32 stub currently returns 0 until someone with a Windows system can develop and test a patch. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Cc: BALATON Zoltan Cc: Christian Ehrhardt Message-Id: <20200722062902.24509-5-alex.bennee@linaro.org> --- include/qemu/osdep.h | 12 ++++++++++++ util/oslib-posix.c | 15 +++++++++++++++ util/oslib-win32.c | 6 ++++++ 3 files changed, 33 insertions(+) -- 2.20.1 diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 45c217aa280..0b1298b3c91 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -668,4 +668,16 @@ static inline void qemu_reset_optind(void) */ char *qemu_get_host_name(Error **errp); +/** + * qemu_get_host_physmem: + * + * Operating system agnostic way of querying host memory. + * + * Returns amount of physical memory on the system. This is purely + * advisery and may return 0 if we can't work it out. At the other + * end we saturate to SIZE_MAX if you are lucky enough to have that + * much memory. + */ +size_t qemu_get_host_physmem(void); + #endif diff --git a/util/oslib-posix.c b/util/oslib-posix.c index d9236746248..ad8001a4ad8 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -841,3 +841,18 @@ char *qemu_get_host_name(Error **errp) return g_steal_pointer(&hostname); } + +size_t qemu_get_host_physmem(void) +{ +#ifdef _SC_PHYS_PAGES + long pages = sysconf(_SC_PHYS_PAGES); + if (pages > 0) { + if (pages > SIZE_MAX / qemu_real_host_page_size) { + return SIZE_MAX; + } else { + return pages * qemu_real_host_page_size; + } + } +#endif + return 0; +} diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 7eedbe5859a..31030463cc9 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -828,3 +828,9 @@ char *qemu_get_host_name(Error **errp) return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL); } + +size_t qemu_get_host_physmem(void) +{ + /* currently unimplemented */ + return 0; +} From patchwork Fri Jul 24 06:44:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247112 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2183400ilg; Thu, 23 Jul 2020 23:46:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyNZLzg9CTjOqVwHtJM2IoVpvdJR+b9MVnqNCzimFY2NLWEomNQacBvmtkUB86Ek/P7hRp X-Received: by 2002:a25:aa69:: with SMTP id s96mr12840487ybi.59.1595573196498; Thu, 23 Jul 2020 23:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573196; cv=none; d=google.com; s=arc-20160816; b=uNt6kfE86uSLCAsGiCMaHYxWB369u0vEWopBWsSpdCgamyxlsavp7f+6Ns028sGdXD jLyT8AXG1DGBBOY2/cXGTbAh7cJrVYYM2Y7w246O5Uhi40Ruc6liULgZe+GmXD1zbxKR fNLAwEQ3NmC1n7dsYJPAKMVnbScQBaHXUqVIMz8apQLDo4VFKUn9BINPTuXGCQOM6+pk cAzcmG/OqOhgs2A1aDX9jaWXmu1vTbTFcHhSw8P6f8NcjmHJIVigqsGoFTD7YhOGn58o lt+bL//sQFaFOuaOFpZHEBEXadfuEZaB+lbQcvpYFQhBI8RXKgITFwjwanSPWbsDXopu J0fA== 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=GMSyvIe/j8rNWqKFP/JxZviEowS878eAm/0kjT0+++A=; b=wkmgKNdMEptlc88BJD24SemlbrDgHTmG3RcEgomcCf5jQ3AUVGkU/Z5PDyXx4Exwda K3QQPxoCHskuBJSUqs5lWvmCBgRKcm86ICAUiKjOE0p9flIiLdCJ7udVQ7HVy6FUM/EN Jog38UX3U2RqLFfPnzs3e09fmIbeTY1KvcvBBfWmh/bpM1OAiAosJ1vmM3BaSoW8Vmxi doarAjXXtW9rqHuGDjV3gkaHtFDA65P0x1whJrQOlMicfmcEfQPgUHr35ny3vVMHRJEb 2X1m4HyJbIxZ73xUwGYE9tLQeItoVysZLDk7aG15beLsbrC+a0ZL6+lmoOeaeZsFWRNP AGfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="i/+Q5o/q"; 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=fail (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 d22si4866143ybh.223.2020.07.23.23.46.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:46:36 -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=fail header.i=@linaro.org header.s=google header.b="i/+Q5o/q"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrTX-0004AY-VG for patch@linaro.org; Fri, 24 Jul 2020 02:46:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSL-00047Y-P6 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:21 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSJ-0000J8-Rg for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:21 -0400 Received: by mail-wm1-x341.google.com with SMTP id 3so308113wmi.1 for ; Thu, 23 Jul 2020 23:45:19 -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=GMSyvIe/j8rNWqKFP/JxZviEowS878eAm/0kjT0+++A=; b=i/+Q5o/qdgd8WEr22OJEAY8eg4zvUw6QjnE3hskmd2tOpi3+Ba07Go661YfzXQXRuI vR6rV8EN0uBUpxdk6mTuJd+BAKJP4rcFQqZsVUfi8lahlozQMp1hWwzQWTlPgJczJgXy YnAyvJm924WN9gp9rC7V0kOtiI7+rUzUjz/olEuNiGvSIRWdHtNU/qTskXjMgwtTIqLp 5KuaBbTRnZ9pnoxTol9l7MEv4GjaMm07CZ8RhpQwujIgKn79XyKzvXu/JEyF4+WcrRFG 3Wmf+6Zose+f7MDPmQHrZar0WnCayJOfRmftaynTAuBFPIMLF/s30VMV8JUsNjfIFQEA Z3vQ== 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=GMSyvIe/j8rNWqKFP/JxZviEowS878eAm/0kjT0+++A=; b=AVA3Qs45L+CgXIwy8YOdpeKkeQrUwfYN3taJi3Kv9CkvF7BRXzTpEgY+REtIBQssKx cQkbtbYIFU29iKKHCxRF3VqttYiTMoA2NF5D/WTDn5NIG0N03X+9LgGc0wGoj75XyEQv TUghLqhLBzGomFWiUFxzBrJyJAE/IPT1wxaJa8vzHPj+1agy/4FYrGHhHL8O4bK8rWuh CSU6iwXPj9adBK5h9chM9ofdEvbmrkW65c8VAbX/J4Sac3r/vDY1p5hxIhJsdaFpuPQs KCwRI6XpKQCwfrvHhvQCg/0rOi5jIRgjzCfnGpLjMhNBXmWZ7xPzPjW8dbobLUe4VMLy w9nw== X-Gm-Message-State: AOAM531CNC1YuZ56DGI1Va5Uxp6V9QWH2vmiwgORyHOQLRT/I1ByDnwj mHzW2bqkB6hU3FgX0btMHZiRwA== X-Received: by 2002:a1c:80d3:: with SMTP id b202mr7569806wmd.111.1595573118412; Thu, 23 Jul 2020 23:45:18 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m16sm133774wrr.71.2020.07.23.23.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A41181FF91; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 05/16] util/oslib-win32: add qemu_get_host_physmem implementation Date: Fri, 24 Jul 2020 07:44:58 +0100 Message-Id: <20200724064509.331-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, cota@braap.org, Stefan Weil , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Compile tested only. Signed-off-by: Alex Bennée Cc: Stefan Weil --- v2 - used more widely available GlobalMemoryStatusEx - dropped Phillipe's r-b due to the change --- util/oslib-win32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Stefan Weil diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 31030463cc9..a74ee5a3aa7 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -831,6 +831,11 @@ char *qemu_get_host_name(Error **errp) size_t qemu_get_host_physmem(void) { - /* currently unimplemented */ + MEMORYSTATUSEX statex; + statex.dwLength = sizeof(statex); + + if (!GlobalMemoryStatusEx(&statex)) { + return statex.ullTotalPhys; + } return 0; } From patchwork Fri Jul 24 06:44:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247117 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2185225ilg; Thu, 23 Jul 2020 23:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHuGYWZp7PCeqZ8kO9aLcKAMJcYwfUdXs7jGxVMemKOEeHZxMvFzb5P+2TQN5GTw3DqF8c X-Received: by 2002:a25:3bc1:: with SMTP id i184mr2989743yba.97.1595573371054; Thu, 23 Jul 2020 23:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573371; cv=none; d=google.com; s=arc-20160816; b=nMoIWbZvDzXWv4FpVH/ywdQYoCvnN52ImHOVVqxRJrVsAgNSbpaykZK6Ctgvvdhud3 xi6zm5GPsjJNjmHgTrbkjXqf3xiwZ9WdxhKI58N/GDMYNzB4qjZfoY5i7SBepgtnX39v UdKiM1iIgbuIhVAaLqyP6Oia8xSODBvnjNMedl9iuL0Jd7CPO0LRj9ZTzZqBY4CJukMY O6VrfWPP4Q+LXdstG1p1sKQMar7ewdrXNw1KcBaauDC1A+Z2GekHP1eAewiL+qc7l8lO 1KBdM6KOBArHM/9HuNp3RrMgdy2Z/afpGYbc5ZsF3ZTBR5oHTtlUhloB3baQ7ozBX4sK r1oQ== 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=6wHpeGuhHza62S57f3L4nQWiCyQTiRLWqfdUIbTB/QU=; b=f8CZAkWykvpCx8Speetx1SP0KsZ1NtrtFi3h04c+7Xjn/asV0OUB1UhRKjzlHCzWUa 2yYgwu+QV/vSxo1A7FiWMrR4Ovp+OtBKmoj82mi/9aO+pwjsEsfYnHaEiEmNZFP/MPVE UP5yhZnXFo5wOQ739hG/w9TsJuGaGgB8Xac1jr1CLGIP1nG1dQ53Py2U7GmvYGuijqdL 1Kjia6Ln6t3qO9GatQCDiG0zyEEweWefTLIsErnQOeEzo9NjAdyi9uBgnYphUeXAM2G5 H03HAL5Ol26thzrN9Qm7voD2F9N+pyC8aio2pCCzyVn2/T/mxC6EsibHj9oAmLbvytS0 JHAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="j7L1mrR/"; 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=fail (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 a6si5058974ybn.272.2020.07.23.23.49.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:49:31 -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=fail header.i=@linaro.org header.s=google header.b="j7L1mrR/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrWM-0002TY-IW for patch@linaro.org; Fri, 24 Jul 2020 02:49:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSK-00045v-TN for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:20 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSI-0000Iq-Q6 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:20 -0400 Received: by mail-wr1-x441.google.com with SMTP id y3so7250838wrl.4 for ; Thu, 23 Jul 2020 23:45:18 -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=6wHpeGuhHza62S57f3L4nQWiCyQTiRLWqfdUIbTB/QU=; b=j7L1mrR/nN3yZacC6ub2KAk/Ft5tc+uOdKb66/fdkni4xB6IYfv4VZYh08Ew0yGYxl VIju40U9ZWfbT+Dg06X+HGvQiKwUYQAIVA43uMgzhZlMN5KUnVdqciGmlHKuFhq7xmlh UR5zpzHqydHTDIkPHVBTqh7kCUkynlmJYFz6q2X5IDYGVg82M+d6epLOVX21M9mXCUlk KUkJnqJGJmop9PJob9tysXavxwuF5T70FdDRN7RHIyWq3dIXtYOP26eE2serl+EINi2k 4jcwzUI8lBGu5EUh7NMDjw25Jz74oegMRjq+iJ1vb/GGt5ANnYX7YhIWMBUMXYcj0LlZ DJ3g== 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=6wHpeGuhHza62S57f3L4nQWiCyQTiRLWqfdUIbTB/QU=; b=gGfr65+a/oaFpngPUmrZtNwoFKy6uu5q3sfJ6gL06hI6uvZmUBjY42pgQioJESxIXs 0bGL1khij9zRcyCbLsRPB9h85A6v2Tuzc2XFKW2m8ovnV8Iq+EyrScPkWyUm5h6nKsvc W56tVm5idlC26weyb8fJI5qowwKYAJikrEiT48i8tcdP9Ph+wR2UUTB4WR6IJaaCsHCY lG9MbCJH1G3DKJRVbZO55XeQBf56gwf+5WG7JB8xpqnTNg00VGKEWaPe7358lsWQcOB+ 7tzddNmFJgcnAv2v1hR2bM01dj5GE2MdwDHKL2v0EzrUri5+eC6AkTEBLo3Lol34D3Hy Op4Q== X-Gm-Message-State: AOAM531Bf0Ruwml9R+6IQZz4CIkbUitbIBOXeUaNTxx//xL3NdCzMzuR 6rO2Ze9/maaeFkp2S5qzUoUduw== X-Received: by 2002:adf:8bd3:: with SMTP id w19mr7025037wra.167.1595573117385; Thu, 23 Jul 2020 23:45:17 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z16sm165588wrr.35.2020.07.23.23.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BA02C1FF92; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 06/16] accel/tcg: better handle memory constrained systems Date: Fri, 24 Jul 2020 07:44:59 +0100 Message-Id: <20200724064509.331-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Christian Ehrhardt , cota@braap.org, Paolo Bonzini , aurelien@aurel32.net, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It turns out there are some 64 bit systems that have relatively low amounts of physical memory available to them (typically CI system). Even with swapping available a 1GB translation buffer that fills up can put the machine under increased memory pressure. Detect these low memory situations and reduce tb_size appropriately. Fixes: 600e17b2615 ("accel/tcg: increase default code gen buffer size for 64 bit") Signed-off-by: Alex Bennée Cc: BALATON Zoltan Cc: Christian Ehrhardt --- v3 - use slightly tweak the logic to taper off more nicely --- accel/tcg/translate-all.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Robert Foley Reviewed-by: Richard Henderson diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 2afa46bd2b1..2d83013633b 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -976,7 +976,12 @@ static inline size_t size_code_gen_buffer(size_t tb_size) { /* Size the buffer. */ if (tb_size == 0) { - tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE; + size_t phys_mem = qemu_get_host_physmem(); + if (phys_mem == 0) { + tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE; + } else { + tb_size = MIN(DEFAULT_CODE_GEN_BUFFER_SIZE, phys_mem / 8); + } } if (tb_size < MIN_CODE_GEN_BUFFER_SIZE) { tb_size = MIN_CODE_GEN_BUFFER_SIZE; From patchwork Fri Jul 24 06:45:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247119 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2185254ilg; Thu, 23 Jul 2020 23:49:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdZac/jBbSCL0PTp//sDDhBkjCIFbOkUVf4eHVJiMgA8+EzqrF/UU5ZvJduMRF937RP7ft X-Received: by 2002:a25:2087:: with SMTP id g129mr12223822ybg.136.1595573375161; Thu, 23 Jul 2020 23:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573375; cv=none; d=google.com; s=arc-20160816; b=X5Fc4NcvgjhK2ZCxsmblWtx6IJ8zrbI2X2PtUhNbYEevirLhrJj11MvSkIs1JFqzIJ U1zVEiJ8LUsx7CeFMv8h0+Jty/OZOCA6I7Ux5ClQVgwhto1lIMxTJeRyWzKkqGEjk9Vf MzJ+mfNumRxrj5MyTREBnUZ2viIqn9ieIs5N+R0VYr0CfIODNpcMN+uZFSyGtVouMVod WRtLTL0Y9tyYYeGKPHC4GFhP94iyCR2vOuNPeOPwWGUCfWLWyOjGHSJZaUCYptea8ONY 6J/mtpZQy4KF9Qr5a+YPduTvTKmzZrY3MU1aOO0VwMWgs2UUoi3feB9WYZ+bnw2x0/fD Swlw== 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=QIJ6+Ao9kA6apvq4j+3BX32mqklvPoOTv4EJQ241qjk=; b=mMsX0eZz2mtaEa81f3w0MSWMAAvJLdMneLqALJJ1j4XLSRdQKgomdmMW6pjZlUVpqM v2D7LHFJm0Z5oMwvWs/SEbNJyk4OLWgbG+NDSrCRreTTWxvlAzPRzKxsT1Z0yNmQZXgj EvToiRDDy9ToX/37gZEZf/DmBpS9gy7TM8g57UqgIiWR5QToOwVwLjC7/2qvFlXzzmf+ parW0dtTfgUzol6KO0S6ntnfYbM/NjITHJz6qU9rPjUAMp3wc4ian6I9ziCZwDQ4paF2 4xRkm1OOxVbwnylYeBbyBYav8XsaQQ/DS2c+c3DNo6ipHnr0J16HR9UDHN9nyN03NP0y idMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OevPCY63; 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=fail (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 w14si7127916ybt.100.2020.07.23.23.49.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:49:35 -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=fail header.i=@linaro.org header.s=google header.b=OevPCY63; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrWQ-0002bS-JU for patch@linaro.org; Fri, 24 Jul 2020 02:49:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSQ-0004GM-G1 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:26 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSM-0000Kl-EB for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:26 -0400 Received: by mail-wm1-x343.google.com with SMTP id c80so6964377wme.0 for ; Thu, 23 Jul 2020 23:45:21 -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=QIJ6+Ao9kA6apvq4j+3BX32mqklvPoOTv4EJQ241qjk=; b=OevPCY63bs+MFhZ6ev6dgVEM8vjKQSIZOlXh4hiVff5iEpP5xnu9ZqvfuznGU+oVkY YGGBRXF2/mizuX/3GKbxa/okPaEGQOeosAZXkDFNEw/G5TckDTlsP1LD8e7NLSuNxjSK qmauTh/y/GbgOkghLoPRATc6Y+RF+MUjnpV50nH5TwBw5HkHqvcfz0A169pRbOUaOIrE SZg6mVe9nXZOmDqRESFVIHLWguUZ5tAk9s48SBAcMKYosPtBeHhQ922xFhI7PVlovszc P4nSg/wjo+4Bbzxc3BqNIVWSbp67FuUENonanfRqimNkXRkOQJQ0I9eD4MfI8SKW1cbM P20g== 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=QIJ6+Ao9kA6apvq4j+3BX32mqklvPoOTv4EJQ241qjk=; b=rKvBQ1gRccZJvoxl5BTwMil8w2jwNmLml+Ad7nla/XOk8lsmtEVjqf53oYU4nIKS0D xWzD5ZQn+HADUOD4NxU6pLWA3/xRpEwhl99O0GPRs4g7Yrg+PrjfwIjOx3ulh0YzMuu9 LqbHUsruNTuFTj29NNhDrra/G3Cw1xMqz5M9p57z+W5Gy8U9V1jtllN7bRdi3QGcoa/7 /nuTjt8aiPNHPBJppa6u29ZvwDqqfjmhxXoB8IhU2W5hW58tnMjvMaxjVZdDVPuDy8MR zhVc0V/lmq4faVg0CdJDU7r0O2YQfcjULgMyWk1cljQaMgBu9cuOBlvDVIBcviWwknAR cFTg== X-Gm-Message-State: AOAM532SrrUuvYWxkdGKM60YJkSR778jdM0FbSr8UPG0La9KP6MpSLhQ 0CB6Yt01C5NR6ssTaqcO23+/ZQ== X-Received: by 2002:a1c:7313:: with SMTP id d19mr6884203wmb.147.1595573120956; Thu, 23 Jul 2020 23:45:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c188sm6231453wma.22.2020.07.23.23.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D411D1FF93; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 07/16] target/i386: floatx80: avoid compound literals in static initializers Date: Fri, 24 Jul 2020 07:45:00 +0100 Message-Id: <20200724064509.331-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.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_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: fam@euphon.net, Peter Maydell , berrange@redhat.com, Eduardo Habkost , Laszlo Ersek , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , cota@braap.org, Joseph Myers , Paolo Bonzini , aurelien@aurel32.net, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laszlo Ersek Quoting ISO C99 6.7.8p4, "All the expressions in an initializer for an object that has static storage duration shall be constant expressions or string literals". The compound literal produced by the make_floatx80() macro is not such a constant expression, per 6.6p7-9. (An implementation may accept it, according to 6.6p10, but is not required to.) Therefore using "floatx80_zero" and make_floatx80() for initializing "f2xm1_table" and "fpatan_table" is not portable. And gcc-4.8 in RHEL-7.6 actually chokes on them: > target/i386/fpu_helper.c:871:5: error: initializer element is not constant > { make_floatx80(0xbfff, 0x8000000000000000ULL), > ^ We've had the make_floatx80_init() macro for this purpose since commit 3bf7e40ab914 ("softfloat: fix for C99", 2012-03-17), so let's use that macro again. Fixes: eca30647fc07 Fixes: ff57bb7b6326 Signed-off-by: Laszlo Ersek Signed-off-by: Alex Bennée Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Cc: Aurelien Jarno Cc: Eduardo Habkost Cc: Joseph Myers Cc: Paolo Bonzini Cc: Peter Maydell Cc: Richard Henderson Link: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg06566.html Link: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04714.html Message-Id: <20200716144251.23004-1-lersek@redhat.com> Message-Id: <20200722062902.24509-8-alex.bennee@linaro.org> --- include/fpu/softfloat.h | 1 + target/i386/fpu_helper.c | 426 +++++++++++++++++++-------------------- 2 files changed, 214 insertions(+), 213 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index f1a19df066b..659218b5c78 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -822,6 +822,7 @@ static inline bool floatx80_invalid_encoding(floatx80 a) } #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL) +#define floatx80_zero_init make_floatx80_init(0x0000, 0x0000000000000000LL) #define floatx80_one make_floatx80(0x3fff, 0x8000000000000000LL) #define floatx80_ln2 make_floatx80(0x3ffe, 0xb17217f7d1cf79acLL) #define floatx80_pi make_floatx80(0x4000, 0xc90fdaa22168c235LL) diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c index f5e6c4b88d4..4ea73874d83 100644 --- a/target/i386/fpu_helper.c +++ b/target/i386/fpu_helper.c @@ -868,201 +868,201 @@ struct f2xm1_data { }; static const struct f2xm1_data f2xm1_table[65] = { - { make_floatx80(0xbfff, 0x8000000000000000ULL), - make_floatx80(0x3ffe, 0x8000000000000000ULL), - make_floatx80(0xbffe, 0x8000000000000000ULL) }, - { make_floatx80(0xbffe, 0xf800000000002e7eULL), - make_floatx80(0x3ffe, 0x82cd8698ac2b9160ULL), - make_floatx80(0xbffd, 0xfa64f2cea7a8dd40ULL) }, - { make_floatx80(0xbffe, 0xefffffffffffe960ULL), - make_floatx80(0x3ffe, 0x85aac367cc488345ULL), - make_floatx80(0xbffd, 0xf4aa7930676ef976ULL) }, - { make_floatx80(0xbffe, 0xe800000000006f10ULL), - make_floatx80(0x3ffe, 0x88980e8092da5c14ULL), - make_floatx80(0xbffd, 0xeecfe2feda4b47d8ULL) }, - { make_floatx80(0xbffe, 0xe000000000008a45ULL), - make_floatx80(0x3ffe, 0x8b95c1e3ea8ba2a5ULL), - make_floatx80(0xbffd, 0xe8d47c382ae8bab6ULL) }, - { make_floatx80(0xbffe, 0xd7ffffffffff8a9eULL), - make_floatx80(0x3ffe, 0x8ea4398b45cd8116ULL), - make_floatx80(0xbffd, 0xe2b78ce97464fdd4ULL) }, - { make_floatx80(0xbffe, 0xd0000000000019a0ULL), - make_floatx80(0x3ffe, 0x91c3d373ab11b919ULL), - make_floatx80(0xbffd, 0xdc785918a9dc8dceULL) }, - { make_floatx80(0xbffe, 0xc7ffffffffff14dfULL), - make_floatx80(0x3ffe, 0x94f4efa8fef76836ULL), - make_floatx80(0xbffd, 0xd61620ae02112f94ULL) }, - { make_floatx80(0xbffe, 0xc000000000006530ULL), - make_floatx80(0x3ffe, 0x9837f0518db87fbbULL), - make_floatx80(0xbffd, 0xcf901f5ce48f008aULL) }, - { make_floatx80(0xbffe, 0xb7ffffffffff1723ULL), - make_floatx80(0x3ffe, 0x9b8d39b9d54eb74cULL), - make_floatx80(0xbffd, 0xc8e58c8c55629168ULL) }, - { make_floatx80(0xbffe, 0xb00000000000b5e1ULL), - make_floatx80(0x3ffe, 0x9ef5326091a0c366ULL), - make_floatx80(0xbffd, 0xc2159b3edcbe7934ULL) }, - { make_floatx80(0xbffe, 0xa800000000006f8aULL), - make_floatx80(0x3ffe, 0xa27043030c49370aULL), - make_floatx80(0xbffd, 0xbb1f79f9e76d91ecULL) }, - { make_floatx80(0xbffe, 0x9fffffffffff816aULL), - make_floatx80(0x3ffe, 0xa5fed6a9b15171cfULL), - make_floatx80(0xbffd, 0xb40252ac9d5d1c62ULL) }, - { make_floatx80(0xbffe, 0x97ffffffffffb621ULL), - make_floatx80(0x3ffe, 0xa9a15ab4ea7c30e6ULL), - make_floatx80(0xbffd, 0xacbd4a962b079e34ULL) }, - { make_floatx80(0xbffe, 0x8fffffffffff162bULL), - make_floatx80(0x3ffe, 0xad583eea42a1b886ULL), - make_floatx80(0xbffd, 0xa54f822b7abc8ef4ULL) }, - { make_floatx80(0xbffe, 0x87ffffffffff4d34ULL), - make_floatx80(0x3ffe, 0xb123f581d2ac7b51ULL), - make_floatx80(0xbffd, 0x9db814fc5aa7095eULL) }, - { make_floatx80(0xbffe, 0x800000000000227dULL), - make_floatx80(0x3ffe, 0xb504f333f9de539dULL), - make_floatx80(0xbffd, 0x95f619980c4358c6ULL) }, - { make_floatx80(0xbffd, 0xefffffffffff3978ULL), - make_floatx80(0x3ffe, 0xb8fbaf4762fbd0a1ULL), - make_floatx80(0xbffd, 0x8e08a1713a085ebeULL) }, - { make_floatx80(0xbffd, 0xe00000000000df81ULL), - make_floatx80(0x3ffe, 0xbd08a39f580bfd8cULL), - make_floatx80(0xbffd, 0x85eeb8c14fe804e8ULL) }, - { make_floatx80(0xbffd, 0xd00000000000bccfULL), - make_floatx80(0x3ffe, 0xc12c4cca667062f6ULL), - make_floatx80(0xbffc, 0xfb4eccd6663e7428ULL) }, - { make_floatx80(0xbffd, 0xc00000000000eff0ULL), - make_floatx80(0x3ffe, 0xc5672a1155069abeULL), - make_floatx80(0xbffc, 0xea6357baabe59508ULL) }, - { make_floatx80(0xbffd, 0xb000000000000fe6ULL), - make_floatx80(0x3ffe, 0xc9b9bd866e2f234bULL), - make_floatx80(0xbffc, 0xd91909e6474372d4ULL) }, - { make_floatx80(0xbffd, 0x9fffffffffff2172ULL), - make_floatx80(0x3ffe, 0xce248c151f84bf00ULL), - make_floatx80(0xbffc, 0xc76dcfab81ed0400ULL) }, - { make_floatx80(0xbffd, 0x8fffffffffffafffULL), - make_floatx80(0x3ffe, 0xd2a81d91f12afb2bULL), - make_floatx80(0xbffc, 0xb55f89b83b541354ULL) }, - { make_floatx80(0xbffc, 0xffffffffffff81a3ULL), - make_floatx80(0x3ffe, 0xd744fccad69d7d5eULL), - make_floatx80(0xbffc, 0xa2ec0cd4a58a0a88ULL) }, - { make_floatx80(0xbffc, 0xdfffffffffff1568ULL), - make_floatx80(0x3ffe, 0xdbfbb797daf25a44ULL), - make_floatx80(0xbffc, 0x901121a0943696f0ULL) }, - { make_floatx80(0xbffc, 0xbfffffffffff68daULL), - make_floatx80(0x3ffe, 0xe0ccdeec2a94f811ULL), - make_floatx80(0xbffb, 0xf999089eab583f78ULL) }, - { make_floatx80(0xbffc, 0x9fffffffffff4690ULL), - make_floatx80(0x3ffe, 0xe5b906e77c83657eULL), - make_floatx80(0xbffb, 0xd237c8c41be4d410ULL) }, - { make_floatx80(0xbffb, 0xffffffffffff8aeeULL), - make_floatx80(0x3ffe, 0xeac0c6e7dd24427cULL), - make_floatx80(0xbffb, 0xa9f9c8c116ddec20ULL) }, - { make_floatx80(0xbffb, 0xbfffffffffff2d18ULL), - make_floatx80(0x3ffe, 0xefe4b99bdcdb06ebULL), - make_floatx80(0xbffb, 0x80da33211927c8a8ULL) }, - { make_floatx80(0xbffa, 0xffffffffffff8ccbULL), - make_floatx80(0x3ffe, 0xf5257d152486d0f4ULL), - make_floatx80(0xbffa, 0xada82eadb792f0c0ULL) }, - { make_floatx80(0xbff9, 0xffffffffffff11feULL), - make_floatx80(0x3ffe, 0xfa83b2db722a0846ULL), - make_floatx80(0xbff9, 0xaf89a491babef740ULL) }, - { floatx80_zero, - make_floatx80(0x3fff, 0x8000000000000000ULL), - floatx80_zero }, - { make_floatx80(0x3ff9, 0xffffffffffff2680ULL), - make_floatx80(0x3fff, 0x82cd8698ac2b9f6fULL), - make_floatx80(0x3ff9, 0xb361a62b0ae7dbc0ULL) }, - { make_floatx80(0x3ffb, 0x800000000000b500ULL), - make_floatx80(0x3fff, 0x85aac367cc488345ULL), - make_floatx80(0x3ffa, 0xb5586cf9891068a0ULL) }, - { make_floatx80(0x3ffb, 0xbfffffffffff4b67ULL), - make_floatx80(0x3fff, 0x88980e8092da7cceULL), - make_floatx80(0x3ffb, 0x8980e8092da7cce0ULL) }, - { make_floatx80(0x3ffb, 0xffffffffffffff57ULL), - make_floatx80(0x3fff, 0x8b95c1e3ea8bd6dfULL), - make_floatx80(0x3ffb, 0xb95c1e3ea8bd6df0ULL) }, - { make_floatx80(0x3ffc, 0x9fffffffffff811fULL), - make_floatx80(0x3fff, 0x8ea4398b45cd4780ULL), - make_floatx80(0x3ffb, 0xea4398b45cd47800ULL) }, - { make_floatx80(0x3ffc, 0xbfffffffffff9980ULL), - make_floatx80(0x3fff, 0x91c3d373ab11b919ULL), - make_floatx80(0x3ffc, 0x8e1e9b9d588dc8c8ULL) }, - { make_floatx80(0x3ffc, 0xdffffffffffff631ULL), - make_floatx80(0x3fff, 0x94f4efa8fef70864ULL), - make_floatx80(0x3ffc, 0xa7a77d47f7b84320ULL) }, - { make_floatx80(0x3ffc, 0xffffffffffff2499ULL), - make_floatx80(0x3fff, 0x9837f0518db892d4ULL), - make_floatx80(0x3ffc, 0xc1bf828c6dc496a0ULL) }, - { make_floatx80(0x3ffd, 0x8fffffffffff80fbULL), - make_floatx80(0x3fff, 0x9b8d39b9d54e3a79ULL), - make_floatx80(0x3ffc, 0xdc69cdceaa71d3c8ULL) }, - { make_floatx80(0x3ffd, 0x9fffffffffffbc23ULL), - make_floatx80(0x3fff, 0x9ef5326091a10313ULL), - make_floatx80(0x3ffc, 0xf7a993048d081898ULL) }, - { make_floatx80(0x3ffd, 0xafffffffffff20ecULL), - make_floatx80(0x3fff, 0xa27043030c49370aULL), - make_floatx80(0x3ffd, 0x89c10c0c3124dc28ULL) }, - { make_floatx80(0x3ffd, 0xc00000000000fd2cULL), - make_floatx80(0x3fff, 0xa5fed6a9b15171cfULL), - make_floatx80(0x3ffd, 0x97fb5aa6c545c73cULL) }, - { make_floatx80(0x3ffd, 0xd0000000000093beULL), - make_floatx80(0x3fff, 0xa9a15ab4ea7c30e6ULL), - make_floatx80(0x3ffd, 0xa6856ad3a9f0c398ULL) }, - { make_floatx80(0x3ffd, 0xe00000000000c2aeULL), - make_floatx80(0x3fff, 0xad583eea42a17876ULL), - make_floatx80(0x3ffd, 0xb560fba90a85e1d8ULL) }, - { make_floatx80(0x3ffd, 0xefffffffffff1e3fULL), - make_floatx80(0x3fff, 0xb123f581d2abef6cULL), - make_floatx80(0x3ffd, 0xc48fd6074aafbdb0ULL) }, - { make_floatx80(0x3ffd, 0xffffffffffff1c23ULL), - make_floatx80(0x3fff, 0xb504f333f9de2cadULL), - make_floatx80(0x3ffd, 0xd413cccfe778b2b4ULL) }, - { make_floatx80(0x3ffe, 0x8800000000006344ULL), - make_floatx80(0x3fff, 0xb8fbaf4762fbd0a1ULL), - make_floatx80(0x3ffd, 0xe3eebd1d8bef4284ULL) }, - { make_floatx80(0x3ffe, 0x9000000000005d67ULL), - make_floatx80(0x3fff, 0xbd08a39f580c668dULL), - make_floatx80(0x3ffd, 0xf4228e7d60319a34ULL) }, - { make_floatx80(0x3ffe, 0x9800000000009127ULL), - make_floatx80(0x3fff, 0xc12c4cca6670e042ULL), - make_floatx80(0x3ffe, 0x82589994cce1c084ULL) }, - { make_floatx80(0x3ffe, 0x9fffffffffff06f9ULL), - make_floatx80(0x3fff, 0xc5672a11550655c3ULL), - make_floatx80(0x3ffe, 0x8ace5422aa0cab86ULL) }, - { make_floatx80(0x3ffe, 0xa7fffffffffff80dULL), - make_floatx80(0x3fff, 0xc9b9bd866e2f234bULL), - make_floatx80(0x3ffe, 0x93737b0cdc5e4696ULL) }, - { make_floatx80(0x3ffe, 0xafffffffffff1470ULL), - make_floatx80(0x3fff, 0xce248c151f83fd69ULL), - make_floatx80(0x3ffe, 0x9c49182a3f07fad2ULL) }, - { make_floatx80(0x3ffe, 0xb800000000000e0aULL), - make_floatx80(0x3fff, 0xd2a81d91f12aec5cULL), - make_floatx80(0x3ffe, 0xa5503b23e255d8b8ULL) }, - { make_floatx80(0x3ffe, 0xc00000000000b7faULL), - make_floatx80(0x3fff, 0xd744fccad69dd630ULL), - make_floatx80(0x3ffe, 0xae89f995ad3bac60ULL) }, - { make_floatx80(0x3ffe, 0xc800000000003aa6ULL), - make_floatx80(0x3fff, 0xdbfbb797daf25a44ULL), - make_floatx80(0x3ffe, 0xb7f76f2fb5e4b488ULL) }, - { make_floatx80(0x3ffe, 0xd00000000000a6aeULL), - make_floatx80(0x3fff, 0xe0ccdeec2a954685ULL), - make_floatx80(0x3ffe, 0xc199bdd8552a8d0aULL) }, - { make_floatx80(0x3ffe, 0xd800000000004165ULL), - make_floatx80(0x3fff, 0xe5b906e77c837155ULL), - make_floatx80(0x3ffe, 0xcb720dcef906e2aaULL) }, - { make_floatx80(0x3ffe, 0xe00000000000582cULL), - make_floatx80(0x3fff, 0xeac0c6e7dd24713aULL), - make_floatx80(0x3ffe, 0xd5818dcfba48e274ULL) }, - { make_floatx80(0x3ffe, 0xe800000000001a5dULL), - make_floatx80(0x3fff, 0xefe4b99bdcdb06ebULL), - make_floatx80(0x3ffe, 0xdfc97337b9b60dd6ULL) }, - { make_floatx80(0x3ffe, 0xefffffffffffc1efULL), - make_floatx80(0x3fff, 0xf5257d152486a2faULL), - make_floatx80(0x3ffe, 0xea4afa2a490d45f4ULL) }, - { make_floatx80(0x3ffe, 0xf800000000001069ULL), - make_floatx80(0x3fff, 0xfa83b2db722a0e5cULL), - make_floatx80(0x3ffe, 0xf50765b6e4541cb8ULL) }, - { make_floatx80(0x3fff, 0x8000000000000000ULL), - make_floatx80(0x4000, 0x8000000000000000ULL), - make_floatx80(0x3fff, 0x8000000000000000ULL) }, + { make_floatx80_init(0xbfff, 0x8000000000000000ULL), + make_floatx80_init(0x3ffe, 0x8000000000000000ULL), + make_floatx80_init(0xbffe, 0x8000000000000000ULL) }, + { make_floatx80_init(0xbffe, 0xf800000000002e7eULL), + make_floatx80_init(0x3ffe, 0x82cd8698ac2b9160ULL), + make_floatx80_init(0xbffd, 0xfa64f2cea7a8dd40ULL) }, + { make_floatx80_init(0xbffe, 0xefffffffffffe960ULL), + make_floatx80_init(0x3ffe, 0x85aac367cc488345ULL), + make_floatx80_init(0xbffd, 0xf4aa7930676ef976ULL) }, + { make_floatx80_init(0xbffe, 0xe800000000006f10ULL), + make_floatx80_init(0x3ffe, 0x88980e8092da5c14ULL), + make_floatx80_init(0xbffd, 0xeecfe2feda4b47d8ULL) }, + { make_floatx80_init(0xbffe, 0xe000000000008a45ULL), + make_floatx80_init(0x3ffe, 0x8b95c1e3ea8ba2a5ULL), + make_floatx80_init(0xbffd, 0xe8d47c382ae8bab6ULL) }, + { make_floatx80_init(0xbffe, 0xd7ffffffffff8a9eULL), + make_floatx80_init(0x3ffe, 0x8ea4398b45cd8116ULL), + make_floatx80_init(0xbffd, 0xe2b78ce97464fdd4ULL) }, + { make_floatx80_init(0xbffe, 0xd0000000000019a0ULL), + make_floatx80_init(0x3ffe, 0x91c3d373ab11b919ULL), + make_floatx80_init(0xbffd, 0xdc785918a9dc8dceULL) }, + { make_floatx80_init(0xbffe, 0xc7ffffffffff14dfULL), + make_floatx80_init(0x3ffe, 0x94f4efa8fef76836ULL), + make_floatx80_init(0xbffd, 0xd61620ae02112f94ULL) }, + { make_floatx80_init(0xbffe, 0xc000000000006530ULL), + make_floatx80_init(0x3ffe, 0x9837f0518db87fbbULL), + make_floatx80_init(0xbffd, 0xcf901f5ce48f008aULL) }, + { make_floatx80_init(0xbffe, 0xb7ffffffffff1723ULL), + make_floatx80_init(0x3ffe, 0x9b8d39b9d54eb74cULL), + make_floatx80_init(0xbffd, 0xc8e58c8c55629168ULL) }, + { make_floatx80_init(0xbffe, 0xb00000000000b5e1ULL), + make_floatx80_init(0x3ffe, 0x9ef5326091a0c366ULL), + make_floatx80_init(0xbffd, 0xc2159b3edcbe7934ULL) }, + { make_floatx80_init(0xbffe, 0xa800000000006f8aULL), + make_floatx80_init(0x3ffe, 0xa27043030c49370aULL), + make_floatx80_init(0xbffd, 0xbb1f79f9e76d91ecULL) }, + { make_floatx80_init(0xbffe, 0x9fffffffffff816aULL), + make_floatx80_init(0x3ffe, 0xa5fed6a9b15171cfULL), + make_floatx80_init(0xbffd, 0xb40252ac9d5d1c62ULL) }, + { make_floatx80_init(0xbffe, 0x97ffffffffffb621ULL), + make_floatx80_init(0x3ffe, 0xa9a15ab4ea7c30e6ULL), + make_floatx80_init(0xbffd, 0xacbd4a962b079e34ULL) }, + { make_floatx80_init(0xbffe, 0x8fffffffffff162bULL), + make_floatx80_init(0x3ffe, 0xad583eea42a1b886ULL), + make_floatx80_init(0xbffd, 0xa54f822b7abc8ef4ULL) }, + { make_floatx80_init(0xbffe, 0x87ffffffffff4d34ULL), + make_floatx80_init(0x3ffe, 0xb123f581d2ac7b51ULL), + make_floatx80_init(0xbffd, 0x9db814fc5aa7095eULL) }, + { make_floatx80_init(0xbffe, 0x800000000000227dULL), + make_floatx80_init(0x3ffe, 0xb504f333f9de539dULL), + make_floatx80_init(0xbffd, 0x95f619980c4358c6ULL) }, + { make_floatx80_init(0xbffd, 0xefffffffffff3978ULL), + make_floatx80_init(0x3ffe, 0xb8fbaf4762fbd0a1ULL), + make_floatx80_init(0xbffd, 0x8e08a1713a085ebeULL) }, + { make_floatx80_init(0xbffd, 0xe00000000000df81ULL), + make_floatx80_init(0x3ffe, 0xbd08a39f580bfd8cULL), + make_floatx80_init(0xbffd, 0x85eeb8c14fe804e8ULL) }, + { make_floatx80_init(0xbffd, 0xd00000000000bccfULL), + make_floatx80_init(0x3ffe, 0xc12c4cca667062f6ULL), + make_floatx80_init(0xbffc, 0xfb4eccd6663e7428ULL) }, + { make_floatx80_init(0xbffd, 0xc00000000000eff0ULL), + make_floatx80_init(0x3ffe, 0xc5672a1155069abeULL), + make_floatx80_init(0xbffc, 0xea6357baabe59508ULL) }, + { make_floatx80_init(0xbffd, 0xb000000000000fe6ULL), + make_floatx80_init(0x3ffe, 0xc9b9bd866e2f234bULL), + make_floatx80_init(0xbffc, 0xd91909e6474372d4ULL) }, + { make_floatx80_init(0xbffd, 0x9fffffffffff2172ULL), + make_floatx80_init(0x3ffe, 0xce248c151f84bf00ULL), + make_floatx80_init(0xbffc, 0xc76dcfab81ed0400ULL) }, + { make_floatx80_init(0xbffd, 0x8fffffffffffafffULL), + make_floatx80_init(0x3ffe, 0xd2a81d91f12afb2bULL), + make_floatx80_init(0xbffc, 0xb55f89b83b541354ULL) }, + { make_floatx80_init(0xbffc, 0xffffffffffff81a3ULL), + make_floatx80_init(0x3ffe, 0xd744fccad69d7d5eULL), + make_floatx80_init(0xbffc, 0xa2ec0cd4a58a0a88ULL) }, + { make_floatx80_init(0xbffc, 0xdfffffffffff1568ULL), + make_floatx80_init(0x3ffe, 0xdbfbb797daf25a44ULL), + make_floatx80_init(0xbffc, 0x901121a0943696f0ULL) }, + { make_floatx80_init(0xbffc, 0xbfffffffffff68daULL), + make_floatx80_init(0x3ffe, 0xe0ccdeec2a94f811ULL), + make_floatx80_init(0xbffb, 0xf999089eab583f78ULL) }, + { make_floatx80_init(0xbffc, 0x9fffffffffff4690ULL), + make_floatx80_init(0x3ffe, 0xe5b906e77c83657eULL), + make_floatx80_init(0xbffb, 0xd237c8c41be4d410ULL) }, + { make_floatx80_init(0xbffb, 0xffffffffffff8aeeULL), + make_floatx80_init(0x3ffe, 0xeac0c6e7dd24427cULL), + make_floatx80_init(0xbffb, 0xa9f9c8c116ddec20ULL) }, + { make_floatx80_init(0xbffb, 0xbfffffffffff2d18ULL), + make_floatx80_init(0x3ffe, 0xefe4b99bdcdb06ebULL), + make_floatx80_init(0xbffb, 0x80da33211927c8a8ULL) }, + { make_floatx80_init(0xbffa, 0xffffffffffff8ccbULL), + make_floatx80_init(0x3ffe, 0xf5257d152486d0f4ULL), + make_floatx80_init(0xbffa, 0xada82eadb792f0c0ULL) }, + { make_floatx80_init(0xbff9, 0xffffffffffff11feULL), + make_floatx80_init(0x3ffe, 0xfa83b2db722a0846ULL), + make_floatx80_init(0xbff9, 0xaf89a491babef740ULL) }, + { floatx80_zero_init, + make_floatx80_init(0x3fff, 0x8000000000000000ULL), + floatx80_zero_init }, + { make_floatx80_init(0x3ff9, 0xffffffffffff2680ULL), + make_floatx80_init(0x3fff, 0x82cd8698ac2b9f6fULL), + make_floatx80_init(0x3ff9, 0xb361a62b0ae7dbc0ULL) }, + { make_floatx80_init(0x3ffb, 0x800000000000b500ULL), + make_floatx80_init(0x3fff, 0x85aac367cc488345ULL), + make_floatx80_init(0x3ffa, 0xb5586cf9891068a0ULL) }, + { make_floatx80_init(0x3ffb, 0xbfffffffffff4b67ULL), + make_floatx80_init(0x3fff, 0x88980e8092da7cceULL), + make_floatx80_init(0x3ffb, 0x8980e8092da7cce0ULL) }, + { make_floatx80_init(0x3ffb, 0xffffffffffffff57ULL), + make_floatx80_init(0x3fff, 0x8b95c1e3ea8bd6dfULL), + make_floatx80_init(0x3ffb, 0xb95c1e3ea8bd6df0ULL) }, + { make_floatx80_init(0x3ffc, 0x9fffffffffff811fULL), + make_floatx80_init(0x3fff, 0x8ea4398b45cd4780ULL), + make_floatx80_init(0x3ffb, 0xea4398b45cd47800ULL) }, + { make_floatx80_init(0x3ffc, 0xbfffffffffff9980ULL), + make_floatx80_init(0x3fff, 0x91c3d373ab11b919ULL), + make_floatx80_init(0x3ffc, 0x8e1e9b9d588dc8c8ULL) }, + { make_floatx80_init(0x3ffc, 0xdffffffffffff631ULL), + make_floatx80_init(0x3fff, 0x94f4efa8fef70864ULL), + make_floatx80_init(0x3ffc, 0xa7a77d47f7b84320ULL) }, + { make_floatx80_init(0x3ffc, 0xffffffffffff2499ULL), + make_floatx80_init(0x3fff, 0x9837f0518db892d4ULL), + make_floatx80_init(0x3ffc, 0xc1bf828c6dc496a0ULL) }, + { make_floatx80_init(0x3ffd, 0x8fffffffffff80fbULL), + make_floatx80_init(0x3fff, 0x9b8d39b9d54e3a79ULL), + make_floatx80_init(0x3ffc, 0xdc69cdceaa71d3c8ULL) }, + { make_floatx80_init(0x3ffd, 0x9fffffffffffbc23ULL), + make_floatx80_init(0x3fff, 0x9ef5326091a10313ULL), + make_floatx80_init(0x3ffc, 0xf7a993048d081898ULL) }, + { make_floatx80_init(0x3ffd, 0xafffffffffff20ecULL), + make_floatx80_init(0x3fff, 0xa27043030c49370aULL), + make_floatx80_init(0x3ffd, 0x89c10c0c3124dc28ULL) }, + { make_floatx80_init(0x3ffd, 0xc00000000000fd2cULL), + make_floatx80_init(0x3fff, 0xa5fed6a9b15171cfULL), + make_floatx80_init(0x3ffd, 0x97fb5aa6c545c73cULL) }, + { make_floatx80_init(0x3ffd, 0xd0000000000093beULL), + make_floatx80_init(0x3fff, 0xa9a15ab4ea7c30e6ULL), + make_floatx80_init(0x3ffd, 0xa6856ad3a9f0c398ULL) }, + { make_floatx80_init(0x3ffd, 0xe00000000000c2aeULL), + make_floatx80_init(0x3fff, 0xad583eea42a17876ULL), + make_floatx80_init(0x3ffd, 0xb560fba90a85e1d8ULL) }, + { make_floatx80_init(0x3ffd, 0xefffffffffff1e3fULL), + make_floatx80_init(0x3fff, 0xb123f581d2abef6cULL), + make_floatx80_init(0x3ffd, 0xc48fd6074aafbdb0ULL) }, + { make_floatx80_init(0x3ffd, 0xffffffffffff1c23ULL), + make_floatx80_init(0x3fff, 0xb504f333f9de2cadULL), + make_floatx80_init(0x3ffd, 0xd413cccfe778b2b4ULL) }, + { make_floatx80_init(0x3ffe, 0x8800000000006344ULL), + make_floatx80_init(0x3fff, 0xb8fbaf4762fbd0a1ULL), + make_floatx80_init(0x3ffd, 0xe3eebd1d8bef4284ULL) }, + { make_floatx80_init(0x3ffe, 0x9000000000005d67ULL), + make_floatx80_init(0x3fff, 0xbd08a39f580c668dULL), + make_floatx80_init(0x3ffd, 0xf4228e7d60319a34ULL) }, + { make_floatx80_init(0x3ffe, 0x9800000000009127ULL), + make_floatx80_init(0x3fff, 0xc12c4cca6670e042ULL), + make_floatx80_init(0x3ffe, 0x82589994cce1c084ULL) }, + { make_floatx80_init(0x3ffe, 0x9fffffffffff06f9ULL), + make_floatx80_init(0x3fff, 0xc5672a11550655c3ULL), + make_floatx80_init(0x3ffe, 0x8ace5422aa0cab86ULL) }, + { make_floatx80_init(0x3ffe, 0xa7fffffffffff80dULL), + make_floatx80_init(0x3fff, 0xc9b9bd866e2f234bULL), + make_floatx80_init(0x3ffe, 0x93737b0cdc5e4696ULL) }, + { make_floatx80_init(0x3ffe, 0xafffffffffff1470ULL), + make_floatx80_init(0x3fff, 0xce248c151f83fd69ULL), + make_floatx80_init(0x3ffe, 0x9c49182a3f07fad2ULL) }, + { make_floatx80_init(0x3ffe, 0xb800000000000e0aULL), + make_floatx80_init(0x3fff, 0xd2a81d91f12aec5cULL), + make_floatx80_init(0x3ffe, 0xa5503b23e255d8b8ULL) }, + { make_floatx80_init(0x3ffe, 0xc00000000000b7faULL), + make_floatx80_init(0x3fff, 0xd744fccad69dd630ULL), + make_floatx80_init(0x3ffe, 0xae89f995ad3bac60ULL) }, + { make_floatx80_init(0x3ffe, 0xc800000000003aa6ULL), + make_floatx80_init(0x3fff, 0xdbfbb797daf25a44ULL), + make_floatx80_init(0x3ffe, 0xb7f76f2fb5e4b488ULL) }, + { make_floatx80_init(0x3ffe, 0xd00000000000a6aeULL), + make_floatx80_init(0x3fff, 0xe0ccdeec2a954685ULL), + make_floatx80_init(0x3ffe, 0xc199bdd8552a8d0aULL) }, + { make_floatx80_init(0x3ffe, 0xd800000000004165ULL), + make_floatx80_init(0x3fff, 0xe5b906e77c837155ULL), + make_floatx80_init(0x3ffe, 0xcb720dcef906e2aaULL) }, + { make_floatx80_init(0x3ffe, 0xe00000000000582cULL), + make_floatx80_init(0x3fff, 0xeac0c6e7dd24713aULL), + make_floatx80_init(0x3ffe, 0xd5818dcfba48e274ULL) }, + { make_floatx80_init(0x3ffe, 0xe800000000001a5dULL), + make_floatx80_init(0x3fff, 0xefe4b99bdcdb06ebULL), + make_floatx80_init(0x3ffe, 0xdfc97337b9b60dd6ULL) }, + { make_floatx80_init(0x3ffe, 0xefffffffffffc1efULL), + make_floatx80_init(0x3fff, 0xf5257d152486a2faULL), + make_floatx80_init(0x3ffe, 0xea4afa2a490d45f4ULL) }, + { make_floatx80_init(0x3ffe, 0xf800000000001069ULL), + make_floatx80_init(0x3fff, 0xfa83b2db722a0e5cULL), + make_floatx80_init(0x3ffe, 0xf50765b6e4541cb8ULL) }, + { make_floatx80_init(0x3fff, 0x8000000000000000ULL), + make_floatx80_init(0x4000, 0x8000000000000000ULL), + make_floatx80_init(0x3fff, 0x8000000000000000ULL) }, }; void helper_f2xm1(CPUX86State *env) @@ -1275,24 +1275,24 @@ struct fpatan_data { }; static const struct fpatan_data fpatan_table[9] = { - { floatx80_zero, - floatx80_zero }, - { make_floatx80(0x3ffb, 0xfeadd4d5617b6e33ULL), - make_floatx80(0xbfb9, 0xdda19d8305ddc420ULL) }, - { make_floatx80(0x3ffc, 0xfadbafc96406eb15ULL), - make_floatx80(0x3fbb, 0xdb8f3debef442fccULL) }, - { make_floatx80(0x3ffd, 0xb7b0ca0f26f78474ULL), - make_floatx80(0xbfbc, 0xeab9bdba460376faULL) }, - { make_floatx80(0x3ffd, 0xed63382b0dda7b45ULL), - make_floatx80(0x3fbc, 0xdfc88bd978751a06ULL) }, - { make_floatx80(0x3ffe, 0x8f005d5ef7f59f9bULL), - make_floatx80(0x3fbd, 0xb906bc2ccb886e90ULL) }, - { make_floatx80(0x3ffe, 0xa4bc7d1934f70924ULL), - make_floatx80(0x3fbb, 0xcd43f9522bed64f8ULL) }, - { make_floatx80(0x3ffe, 0xb8053e2bc2319e74ULL), - make_floatx80(0xbfbc, 0xd3496ab7bd6eef0cULL) }, - { make_floatx80(0x3ffe, 0xc90fdaa22168c235ULL), - make_floatx80(0xbfbc, 0xece675d1fc8f8cbcULL) }, + { floatx80_zero_init, + floatx80_zero_init }, + { make_floatx80_init(0x3ffb, 0xfeadd4d5617b6e33ULL), + make_floatx80_init(0xbfb9, 0xdda19d8305ddc420ULL) }, + { make_floatx80_init(0x3ffc, 0xfadbafc96406eb15ULL), + make_floatx80_init(0x3fbb, 0xdb8f3debef442fccULL) }, + { make_floatx80_init(0x3ffd, 0xb7b0ca0f26f78474ULL), + make_floatx80_init(0xbfbc, 0xeab9bdba460376faULL) }, + { make_floatx80_init(0x3ffd, 0xed63382b0dda7b45ULL), + make_floatx80_init(0x3fbc, 0xdfc88bd978751a06ULL) }, + { make_floatx80_init(0x3ffe, 0x8f005d5ef7f59f9bULL), + make_floatx80_init(0x3fbd, 0xb906bc2ccb886e90ULL) }, + { make_floatx80_init(0x3ffe, 0xa4bc7d1934f70924ULL), + make_floatx80_init(0x3fbb, 0xcd43f9522bed64f8ULL) }, + { make_floatx80_init(0x3ffe, 0xb8053e2bc2319e74ULL), + make_floatx80_init(0xbfbc, 0xd3496ab7bd6eef0cULL) }, + { make_floatx80_init(0x3ffe, 0xc90fdaa22168c235ULL), + make_floatx80_init(0xbfbc, 0xece675d1fc8f8cbcULL) }, }; void helper_fpatan(CPUX86State *env) From patchwork Fri Jul 24 06:45:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247118 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2185233ilg; Thu, 23 Jul 2020 23:49:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzEhyxxe1Vde1OUjrVYhYH3C8HbFdIZvL6MPdrgFYrCFPiiVi2GX2teEJgNZNTIX4gDlhQ X-Received: by 2002:a25:ec0e:: with SMTP id j14mr13218263ybh.173.1595573372224; Thu, 23 Jul 2020 23:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573372; cv=none; d=google.com; s=arc-20160816; b=eXYOkN0aNRNfu4SImDpE/cyX0ZTEZoRd+ctPNFn1K4wLkG+V3brkl5wWZRwnraFAf8 h+F6ILts/kZzG2yeoJ1ZpV4ThpQmi/gdtJKWByCXCO0axqTCky/CGhXZGgKqbve6g4Tt rxfKf7P2UduDUMLfAHtEKiu711IzBsdxV+TMiSqV5OH2hlOxU6yL9/TjPdARQu9ene1c aQj/mk7DV425D6OarxNNjYaB7cAaihso59gURFyjF2UFRRUV2P/aQFO0UTqbAzTTz56/ 6FjhiX8qVCGJWJHYUsyn37rBLbuGxOLrhXctGAhv8O0m/BTFo3T0uzfDVjsBiqMfyput fB8w== 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=Mb3qWyP/9FE2vD7jrxPFH4L+sWhR13YlYckySzBJW0Y=; b=z8XqP/5K8Iux64iqjQtPkMuO59t0RRoB68oZQy/oCaSU25RFp16HslvS4VV0AwNDeN CUFAuVaTvrdjt+mHw+aGV9BP9XfwFdg0nIgns4QbTZwPdA99b/4uwzBc8XjBaLsUfGKR lYhj9b8FUU020Su2EBWwIAlS773QI6wNR2kduAtqK3jW6zFPY0CPuIiiNFjM4kvi/yuK Fp32eFMkTJ+gFhqbPQE3VOP9FgO+OvJAz30Wi2w4n0kwRcU8z8oaBJfWZWwQr0TqpzQe L0+SwQ7LZtVBg2mOXdb0fwX378kdcuCZVjzpW/+zaZHo0NEzToSj3z48gYODtlzBEbSH L31g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MHxmv6Gb; 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=fail (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 j5si4946077ybt.321.2020.07.23.23.49.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:49:32 -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=fail header.i=@linaro.org header.s=google header.b=MHxmv6Gb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrWN-0002Vo-MC for patch@linaro.org; Fri, 24 Jul 2020 02:49:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSM-000499-PV for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:22 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:40928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSL-0000Jz-02 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:22 -0400 Received: by mail-wm1-x343.google.com with SMTP id f139so7229858wmf.5 for ; Thu, 23 Jul 2020 23:45:20 -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=Mb3qWyP/9FE2vD7jrxPFH4L+sWhR13YlYckySzBJW0Y=; b=MHxmv6Gbd5UqfNI/R9ENV5xXM4lYKiMEUl/0jEtz0eSk7+iedQiQ/NJtKGKB4vG8Q5 NUcPgndghBVu9tSHW6M2jabML9J7t7wXfkEWRJXz1UrGgAlku3yZzEi+IJU7c7dDfg9b l+Yhj/CxmueeRHYdKBIeyewoyGpOs6sfbBTSOHDZIwOg1YT5n4ltvFp38GWgNO6Hyuta opGC45mo3VYC2laiibJrHwLTXgKrTDUDF2b4euE8C8BbB9feoF9HARV6HFMR50XceIUw 5OkLWKXb0WZdhSqS9ELt00uCwmDpz0m5hird7hLm0+gOpkWLbyKX8PfmdPhkztovQSHE tCJA== 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=Mb3qWyP/9FE2vD7jrxPFH4L+sWhR13YlYckySzBJW0Y=; b=i4+wCpTsaPn2bMsWkqJZDVTXUM2hvTOqCFX+tjBL5LiEK7mRxVRVtPasFhCCvB3vC0 bHOktlkoeZYFTrTfnnJ9JamQOHKyx/GefFeOoQOTUBUa/9We5eD8O/zD3MEU2GTOyuna DmW/BOtIC3N7T0Rk3mqbuzpeVzZNNBuSGKkHnrWHUbnzrhuPM+YmPDqOoL0tfuk1ehny G7YtywFjeSie4oNYAYBgrHYUKp7575deFVGDhxrPL4NNQAzGZj7SY81/BNiwXoH/PZzC 0n+J0zKVxmZZkZOHi6QX5X0ynukMpUXzq1zWoGVZ+HD6f5QcXxOe6BgXV9/WBRlzMgVW 3LJg== X-Gm-Message-State: AOAM53190DKxsvN7GgO/1JBoFrAzoMuJAuSoSFS3haGiXhMChS/BW5Tv y8vn4i+aIOYwfwylhmRBUdIQng== X-Received: by 2002:a1c:6707:: with SMTP id b7mr16022wmc.97.1595573119527; Thu, 23 Jul 2020 23:45:19 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h11sm152763wrb.68.2020.07.23.23.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EA3291FF96; Fri, 24 Jul 2020 07:45:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback Date: Fri, 24 Jul 2020 07:45:01 +0100 Message-Id: <20200724064509.331-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Laurent Vivier , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Plain MAP_FIXED has the undesirable behaviour of splatting exiting maps so we don't actually achieve what we want when looking for gaps. We should be using MAP_FIXED_NOREPLACE. As this isn't always available we need to potentially check the returned address to see if the kernel gave us what we asked for. Fixes: ad592e37dfc ("linux-user: provide fallback pgd_find_hole for bare chroots") Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20200722062902.24509-9-alex.bennee@linaro.org> --- include/qemu/osdep.h | 3 +++ linux-user/elfload.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 0b1298b3c91..20872e793e4 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -173,6 +173,9 @@ extern int daemon(int, int); #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif +#ifndef MAP_FIXED_NOREPLACE +#define MAP_FIXED_NOREPLACE 0 +#endif #ifndef ENOMEDIUM #define ENOMEDIUM ENODEV #endif diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 7e7f642332d..fe9dfe795dd 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2134,12 +2134,15 @@ static uintptr_t pgd_find_hole_fallback(uintptr_t guest_size, uintptr_t brk, /* we have run out of space */ return -1; } else { - int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE | MAP_FIXED; + int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE | + MAP_FIXED_NOREPLACE; void * mmap_start = mmap((void *) align_start, guest_size, PROT_NONE, flags, -1, 0); if (mmap_start != MAP_FAILED) { munmap((void *) align_start, guest_size); - return (uintptr_t) mmap_start + offset; + if (MAP_FIXED_NOREPLACE || mmap_start == (void *) align_start) { + return (uintptr_t) mmap_start + offset; + } } base += qemu_host_page_size; } @@ -2307,9 +2310,8 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr, /* Widen the "image" to the entire reserved address space. */ pgb_static(image_name, 0, reserved_va, align); -#ifdef MAP_FIXED_NOREPLACE + /* osdep.h defines this as 0 if it's missing */ flags |= MAP_FIXED_NOREPLACE; -#endif /* Reserve the memory on the host. */ assert(guest_base != 0); From patchwork Fri Jul 24 06:45:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247122 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2186420ilg; Thu, 23 Jul 2020 23:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwQllx2T9eXCR13cJ2KXx3BtTze+P2jTkkuLmiYlp2TjI/S+oIdd87LR4wU3xEmL1t9P93 X-Received: by 2002:a25:8503:: with SMTP id w3mr11339829ybk.2.1595573515943; Thu, 23 Jul 2020 23:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573515; cv=none; d=google.com; s=arc-20160816; b=H3ZF0/SVsEg3Rcz1ELxWHWXrvDExAvHMEgdQhQHoEDBUIHUnDxbQrBh10h1o8OZy6M CfExnY1DbsEpXVrSX5vriUlAvrY9AMY/GKQ2LY8aqQIN54KeoDXV9nDWZqAIP9xNJHse shzpkSnXXSZDCJEcXLih92lgGORX2Bvnf9uOsPz6gqn0vNJkefzEGQ1sP+qI0PXFo2Uf CUwI8vTY727U3nx4zo+7zR/4HM4bpgjskCxEedwOHlupY68y0EXGkjuaqWKtmiPrxOto CQ9gPV9fBglo8aHQwOXSsvPWuvaBeFdgP9Hl7e3ol62Z7gSYacwgi8cCawpPbR9Vv+Pn tGNA== 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=bBHLOf2caPKPYUmFKO5eX0gKvXVT+aR9KRaX+uIZvh0=; b=zbpHWuRP4ByDof5AkJoW+qU6rb6gHzew7VNddp6C8xCYPDrlby1ZdztnJFWPj34N2s ITmx13Qhd5fErm/bpYAF1J2J6YLeQUWEl2W13AWiaKJQxNqgPiSmK1wQrEOxgj0z/Tut SZYNLBOYZ58rczRHSQhw91w5FqNN71HPQvpfu/dt2gzsvAjtcs8zMTPg+yJ7R27ZIeI2 8crEoLr0BkveqLp26vdq3jQE5jC/OXpB/JChwqQBO6qWL9DGoyClWQUlJZFOT+IxLZ/1 7xAqtiL7cO/jfWgEzkjqj3ILe4bx032alR6PVHdq10Bvayga+PBIPdie7areXY9c1FDu JtjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=m4Jz8v2l; 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=fail (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 e8si5305022ybc.421.2020.07.23.23.51.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:51:55 -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=fail header.i=@linaro.org header.s=google header.b=m4Jz8v2l; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrYh-00058f-Dz for patch@linaro.org; Fri, 24 Jul 2020 02:51:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSS-0004I0-Gw for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:29 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:40983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSO-0000LG-LC for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:28 -0400 Received: by mail-wr1-x444.google.com with SMTP id r2so2165304wrs.8 for ; Thu, 23 Jul 2020 23:45:24 -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=bBHLOf2caPKPYUmFKO5eX0gKvXVT+aR9KRaX+uIZvh0=; b=m4Jz8v2lJggWycIJbEITQmGAIvP6WoXc1zQwbGFwbp/PrTW8Xt87tPWRczqgEhVPOq X57w9FsDEOkxtfjgAZ/Kh3q7QAvccqA9CKmwY6mweKO2Qjradqcu4Xbp89yDLfd5Fala m9oUprl1MBGXppzURqtoBdHGXHfp/0bppQtLNZsjbESmW2umhd8RVqvqp+yifoih2sXw kfqZtejQvDFajwVAE/8b2DIpjKANOrAX+UKXS2ssJL2+/PtBFAEdUtYC721EhtHRNZM6 rDZ1rP+ObKeAm05mLXZ1FiemvzqWpoeo1pVYCmzwsNJManTzKksbVbKBX9/eQti9/hV0 tMXw== 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=bBHLOf2caPKPYUmFKO5eX0gKvXVT+aR9KRaX+uIZvh0=; b=NOpQDekBS/kuI4qhAoS6iaGx8kIJ5hO9iILYGiunffKYTXpMqtyi9FnVJGkwSV1Xi8 n00zlkIo66kE5TT28SpqfTZiduRQ5GpdxgJotjnb2u6UfsHcVN8Fk42awKdApeRe0rVf tY+rcaJwWiT3lar96Eso0+DzORxPJuLXdrCvK5+tivOPa2biOFOYkG1nyvhGLd5hMRdO 5fz90W/7Hp0+r0QM3izOYUNkYfSionwwR+zSpL5m5xkGQ64wip/cPO1MZQXeUp10oIPt wdMqmw7vrYBnt05P1LuaHi1e9U6s3mx4q/Ye5qBXKW1CQbd/l7iHceI3O4x2UfzgNL89 cA9A== X-Gm-Message-State: AOAM533MkYUHutHfPRzKW1U+jpgMkt1NogQOklOCnJmuAsWpFm/xMf/k wwqZYSbIQPdUhcs/FqXtYvc4UA== X-Received: by 2002:adf:83c5:: with SMTP id 63mr7036489wre.321.1595573123304; Thu, 23 Jul 2020 23:45:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v1sm126517wro.83.2020.07.23.23.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0C3151FF98; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 09/16] tests/docker: fix update command due to python3 str/bytes distinction Date: Fri, 24 Jul 2020 07:45:02 +0100 Message-Id: <20200724064509.331-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.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_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Does this seem convoluted to you? It feels a little complicated to me. Signed-off-by: Alex Bennée Message-Id: <20200722062902.24509-10-alex.bennee@linaro.org> --- tests/docker/docker.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index c9f20d8d093..356d7618f1a 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -24,7 +24,7 @@ import tempfile import re import signal from tarfile import TarFile, TarInfo -from io import StringIO +from io import StringIO, BytesIO from shutil import copy, rmtree from pwd import getpwuid from datetime import datetime, timedelta @@ -541,13 +541,14 @@ class UpdateCommand(SubCommand): # Create a Docker buildfile df = StringIO() - df.write("FROM %s\n" % args.tag) - df.write("ADD . /\n") - df.seek(0) + df.write(u"FROM %s\n" % args.tag) + df.write(u"ADD . /\n") + + df_bytes = BytesIO(bytes(df.getvalue(), "UTF-8")) df_tar = TarInfo(name="Dockerfile") - df_tar.size = len(df.buf) - tmp_tar.addfile(df_tar, fileobj=df) + df_tar.size = df_bytes.getbuffer().nbytes + tmp_tar.addfile(df_tar, fileobj=df_bytes) tmp_tar.close() From patchwork Fri Jul 24 06:45:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247116 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2184284ilg; Thu, 23 Jul 2020 23:47:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+xnvuaaKyl6MMARjIBA6D7zuNtWhuUb5eKnMyRJ0ISeEJT9IW1wMXjqXpGlpjHXLoNKqw X-Received: by 2002:a25:641:: with SMTP id 62mr12297609ybg.484.1595573275851; Thu, 23 Jul 2020 23:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573275; cv=none; d=google.com; s=arc-20160816; b=ng8BD72E4l8gJrxNdHiaMhyCcw5zzuFfDkiFBVeBPxDfYbgSD8gyyx36pRXw1m0q3O /TuQXHZ4JauBSjdQho7l7Z+QqBuaRnTa8FhKJsowk5llkOJh5Ea1MzxEUqYpANDwUGX7 bBEcp6wPW6zAFwnYbznf58LEBvjIfMqaKmhVVT0JcdQUsKkTgsoVZlpVp9K8FradzQFV 5K0jFAewydbS/+RfrXbSC8ERX0UOHDf9AJI7HhD1Mi9mP1AeRPGfRsf5V/yoAaIO3M3y kFhY4pJWUXfhXJsHUO22l0lWlkv6VdTc0uMe2v6YNmSdEi66g7XthQNr/PiTxhxDD8kr Iq3A== 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=HzimzYj3p+9RcjT7t+vr+X1plKLq4z2KdTC48DV27wo=; b=q4uwfIxFPKFWkpDgMDT3/CfFkVZNvExLVtgaHWbIG9mzSNhclvF/be8HIbtb+Kp53r 0kkm/FF5R3tSRXhIz7WWcIHMyhN0DgYYKYQkLDUUplNZDUcTiLVRsPTT4re5iF1Qt9C5 eq8l++V7EF3eUgz+3TltlvcmMRYod1Eb/GsIdDNttDMZ/c2e9cTOSgUUd1sOtMtnfw1X kHuyDnqALdhFNlPftLRVmjUGLrif3js+k8tD1BFbue4Qry/CSK2hff4Hh+0lMANi0AOT awwnFjFvX1ZtSWYAbhWbk1Ep7BCmks/N8nRvvUKPc20eBcmtAeYGQPmY3HOUd6sWTZpi e5WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hhSHACU9; 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=fail (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 u12si4769651ybc.311.2020.07.23.23.47.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:47:55 -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=fail header.i=@linaro.org header.s=google header.b=hhSHACU9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrUp-0007hn-B1 for patch@linaro.org; Fri, 24 Jul 2020 02:47:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSP-0004Fh-VS for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:26 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:46317) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSN-0000L5-I2 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:25 -0400 Received: by mail-wr1-x444.google.com with SMTP id r12so7218895wrj.13 for ; Thu, 23 Jul 2020 23:45:23 -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=HzimzYj3p+9RcjT7t+vr+X1plKLq4z2KdTC48DV27wo=; b=hhSHACU96t153SMNPx2yu3+mfMOCLhc9B83H5se/7ZCCmjKQ125JKpN+sooLaOmUl8 avl1Lc7D0KxW1XyfzYOjyHwgm8Afnu/HFZpKQvupwHrybdYUfa4Cqro9M9UDtCTjpm7L rd3PkZapum8kpD0LSQGNuDZUO3mXYuQo19RXFbFZMyHX0/EIL1Hs6pGrGeq7s7qkbrKE H2Cf5t5va/ngE7Ds8tZm7wTVveenlThTeCMrAILbmZwdevBN70gx7NmbZ+GXnCxzAQTQ wTKV3MCR8UZ5gShczoAP5n94oeEO/a642cqjbjJCovh2J2e3LAN1YG1Q891eEH0s514b NSmw== 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=HzimzYj3p+9RcjT7t+vr+X1plKLq4z2KdTC48DV27wo=; b=CB/WKdk3rNHH2PESPpjR9XKIbxS3j3scDDWB6whDfrHED6TspK11wqtGVDoucSr6OZ e2jPKk/oaESOLlhhBiQrJjgg07O6N8xfoSo0sFcbpoojzhC198FRBInxQjGEUqxDI8Wr aKERwQ8jYSByUFQq3XuowbfXqmzPwDlEej+MdMOTouQxoasZPdYGT7S/tYRnaC7lijcy DRVfsdGuq5xq7ZtgHaRTk9euyoyjsCg49vMghnQH/6gLJr5lcJxYYcpNZ5IQj4yKhYre tyWoOdauNK5lL9lN9Rqw51ipT9H2lpTzrAjltIcOIuqMKz9FsxdjrckwLp/xlrEoYNCS Gf5g== X-Gm-Message-State: AOAM530CwmrgHJVDHyg3FNO4fai2AUodK60TFFZHhG31Z1KTmq0iBeCa Wn0T1M/Oym7bi8Y90Eo51PS02/+aF+0= X-Received: by 2002:a5d:538a:: with SMTP id d10mr2941372wrv.280.1595573122188; Thu, 23 Jul 2020 23:45:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 88sm158744wrk.43.2020.07.23.23.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 218671FF99; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 10/16] tests/docker: fix binfmt_misc image building Date: Fri, 24 Jul 2020 07:45:03 +0100 Message-Id: <20200724064509.331-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.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_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When we updated the arguments for docker.py we missed a bit. Fixes: dfae6284 Fixes: dfae628459 ("docker.py/build: support -t and -f arguments") Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200722062902.24509-11-alex.bennee@linaro.org> --- tests/docker/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index a104e9df281..9119dff97de 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -78,7 +78,7 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker DEB_ARCH=$(DEB_ARCH) \ DEB_TYPE=$(DEB_TYPE) \ $(if $(DEB_URL),DEB_URL=$(DEB_URL),) \ - $(DOCKER_SCRIPT) build qemu/debian-$* $< \ + $(DOCKER_SCRIPT) build -t qemu/debian-$* -f $< \ $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \ $(if $(NOUSER),,--add-current-user) \ $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES)) \ From patchwork Fri Jul 24 06:45:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247121 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2186416ilg; Thu, 23 Jul 2020 23:51:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzypU7h+fIwnmBf/j7jnwsv5wIzPB6PA8taLKoecusEPnn0nyz1pBqofIgeTkJvTNMil5/l X-Received: by 2002:a05:6902:1002:: with SMTP id w2mr11904812ybt.321.1595573515552; Thu, 23 Jul 2020 23:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573515; cv=none; d=google.com; s=arc-20160816; b=Xmt5ggMh4b2WpHD9rZUH50uJ4E2d+G4UpTzWSxKGY4Q+Ojqw9MAMuO3ckWFOA9HKhN Ei8Kyjqv4xTXGkevtk0m6bU8qontnmEkF2ZZ5GkYgxJlxiqtcqGDkXnJxm2weXsmBK9l 7h2EUCfswav0gUGyCysI1iG3W53lOZLnaRTFiuUoi9A9GZAXm1zK1n6hChlxTPbHu0BO NUqFP/ZT05OFGr1+FPnTB92XT4dkNEFErJKUM3UX7ECAjvTxE3L5thKCD/aGjd1qSw4K gG+INrLq5B1zdks5LOCH300yStT85jj2lCUApVZKO9YWcTPwynr1emOsXViyl2N97SJv PTSQ== 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=nuRgaJpHsfYCPj7hspcbTe7Etj9//S0efTA7UU/SI/Q=; b=sk0E9vvku1nNzJD8diQ+DMTshANrs/mGT9F/mEJrL3Sh9TFn29O2Mpc8sciIayOtTY TyHc2WqzHGI8n/eIfjB5pi0oMZW7YQx+AYLaaIwH5IDxHXv4ELn5x/aWkzvaSLss+lMR YNXQmgPwMF4OJJjVrOW/T/YjK2l8RyvxgnSgxxlZUEdnmJ0oq3ji34z2xz6WM8RFVqDN 3uBEIhxc4EQKt0FLs0ZOWn7XhGYdpeoZClr8wgNWqQoBkAeu7nvmtB96kzjCv/PgChNV 9zbGNAplDvGtFOYsHmw3zNo3qLUSzeRvaIX+py5IyAjFA54kBEu1vzLYMKJHe9sJ4TSP GNcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=p04GFu32; 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=fail (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 j206si5018534ybg.155.2020.07.23.23.51.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:51:55 -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=fail header.i=@linaro.org header.s=google header.b=p04GFu32; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrYh-00057L-0F for patch@linaro.org; Fri, 24 Jul 2020 02:51:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSY-0004OF-1z for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:34 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:33763) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSV-0000MC-Qj for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:33 -0400 Received: by mail-wr1-x443.google.com with SMTP id f18so7275904wrs.0 for ; Thu, 23 Jul 2020 23:45:30 -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=nuRgaJpHsfYCPj7hspcbTe7Etj9//S0efTA7UU/SI/Q=; b=p04GFu32I64rK7bhN+j46Dltf+esqa05/VBG/SAhybu5c9wj1Nj9sJ9WjVCo6sVCJ/ wqX2XhoNKE9SlyzFAXZXEWoRKFr/eCsRngutWUHor75Ai/5c1AoxTAFBGf5VSJNk0FVx HAnATcg+cqo9U87XbXF+LSRVSMxd6LB7A64CioJAk3C9/ash5KGW1joeO90Smyha1xDd CAR5XQ9ADKN5hp7A+J711WTEvKT2dRlYTyIgBByxpGHuiKymORjw8migylKUiUcW68eR +ASQ1GZCBeV495FNZoXQJjm2A4kW/PUTUitjiCo/CRj3/xlZPGsKqdr8xnZ7j/c7AKOz CLrw== 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=nuRgaJpHsfYCPj7hspcbTe7Etj9//S0efTA7UU/SI/Q=; b=GlbCQR2dbgwQKO07R+6MF2t1waFplawc8Kb0dBO9d1bKXdWGlAkz9JCLrQRsHorL7h xrjfLo4qHmbR681J8lwTKKO8IIslw1mi9r6pmRUwSm/a93BbniB4LbX5qZadc/2PRGww fmuL5DymbJJ0yUapJ9V5JGUS9HRnLgGXrxfoJC/f4LSIdWg2U/otQ2Bkc1hJ33aoG9d7 ltMhAa+JLJDcG1bzbeDfbpCHte19RY2c/GpU+Ff+96vnY69GBQOUMzgB43iqOEB87ADz yDJHfuFPPa+O8sU3HH+M3M4yp8gA3PNi/a7HNCretoe4azRHlyiwvS8vJzaZy/ptqpNe 0nDg== X-Gm-Message-State: AOAM530inadzdvoqYZ5jFizu1tnJcrDkzMHU/Xocylg6notAtVxhamYp KIYZeUMM9hFMBSkpi4DvwuWaIA== X-Received: by 2002:a5d:4e81:: with SMTP id e1mr6841055wru.22.1595573129592; Thu, 23 Jul 2020 23:45:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j145sm6561848wmj.7.2020.07.23.23.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 376271FF9A; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 11/16] tests/docker: add support for DEB_KEYRING Date: Fri, 24 Jul 2020 07:45:04 +0100 Message-Id: <20200724064509.331-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x443.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For installing stuff from sid or ports you may need to manually specify the location of the keyring. You can even import keys into your personal keyring and point it there, e.g.: gpg --keyserver keyring.debian.org --recv-keys 84C573CD4E1AFD6C make docker-binfmt-image-debian-sid-hppa DEB_TYPE=sid DEB_ARCH=hppa \ DEB_URL=http://ftp.ports.debian.org/debian-ports/ \ EXECUTABLE=./hppa-linux-user/qemu-hppa V=1 \ DEB_KEYRING=${HOME}/.gnupg/pubring.kbx Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200722062902.24509-12-alex.bennee@linaro.org> --- tests/docker/dockerfiles/debian-bootstrap.pre | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.20.1 diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre index c164778c302..35c85f7db8a 100755 --- a/tests/docker/dockerfiles/debian-bootstrap.pre +++ b/tests/docker/dockerfiles/debian-bootstrap.pre @@ -79,6 +79,13 @@ else fi fi +# +# Add optional args +# +if [ -n "${DEB_KEYRING}" ]; then + DEBOOTSTRAP="${DEBOOTSTRAP} --keyring=${DEB_KEYRING}" +fi + # # Finally check to see if any qemu's are installed # From patchwork Fri Jul 24 06:45:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247123 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2187077ilg; Thu, 23 Jul 2020 23:53:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvH7fF/YCgc/1zL6Yd+fBbD0/Plv8llKUE/P5yREMkEKZqyZqsYP2kzOPX9c+luJHZpC9w X-Received: by 2002:a25:2513:: with SMTP id l19mr12963088ybl.357.1595573591718; Thu, 23 Jul 2020 23:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573591; cv=none; d=google.com; s=arc-20160816; b=OwSfAHIlg+W9zLB/8EW7W9em9JMqeqnbRgYIYRwfI5yQ0jGGcueHsungG/x4SeY/jT bHB0NGxT1oKGIYl1CW6taMXg3fUTrEkXhv4McbjqxqivZBukNql/u1v2zyhZjf5m4oZL QofuWY8+YJPEUo2GL5R22UXxU+dFTv8JmtnUBB8ChLbIjyGKQ437SxT7BdSvPKcmQ6kc SvvsCYoZCGLJHJ368k5krvD+Fy3H9JX26X+VmwgC1mCMivvexpXBe4QinMFQ6VEbfyZj DxAhcz9M9cEHJxoLocoNcKEVmG+VpiFfDoNOqZ6tE63QItytXa6t3WXJJ295BtCFvpAF 7I9g== 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=k0qObaslF7DMl08qf2Ikqb0eMymc3tJSTaDPkACMeck=; b=SqQaBc0VCJnNssz51k5hp+chQpcZ1a0LQZAck2noybk+L5PI2ev7ruJfPVemwM0ayz 0KFY4R+2G/wG+aKEC2v8bJrYDajHHdOTwYizaIuJnZ425nYfnmqr9KIzQ/Zs0UUDzgfg oetna6hhqrhCmqzXpff7cC9JMhBh6wRhH3fcikIV4DRthBGVWvfkgFn7fkALFVuL9Kkx 31ujMPInP1BK4nyebVgOllwK+bgkYGFmwnlWsLbihDK18UyrVurWFn/GBfFYFgKjQdLY x9Nl2rrBNQys6Z2DbyWxya/9hdq/xpyekpbwzrqP9flqOLpgk+arbnUVyUjBT4+8eqeV 2VUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ctnrTEYi; 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=fail (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 z12si5303530ybk.134.2020.07.23.23.53.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:53:11 -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=fail header.i=@linaro.org header.s=google header.b=ctnrTEYi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrZv-00007N-4c for patch@linaro.org; Fri, 24 Jul 2020 02:53:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSU-0004JS-As for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:31 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSQ-0000LY-RM for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:29 -0400 Received: by mail-wm1-x344.google.com with SMTP id j18so6950433wmi.3 for ; Thu, 23 Jul 2020 23:45:26 -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=k0qObaslF7DMl08qf2Ikqb0eMymc3tJSTaDPkACMeck=; b=ctnrTEYicUVpwrQ7pLianFLKXCX2N46xqGI5CbxAaJZS4y02LLguBGtPTYYg/8wALJ 3en7tR9aglucyHESPdTp1xMbTBzsw46V4ohg299Tk5rhZusVBsPW2rBlbxDwhlns3g8F z5y0EcG7Q0z5p78ZTvcj0veJq32BfYWLm9hv9TZaakpdH37kjIPFZ8L5Jcc81ZFTp0Jc Pxu1wn+e/I6Ora4f6kWi3JyE5g2/nxsFoNGNTWc5HkDk3A5jLSvQTQ27GoQlv1pTddK5 lYBjz4UmfK7DEiwqfHRSTr3xRUYhY7Sg9CoBNu3AjHGuTw36j/oyl0ECG6801B7XtCMr DagQ== 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=k0qObaslF7DMl08qf2Ikqb0eMymc3tJSTaDPkACMeck=; b=gMOfR9AVnl0f9Uwgkbz++YYAZpI1thEUfSbEzOabTR3G/PYVPmSM0lWhR7YtPGGnU2 Pb42EdQpOM+05nXnkyUKnMS3/onE5GK3qge2Sf0va3m5a0rjXzz9Q6+LfXxBUieZF5pA 1A3pkny3JUAKrSuC7sW+5l3pyj86SLt0yGedoL7X0B8zZBfC28FVvn1VAAQimI0QiP14 fxAu2+iJzrzRyi8uhWUtrFilqLRd18szGnpz6O5Rtvd1aQrgODtrwsPPVDJl2h/nME+D SgKV2R5aK/RIO0cu9CGt8MSPiRZpUdmNDOTNs+tMgFygIjTnW6fL90rCgrFTG/K+BPLz wmpg== X-Gm-Message-State: AOAM530eFnPpDjT3nF9sc5PP5BrMw6L6Oe7peuuY8vOFHJXD/sb+hmDG 7gcmMNFc34nkpdZZCK6VEjATjA== X-Received: by 2002:a1c:2e57:: with SMTP id u84mr7801546wmu.52.1595573125428; Thu, 23 Jul 2020 23:45:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c188sm6231551wma.22.2020.07.23.23.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4BAF41FF9B; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 12/16] linux-user: fix clock_nanosleep() Date: Fri, 24 Jul 2020 07:45:05 +0100 Message-Id: <20200724064509.331-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Laurent Vivier , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier If the call is interrupted by a signal handler, it fails with error EINTR and if "remain" is not NULL and "flags" is not TIMER_ABSTIME, it returns the remaining unslept time in "remain". Update linux-user to not overwrite the "remain" structure if there is no error. Found with "make check-tcg", linux-test fails on nanosleep test: TEST linux-test on x86_64 .../tests/tcg/multiarch/linux-test.c:242: nanosleep Reported-by: Philippe Mathieu-Daudé Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Message-Id: <20200722174612.2917566-2-laurent@vivier.eu> --- linux-user/syscall.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1211e759c26..43a6e283961 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11831,8 +11831,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, target_to_host_timespec(&ts, arg3); ret = get_errno(safe_clock_nanosleep(arg1, arg2, &ts, arg4 ? &ts : NULL)); - if (arg4) + /* + * if the call is interrupted by a signal handler, it fails + * with error -TARGET_EINTR and if arg4 is not NULL and arg2 is not + * TIMER_ABSTIME, it returns the remaining unslept time in arg4. + */ + if (ret == -TARGET_EINTR && arg4 && arg2 != TIMER_ABSTIME) { host_to_target_timespec(arg4, &ts); + } #if defined(TARGET_PPC) /* clock_nanosleep is odd in that it returns positive errno values. From patchwork Fri Jul 24 06:45:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247120 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2186171ilg; Thu, 23 Jul 2020 23:51:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXFFxz0Vt1CNO+n7pYzI1BaiDbhNWJ6fmRc1O/DhjCzGvlhgfpFkCv1+hVsBOZg/5tOeXs X-Received: by 2002:a5b:3c9:: with SMTP id t9mr13216626ybp.55.1595573485532; Thu, 23 Jul 2020 23:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573485; cv=none; d=google.com; s=arc-20160816; b=L6WQxF5PGRsux74p2/TWvq3zaXOjZlKezFC1T6+pWR4IY6yzlcitZkD7bKD1+JmhUT +j00JbRakVN5cLqYfhNKTdsbh0cROdsYQH8c6++qysc+TJS5ahIG0ZyKfNLS8K0ubATH BUJysrAZtvwuiMvzxX4nV6aK0z/Ep+A2HieGVR0duafVyj4wxNpVfTNvx5/N5OKT2szL 9PXpPoKmzGuDJQNp8vjBqvGUE0CJG09n2ogHZJHsSPcTZWJSJy8+/OXkV9T+y7UYOJsO z71bL8gjHa9BQX7/p4e31mx+8J+SXybcZXnZQJaS5MP/qol3jcdOt2M2sCb3FOxwDSz1 zBZw== 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=5qWBsUBL0rRACFD5SJtMCfUkk7hZwZaQ4gS8O1OugSM=; b=N2JWdjHJNXFVWAARgP7DUJGHmmwYF18q9P3pNmbfGw2AJtdb/7Xw1vIhPrddzVDA/C 5hKA0EjOtZnar/LYhGpKbkBS31W249OT+QHStzWPTsI3EjN4us2G7xiVdJWVLUDSU4fd stt+7eR0CVzTEHkriEXGH+s2fh6IAgCgBCHMR0h2SHuL5kfYHbbRsm6EWCIjqvzeU6fl EY+uaTLLApiCPnFmyzATTM5k5aXe/7N0mCJC4TByvLDAoVthwErc9KGmpkjLi/gzJWKp wHbUbZOWbWAaeeRfXH/8kimbTTFD8CNpySD3BTJROTlXYGycr8KgRWNoYvXfYd6as9cH DUkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EGWIkPTG; 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=fail (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 t7si5014539ybl.494.2020.07.23.23.51.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:51:25 -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=fail header.i=@linaro.org header.s=google header.b=EGWIkPTG; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrYC-0005O4-V7 for patch@linaro.org; Fri, 24 Jul 2020 02:51:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSY-0004O7-27 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:34 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSU-0000Lw-0A for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:32 -0400 Received: by mail-wr1-x441.google.com with SMTP id 88so7257477wrh.3 for ; Thu, 23 Jul 2020 23:45:28 -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=5qWBsUBL0rRACFD5SJtMCfUkk7hZwZaQ4gS8O1OugSM=; b=EGWIkPTGJ/MjDG3ScsYu2NgagVco3kUB2JQLHhPF2ea9xlC8rqrIfbIUK7sdjNK48I dnCFJH+YFSiphz3d35Hz4d4js9zFuBSml+tXcUeM7r1+mm9N6BsERceeNCUOkK3+abgP EMvb3P9JLvXB1Iqvl8dsDd6ILIP9xtYGNKRPN++J+DVblfvtWVkWazG8FW8m4TdulKQl 7pXeBKH8yzPPfa9nauOZ6/P6PyOyMCwG4VvkUEejNZtEP+BWYilQWeiv9Cnm4waD+wOu t4d9Z2p9bw0FM3woDM7UAw58sUhsKhG7k/nt11SRHXQ9CER8mNqisND+GgT5q09LGQL6 5UDw== 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=5qWBsUBL0rRACFD5SJtMCfUkk7hZwZaQ4gS8O1OugSM=; b=CSKPBkrY20RTxFhZTQoNWOUsJYm4wKdY87bX9pdnpi45ioJLvA+XkjGD4iM0hNRYXn pMfjLe99Di0Mye+aDgjXpcZjombJmwH5plkb12uO6rHilPjCMRjQO80p/pHLed9P9Z4L qjzi34hBFZvsipxhiG7dhIg0cwjxZ/IDmehggwM+zf7vzBjXJIgthOL/G6SZ1w7+pNVn pjia65p4eB32m8FeLi+mGxNP7pt1kF6pK9NrTkOQZE+VfaI64Y20F6wIPWymUpbbYx1t k4rEYKy2jOybO4cdmw9ynmR4bsguDvloshIuPeNIMAD/ZtNLSQ+j26o/OgQgATZucvzY 8XCw== X-Gm-Message-State: AOAM531ix07NFRaFzxp7n2IHcV61aGiR26r7ekiC2NctXqU7U29VLdxi Tbx7VfZ7dRLvsY9v2z2Ukdg/mw== X-Received: by 2002:a5d:538a:: with SMTP id d10mr2941718wrv.280.1595573127747; Thu, 23 Jul 2020 23:45:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 62sm171572wrq.31.2020.07.23.23.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 613261FF9C; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 13/16] linux-user, ppc: fix clock_nanosleep() for linux-user-ppc Date: Fri, 24 Jul 2020 07:45:06 +0100 Message-Id: <20200724064509.331-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.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_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: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, Laurent Vivier , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Our safe_clock_nanosleep() returns -1 and updates errno. We don't need to update the CRF bit in syscall.c because it will be updated in ppc/cpu_loop.c as the return value is negative. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée Message-Id: <20200722174612.2917566-3-laurent@vivier.eu> --- linux-user/syscall.c | 7 ------- 1 file changed, 7 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 43a6e283961..f5c4f6b95db 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11840,13 +11840,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, host_to_target_timespec(arg4, &ts); } -#if defined(TARGET_PPC) - /* clock_nanosleep is odd in that it returns positive errno values. - * On PPC, CR0 bit 3 should be set in such a situation. */ - if (ret && ret != -TARGET_ERESTARTSYS) { - ((CPUPPCState *)cpu_env)->crf[0] |= 1; - } -#endif return ret; } #endif From patchwork Fri Jul 24 06:45:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247125 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2187502ilg; Thu, 23 Jul 2020 23:54:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV27mXzBc0kuWdwp16LcBkhVaU9iiAnmTI8GKEaTx4IrnYR+lTJrH3CVD5cp0D1BhwmSWi X-Received: by 2002:a25:ac66:: with SMTP id r38mr13242441ybd.105.1595573640964; Thu, 23 Jul 2020 23:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573640; cv=none; d=google.com; s=arc-20160816; b=r9Ri8VooSu+/nwEx/RxyM9NauLkNyHhIKvChykwd1Xp+AsDA82Lt2wO6qqX0vSArpZ nUpFNLBS8YQlLkYyWlHXXdgjkzks16RL2SImtrIn7RoQ9R5xW0OmmWZP5K+xjFXZqKPC k+qZrMnMuyNtucyhKZMK+F3ag4X22sIrEcVvNypMPzVvx5rYqtf778sK4zCx/0V8xP1h c/UT/MXCqsJ8uOyCnQPH9eFQPibDUg+Yk7xmUqKGlskEAtFtXNXhupB5m3Z1ONtudAdT UjqHfX+CmAIEAWg9aGFxHg0LYiK3olr2kjHW7KiaAQp8tVevAj2lzRB94YluDgNSTRZ1 Lkyw== 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=tbuf3a7z9rzul3Y2V8EPpXFJXL5dyVGH3TuBWvwpmx8=; b=LMojEYyvNn2b7e53pkt3err0OdRV/enq/h9/owO6juGDY1wLBYE4zMZhN9JHD9fMal X0TRn2ahxo+jn1qfdwWDqImJh2lRjcced0/BTdAfHDr7Arsu0e3V3cMQzw79S6UMeg9q 6edBAcehqL2mNVHSb1DwapeRN9FijpLjyP18LjLKlOLvlQVIdicBVIiqNle8R3dRZU8c xIjQG/3OlZhdRDQ8gsyuTpxnTW1/gXd8zWNQGifoiO2DAfJ61f9oCKjQ2mwrX3XhP9ol pp2t5Kx8h8MCBa71MtgYah7CE8QbabLQhUtNg7LxHdfwNUu3bikss3bfPYKc468zC6u9 3QYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=czH50u3r; 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=fail (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 g3si665292ybd.56.2020.07.23.23.54.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:54:00 -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=fail header.i=@linaro.org header.s=google header.b=czH50u3r; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrai-00017b-F6 for patch@linaro.org; Fri, 24 Jul 2020 02:54:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSZ-0004Qc-OD for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:35 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:38570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSV-0000M8-Dp for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:34 -0400 Received: by mail-wr1-x42d.google.com with SMTP id a14so7260674wra.5 for ; Thu, 23 Jul 2020 23:45:29 -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=tbuf3a7z9rzul3Y2V8EPpXFJXL5dyVGH3TuBWvwpmx8=; b=czH50u3rdbRKcqYW6O5nHGT5vMnGOw9i0OwjLR9SQG4rOaIMI9u9Jv18+prPTSZikr qqeoY1yHgC/uiPjNtO/w+JlF3gLsXoZp+YJoMfsNjoPpuXCIwYvqZgBbnLuagimF90+q 7wXvzW2NktKCzk7QeleUf3bjBpSckUgzuySjJwzPGosKsQAqi0/MJSdrF9bK5dVytEOF cyUvKNdSswW+EROQEIqPf9TT/QBCAbAGgITpF1mzqB6vIDZc7P8aFWZSd2sWnbT8xCf1 7xdED4O5dDCDK19NxIGSALZdbeKVXjHIlTSaHQQiEoZKh4hMKs3AuQJHmk9YtgNqYksk 5sYg== 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=tbuf3a7z9rzul3Y2V8EPpXFJXL5dyVGH3TuBWvwpmx8=; b=tn6+9hptF+TCff8rn9itLIC1TtYZoRPKUQ/81v3//dp5PoiLUCkLxWUnwMdhpdwTbs /HSxUhmQ9vxU0WCQweWRsS2Qpgc7V23XaxHP/L3DQvVuIQ5YEJiefiq52c7VuNB51O6G 5se3Dz+bHxL0knoJRTajE1beXnmZFjFqRxl6fvcGQYdX2ZxkDY2LlSI7JkwUFBTCvJAe AiRiYMdvoCiePKRq6h3bHj109BlmmJuGKe5X6OYiuGH18XcCy/u7oyEofnX8n9RGJFDG lpiDtu512Wer6PFMfWUZLhHbvR9LCRgswGVlrUtwzkhtS27Ss7i0nBsfFEwMqfxT+hG0 8nNQ== X-Gm-Message-State: AOAM533iUtdjeRUF0X1QNnovR0kUo5faiz2QMzydFLTH1DTXqAHh/Lif qPwa3cXraCyuOAfNVzpDqZUi1w== X-Received: by 2002:a5d:69c8:: with SMTP id s8mr7001947wrw.405.1595573128712; Thu, 23 Jul 2020 23:45:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 1sm5940977wmf.21.2020.07.23.23.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 79DD81FF9D; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 14/16] python/qemu: Cleanup changes to ConsoleSocket Date: Fri, 24 Jul 2020 07:45:07 +0100 Message-Id: <20200724064509.331-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, cota@braap.org, Cleber Rosa , aurelien@aurel32.net, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley The changes to console_socket.py and machine.py are to cleanup for pylint and flake8. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200717203041.9867-2-robert.foley@linaro.org> --- python/qemu/console_socket.py | 57 ++++++++++++++++++----------------- python/qemu/machine.py | 7 +++-- python/qemu/pylintrc | 2 +- 3 files changed, 34 insertions(+), 32 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index 830cb7c6282..09986bc2152 100644 --- a/python/qemu/console_socket.py +++ b/python/qemu/console_socket.py @@ -1,12 +1,9 @@ -#!/usr/bin/env python3 -# -# This python module implements a ConsoleSocket object which is -# designed always drain the socket itself, and place -# the bytes into a in memory buffer for later processing. -# -# Optionally a file path can be passed in and we will also -# dump the characters to this file for debug. -# +""" +QEMU Console Socket Module: + +This python module implements a ConsoleSocket object, +which can drain a socket and optionally dump the bytes to file. +""" # Copyright 2020 Linaro # # Authors: @@ -15,20 +12,27 @@ # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. # + import asyncore import socket import threading -import io -import os -import sys from collections import deque import time -import traceback + class ConsoleSocket(asyncore.dispatcher): + """ + ConsoleSocket represents a socket attached to a char device. + Drains the socket and places the bytes into an in memory buffer + for later processing. + + Optionally a file path can be passed in and we will also + dump the characters to this file for debugging purposes. + """ def __init__(self, address, file=None): self._recv_timeout_sec = 300 + self._sleep_time = 0.5 self._buffer = deque() self._asyncore_thread = None self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) @@ -70,31 +74,28 @@ class ConsoleSocket(asyncore.dispatcher): def handle_read(self): """process arriving characters into in memory _buffer""" - try: - data = asyncore.dispatcher.recv(self, 1) - # latin1 is needed since there are some chars - # we are receiving that cannot be encoded to utf-8 - # such as 0xe2, 0x80, 0xA6. - string = data.decode("latin1") - except: - print("Exception seen.") - traceback.print_exc() - return + data = asyncore.dispatcher.recv(self, 1) + # latin1 is needed since there are some chars + # we are receiving that cannot be encoded to utf-8 + # such as 0xe2, 0x80, 0xA6. + string = data.decode("latin1") if self._logfile: self._logfile.write("{}".format(string)) self._logfile.flush() for c in string: self._buffer.extend(c) - def recv(self, n=1, sleep_delay_s=0.1): - """Return chars from in memory buffer""" + def recv(self, buffer_size=1): + """Return chars from in memory buffer. + Maintains the same API as socket.socket.recv. + """ start_time = time.time() - while len(self._buffer) < n: - time.sleep(sleep_delay_s) + while len(self._buffer) < buffer_size: + time.sleep(self._sleep_time) elapsed_sec = time.time() - start_time if elapsed_sec > self._recv_timeout_sec: raise socket.timeout - chars = ''.join([self._buffer.popleft() for i in range(n)]) + chars = ''.join([self._buffer.popleft() for i in range(buffer_size)]) # We choose to use latin1 to remain consistent with # handle_read() and give back the same data as the user would # receive if they were reading directly from the diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 80c4d4a8b6e..9956360a792 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -27,7 +27,7 @@ import socket import tempfile from typing import Optional, Type from types import TracebackType -from qemu.console_socket import ConsoleSocket +from . import console_socket from . import qmp @@ -674,8 +674,9 @@ class QEMUMachine: """ if self._console_socket is None: if self._drain_console: - self._console_socket = ConsoleSocket(self._console_address, - file=self._console_log_path) + self._console_socket = console_socket.ConsoleSocket( + self._console_address, + file=self._console_log_path) else: self._console_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) diff --git a/python/qemu/pylintrc b/python/qemu/pylintrc index 5d6ae7367d8..3f69205000d 100644 --- a/python/qemu/pylintrc +++ b/python/qemu/pylintrc @@ -33,7 +33,7 @@ good-names=i, Run, _, fd, - + c, [VARIABLES] [STRING] From patchwork Fri Jul 24 06:45:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247124 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2187293ilg; Thu, 23 Jul 2020 23:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymLEgoVkJiRMBgE3HoErf6Cr/oMRVFDYg1TAiCKDDkW1pLfDAfKFyap/125SndLAKnu0Gt X-Received: by 2002:a25:d415:: with SMTP id m21mr10209475ybf.75.1595573617018; Thu, 23 Jul 2020 23:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573617; cv=none; d=google.com; s=arc-20160816; b=vx4UiNZ7mjRhpFRGLlpMaiP4g/YHfB5O3fXf5fXxSqcdXkFsor11K1qXst/Om6YMAV h3yi9XQHwmB4X7tKT/FXeVSvlIRHNk8Z3JrChTkQ/OK3sIFr9DOmD2e0CwB6uyCoq+IQ XAMwgBJ8PeHNEJQDhIL/UcUyN6THnqSLWb84YHzq0PLvyKAY1jYIpneceWX9fSCU3yFK E/Uundlg4OxZ07XSMiWi7lSImx3wL7H/m4zyUljZKeKptzu14hv89ify7TSBxEbbeAHG j2wDw+iXJ6usNIU79LwzZsbK8hLZB5b5Ka8ROA/QgfdZUVlN/TF4voTL29gt34up1au1 MyUw== 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=yj8DDf6/1Mn/GS/Gll82s3CyxDwZlUdXHnnJnmWRd1o=; b=C2DUbbL7Y/Qjlu3B6itpH3v5W/CHk5OJBAs6QT/BdvKMSWkSgWwTPixHWr90YOgOlf hvHp0s2ut1XPpECf4iPgL9P0Y42lL6u8zVYUyHiCvL6HeV3WBDdmghApm20bJJQM892L WhJ/+fiAZDCOprDQVcEG2Y0WAA+S8FjxEG5lbmnAH6Hga8hcQywed317EcEnAoWreeur H2fSCPWNB0C8Io7NE/vp+psFQyG3DOTwkGR6ko/xvdyz69ZR8wHfw+JZ1WikoKovEX9D vTyDy1pv3+Cwuwq/lVaj+z2dzbLYmDYG2Xp1En82CN0MWa84uaRKkYeg1nrNKkNroREW tNRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eK72XM5w; 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=fail (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 j131si5083300ybj.220.2020.07.23.23.53.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:53:37 -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=fail header.i=@linaro.org header.s=google header.b=eK72XM5w; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyraK-0000Ej-EO for patch@linaro.org; Fri, 24 Jul 2020 02:53:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrYu-00071B-KT for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:52:08 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrYr-0001Es-Q6 for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:52:08 -0400 Received: by mail-wm1-x343.google.com with SMTP id f139so7245157wmf.5 for ; Thu, 23 Jul 2020 23:52:05 -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=yj8DDf6/1Mn/GS/Gll82s3CyxDwZlUdXHnnJnmWRd1o=; b=eK72XM5w1G6nLYOmOYrmPRSVEU5dRydtru1wO2MiWTNMKxmWjtS966NdJB6nkL0gKv pIIEGj5FHMn01xYEGJ/7YoaBfLtBpVv9O+URvpb2eggUIRyFGrZOYKCBSNLehOubShV6 cbBlmB5gGrDca4sqKujV/FzNnObLDWGDFm3Ol0jLm1LQy/lMpR+RhuOpS0Wi2mvDdArS Eo4DZbVCnuwwWTX0hieM2Dyp8AKbdz04ISzT9HNF99YPMYkB2UEC6jv3qIELlCkixYTH YzUfkm3oh3gPpZS994fS+wR37aMf1qxBLq/PvTJCUPkD39CaictonmrTBr6z0flmW1gR AxBA== 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=yj8DDf6/1Mn/GS/Gll82s3CyxDwZlUdXHnnJnmWRd1o=; b=DSXqH96v6rwvkuIvGCUt/X5wYoNY/zeDjnqKHe0vVUOV69Rfy21H/LsRhizaXkc77T vol8acIBx78ZtrSkWVaQo+a+lbh7SJLTl+VT4pA0ORO/4lTt4M1vr0LTcAEGTspOJCbm ICE8hL1nTD6Uuwc2306LVXVQiKf8HfEOghY9XFv0OXIwkRRSxrgfxTbBcbvC0KE/7gC0 0fODiQWUUON9n1rj9vXop73hY5c+K8Tujvis3i9v4qg88rLwiBryuGJhT0UAVBqr+QEe fFcld2Pk4I4fWbVwzho2f9Y2RJCYFmSSkR6tCksURuuotFlU0Tpjk3NLJhFgEIOwQsbf sIGQ== X-Gm-Message-State: AOAM533AKuFsJD5lya0/JZlTgYNpHbEYDQonEexdsCVLbyJT4lcC0+rV 6VNs/D/8sepoqa1JVw0ieVhnGg== X-Received: by 2002:a05:600c:414f:: with SMTP id h15mr7780878wmm.82.1595573524352; Thu, 23 Jul 2020 23:52:04 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b23sm6049173wmd.37.2020.07.23.23.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:52:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9206D1FF9E; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 15/16] python/qemu: Change ConsoleSocket to optionally drain socket. Date: Fri, 24 Jul 2020 07:45:08 +0100 Message-Id: <20200724064509.331-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.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_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, cota@braap.org, Cleber Rosa , aurelien@aurel32.net, Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley The primary purpose of this change is to clean up machine.py's console_socket property to return a single type, a ConsoleSocket. ConsoleSocket now derives from a socket, which means that in the default case (of not draining), machine.py will see the same behavior as it did prior to ConsoleSocket. Signed-off-by: Robert Foley Signed-off-by: Alex Bennée Message-Id: <20200717203041.9867-3-robert.foley@linaro.org> --- python/qemu/console_socket.py | 92 +++++++++++++++++++++-------------- python/qemu/machine.py | 13 ++--- 2 files changed, 59 insertions(+), 46 deletions(-) -- 2.20.1 diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index 09986bc2152..70869fbbdc4 100644 --- a/python/qemu/console_socket.py +++ b/python/qemu/console_socket.py @@ -13,68 +13,75 @@ which can drain a socket and optionally dump the bytes to file. # the COPYING file in the top-level directory. # -import asyncore import socket import threading from collections import deque import time -class ConsoleSocket(asyncore.dispatcher): +class ConsoleSocket(socket.socket): """ ConsoleSocket represents a socket attached to a char device. - Drains the socket and places the bytes into an in memory buffer - for later processing. + Optionally (if drain==True), drains the socket and places the bytes + into an in memory buffer for later processing. Optionally a file path can be passed in and we will also dump the characters to this file for debugging purposes. """ - def __init__(self, address, file=None): + def __init__(self, address, file=None, drain=False): self._recv_timeout_sec = 300 self._sleep_time = 0.5 self._buffer = deque() - self._asyncore_thread = None - self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - self._sock.connect(address) + socket.socket.__init__(self, socket.AF_UNIX, socket.SOCK_STREAM) + self.connect(address) self._logfile = None if file: self._logfile = open(file, "w") - asyncore.dispatcher.__init__(self, sock=self._sock) self._open = True - self._thread_start() + if drain: + self._drain_thread = self._thread_start() + else: + self._drain_thread = None - def _thread_start(self): - """Kick off a thread to wait on the asyncore.loop""" - if self._asyncore_thread is not None: - return - self._asyncore_thread = threading.Thread(target=asyncore.loop, - kwargs={'timeout':1}) - self._asyncore_thread.daemon = True - self._asyncore_thread.start() + def _drain_fn(self): + """Drains the socket and runs while the socket is open.""" + while self._open: + try: + self._drain_socket() + except socket.timeout: + # The socket is expected to timeout since we set a + # short timeout to allow the thread to exit when + # self._open is set to False. + time.sleep(self._sleep_time) - def handle_close(self): - """redirect close to base class""" - # Call the base class close, but not self.close() since - # handle_close() occurs in the context of the thread which - # self.close() attempts to join. - asyncore.dispatcher.close(self) + def _thread_start(self): + """Kick off a thread to drain the socket.""" + # Configure socket to not block and timeout. + # This allows our drain thread to not block + # on recieve and exit smoothly. + socket.socket.setblocking(self, False) + socket.socket.settimeout(self, 1) + drain_thread = threading.Thread(target=self._drain_fn) + drain_thread.daemon = True + drain_thread.start() + return drain_thread def close(self): """Close the base object and wait for the thread to terminate""" if self._open: self._open = False - asyncore.dispatcher.close(self) - if self._asyncore_thread is not None: - thread, self._asyncore_thread = self._asyncore_thread, None + if self._drain_thread is not None: + thread, self._drain_thread = self._drain_thread, None thread.join() + socket.socket.close(self) if self._logfile: self._logfile.close() self._logfile = None - def handle_read(self): + def _drain_socket(self): """process arriving characters into in memory _buffer""" - data = asyncore.dispatcher.recv(self, 1) + data = socket.socket.recv(self, 1) # latin1 is needed since there are some chars # we are receiving that cannot be encoded to utf-8 # such as 0xe2, 0x80, 0xA6. @@ -85,27 +92,38 @@ class ConsoleSocket(asyncore.dispatcher): for c in string: self._buffer.extend(c) - def recv(self, buffer_size=1): + def recv(self, bufsize=1): """Return chars from in memory buffer. Maintains the same API as socket.socket.recv. """ + if self._drain_thread is None: + # Not buffering the socket, pass thru to socket. + return socket.socket.recv(self, bufsize) start_time = time.time() - while len(self._buffer) < buffer_size: + while len(self._buffer) < bufsize: time.sleep(self._sleep_time) elapsed_sec = time.time() - start_time if elapsed_sec > self._recv_timeout_sec: raise socket.timeout - chars = ''.join([self._buffer.popleft() for i in range(buffer_size)]) + chars = ''.join([self._buffer.popleft() for i in range(bufsize)]) # We choose to use latin1 to remain consistent with # handle_read() and give back the same data as the user would # receive if they were reading directly from the # socket w/o our intervention. return chars.encode("latin1") - def set_blocking(self): - """Maintain compatibility with socket API""" - pass + def setblocking(self, value): + """When not draining we pass thru to the socket, + since when draining we control socket blocking. + """ + if self._drain_thread is None: + socket.socket.setblocking(self, value) def settimeout(self, seconds): - """Set current timeout on recv""" - self._recv_timeout_sec = seconds + """When not draining we pass thru to the socket, + since when draining we control the timeout. + """ + if seconds is not None: + self._recv_timeout_sec = seconds + if self._drain_thread is None: + socket.socket.settimeout(self, seconds) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 9956360a792..c5f777b9e72 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -23,7 +23,6 @@ import os import subprocess import shutil import signal -import socket import tempfile from typing import Optional, Type from types import TracebackType @@ -673,12 +672,8 @@ class QEMUMachine: Returns a socket connected to the console """ if self._console_socket is None: - if self._drain_console: - self._console_socket = console_socket.ConsoleSocket( - self._console_address, - file=self._console_log_path) - else: - self._console_socket = socket.socket(socket.AF_UNIX, - socket.SOCK_STREAM) - self._console_socket.connect(self._console_address) + self._console_socket = console_socket.ConsoleSocket( + self._console_address, + file=self._console_log_path, + drain=self._drain_console) return self._console_socket From patchwork Fri Jul 24 06:45:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 247114 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2184245ilg; Thu, 23 Jul 2020 23:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPcZNhDedbct9oPo5Kxp1ZpvlapIaZ9rrGcMzUXjQFrwza0oQlIDGB1BX/tjQo5fHtaebB X-Received: by 2002:a25:d8d4:: with SMTP id p203mr1569242ybg.109.1595573272243; Thu, 23 Jul 2020 23:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595573272; cv=none; d=google.com; s=arc-20160816; b=tv872yLO/G77FjQ2SFtlh/q9ORmQQ/4QRbQ+dfwBtG10Hsmz+vNZ8IPpIi31cD8Ws4 AmEP9hLuXc+z5YLfzYJBChvV/CISaWc0W2koSNleBd9wqyzLczqvN6Tt2GApFt8p6Je3 csbGz4iR4xOcc3PeMsfv9+lZUYKjuEEna9xv7s6fTi9GX9dEtJPCcBdKcMBkfpHhR4w3 QFL9ieqBDiZ7rel0rFrw8USEeMs7xemYU/aCUv/lMueugZNNOj8opBHa/Dr32hJKPNXo LF1y/pFsFLUFHOnRbJoVc7BZxJ5s0Hk0HRjVm6SzVGYIGMfT1j5b98kXzbdIfx7Cz4Vj RoCg== 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=o96Arm+AsiTT6WxJk5cGUcDJbyjeQXafxD+vVt8iLyE=; b=NJvSyLN+bNyMqu2E2VZGQ0088hxE6Aa9RZp+iRiTObRjsxh7Nff6RZ9RWYLX8CsqSi oaZDqAB2M7KcHwMsEnk3KpfJml+SnJWbDoOuns3wESqj28ojUV9OJXp80qBOrHyyA3qZ xsL6qtL55AYDzk87o4z4V3V9ae31v+zsMQIWNi7oYPEAkZ0bcoYmQRQf6MEoNkQJ2e3S EGV701T+L3FINhdg98JGEJZC8OVuvKijoPP8hoFZ/UZzS8AFoKbPnbEJzZIhmq6WKzmc Og4BeYBz59iAD22UglmXipu7IqnmEoGo3zQ6XexotS8lAM6NYMGugWDNX5FUyoXefHl6 XfJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tbFibdVm; 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=fail (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 g14si4664350ybq.424.2020.07.23.23.47.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 23:47:52 -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=fail header.i=@linaro.org header.s=google header.b=tbFibdVm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyrUl-0007Xt-J2 for patch@linaro.org; Fri, 24 Jul 2020 02:47:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyrSW-0004La-5s for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:33 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:40377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyrSS-0000Ll-4n for qemu-devel@nongnu.org; Fri, 24 Jul 2020 02:45:31 -0400 Received: by mail-wr1-x441.google.com with SMTP id f2so7245495wrp.7 for ; Thu, 23 Jul 2020 23:45:27 -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=o96Arm+AsiTT6WxJk5cGUcDJbyjeQXafxD+vVt8iLyE=; b=tbFibdVm08jBFOPNF7mmdndak7mQhIfIJNgz2pAo4Muftj7bHdgmhDoUdG/9UMeY0W l/3bPQUY3+d/JfEl2DAYdk4cHfnjjBuzxjHGHWqizV4ESVR4g2zL/SpjhWNG9keG0o9P quh9JLM6WDVS2zMUj5LymZNcLASaoFlb1YlE4FQRvYZeY3lhHdOuOi5ar/Kvi2IJMwGj je3MsImUGydAtRLwq4MQUdmfrAuApBHB6SmoKaSYLA+6DJ2ivmzhrCxufyHfWaOdWDON DbRPVyA8Ac3FfyHtHRJEe29mpn6QJObhUWyW4v77oqU/GkSaxtTHvQejorqZMv8oNvJe sRlA== 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=o96Arm+AsiTT6WxJk5cGUcDJbyjeQXafxD+vVt8iLyE=; b=GCk9pZTtB8MWlM+Dg6iBdgqmyFoDDBuUMwZmXIQqlkualPJigMA1VD9KmY3wsNCVQX lV5I7CWIj0OHi31Q10GxPD1ak7jq/TOwScFFs6I0CRYyRsCxB3S782e84jqFt/8+3v+O jpbUPMvKjBa7yYavxDGPZKZ660WAYqWb4QO4VScc2o12opAmfAO/tyAAEpsOdTK72iyR hLdA7tFsZjOH+quC+wPoWGoIdo+QDTuFdzaNiXLL1Oey9sTaMjH6u/2zCjpVfKTK/Et3 lR2L0XF+HNGhIjLgPvi/xn44hIbjMCm7e0He9i8N6I6b4pyXvrVz3Ut9zsxMBifO4S8y l8Jw== X-Gm-Message-State: AOAM5336Gvh0QYzRU53UymPRSTgv/mZI/SQgvbemoNsL0edzjLbAlHnO H6XQsCg9YRk7AejO51sNaXBsAw== X-Received: by 2002:adf:de08:: with SMTP id b8mr6764130wrm.4.1595573126400; Thu, 23 Jul 2020 23:45:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o4sm5729789wmc.13.2020.07.23.23.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 23:45:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A7E591FF9F; Fri, 24 Jul 2020 07:45:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 16/16] tests/vm: add shutdown timeout in basevm.py Date: Fri, 24 Jul 2020 07:45:09 +0100 Message-Id: <20200724064509.331-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724064509.331-1-alex.bennee@linaro.org> References: <20200724064509.331-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.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_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley We are adding the shutdown timeout to solve an issue we now see where the aarch64 VMs timeout on shutdown under TCG. There is a new 3 second timeout in machine.py, which we override in basevm.py when shutting down. Signed-off-by: Robert Foley Signed-off-by: Alex Bennée Message-Id: <20200717203041.9867-4-robert.foley@linaro.org> --- tests/vm/basevm.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 7acb48b8761..3fac20e929a 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -80,6 +80,8 @@ class BaseVM(object): arch = "#arch" # command to halt the guest, can be overridden by subclasses poweroff = "poweroff" + # Time to wait for shutdown to finish. + shutdown_timeout_default = 30 # enable IPv6 networking ipv6 = True # This is the timeout on the wait for console bytes. @@ -87,7 +89,7 @@ class BaseVM(object): # Scale up some timeouts under TCG. # 4 is arbitrary, but greater than 2, # since we found we need to wait more than twice as long. - tcg_ssh_timeout_multiplier = 4 + tcg_timeout_multiplier = 4 def __init__(self, args, config=None): self._guest = None self._genisoimage = args.genisoimage @@ -141,9 +143,12 @@ class BaseVM(object): if args.jobs and args.jobs > 1: self._args += ["-smp", "%d" % args.jobs] if kvm_available(self.arch): + self._shutdown_timeout = self.shutdown_timeout_default self._args += ["-enable-kvm"] else: logging.info("KVM not available, not using -enable-kvm") + self._shutdown_timeout = \ + self.shutdown_timeout_default * self.tcg_timeout_multiplier self._data_args = [] if self._config['qemu_args'] != None: @@ -423,7 +428,7 @@ class BaseVM(object): def wait_ssh(self, wait_root=False, seconds=300, cmd="exit 0"): # Allow more time for VM to boot under TCG. if not kvm_available(self.arch): - seconds *= self.tcg_ssh_timeout_multiplier + seconds *= self.tcg_timeout_multiplier starttime = datetime.datetime.now() endtime = starttime + datetime.timedelta(seconds=seconds) cmd_success = False @@ -441,14 +446,14 @@ class BaseVM(object): raise Exception("Timeout while waiting for guest ssh") def shutdown(self): - self._guest.shutdown() + self._guest.shutdown(timeout=self._shutdown_timeout) def wait(self): - self._guest.wait() + self._guest.wait(timeout=self._shutdown_timeout) def graceful_shutdown(self): self.ssh_root(self.poweroff) - self._guest.wait() + self._guest.wait(timeout=self._shutdown_timeout) def qmp(self, *args, **kwargs): return self._guest.qmp(*args, **kwargs)