RE: [PATCH v2 4/4] KVM: PPC: Bookehv: Get vcpu's last instruction for emulation

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

 



From: Alexander Graf
...
> > +	page = pfn_to_page(pfn);
> > +	eaddr = (unsigned long)kmap_atomic(page);
> > +	eaddr |= addr & ~PAGE_MASK;
> > +	*instr = *(u32 *)eaddr;
> > +	kunmap_atomic((u32 *)eaddr);
> 
> I think I'd rather write this as
> 
>    *instr = *(u32 *)(eaddr | (addr & ~PAGE));
>    kunmap_atomic((void*)eaddr);
> 
> to make sure we pass the unmap function the same value we got from the
> map function.
> 
> Otherwise looks good to me.

Is there any mileage in keeping a virtual address page allocated (per cpu)
for this (and similar) accesses to physical memory?
Not having to search for a free VA page might speed things up (if that matters).

You also probably want the page mapped uncached - no point polluting the data
cache.

	David

��.n��������+%������w��{.n�����o�^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[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