From patchwork Mon Jul 31 21:02:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 708422 Delivered-To: patch@linaro.org Received: by 2002:a5d:6787:0:b0:317:2194:b2bc with SMTP id v7csp2522940wru; Mon, 31 Jul 2023 14:04:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqmTtIOQ8d9FZ8HO2XLns/Rax5zRPWIYUKLOe8I4zGh4+m/2bhpdAEuySZSfE86Qt0zviY X-Received: by 2002:a05:620a:450f:b0:768:1053:b1b3 with SMTP id t15-20020a05620a450f00b007681053b1b3mr16467252qkp.31.1690837473945; Mon, 31 Jul 2023 14:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690837473; cv=none; d=google.com; s=arc-20160816; b=MeBrL0Kjuh9Rrj1Lg+QKDMRUpcjhPlo+FpDTfWxIOD+s+VwKstU4ropMpno5GHek6X mDRahhQ+Ccb4opSuD3gSsz1RmP6CUcooHSVGaC0sopEd120oLflklHqJz+y/3FiFfMLk SOREZrcvBxVUp9HFL91IzkrQKwARJRGtoKCQYJ7YPOWQbDZpZCyG5EyLP3QP3MV4mpc/ JCa4FcHTh11wcCYZMmBmGjp3fQJBxDAcBBVOdbV125yvS5CRelF15hIatMKD4GpliOYS OcuNlHlCAEiNgE7yna+qyOfsttrEpettlJr2sF0DSYGnY4N80wQyi+X4HFR6e+z7ZAF0 4kkg== 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:dkim-signature; bh=ZyEq/ubSCgSD+ft15Usf/3AynvuxUvcxwUVoiqZ43kc=; fh=Ah6H6tQOatmg8gyKeZn11fyzkkFTDqme0iqbNis7KsQ=; b=FaisJzaIa1CL6hk1VPxLoVC3wgPsNN4e83D4sAUFN0bT5YMS4kDhxI0Wf+t8JyEJQT qgCOWLhWaPsDfAxkBRT53Kt03lvFSWA7yfjeEhJccW7H3wstR4y5pS4zU34JXlj3VCib xkKd90URrsgrUFXF2+o5I1hrrzCD9n9tAZcBkRZSBWCC8FaqQQgjVQkHix1mRWVQAkp6 BCFgabhnedRrgopxwtKDqJuFJARjwvBpqKTAcGO4jxkgfmt7zVJeNMzjpPs3sXwoiqNt 3aew4leYaEDrEyODTVzJAqQUApA/Lt/WP74NHdDjMIQRwCahBeBk40CS8H/vmL2MKWeo 2fRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ToR4rD1d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d16-20020a05620a241000b00767f1da20c3si6519432qkn.500.2023.07.31.14.04.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Jul 2023 14:04: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=pass header.i=@linaro.org header.s=google header.b=ToR4rD1d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQa27-0000tT-Qt; Mon, 31 Jul 2023 17:02:28 -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 1qQa23-0000sf-Hp for qemu-devel@nongnu.org; Mon, 31 Jul 2023 17:02:23 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qQa21-0006Pc-Dh for qemu-devel@nongnu.org; Mon, 31 Jul 2023 17:02:22 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bbbbb77b38so29007525ad.3 for ; Mon, 31 Jul 2023 14:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690837339; x=1691442139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZyEq/ubSCgSD+ft15Usf/3AynvuxUvcxwUVoiqZ43kc=; b=ToR4rD1dxnuU8AeOWh4/Rwnj8qj8+GYsy6kTkAG8gjufqOBCncVyYXhtNJ5Kp8W2LX cGqjldi7bdBlRdskC6II5xUHuJUyDMLO+Kaa0ENyGAIDxkWJAtgd/PH75erNQW2LhQD2 0a9JmSxTcRbddBao2ke1IV7/c2auVIldQBR5uwPLbK5um7hQLnt4C3XHgxV9HOzQPv9Z ApnMFJZuo2i4fJBqSkDKKEt2WdEMJ1eDFM4CcpJpNa6s3SUM1EVww/UCMlRxjfaNFSXT yFTWLI3wQ1R3hpA5apmd9JouHGV0jWtbZ3O/mMLB2NlxSHuaHdNBch+w+qki0/ETRXfQ F75Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690837339; x=1691442139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZyEq/ubSCgSD+ft15Usf/3AynvuxUvcxwUVoiqZ43kc=; b=YUPWw+RYgjFfFI48s8xtQevJYEyTNkOAQlrfJeCiJiqQiM3IWX9CcH81Rshy4WlD75 U8zek5tGjtM9ne9xwdvuU18iv12c/PSTnnrnQVpDqV/Mfbwy9uW0bfS4+sntC0lc5IGR qOJK1qhyDAEI7PT1jgobwpgSM+Lmc3EXTcPSYfFmhal9jSaZ8HQd4CXAsHqBLP6nqkjP NGbE3xBmpVoT1q9e4RKgpS5ozy/xFCQuMkPpmjc0nIJ/xZlbN8xaiwathPmJalbjM/1m 3ap8oMduWUJE2sigIjIMg2w8niRtKldCTVS9VW2CPyskopvsjulD2IL9lJJOuZ5B1wis opNA== X-Gm-Message-State: ABy/qLbiOKJZOEMmS67Owh8FPz4FXCbiyTZz5O1/Cxe8iw4tB0PlFsPS /ET433+y3v69kY7ELZ0xAleqnanK2O6PC/x7wy8= X-Received: by 2002:a17:902:988e:b0:1b9:cc6b:408c with SMTP id s14-20020a170902988e00b001b9cc6b408cmr9995735plp.38.1690837339148; Mon, 31 Jul 2023 14:02:19 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:4f6f:6b:2de4:e0cb]) by smtp.gmail.com with ESMTPSA id r11-20020a1709028bcb00b001bb8895848bsm8924230plo.71.2023.07.31.14.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 14:02:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Warner Losh Subject: [PULL 07/10] bsd-user: Specify host page alignment if none specified Date: Mon, 31 Jul 2023 14:02:08 -0700 Message-Id: <20230731210211.137353-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230731210211.137353-1-richard.henderson@linaro.org> References: <20230731210211.137353-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Warner Losh We're hitting an assert when we pass in alignment == 0 since that's not a power of two. so pass in the ideal page size. Signed-off-by: Warner Losh Message-Id: <20230728162927.5009-1-imp@bsdimp.com> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- bsd-user/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 74ed00b9fe..b62a69bd07 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -260,7 +260,8 @@ static abi_ulong mmap_find_vma_aligned(abi_ulong start, abi_ulong size, if (reserved_va) { return mmap_find_vma_reserved(start, size, - (alignment != 0 ? 1 << alignment : 0)); + (alignment != 0 ? 1 << alignment : + MAX(qemu_host_page_size, TARGET_PAGE_SIZE))); } addr = start;