Subject: Re: HEADS UP: Package removal candidates
To: None <tech-pkg@NetBSD.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-pkg
Date: 12/07/2005 20:03:48
On Wed, Dec 07, 2005 at 07:21:06AM +0100, Bernd Ernesti wrote:
> vmware is 2.x, not 3. The 3.x is vmware-module3, which is also broken.
> For vmware-module3 there is even a pr open with some patches, it is assigend to
> the maintainer jdolecek, but nothing happens.
> I'm going to commit the following patches by Saturday if I hear nothing
> from jdolecek by that time.

Well, the problem is that vmware3 doesn't work at all with -current
kernels - it freezes very soon after the virtual machine starts.
That's why I did not update othersrc/pkgsrc.

If you find -current works with the patches, I'd be interested to hear
that.

Other than then, please you proper #ifdef conditionals so that it compiles
on 2.x as well as on 3.x.

Jaromir

> And yes, the 2.x should be removed.
> 
> > So, I think it's better to leave it (perhaps marked broken) in the
> > hopes that someone will do the work.  But perhaps everyone is working
> > on qemu instead.
> 
> What we would need is a package for vmware 5.5.
> 
> Bernd
> 

> $NetBSD$
> 
> --- source/vmmon/netbsd/drv.c.orig	2004-12-07 22:06:47.000000000 +0100
> +++ source/vmmon/netbsd/drv.c
> @@ -426,7 +426,11 @@ vmmon_alloc_low_pages(struct vmx86_softc
>  	/*
>  	 * Map the segment into wired kernel virtual memory.
>  	 */
> +#if __NetBSD_Version__ >= 399000300
> +	va = uvm_km_alloc(kernel_map, numPages * PAGE_SIZE, 0, UVM_KMF_VAONLY);
> +#else
>  	va = uvm_km_valloc(kernel_map, numPages * PAGE_SIZE);
> +#endif
>  	if (va == 0) {
>  		VMDEBUG("vmmon_alloc_low_pages: km_valloc failed\n");
>  		goto bad;
> @@ -496,7 +500,15 @@ vmmon_destroy_low_pages(MemRange *r)
>  	/*
>  	 * Unmap the kernel virtual memory used by this range.
>  	 */
> +#if __NetBSD_Version__ >= 399000300
> +	pmap_remove(pmap_kernel(), (vaddr_t)r->kAddr,
> +	    (vaddr_t)r->kAddr + r->numPages * PAGE_SIZE);
> +	pmap_update(pmap_kernel());
> +	uvm_km_free(kernel_map, (vaddr_t)r->kAddr, r->numPages * PAGE_SIZE,
> +	    UVM_KMF_VAONLY);
> +#else
>  	uvm_km_free(kernel_map, (vaddr_t)r->kAddr, r->numPages * PAGE_SIZE);
> +#endif
>  
>  	/*
>  	 * Build a list of pages to free back to the VM system.

> $NetBSD$
> 
> --- source/vmmon/netbsd/host.c.orig	2003-10-09 20:38:04.000000000 +0200
> +++ source/vmmon/netbsd/host.c
> @@ -656,7 +656,12 @@ HostIF_UserToDriverPtr(VMDriver *vm, // 
>  	    VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
>  
>  	uaddr = (vaddr_t)addr;
> +#if __NetBSD_Version__ >= 399000300
> +	kvaddr = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
> +	    UVM_KMF_VAONLY | UVM_KMF_WAITVA);
> +#else
>  	kvaddr = uvm_km_valloc_wait(kernel_map, PAGE_SIZE);
> +#endif
>  	pmap_extract(vm_map_pmap(&curproc->p_vmspace->vm_map), uaddr, &paddr);
>  	pmap_kenter_pa(kvaddr, paddr,
>  	    VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);

> $NetBSD$
> 
> --- source/vmnet/if_hubmod.c.orig	2004-12-07 22:06:47.000000000 +0100
> +++ source/vmnet/if_hubmod.c
> @@ -433,7 +433,12 @@ port_mappoll(struct hubport_softc *ports
>  	off = uaddr - upage;
>  	if (off > (PAGE_SIZE - sizeof(u_int32_t)))
>  		return EINVAL;
> +#if __NetBSD_Version__ >= 399000300
> +	kpage = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
> +	    UVM_KMF_VAONLY | UVM_KMF_WAITVA);
> +#else
>  	kpage = uvm_km_valloc_wait(kernel_map, PAGE_SIZE);
> +#endif
>  	kaddr = kpage + off;
>  
>  	PHOLD(CURLWP);
> @@ -456,7 +461,11 @@ port_mappoll(struct hubport_softc *ports
>  
>      err:
>  	PRELE(CURLWP);
> +#if __NetBSD_Version__ >= 399000300
> +	uvm_km_free(kernel_map, kpage, PAGE_SIZE, UVM_KMF_VAONLY);
> +#else
>  	uvm_km_free_wakeup(kernel_map, kpage, PAGE_SIZE);
> +#endif
>  	return (error);
>  }
>  
> @@ -467,7 +476,12 @@ port_unmappoll(struct hubport_softc *por
>  #if 1
>  	pmap_update(pmap_kernel());
>  #endif
> +#if __NetBSD_Version__ >= 399000300
> +	uvm_km_free(kernel_map, portsc->port_kpollpage, PAGE_SIZE,
> +	    UVM_KMF_VAONLY);
> +#else
>  	uvm_km_free_wakeup(kernel_map, portsc->port_kpollpage, PAGE_SIZE);
> +#endif
>  	PHOLD(CURLWP);
>  	uvm_vsunlock(curproc, (void *)portsc->port_upollpage, PAGE_SIZE);
>  	PRELE(CURLWP);


-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same;     -=-
-=- We can run alone and free if we pursue a different aim.          -=-