Re: [PATCH kvm-unit-tests] riscv: Fix virt_to_phys()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 15, 2024 at 03:57:12PM GMT, Andrew Jones wrote:
> On Sat, Jul 06, 2024 at 04:09:44PM GMT, Cade Richard wrote:
> > 
> 
> Needs a commit message stating it's currently broken for anything
> other than addresses on page boundaries and that this is the fix.
> 
> > 
> > ---
> 
> These dashes shouldn't be here. With them, git will strip the s-o-b on
> commit.
> 
> Please also add
> 
> Fixes: 23100d972705 ("riscv: Enable vmalloc")
> 
> > Signed-off-by: Cade Richard <cade.richard@xxxxxxxxxxxx>
> > ---
> >  lib/riscv/mmu.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/riscv/mmu.c b/lib/riscv/mmu.c
> > index bd006881..c4770552 100644
> > --- a/lib/riscv/mmu.c
> > +++ b/lib/riscv/mmu.c
> > @@ -194,7 +194,7 @@ unsigned long virt_to_phys(volatile void *address)
> >  	paddr = virt_to_pte_phys(pgtable, (void *)address);
> >  	assert(sizeof(long) == 8 || !(paddr >> 32));
> >  
> > -	return (unsigned long)paddr;
> > +	return (unsigned long)paddr | ((unsigned long) address & 0x00000FFF);
> 
> Let's add
> 
>   #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
> 
> to lib/asm-generic/page.h and use it here.
> 
> >  }
> >  
> >  void *phys_to_virt(unsigned long address)
> >
> 
> Thanks,
> drew
>

Since this is a fix that I'd like to get in sooner than later, I've made
my suggested changes myself and merged it.

Thanks,
drew




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux