X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-host-dev.c;h=9940ceb338958f7e45c2b0b645a227bb69daf94c;hb=92494646e1553eed626597050e1395371a3f9b34;hp=730a9719e1a1c2f3bba24c7bc658e6c7c9c54183;hpb=675206650bb9a05023c0e53a1e0c21aa1f375f88;p=palacios.git diff --git a/linux_module/iface-host-dev.c b/linux_module/iface-host-dev.c index 730a971..9940ceb 100644 --- a/linux_module/iface-host-dev.c +++ b/linux_module/iface-host-dev.c @@ -126,14 +126,14 @@ struct palacios_host_dev { #define DEEP_DEBUG 0 #define SHALLOW_DEBUG 0 -#if DEEP_DEBUG -#define DEEP_DEBUG_PRINT(fmt, args...) DEBUG((fmt), ##args) +#if DEEP_DEBUG == 1 +#define DEEP_DEBUG_PRINT(fmt, args...) DEBUG(fmt, ##args) #else #define DEEP_DEBUG_PRINT(fmt, args...) #endif -#if SHALLOW_DEBUG -#define SHALLOW_DEBUG_PRINT(fmt, args...) INFO((fmt), ##args) +#if SHALLOW_DEBUG == 1 +#define SHALLOW_DEBUG_PRINT(fmt, args...) INFO(fmt, ##args) #else #define SHALLOW_DEBUG_PRINT(fmt, args...) #endif @@ -873,13 +873,13 @@ static uint64_t palacios_host_dev_read_io(v3_host_dev_t hostdev, DEEP_DEBUG_PRINT("palacios: hostdev: read io port 0x%x\n",port); - palacios_spinlock_lock_irqsave(&(dev->lock),f); if (palacios_host_dev_rendezvous(dev)) { - palacios_spinlock_unlock_irqrestore(&(dev->lock),f); + //palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: ignoring request as user side is not connected (and did not rendezvous) for host device \"%s\"\n",dev->url); return 0; } + palacios_spinlock_lock_irqsave(&(dev->lock),f); if (dev->waiting) { palacios_spinlock_unlock_irqrestore(&(dev->lock),f); @@ -948,13 +948,13 @@ static uint64_t palacios_host_dev_read_mem(v3_host_dev_t hostdev, DEEP_DEBUG_PRINT("palacios: hostdev: read mem 0x%p\n",gpa); - palacios_spinlock_lock_irqsave(&(dev->lock),f); if (palacios_host_dev_rendezvous(dev)) { - palacios_spinlock_unlock_irqrestore(&(dev->lock),f); + //palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: ignoring request as user side is not connected (and did not rendezvous) for host device \"%s\"\n",dev->url); return 0; } + palacios_spinlock_lock_irqsave(&(dev->lock),f); if (dev->waiting) { palacios_spinlock_unlock_irqrestore(&(dev->lock),f); @@ -1018,15 +1018,15 @@ static uint64_t palacios_host_dev_read_conf(v3_host_dev_t hostdev, unsigned long f; uint64_t op_len; - DEEP_DEBUG_PRINT("palacios: hostdev: read conf 0x%p\n",(void*)offset); + DEEP_DEBUG_PRINT("palacios: hostdev: read conf 0x%p (len=%lld)\n",(void*)offset, len); - palacios_spinlock_lock_irqsave(&(dev->lock),f); if (palacios_host_dev_rendezvous(dev)) { - palacios_spinlock_unlock_irqrestore(&(dev->lock),f); + //palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: ignoring request as user side is not connected (and did not rendezvous) for host device \"%s\"\n",dev->url); return 0; } + palacios_spinlock_lock_irqsave(&(dev->lock),f); if (dev->waiting) { palacios_spinlock_unlock_irqrestore(&(dev->lock),f); @@ -1093,13 +1093,13 @@ static uint64_t palacios_host_dev_write_io(v3_host_dev_t hostdev, DEEP_DEBUG_PRINT("palacios: hostdev: write io port 0x%x \n",port); - palacios_spinlock_lock_irqsave(&(dev->lock),f); if (palacios_host_dev_rendezvous(dev)) { - palacios_spinlock_unlock_irqrestore(&(dev->lock),f); + //palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: ignoring request as user side is not connected (and did not rendezvous) for host device \"%s\"\n",dev->url); return 0; } + palacios_spinlock_lock_irqsave(&(dev->lock),f); if (dev->waiting) { palacios_spinlock_unlock_irqrestore(&(dev->lock),f); @@ -1166,14 +1166,15 @@ static uint64_t palacios_host_dev_write_mem(v3_host_dev_t hostdev, DEEP_DEBUG_PRINT("palacios: hostdev: write mem 0x%p\n",gpa); - palacios_spinlock_lock_irqsave(&(dev->lock),f); if (palacios_host_dev_rendezvous(dev)) { - palacios_spinlock_unlock_irqrestore(&(dev->lock),f); + //palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: ignoring request as user side is not connected (and did not rendezvous) for host device \"%s\"\n",dev->url); return 0; } + palacios_spinlock_lock_irqsave(&(dev->lock),f); + if (dev->waiting) { palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: guest issued memory write request with host device \"%s\" in wrong state (waiting=%d, connected=%d)\n",dev->url,dev->waiting,dev->connected); @@ -1241,13 +1242,13 @@ static uint64_t palacios_host_dev_write_conf(v3_host_dev_t hostdev, DEEP_DEBUG_PRINT("palacios: hostdev: write conf 0x%p\n",(void*)offset); - palacios_spinlock_lock_irqsave(&(dev->lock),f); if (palacios_host_dev_rendezvous(dev)) { - palacios_spinlock_unlock_irqrestore(&(dev->lock),f); + //palacios_spinlock_unlock_irqrestore(&(dev->lock),f); ERROR("palacios: ignoring request as user side is not connected (and did not rendezvous) for host device \"%s\"\n",dev->url); return 0; } + palacios_spinlock_lock_irqsave(&(dev->lock),f); if (dev->waiting) { palacios_spinlock_unlock_irqrestore(&(dev->lock),f);