From nobody Thu May 2 09:01:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1660137974; cv=none; d=zohomail.com; s=zohoarc; b=QXQitmA/9/7Tx2r1zWrYiuGMJol+C3e5nQEAVsxeyPxE4l9GkiQTa185YXb0bkKGauq3nO23KpKSwMKscv6qZBtL291excTzLruIo4Eq9mNX2GAtp5TICvA7hQmuQ2duK2CRkHsyU9SP3jbT5agGgGQ5aMJvrxopHxYkg3Og3+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660137974; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gmbpZNyavQxKDGbXfYJjxOfxf3liXSQeUKOUnbr0AeI=; b=lW0qq5aDWTsPw81wb2EJdpkdUncNXoP2JQokYRv0kq7zmlkK+PwZiOtT5wlPWd1x/La/av/AEmAiaKkSVfMeHwt4hSarnUsJi3jaemw9X4pzFbJKrkQ3aQ9JA6rDgQpDtiGUpfV/0lHzfiWS6ZYVNn5ZTQjcPyg3yLpm2tOJfm4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1660137974747848.6237573732377; Wed, 10 Aug 2022 06:26:14 -0700 (PDT) Received: from localhost ([::1]:59002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLliv-0005Jx-JK for importer@patchew.org; Wed, 10 Aug 2022 09:26:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlH9-0000AP-JW for qemu-devel@nongnu.org; Wed, 10 Aug 2022 08:57:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:59007) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlH7-0000Zy-Fd for qemu-devel@nongnu.org; Wed, 10 Aug 2022 08:57:31 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-471-RgecRYx4MKKWmBku0-HBPA-1; Wed, 10 Aug 2022 08:57:27 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4255629ABA14; Wed, 10 Aug 2022 12:57:27 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 635EA40315F; Wed, 10 Aug 2022 12:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660136248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gmbpZNyavQxKDGbXfYJjxOfxf3liXSQeUKOUnbr0AeI=; b=f7i536CmvBzaPNlM3HsFi/NakVse7ASs7TFZ8oW3ENvxXYrJU4ei9s+zs29gKidvkNE/Xm nGQJKSfDcgiDKWC+3NObm0IMRKeFudMDHVoe0C3TElhJuXtpp58I3PWok6ybCn0RoAuSmr kGkIqMat2LQ+HyNtMHGDQwYtIWmBDYQ= X-MC-Unique: RgecRYx4MKKWmBku0-HBPA-1 From: Thomas Huth To: qemu-devel@nongnu.org, David Hildenbrand , Igor Mammedov Cc: David Gibson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Claudio Imbrenda Subject: [PATCH v2 1/3] backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize() Date: Wed, 10 Aug 2022 14:57:18 +0200 Message-Id: <20220810125720.3849835-2-thuth@redhat.com> In-Reply-To: <20220810125720.3849835-1-thuth@redhat.com> References: <20220810125720.3849835-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1660137976029100001 Content-Type: text/plain; charset="utf-8" It is currently not possible yet to use "memory-backend-memfd" on s390x with hugepages enabled. This problem is caused by qemu_maxrampagesize() not taking memory-backend-memfd objects into account yet, so the code in s390_memory_init() fails to enable the huge page support there via s390_set_max_pagesize(). Fix it by generalizing the code, so that it looks at qemu_ram_pagesize(memdev->mr.ram_block) instead of re-trying to get the information from the filesystem. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D2116496 Suggested-by: David Hildenbrand Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda Reviewed-by: David Hildenbrand --- backends/hostmem.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 624bb7ecd3..4428e06738 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -306,22 +306,12 @@ bool host_memory_backend_is_mapped(HostMemoryBackend = *backend) return backend->is_mapped; } =20 -#ifdef __linux__ size_t host_memory_backend_pagesize(HostMemoryBackend *memdev) { - Object *obj =3D OBJECT(memdev); - char *path =3D object_property_get_str(obj, "mem-path", NULL); - size_t pagesize =3D qemu_mempath_getpagesize(path); - - g_free(path); + size_t pagesize =3D qemu_ram_pagesize(memdev->mr.ram_block); + g_assert(pagesize >=3D qemu_real_host_page_size()); return pagesize; } -#else -size_t host_memory_backend_pagesize(HostMemoryBackend *memdev) -{ - return qemu_real_host_page_size(); -} -#endif =20 static void host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) --=20 2.31.1 From nobody Thu May 2 09:01:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1660136953; cv=none; d=zohomail.com; s=zohoarc; b=ZyO/ucbCOYM6eWpNE+97Lmbm7WcjS7RcMyuIITWeZ53pu8YeM6ceczDY8PsiSqA/sfPowutbQAxAGodf+AfD3RMjlhIxDsCe4xyQiyfvovfErtJX35gbMmeG4fhoMyG345A4VUGbVoE6MlYrIncU4oQP7q+ayQZ0ibBePk94Y1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660136953; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T7FalK2RvLkWsOsYtdYaaTP3cQYbPtubc2HJwoCazis=; b=McuSCkGJetRnup9IWvEsB2us8Ia/s9SggNGIUw4RzNNy3VHEIvpTQPvf/O1k6T3KpAADaYWwy6gL/ds2CBfkYBo1Jv0vzBEZnI9Pp+O0nLsNZpzDBRVoX/djl2OSN2rH9Of9VpgSDS21HbW+4rHiJqfyBmD8L9aZbaBPqznVP7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1660136953145123.9367056403214; Wed, 10 Aug 2022 06:09:13 -0700 (PDT) Received: from localhost ([::1]:52562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLlSS-000671-3Y for importer@patchew.org; Wed, 10 Aug 2022 09:09:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlHF-0000IS-D2 for qemu-devel@nongnu.org; Wed, 10 Aug 2022 08:57:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlHD-0000b9-Sb for qemu-devel@nongnu.org; Wed, 10 Aug 2022 08:57:37 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-669-_M-cUURrN22KzFXES5PKIw-1; Wed, 10 Aug 2022 08:57:29 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 502FE1019C93; Wed, 10 Aug 2022 12:57:29 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 998F5492C3B; Wed, 10 Aug 2022 12:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660136255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T7FalK2RvLkWsOsYtdYaaTP3cQYbPtubc2HJwoCazis=; b=btXbxeZ2UzX+OqxH9rHEs98+/asABvnu+pqw6UR72w8/xGQeD1LZ4rUuN5/jbvj91mKVCh hxPBFsEr3s9v4OGMm7sfy30zmdxtOdMW6muAO8Ursm1/uLKjcPaIqbNHabyoTf7Zanvbkb zo6OAAwEWfIl+iE3a1PztqUZ+iThGlw= X-MC-Unique: _M-cUURrN22KzFXES5PKIw-1 From: Thomas Huth To: qemu-devel@nongnu.org, David Hildenbrand , Igor Mammedov Cc: David Gibson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Claudio Imbrenda Subject: [PATCH v2 2/3] softmmu/physmem: Remove the ifdef __linux__ around the pagesize functions Date: Wed, 10 Aug 2022 14:57:19 +0200 Message-Id: <20220810125720.3849835-3-thuth@redhat.com> In-Reply-To: <20220810125720.3849835-1-thuth@redhat.com> References: <20220810125720.3849835-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1660136954935100003 Content-Type: text/plain; charset="utf-8" Now that host_memory_backend_pagesize() is not depending on the hugetlb memory path handling anymore, we can also remove the #ifdef and the TOCTTOU comment from the calling functions - the code should now work equally well on all host architectures. Signed-off-by: Thomas Huth Acked-by: David Hildenbrand Reviewed-by: Claudio Imbrenda --- softmmu/physmem.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index dc3c3e5f2e..50231bab30 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1331,13 +1331,6 @@ GString *ram_block_format(void) return buf; } =20 -#ifdef __linux__ -/* - * FIXME TOCTTOU: this iterates over memory backends' mem-path, which - * may or may not name the same files / on the same filesystem now as - * when we actually open and map them. Iterate over the file - * descriptors instead, and use qemu_fd_getpagesize(). - */ static int find_min_backend_pagesize(Object *obj, void *opaque) { long *hpsize_min =3D opaque; @@ -1391,16 +1384,6 @@ long qemu_maxrampagesize(void) object_child_foreach(memdev_root, find_max_backend_pagesize, &pagesize= ); return pagesize; } -#else -long qemu_minrampagesize(void) -{ - return qemu_real_host_page_size(); -} -long qemu_maxrampagesize(void) -{ - return qemu_real_host_page_size(); -} -#endif =20 #ifdef CONFIG_POSIX static int64_t get_file_size(int fd) --=20 2.31.1 From nobody Thu May 2 09:01:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1660137498; cv=none; d=zohomail.com; s=zohoarc; b=OoUbjHBC6tVc2OtfsQAw9CT6Ov3tBDe6OSpznVbWjtIeWfq9/rn5R0k31ErXBUv+6o2p2Se66ZnJeGW55AudPspza9pEOddawPbl7/p/fqY6wxf0ExdYoQJ+jkMVhdnGnZR/y9FO+AoSTCVZyQNApI7T9sxMYb4Y9ICsuS9C3CU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660137498; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6/hrPHfiodMopFBVOP+wSnp5t6vAjuyjDdcWGuVOGX0=; b=FLzSqEaJ1HGTNhImXWbydr83fp6eXGWbgQtgTE5X3SHfkWHZPrJvX/4bLmeCCIKgxYSokUXJpfsTxfQBZrYKjsmYey4+DqoXcHoxDCxdOaXW7fvjyRPEJIOW9f9tWwcK1JfHQNKBol572erBFkqvAx4a+Jh4S6OWvImTKi5MDzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1660137498034497.10580052588205; Wed, 10 Aug 2022 06:18:18 -0700 (PDT) Received: from localhost ([::1]:44908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLlbE-0003Zx-RE for importer@patchew.org; Wed, 10 Aug 2022 09:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlHE-0000GY-TD for qemu-devel@nongnu.org; Wed, 10 Aug 2022 08:57:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLlHD-0000b5-GZ for qemu-devel@nongnu.org; Wed, 10 Aug 2022 08:57:36 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-Sp-YcEjyOsW6xu4pIFpM8A-1; Wed, 10 Aug 2022 08:57:31 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D3FB805B72; Wed, 10 Aug 2022 12:57:31 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEE6A492C3B; Wed, 10 Aug 2022 12:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660136255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6/hrPHfiodMopFBVOP+wSnp5t6vAjuyjDdcWGuVOGX0=; b=RqtNi7/lFHIFSsbI7nBg+f6Qo4gND7Pw6oH6HYaPitgi4mlJQPPeVIRA9fT/xHKztM11UI MlX29FXhrLdOlbvZu/yB7ZU0LHcFYUCEv1hgZDLS2x+7DzYH9TYwFb4BUbs5OeIgLEKZ1F 4fg/szztxFx0x+0+LUEzWdkd2o5yKOo= X-MC-Unique: Sp-YcEjyOsW6xu4pIFpM8A-1 From: Thomas Huth To: qemu-devel@nongnu.org, David Hildenbrand , Igor Mammedov Cc: David Gibson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-s390x@nongnu.org, Claudio Imbrenda Subject: [PATCH v2 3/3] util/mmap-alloc: Remove qemu_mempath_getpagesize() Date: Wed, 10 Aug 2022 14:57:20 +0200 Message-Id: <20220810125720.3849835-4-thuth@redhat.com> In-Reply-To: <20220810125720.3849835-1-thuth@redhat.com> References: <20220810125720.3849835-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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=unavailable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1660137500170100003 Content-Type: text/plain; charset="utf-8" The last user of this function has just been removed, so we can drop this function now, too. Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda Reviewed-by: David Hildenbrand --- include/qemu/mmap-alloc.h | 2 -- util/mmap-alloc.c | 31 ------------------------------- 2 files changed, 33 deletions(-) diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h index 5076695cc8..2825e231a7 100644 --- a/include/qemu/mmap-alloc.h +++ b/include/qemu/mmap-alloc.h @@ -4,8 +4,6 @@ =20 size_t qemu_fd_getpagesize(int fd); =20 -size_t qemu_mempath_getpagesize(const char *mem_path); - /** * qemu_ram_mmap: mmap anonymous memory, the specified file or device. * diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 5b90cb68ea..5ed7d29183 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -53,37 +53,6 @@ size_t qemu_fd_getpagesize(int fd) return qemu_real_host_page_size(); } =20 -size_t qemu_mempath_getpagesize(const char *mem_path) -{ -#ifdef CONFIG_LINUX - struct statfs fs; - int ret; - - if (mem_path) { - do { - ret =3D statfs(mem_path, &fs); - } while (ret !=3D 0 && errno =3D=3D EINTR); - - if (ret !=3D 0) { - fprintf(stderr, "Couldn't statfs() memory path: %s\n", - strerror(errno)); - exit(1); - } - - if (fs.f_type =3D=3D HUGETLBFS_MAGIC) { - /* It's hugepage, return the huge page size */ - return fs.f_bsize; - } - } -#ifdef __sparc__ - /* SPARC Linux needs greater alignment than the pagesize */ - return QEMU_VMALLOC_ALIGN; -#endif -#endif - - return qemu_real_host_page_size(); -} - #define OVERCOMMIT_MEMORY_PATH "/proc/sys/vm/overcommit_memory" static bool map_noreserve_effective(int fd, uint32_t qemu_map_flags) { --=20 2.31.1