Re: [PATCH RFC 03/15] x86/vmexit: Make use of ioremap()

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

 



On Mon, Apr 11, 2016 at 01:04:15PM +0200, Alexander Gordeev wrote:
> Cc: Thomas Huth <thuth@xxxxxxxxxx>
> Cc: Andrew Jones <drjones@xxxxxxxxxx>
> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx>
> ---
>  x86/vmexit.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/x86/vmexit.c b/x86/vmexit.c
> index 9e049752f6c6..a3d3b841110d 100644
> --- a/x86/vmexit.c
> +++ b/x86/vmexit.c
> @@ -372,8 +372,7 @@ int main(int ac, char **av)
>  {
>  	struct fadt_descriptor_rev1 *fadt;
>  	int i;
> -	unsigned long membar = 0, base, offset;
> -	void *m;
> +	uint64_t membar = 0;

Why change membar to u64? pci_bar_addr still returns a ulong.

>  	pcidevaddr_t pcidev;
>  
>  	smp_init();
> @@ -395,17 +394,12 @@ int main(int ac, char **av)
>  			}
>  			if (pci_bar_is_memory(pcidev, i)) {
>  				membar = pci_bar_addr(pcidev, i);
> -				base = membar & ~4095;
> -				offset = membar - base;
> -				m = alloc_vpages(1);
> -				
> -				install_page((void *)read_cr3(), base, m);
> -				pci_test.memaddr = m + offset;
> +				pci_test.memaddr = ioremap(membar, 0);

Having ioremap's size argument be useful and passing a '1' here would
be much nicer.

>  			} else {
>  				pci_test.iobar = pci_bar_addr(pcidev, i);
>  			}
>  		}
> -		printf("pci-testdev at 0x%x membar %lx iobar %x\n",
> +		printf("pci-testdev at 0x%x membar %" PRIx64 " iobar %x\n",
>  		       pcidev, membar, pci_test.iobar);
>  	}
>  
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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