From: dv Date: Wed, 1 Jun 2022 17:47:18 +0000 (+0000) Subject: change amd64 pmap_convert to return void X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=aea267e5d80eb656e26e151291315e3c16f51e2e;p=openbsd change amd64 pmap_convert to return void There are no other return options, so adjust function signature to void. This also allows for cleaning up its usage in vmm(4) in the vm pmap initialization logic. ok mlarkin@ --- diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index b69d9720b4e..10239b4e920 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.149 2022/02/01 08:38:53 guenther Exp $ */ +/* $OpenBSD: pmap.c,v 1.150 2022/06/01 17:47:18 dv Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -3095,11 +3095,8 @@ pmap_virtual_space(vaddr_t *vstartp, vaddr_t *vendp) * Parameters: * pmap: the pmap to convert * mode: the new mode (see pmap.h, PMAP_TYPE_xxx) - * - * Return value: - * always 0 */ -int +void pmap_convert(struct pmap *pmap, int mode) { pt_entry_t *pte; @@ -3117,8 +3114,6 @@ pmap_convert(struct pmap *pmap, int mode) pmap->pm_pdir_intel = NULL; } } - - return (0); } #ifdef MULTIPROCESSOR diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 3ac38950747..323a77859ae 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.311 2022/05/20 22:42:09 dv Exp $ */ +/* $OpenBSD: vmm.c,v 1.312 2022/06/01 17:47:18 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -1805,14 +1805,7 @@ vm_impl_init_vmx(struct vm *vm, struct proc *p) } } - ret = pmap_convert(vm->vm_map->pmap, PMAP_TYPE_EPT); - if (ret) { - printf("%s: pmap_convert failed\n", __func__); - /* uvmspace_free calls pmap_destroy for us */ - uvmspace_free(vm->vm_vmspace); - vm->vm_vmspace = NULL; - return (ENOMEM); - } + pmap_convert(vm->vm_map->pmap, PMAP_TYPE_EPT); return (0); } @@ -1869,9 +1862,9 @@ vm_impl_init_svm(struct vm *vm, struct proc *p) } /* Convert pmap to RVI */ - ret = pmap_convert(vm->vm_map->pmap, PMAP_TYPE_RVI); + pmap_convert(vm->vm_map->pmap, PMAP_TYPE_RVI); - return (ret); + return (0); } /* diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index c5ba981b282..04d3a3f3bde 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.79 2022/02/01 08:38:53 guenther Exp $ */ +/* $OpenBSD: pmap.h,v 1.80 2022/06/01 17:47:18 dv Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -400,7 +400,7 @@ paddr_t pmap_prealloc_lowmem_ptps(paddr_t); void pagezero(vaddr_t); -int pmap_convert(struct pmap *, int); +void pmap_convert(struct pmap *, int); void pmap_enter_special(vaddr_t, paddr_t, vm_prot_t); vaddr_t pmap_set_pml4_early(paddr_t pa); void pmap_clear_pml4_early(void);