dm:use acrn-dm logger function instread of printf

Use acrn-dm logger function instread of printf,
this helps the stability testing log capture.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Cao Minggui <minggui.cao@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Mingqiang Chi
2019-11-13 14:11:37 +08:00
committed by wenlingz
parent 22a1bd6948
commit 5375a1613b
22 changed files with 130 additions and 121 deletions

View File

@@ -516,7 +516,7 @@ modify_bar_registration(struct pci_vdev *dev, int idx, int registration)
* addressing and generate ACPI PCI resource from using
* acrn-dm.
*/
printf("modify_bar_registration: bypass for pci-gvt\n");
pr_notice("modify_bar_registration: bypass for pci-gvt\n");
return 0;
}
switch (dev->bar[idx].type) {
@@ -2306,7 +2306,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
if (baridx == 0) {
if (offset + size > DIOSZ) {
printf("diow: iow too large, offset %ld size %d\n",
pr_err("diow: iow too large, offset %ld size %d\n",
offset, size);
return;
}
@@ -2319,7 +2319,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
else if (size == 4)
*(uint32_t *)offset = value;
else
printf("diow: iow unknown size %d\n", size);
pr_err("diow: iow unknown size %d\n", size);
/*
* Special magic value to generate an interrupt
@@ -2335,7 +2335,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
if (baridx == 1 || baridx == 2) {
if (offset + size > DMEMSZ) {
printf("diow: memw too large, offset %ld size %d\n",
pr_err("diow: memw too large, offset %ld size %d\n",
offset, size);
return;
}
@@ -2352,7 +2352,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
else if (size == 8)
*(uint64_t *)offset_ptr = value;
else
printf("diow: memw unknown size %d\n", size);
pr_err("diow: memw unknown size %d\n", size);
/*
* magic interrupt ??
@@ -2360,7 +2360,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
}
if (baridx > 2 || baridx < 0)
printf("diow: unknown bar idx %d\n", baridx);
pr_err("diow: unknown bar idx %d\n", baridx);
}
static uint64_t
@@ -2374,7 +2374,7 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
if (baridx == 0) {
if (offset + size > DIOSZ) {
printf("dior: ior too large, offset %ld size %d\n",
pr_err("dior: ior too large, offset %ld size %d\n",
offset, size);
return 0;
}
@@ -2388,12 +2388,12 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
else if (size == 4)
value = *(uint32_t *)offset_ptr;
else
printf("dior: ior unknown size %d\n", size);
pr_err("dior: ior unknown size %d\n", size);
}
if (baridx == 1 || baridx == 2) {
if (offset + size > DMEMSZ) {
printf("dior: memr too large, offset %ld size %d\n",
pr_err("dior: memr too large, offset %ld size %d\n",
offset, size);
return 0;
}
@@ -2410,12 +2410,12 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
else if (size == 8)
value = *(uint64_t *)offset_ptr;
else
printf("dior: ior unknown size %d\n", size);
pr_err("dior: ior unknown size %d\n", size);
}
if (baridx > 2 || baridx < 0) {
printf("dior: unknown bar idx %d\n", baridx);
pr_err("dior: unknown bar idx %d\n", baridx);
return 0;
}

View File

@@ -501,7 +501,7 @@ deinit_msix_table(struct vmctx *ctx, struct passthru_dev *ptdev)
int vector_cnt = dev->msix.table_count;
if (ptdev->msix.ptirq_allocated) {
printf("ptdev reset msix: 0x%x-%x, vector_cnt=%d.\n",
pr_info("ptdev reset msix: 0x%x-%x, vector_cnt=%d.\n",
virt_bdf, ptdev->phys_bdf, vector_cnt);
vm_reset_ptdev_msix_info(ctx, virt_bdf, ptdev->phys_bdf, vector_cnt);
ptdev->msix.ptirq_allocated = false;
@@ -920,7 +920,7 @@ passthru_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
vm_reset_ptdev_msix_info(ctx, virt_bdf, ptdev->phys_bdf, 1);
}
printf("vm_reset_ptdev_intx:0x%x-%x, ioapic virpin=%d.\n",
pr_info("vm_reset_ptdev_intx:0x%x-%x, ioapic virpin=%d.\n",
virt_bdf, ptdev->phys_bdf, dev->lintr.ioapic_irq);
if (dev->lintr.pin != 0) {
@@ -992,9 +992,9 @@ passthru_bind_irq(struct vmctx *ctx, struct pci_vdev *dev)
if (dev->lintr.pin == 0)
return;
printf("vm_set_ptdev_intx for %d:%d.%d, ",
pr_info("vm_set_ptdev_intx for %d:%d.%d, ",
dev->bus, dev->slot, dev->func);
printf("virt_pin=%d, phys_pin=%d, virt_bdf=0x%x, phys_bdf=0x%x.\n",
pr_info("virt_pin=%d, phys_pin=%d, virt_bdf=0x%x, phys_bdf=0x%x.\n",
dev->lintr.ioapic_irq, ptdev->phys_pin,
virt_bdf, ptdev->phys_bdf);
@@ -1106,7 +1106,7 @@ passthru_read(struct vmctx *ctx, int vcpu, struct pci_vdev *dev, int baridx,
static void
write_dsdt_xdci(struct pci_vdev *dev)
{
printf("write virt-%x:%x.%x in dsdt for XDCI @ 00:15.1\n",
pr_info("write virt-%x:%x.%x in dsdt for XDCI @ 00:15.1\n",
dev->bus,
dev->slot,
dev->func);
@@ -1124,7 +1124,7 @@ write_dsdt_xdci(struct pci_vdev *dev)
static void
write_dsdt_hdac(struct pci_vdev *dev)
{
printf("write virt-%x:%x.%x in dsdt for HDAC @ 00:17.0\n",
pr_info("write virt-%x:%x.%x in dsdt for HDAC @ 00:17.0\n",
dev->bus,
dev->slot,
dev->func);
@@ -1243,7 +1243,7 @@ write_dsdt_hdac(struct pci_vdev *dev)
static void
write_dsdt_hdas(struct pci_vdev *dev)
{
printf("write virt-%x:%x.%x in dsdt for HDAS @ 00:e.0\n",
pr_info("write virt-%x:%x.%x in dsdt for HDAS @ 00:e.0\n",
dev->bus,
dev->slot,
dev->func);
@@ -1463,7 +1463,7 @@ write_dsdt_hdas(struct pci_vdev *dev)
static void
write_dsdt_ipu_i2c(struct pci_vdev *dev)
{
printf("write virt-%x:%x.%x in dsdt for ipu's i2c-bus @ 00:16.0\n",
pr_info("write virt-%x:%x.%x in dsdt for ipu's i2c-bus @ 00:16.0\n",
dev->bus, dev->slot, dev->func);
/* physical I2C 0:16.0 */
@@ -1693,7 +1693,7 @@ write_dsdt_ipu_i2c(struct pci_vdev *dev)
static void
write_dsdt_urt1(struct pci_vdev *dev)
{
printf("write virt-%x:%x.%x in dsdt for URT1 @ 00:18.0\n",
pr_info("write virt-%x:%x.%x in dsdt for URT1 @ 00:18.0\n",
dev->bus,
dev->slot,
dev->func);
@@ -1715,7 +1715,7 @@ write_dsdt_urt1(struct pci_vdev *dev)
static void
write_dsdt_sdc(struct pci_vdev *dev)
{
printf("write SDC-%x:%x.%x in dsdt for SDC @ 00:1b.0\n",
pr_info("write SDC-%x:%x.%x in dsdt for SDC @ 00:1b.0\n",
dev->bus,
dev->slot,
dev->func);

View File

@@ -450,7 +450,7 @@ virtio_blk_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
dummy_bctxt = false;
if (opts == NULL) {
printf("virtio_blk: backing device required\n");
pr_err("virtio_blk: backing device required\n");
return -1;
}

View File

@@ -3919,7 +3919,7 @@ pci_xhci_parse_log_level(struct pci_xhci_vdev *xdev, char *opts)
errout:
if (rc)
printf("USB: fail to set log level, rc=%d\r\n", rc);
pr_err("USB: fail to set log level, rc=%d\r\n", rc);
free(o);
return rc;
}
@@ -4086,7 +4086,7 @@ pci_xhci_parse_extcap(struct pci_xhci_vdev *xdev, char *opts)
errout:
if (rc)
printf("USB: fail to set vendor capability, rc=%d\r\n", rc);
pr_err("USB: fail to set vendor capability, rc=%d\r\n", rc);
free(o);
return rc;
}