From patchwork Fri Jun 7 09:05:26 2019 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: 166112 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp423786ili; Fri, 7 Jun 2019 03:00:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJPj6Pvugi10EA2Guvh8anXRtmUtbCK+itq9dgYYDEgYx04w2Mg9Aeo6ElwIQySKTurT2r X-Received: by 2002:ac8:38cf:: with SMTP id g15mr38375656qtc.268.1559901606641; Fri, 07 Jun 2019 03:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559901606; cv=none; d=google.com; s=arc-20160816; b=ye0ITGdEaY+YsJl4955aBOKQlZNUKnA/3BTPB1L+PsMLa6C+LBKKyhZ3b4mxxOGAFG t6o1RoyIGKguytNzqym0bhocERTyfD0GN10TxLEgNY6PBkDxHV+hP4c2vrkrCEZnDO5z g7bXiAlrw6Bsh9Awsl3C375kar0cUC+468hzgGSIsus4hwAhwsY7BgQOqzdAdMSE+TtV o6z/NPjuYcbGu9ERtSGrz9ZUY9yZ2I5Opf/3jaDcqdZkoVHvzQ5AWhYfHps2WpzK9nxd 1yRG8u5W3ZQ/p7ypO0d5fmo9BOJWGkSIFP2/c1RXUGLiIPtnyRHPNZAVTNIEjowYgy1Y ZOYw== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=99Dn3AIAE6bUMupx6Zxv5Z+hFUdE7BsSiaYvbx/TT8U=; b=PY7I3tDtIuybSfQzDsxU1SyIWjV9KipKUgocXzsVpqAhvwyedFZ6UHW3jfX7KagGwv nT7c32eNwUMDngp2DNA3oTMxPEziBvDaj1FfBd5/cQ2zPhTSctnVe/DsJxgx7fmm+4pI ke2PhM0vCSFo0J53FC2flFEOwoLHlfi5Weu8vwf0JFU2aGsL2x1jce0Pj6yJvMkUFeEU a0f6nJzWr8Egt04OSTauy8gIaqGCg+E37jp+gghlDg+N0gNJBLpQO0Ftw3Pix67Z+fGG dUs+Nf3R8HYInHp41NzIEuhJ3gZBBDlSgsrHSBrhFC/7JBD42BInHIZ+koveFjuHjBx2 6FRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cet4zqGw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.47 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.47]) by mx.google.com with ESMTPS id c65si886772qkf.51.2019.06.07.03.00.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 03:00:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cet4zqGw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.47 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]:47722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZBfK-0008IV-4H for patch@linaro.org; Fri, 07 Jun 2019 06:00:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42201) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZAvT-0002FX-AY for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:12:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZAvQ-0004yE-He for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:12:43 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:51456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZAvQ-0004kQ-8j for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:12:40 -0400 Received: by mail-wm1-x331.google.com with SMTP id f10so1243927wmb.1 for ; Fri, 07 Jun 2019 02:12:34 -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=99Dn3AIAE6bUMupx6Zxv5Z+hFUdE7BsSiaYvbx/TT8U=; b=Cet4zqGwxmOsg9wlvbgbB0jSgfw143kcG3Mv7oMA9DzOl4GxtUwDEb6PX6Sg3z5M+z JZf0Uwnz9fxzhft81kDZx9UdVtyRB83w1uBvVm8KnaDrwGEKBSndUQxp/f7w1SPnFAYL iBe3UjrzbHBwmqh9CKW5/gXpDVPh+EIoGyvi4z7H/uMd2pZWvi5RmGOeDZApH59+4iGG 7CnkqWmuehmD4BBuiEHEBnKkpy3bt6tcruNrZLMQtzOE4ISLtIG39GLFX4/GNF18JOel pOtFQRlNDAJTH/gvTMceJX1vXnM9EyXIzGWh0YnPLUH1X50mKbMWgdE9h8EOaeIVqRXB VlBw== 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=99Dn3AIAE6bUMupx6Zxv5Z+hFUdE7BsSiaYvbx/TT8U=; b=H2Er5Ci16YzhMU02tGQX0S9BJDM4hI/7yuxM75aoBW5q3KPg7XqX6LqXknBpUadlcV X3tVgh2Ahj8Puj4zP9Bo80PXhr6/K8OpMIRNstRwApbyTbVx+oL6sxMZjcj09F339ruD 1h1hKargy23Ub8uOmiYN1muoW2Lc8MGECDp13I+QstUzBxk+osox/wa24ERCJFWNIPTn Tu3c1cYT62iHa7fwWLWyIQNiO/+vnRpkwahzLOUQ1QppSGK75Baea2Jg1SOmRpPLrvF+ 2SL/Gbrc2YrtDd2za04Y7EHrRb+yWb/sJME/PouCURHUCzFSnU4yv4kLSOvUstGJmwgl vv2Q== X-Gm-Message-State: APjAAAVWn9uoJnQJSzLTzIGNHONBo19fLqcp7YkQmbs8hwucHvjqyhVW VgrH5q/eLElYinsZsiCBQs2/rw== X-Received: by 2002:a05:600c:20c3:: with SMTP id y3mr3008049wmm.3.1559898753112; Fri, 07 Jun 2019 02:12:33 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j82sm1303398wmj.40.2019.06.07.02.12.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 02:12:30 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 31EC21FFB1; Fri, 7 Jun 2019 10:05:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 7 Jun 2019 10:05:26 +0100 Message-Id: <20190607090552.12434-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190607090552.12434-1-alex.bennee@linaro.org> References: <20190607090552.12434-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 Subject: [Qemu-devel] [PULL 27/52] cputlb: use uint64_t for interim values for unaligned load 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: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , qemu-devel@nongnu.org, Laszlo Ersek , Paolo Bonzini , Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When running on 32 bit TCG backends a wide unaligned load ends up truncating data before returning to the guest. We specifically have the return type as uint64_t to avoid any premature truncation so we should use the same for the interim types. Fixes: https://bugs.launchpad.net/qemu/+bug/1830872 Fixes: eed5664238e Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Tested-by: Laszlo Ersek Tested-by: Igor Mammedov -- 2.20.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index cdcc377102..b796ab1cbe 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1303,7 +1303,7 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, && unlikely((addr & ~TARGET_PAGE_MASK) + size - 1 >= TARGET_PAGE_SIZE)) { target_ulong addr1, addr2; - tcg_target_ulong r1, r2; + uint64_t r1, r2; unsigned shift; do_unaligned_access: addr1 = addr & ~(size - 1);