Re: acpidmar(4): Move debug printf to show the actual mapping

hshoexer <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
Hi,

On Wed, Jul 29, 2026 at 11:15:14PM +0200, Mark Kettenis wrote:
> > Date: Tue, 28 Jul 2026 16:04:39 +0200
> > From: hshoexer <[email protected]>
> > 
> > Hi,
> > 
> > trivial tweak to debug print the single mappings.  Note, this
> > requires to adjust debugme() to actually print something.
> > 
> > ok?
> 
> I think I had something similar in my tree at some point.  So ok
> kettenis@.  Although I question the usefulness of most of the debug
> code in acpidmar(4).  I'd like to see most of it removed eventually.

sure.  It's on my todo list.

> > 
> > ------------------------------------------------------------------------
> > diff --git a/sys/dev/acpi/acpidmar.c b/sys/dev/acpi/acpidmar.c
> > index cf18265fd09..b680b858411 100644
> > --- a/sys/dev/acpi/acpidmar.c
> > +++ b/sys/dev/acpi/acpidmar.c
> > @@ -857,16 +857,16 @@ domain_load_map(struct domain *dom, bus_dmamap_t map, int flags, int pteflag,
> >  			if (error)
> >  				goto fail;
> >  
> > +			if (debugme(dom)) {
> > +				printf("  LOADMAP: %.16llx %x => %.16llx\n",
> > +				    (uint64_t)seg->ds_addr,
> > +				    (uint32_t)seg->ds_len, (uint64_t)res);
> > +			}
> > +
> >  			/* Reassign DMA address */
> >  			seg->ds_addr = res | (seg->ds_addr & VTD_PAGE_MASK);
> >  		}
> >  
> > -		if (debugme(dom)) {
> > -			printf("  LOADMAP: %.16llx %x => %.16llx\n",
> > -			    (uint64_t)seg->ds_addr, (uint32_t)seg->ds_len,
> > -			    (uint64_t)res);
> > -		}
> > -
> >  		mapped_nsegs = i + 1;
> >  
> >  		for (idx = 0; idx < alen; idx += VTD_PAGE_SIZE) {
> > 
> >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.