From patchwork Wed Apr 10 07:21:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 787476 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp566946wrs; Wed, 10 Apr 2024 00:25:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVSKllJcOPgSUavM2tj7blhhHhfcSHGTGUczFOyKhwuZf+bgLO2O3F0U6An5Zvs2BeOrBP15XNJNo49HSGinDB4 X-Google-Smtp-Source: AGHT+IGFe/YZmBCZ2VLHUmFNr24yDNPF0tICJqpM69/JZMU6thWNpTwNmkPXXo51X/9BdGGh9kjC X-Received: by 2002:a05:6214:e61:b0:69b:14ed:f0db with SMTP id jz1-20020a0562140e6100b0069b14edf0dbmr1713168qvb.59.1712733950621; Wed, 10 Apr 2024 00:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712733950; cv=none; d=google.com; s=arc-20160816; b=IlTGg6jgQQMqTgMMsrODeTlbtsu5xfP8R349YyUzx3Uvx3L5yOgCicH8eAaaxzZ+0K 7QtfcLYEBU7HJ5NpACMQBSDMjt6WarjPG7kSrkBPxUdWE/Dw8VIaTxWc7hW5YlC4H9Gb nQ7IedF23mAYbKuNLHBHp0BePAvRqXDB9kEsbfblE5jihFX7+16kRL3XjRN89sx3M7dh X0rf70gyrdbef5FoM0Uel6KY41o/ZHzDMJujks1cCRYld3Qo4eTw9FXxUZt+QFw5i/Hi vfAKndDA0vqxqsSUNB44Gy90WKXEBp5fHiUvphXYLX89YqYGmF3foisAA5IoVWrAILs8 uNqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from; bh=0IBSA7d2yFuY5RiiVHA+FFeIIFjGvAg8+fl7SZXgyp4=; fh=pNPzA2klLwkTa9wB0TH4HdzIuaYqvoyobZ1rUSsbmbA=; b=rdy3zvWyXv4o3VMebSz3g1nQylP6k/kQtvBH3EEHZUxdvE0vlN40H0bICMXr+dvdR5 MmyXchmLVOluyzGIF9G6VWQvBabps5IBrsZs5UFAnuym746lM9BxvvWALcAFtvpiQrLg Keg4KsKfAynsTA7tu0ES4gV+eomzudBLCs0fidQWDQ/MuxfRLH8HFGm3Lla9j77vsmZt E0t6WaBG4kCIXDZrFRBfHJc9g1FNIT7A/6d3yKonYVxXbV8JA40TuIU+zOFCgbbrx4e9 XAl8DdN5+7s2NjThJ9J0Wq8cPYN0R/gmTvVWDR4l96cLb/2DgEH42YYiNl/P7gmFmnIv O00w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ct14-20020a056214178e00b0069b1efa1029si5014000qvb.167.2024.04.10.00.25.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2024 00:25:50 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruSIp-0007Zk-D8; Wed, 10 Apr 2024 03:23:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruSIh-0007R2-LL; Wed, 10 Apr 2024 03:23:20 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruSIe-0003s2-SS; Wed, 10 Apr 2024 03:23:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9DFE85D673; Wed, 10 Apr 2024 10:25:02 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 41E1BB02B4; Wed, 10 Apr 2024 10:23:04 +0300 (MSK) Received: (nullmailer pid 4191656 invoked by uid 1000); Wed, 10 Apr 2024 07:23:04 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Alexey Sheplyakov , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Michael Tokarev Subject: [Stable-8.2.3 04/87] linux-user: Remove pgb_dynamic alignment assertion Date: Wed, 10 Apr 2024 10:21:37 +0300 Message-Id: <20240410072303.4191455-4-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson The assertion was never correct, because the alignment is a composite of the image alignment and SHMLBA. Even if the image alignment didn't match the image address, an assertion would not be correct -- more appropriate would be an error message about an ill formed image. But the image cannot be held to SHMLBA under any circumstances. Fixes: ee94743034b ("linux-user: completely re-write init_guest_space") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2157 Signed-off-by: Richard Henderson Reported-by: Alexey Sheplyakov Reviewed-by: Philippe Mathieu-Daudé (cherry picked from commit b816e1b5ba58a986b10cd830d6617f351979ab91) Signed-off-by: Michael Tokarev diff --git a/linux-user/elfload.c b/linux-user/elfload.c index cf9e74468b..7cc8d9685e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3016,8 +3016,6 @@ static void pgb_dynamic(const char *image_name, uintptr_t guest_loaddr, uintptr_t brk, ret; PGBAddrs ga; - assert(QEMU_IS_ALIGNED(guest_loaddr, align)); - /* Try the identity map first. */ if (pgb_addr_set(&ga, guest_loaddr, guest_hiaddr, true)) { brk = (uintptr_t)sbrk(0);