[PULL] virtio console fixes and lguest comment fix

2010-09-20 Thread Rusty Russell
The following changes since commit 2422084a94fcd5038406261b331672a13c92c050:
  Linus Torvalds (1):
Merge branch 'for-linus' of git://git.kernel.org/.../mattst88/alpha-2.6

are available in the git repository at:

  
ssh://master.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus.git 
master

Amit Shah (1):
  virtio: console: Prevent userspace from submitting NULL buffers

Hans de Goede (1):
  virtio: console: Fix poll blocking even though there is data to read

Rusty Russell (1):
  lguest: update comments to reflect LHCALL_LOAD_GDT_ENTRY.

 arch/x86/lguest/boot.c|   13 -
 drivers/char/virtio_console.c |6 +-
 2 files changed, 13 insertions(+), 6 deletions(-)
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


Re: [PATCH 2/2] staging: hv: Remove camel cases from vmbus channel functions

2010-09-20 Thread Greg KH
On Mon, Sep 20, 2010 at 09:13:39PM +, Haiyang Zhang wrote:
> From: Haiyang Zhang 
> 
> Remove camel cases from vmbus channel functions
> Converted the function names, local variables to lower cases.

Nice try, but you can do better :)

>  /* Internal routines */
> -static int VmbusChannelCreateGpadlHeader(
> - void *Kbuffer,  /* must be phys and virt contiguous */
> - u32 Size,   /* page-size multiple */
> - struct vmbus_channel_msginfo **msgInfo,
> - u32 *MessageCount);
> -static void DumpVmbusChannel(struct vmbus_channel *channel);
> -static void VmbusChannelSetEvent(struct vmbus_channel *channel);
> +static int vmbuschannel_creategpadlheader(
> + void *kbuffer,  /* must be phys and virt contiguous */
> + u32 size,   /* page-size multiple */
> + struct vmbus_channel_msginfo **msginfo,
> + u32 *messagecount);
> +static void dumpvmbuschannel(struct vmbus_channel *channel);
> +static void vmbuschannel_setevent(struct vmbus_channel *channel);

Internal functions are that, internal, why the verbosity for them?  Why
not try the following:
create_gpad_header()
dump_channel()
set_event()

Looks almost readable, right?

> -#if 0
> -static void DumpMonitorPage(struct hv_monitor_page *MonitorPage)
> -{
> - int i = 0;
> - int j = 0;
> -
> - DPRINT_DBG(VMBUS, "monitorPage - %p, trigger state - %d",
> -MonitorPage, MonitorPage->TriggerState);
> -
> - for (i = 0; i < 4; i++)
> - DPRINT_DBG(VMBUS, "trigger group (%d) - %llx", i,
> -MonitorPage->TriggerGroup[i].AsUINT64);
> -
> - for (i = 0; i < 4; i++) {
> - for (j = 0; j < 32; j++) {
> - DPRINT_DBG(VMBUS, "latency (%d)(%d) - %llx", i, j,
> -MonitorPage->Latency[i][j]);
> - }
> - }
> - for (i = 0; i < 4; i++) {
> - for (j = 0; j < 32; j++) {
> - DPRINT_DBG(VMBUS, "param-conn id (%d)(%d) - %d", i, j,
> -MonitorPage->Parameter[i][j].ConnectionId.Asu32);
> - DPRINT_DBG(VMBUS, "param-flag (%d)(%d) - %d", i, j,
> - MonitorPage->Parameter[i][j].FlagNumber);
> - }
> - }
> -}
> -#endif

Nice fix, but, it has nothing to do with the camelcase changes in this
file.

Please, again, one-patch-per-logical-change.  I'm getting tired of
repeating this...


>  /*
>   * VmbusChannelSetEvent - Trigger an event notification on the specified
>   * channel.
>   */
> -static void VmbusChannelSetEvent(struct vmbus_channel *Channel)
> +static void vmbuschannel_setevent(struct vmbus_channel *Channel)

You forgot to change the function comment name as well.

> -#if 0
> -static void VmbusChannelClearEvent(struct vmbus_channel *channel)
> -{
> - struct hv_monitor_page *monitorPage;
> -
> - if (Channel->OfferMsg.MonitorAllocated) {
> - /* Each u32 represents 32 channels */
> - clear_bit(Channel->OfferMsg.ChildRelId & 31,
> -   (unsigned long *)gVmbusConnection.SendInterruptPage +
> -   (Channel->OfferMsg.ChildRelId >> 5));
> -
> - monitorPage =
> - (struct hv_monitor_page *)gVmbusConnection.MonitorPages;
> - monitorPage++; /* Get the child to parent monitor page */
> -
> - clear_bit(Channel->MonitorBit,
> -   (unsigned long *)&monitorPage->TriggerGroup
> - [Channel->MonitorGroup].Pending);
> - }
> -}
> -
> -#endif

Again a different thing than the case changing.

>  /*
> - * VmbusChannelGetDebugInfo -Retrieve various channel debug info
> + * vmbuschannel_getdebuginfo -Retrieve various channel debug info
>   */
> -void VmbusChannelGetDebugInfo(struct vmbus_channel *Channel,
> -   struct vmbus_channel_debug_info *DebugInfo)
> +void vmbuschannel_getdebuginfo(struct vmbus_channel *channel,
> +   struct vmbus_channel_debug_info *debuginfo)

Do you really need the vmbuschannel prefix here?

How about hyperv_get_debuginfo()?
Or vmbus_get_debuginfo()?

Although you might get vmbus confused with the vme bus, right?  Care to
find a consistant prefix for all hyperv bus functions and stick to it?

Oh, and what's wrong with "debug_info" instead of "debuginfo"?  You
alredy have it split up in the structure name, consistancy is good.


>  {
>   struct hv_monitor_page *monitorPage;
> - u8 monitorGroup = (u8)Channel->OfferMsg.MonitorId / 32;
> - u8 monitorOffset = (u8)Channel->OfferMsg.MonitorId % 32;
> + u8 monitorGroup = (u8)channel->OfferMsg.MonitorId / 32;
> + u8 monitorOffset = (u8)channel->OfferMsg.MonitorId % 32;
>   /* u32 monitorBit   = 1 << monitorOffset; */

Function name changes are one thing.

Variable names are another thing.

Again, one patch per thing please.

It's easier to read and verify that ever

[PATCH 1/2] staging: hv: Remove camel cases of vmbus packet buffer structures

2010-09-20 Thread Haiyang Zhang
From: Haiyang Zhang 

Remove camel cases of vmbus packet buffer structures
 Remove camel cases of:
 struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER
 struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER

Signed-off-by: Haiyang Zhang 
Signed-off-by: Hank Janssen 

---
 drivers/staging/hv/blkvsc.c  |2 +-
 drivers/staging/hv/channel.c |   48 +-
 drivers/staging/hv/channel.h |   36 +++---
 drivers/staging/hv/storvsc.c |2 +-
 drivers/staging/hv/vmbus.c   |6 ++--
 5 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/hv/blkvsc.c b/drivers/staging/hv/blkvsc.c
index 929238a..d5b0abd 100644
--- a/drivers/staging/hv/blkvsc.c
+++ b/drivers/staging/hv/blkvsc.c
@@ -81,7 +81,7 @@ int BlkVscInitialize(struct hv_driver *Driver)
 * Divide the ring buffer data size (which is 1 page less than the ring
 * buffer size since that page is reserved for the ring buffer indices)
 * by the max request size (which is
-* VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + struct vstor_packet + u64)
+* vmbus_channel_packet_multipage_buffer + struct vstor_packet + u64)
 */
storDriver->MaxOutstandingRequestsPerChannel =
((storDriver->RingBufferSize - PAGE_SIZE) /
diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index fece30c..37b7b4c 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -765,7 +765,7 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel 
*Channel,
 {
int ret;
int i;
-   struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER desc;
+   struct vmbus_channel_packet_page_buffer desc;
u32 descSize;
u32 packetLen;
u32 packetLenAligned;
@@ -778,10 +778,10 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel 
*Channel,
DumpVmbusChannel(Channel);
 
/*
-* Adjust the size down since VMBUS_CHANNEL_PACKET_PAGE_BUFFER is the
+* Adjust the size down since vmbus_channel_packet_page_buffer is the
 * largest size we support
 */
-   descSize = sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER) -
+   descSize = sizeof(struct vmbus_channel_packet_page_buffer) -
  ((MAX_PAGE_BUFFER_COUNT - PageCount) *
  sizeof(struct hv_page_buffer));
packetLen = descSize + BufferLen;
@@ -790,17 +790,17 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel 
*Channel,
/* ASSERT((packetLenAligned - packetLen) < sizeof(u64)); */
 
/* Setup the descriptor */
-   desc.Type = VmbusPacketTypeDataUsingGpaDirect;
-   desc.Flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
-   desc.DataOffset8 = descSize >> 3; /* in 8-bytes grandularity */
-   desc.Length8 = (u16)(packetLenAligned >> 3);
-   desc.TransactionId = RequestId;
-   desc.RangeCount = PageCount;
+   desc.type = VmbusPacketTypeDataUsingGpaDirect;
+   desc.flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
+   desc.dataoffset8 = descSize >> 3; /* in 8-bytes grandularity */
+   desc.length8 = (u16)(packetLenAligned >> 3);
+   desc.transactionid = RequestId;
+   desc.rangecount = PageCount;
 
for (i = 0; i < PageCount; i++) {
-   desc.Range[i].Length = PageBuffers[i].Length;
-   desc.Range[i].Offset = PageBuffers[i].Offset;
-   desc.Range[i].Pfn= PageBuffers[i].Pfn;
+   desc.range[i].Length = PageBuffers[i].Length;
+   desc.range[i].Offset = PageBuffers[i].Offset;
+   desc.range[i].Pfn= PageBuffers[i].Pfn;
}
 
sg_init_table(bufferList, 3);
@@ -826,7 +826,7 @@ int VmbusChannelSendPacketMultiPageBuffer(struct 
vmbus_channel *Channel,
void *Buffer, u32 BufferLen, u64 RequestId)
 {
int ret;
-   struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER desc;
+   struct vmbus_channel_packet_multipage_buffer desc;
u32 descSize;
u32 packetLen;
u32 packetLenAligned;
@@ -844,10 +844,10 @@ int VmbusChannelSendPacketMultiPageBuffer(struct 
vmbus_channel *Channel,
return -EINVAL;
 
/*
-* Adjust the size down since VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER is
+* Adjust the size down since vmbus_channel_packet_multipage_buffer is
 * the largest size we support
 */
-   descSize = sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER) -
+   descSize = sizeof(struct vmbus_channel_packet_multipage_buffer) -
  ((MAX_MULTIPAGE_BUFFER_COUNT - PfnCount) *
  sizeof(u64));
packetLen = descSize + BufferLen;
@@ -856,17 +856,17 @@ int VmbusChannelSendPacketMultiPageBuffer(struct 
vmbus_channel *Channel,
/* ASSERT((packetLenAligned - packetLen) < sizeof(u64)); */
 
/* Setup the descriptor */
-   desc.Type = VmbusPacketType

Re: [GIT PULL net-2.6] vhost-net: fix range checking

2010-09-20 Thread David Miller
From: "Michael S. Tsirkin" 
Date: Mon, 20 Sep 2010 19:42:22 +0200

>   git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net

Pulled, thanks!
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


[GIT PULL net-2.6] vhost-net: fix range checking

2010-09-20 Thread Michael S. Tsirkin
David,
The following tree includes a bugfix for vhost-net.
It is on top of net-2.6.  Please merge it for 2.6.36.
Thanks!

The following changes since commit 053d8f6622701f849fda2ca2c9ae596c13599ba9:

  Merge branch 'vhost-net' of 
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost (2010-09-09 21:59:51 
-0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net

Michael S. Tsirkin (1):
  vhost-net: fix range checking in mrg bufs case

 drivers/vhost/net.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization