lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131003084833.GZ17294@redhat.com>
Date:	Thu, 3 Oct 2013 11:48:33 +0300
From:	Gleb Natapov <gleb@...hat.com>
To:	Andre Richter <andre.o.richter@...il.com>
Cc:	Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] virt/kvm/iommu.c: Add leading zeros to device's BDF
 notation in debug messages

On Wed, Oct 02, 2013 at 12:23:26PM +0200, Andre Richter wrote:
> When KVM (de)assigns PCI(e) devices to VMs, a debug message is printed
> including the BDF notation of the respective device. Currently, the BDF
> notation does not have the commonly used leading zeros. This produces
> messages like "assign device 0:1:8.0", which look strange at first sight.
> 
> The patch fixes this by exchanging the printk(KERN_DEBUG ...) with dev_info()
> and also inserts "kvm" into the debug message, so that it is obvious where
> the message comes from. Also reduces LoC.
> 
> Signed-off-by: Andre Richter <andre.o.richter@...il.com>
Applied, thanks.

> ---
>  virt/kvm/iommu.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
> index 72a130b..a3b1410 100644
> --- a/virt/kvm/iommu.c
> +++ b/virt/kvm/iommu.c
> @@ -190,11 +190,7 @@ int kvm_assign_device(struct kvm *kvm,
>  
>  	pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
>  
> -	printk(KERN_DEBUG "assign device %x:%x:%x.%x\n",
> -		assigned_dev->host_segnr,
> -		assigned_dev->host_busnr,
> -		PCI_SLOT(assigned_dev->host_devfn),
> -		PCI_FUNC(assigned_dev->host_devfn));
> +	dev_info(&pdev->dev, "kvm assign device\n");
>  
>  	return 0;
>  out_unmap:
> @@ -220,11 +216,7 @@ int kvm_deassign_device(struct kvm *kvm,
>  
>  	pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
>  
> -	printk(KERN_DEBUG "deassign device %x:%x:%x.%x\n",
> -		assigned_dev->host_segnr,
> -		assigned_dev->host_busnr,
> -		PCI_SLOT(assigned_dev->host_devfn),
> -		PCI_FUNC(assigned_dev->host_devfn));
> +	dev_info(&pdev->dev, "kvm deassign device\n");
>  
>  	return 0;
>  }
> -- 
> 1.8.1.2

--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ