From owner-svn-src-all@freebsd.org Wed Dec 4 18:40:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D0D61AB6FC; Wed, 4 Dec 2019 18:40:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Snhk3l9Lz4DLD; Wed, 4 Dec 2019 18:40:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63BBF472A; Wed, 4 Dec 2019 18:40:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB4Ie6Bf012114; Wed, 4 Dec 2019 18:40:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB4Ie6c4012113; Wed, 4 Dec 2019 18:40:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201912041840.xB4Ie6c4012113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 4 Dec 2019 18:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355398 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Dec 2019 18:40:06 -0000 Author: andrew Date: Wed Dec 4 18:40:05 2019 New Revision: 355398 URL: https://svnweb.freebsd.org/changeset/base/355398 Log: Fix the signature for zone_import and zone_release These are cast to uma_import and uma_release functions. Use the signature for these in the zone functions. This was found with an experimental Kernel CFI. It will complain if the signature is different than what a function pointer expects. The simplest way to fix these is to correct the signature. Reviewed by: rlibby Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22671 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Dec 4 18:38:50 2019 (r355397) +++ head/sys/vm/uma_core.c Wed Dec 4 18:40:05 2019 (r355398) @@ -279,8 +279,8 @@ static void *slab_alloc_item(uma_keg_t keg, uma_slab_t static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item); static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags); -static int zone_import(uma_zone_t, void **, int, int, int); -static void zone_release(uma_zone_t, void **, int); +static int zone_import(void *, void **, int, int, int); +static void zone_release(void *, void **, int); static void uma_zero_item(void *, uma_zone_t); static bool cache_alloc(uma_zone_t, uma_cache_t, void *, int); static bool cache_free(uma_zone_t, uma_cache_t, void *, void *, int); @@ -2094,8 +2094,8 @@ zone_ctor(void *mem, int size, void *udata, int flags) /* * Use the regular zone/keg/slab allocator. */ - zone->uz_import = (uma_import)zone_import; - zone->uz_release = (uma_release)zone_release; + zone->uz_import = zone_import; + zone->uz_release = zone_release; zone->uz_arg = zone; keg = arg->keg; @@ -3112,8 +3112,9 @@ slab_alloc_item(uma_keg_t keg, uma_slab_t slab) } static int -zone_import(uma_zone_t zone, void **bucket, int max, int domain, int flags) +zone_import(void *arg, void **bucket, int max, int domain, int flags) { + uma_zone_t zone; uma_slab_t slab; uma_keg_t keg; #ifdef NUMA @@ -3121,6 +3122,7 @@ zone_import(uma_zone_t zone, void **bucket, int max, i #endif int i; + zone = arg; slab = NULL; keg = zone->uz_keg; KEG_LOCK(keg); @@ -3616,14 +3618,16 @@ slab_free_item(uma_zone_t zone, uma_slab_t slab, void } static void -zone_release(uma_zone_t zone, void **bucket, int cnt) +zone_release(void *arg, void **bucket, int cnt) { + uma_zone_t zone; void *item; uma_slab_t slab; uma_keg_t keg; uint8_t *mem; int i; + zone = arg; keg = zone->uz_keg; KEG_LOCK(keg); for (i = 0; i < cnt; i++) {