Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228066
b: refs/heads/master
c: f6feebe
h: refs/heads/master
v: v3
  • Loading branch information
Haiyang Zhang authored and Greg Kroah-Hartman committed Nov 10, 2010
1 parent 0006bb4 commit 16ec042
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 228 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c50f7fb28400bc4829c26bb4a2d6c06a45e90b1a
refs/heads/master: f6feebe073db4c97dc10f6fab54f9d4b5816886b
32 changes: 16 additions & 16 deletions trunk/drivers/staging/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ static void DumpMonitorPage(struct hv_monitor_page *MonitorPage)
int j = 0;

DPRINT_DBG(VMBUS, "monitorPage - %p, trigger state - %d",
MonitorPage, MonitorPage->TriggerState);
MonitorPage, MonitorPage->trigger_state);

for (i = 0; i < 4; i++)
DPRINT_DBG(VMBUS, "trigger group (%d) - %llx", i,
MonitorPage->TriggerGroup[i].AsUINT64);
MonitorPage->trigger_group[i].as_uint64);

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]);
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);
MonitorPage->parameter[i][j].connectionid.asu32);
DPRINT_DBG(VMBUS, "param-flag (%d)(%d) - %d", i, j,
MonitorPage->Parameter[i][j].FlagNumber);
MonitorPage->parameter[i][j].flag_number);
}
}
}
Expand All @@ -84,8 +84,8 @@ static void vmbus_setevent(struct vmbus_channel *channel)
monitorpage++; /* Get the child to parent monitor page */

set_bit(channel->monitor_bit,
(unsigned long *)&monitorpage->TriggerGroup
[channel->monitor_grp].Pending);
(unsigned long *)&monitorpage->trigger_group
[channel->monitor_grp].pending);

} else {
VmbusSetEvent(channel->offermsg.child_relid);
Expand All @@ -108,7 +108,7 @@ static void VmbusChannelClearEvent(struct vmbus_channel *channel)
monitorPage++; /* Get the child to parent monitor page */

clear_bit(Channel->monitor_bit,
(unsigned long *)&monitorPage->TriggerGroup
(unsigned long *)&monitorPage->trigger_group
[Channel->monitor_grp].Pending);
}
}
Expand Down Expand Up @@ -138,22 +138,22 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
debuginfo->monitorid = channel->offermsg.monitorid;

debuginfo->servermonitor_pending =
monitorpage->TriggerGroup[monitor_group].Pending;
monitorpage->trigger_group[monitor_group].pending;
debuginfo->servermonitor_latency =
monitorpage->Latency[monitor_group][monitor_offset];
monitorpage->latency[monitor_group][monitor_offset];
debuginfo->servermonitor_connectionid =
monitorpage->Parameter[monitor_group]
[monitor_offset].ConnectionId.u.Id;
monitorpage->parameter[monitor_group]
[monitor_offset].connectionid.u.id;

monitorpage++;

debuginfo->clientmonitor_pending =
monitorpage->TriggerGroup[monitor_group].Pending;
monitorpage->trigger_group[monitor_group].pending;
debuginfo->clientmonitor_latency =
monitorpage->Latency[monitor_group][monitor_offset];
monitorpage->latency[monitor_group][monitor_offset];
debuginfo->clientmonitor_connectionid =
monitorpage->Parameter[monitor_group]
[monitor_offset].ConnectionId.u.Id;
monitorpage->parameter[monitor_group]
[monitor_offset].connectionid.u.id;

RingBufferGetDebugInfo(&channel->inbound, &debuginfo->inbound);
RingBufferGetDebugInfo(&channel->outbound, &debuginfo->outbound);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ void vmbus_onmessage(void *context)
struct vmbus_channel_message_header *hdr;
int size;

hdr = (struct vmbus_channel_message_header *)msg->u.Payload;
size = msg->Header.PayloadSize;
hdr = (struct vmbus_channel_message_header *)msg->u.payload;
size = msg->header.payload_size;

DPRINT_DBG(VMBUS, "message type %d size %d", hdr->msgtype, size);

Expand All @@ -752,7 +752,7 @@ void vmbus_onmessage(void *context)
"Received invalid channel message type %d size %d",
hdr->msgtype, size);
print_hex_dump_bytes("", DUMP_PREFIX_NONE,
(unsigned char *)msg->u.Payload, size);
(unsigned char *)msg->u.payload, size);
kfree(msg);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/hv/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ int VmbusPostMessage(void *buffer, size_t bufferLen)
{
union hv_connection_id connId;

connId.Asu32 = 0;
connId.u.Id = VMBUS_MESSAGE_CONNECTION_ID;
connId.asu32 = 0;
connId.u.id = VMBUS_MESSAGE_CONNECTION_ID;
return HvPostMessage(connId, 1, buffer, bufferLen);
}

Expand Down
120 changes: 60 additions & 60 deletions trunk/drivers/staging/hv/hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int HvQueryHypervisorPresence(void)
ebx = 0;
ecx = 0;
edx = 0;
op = HvCpuIdFunctionVersionAndFeatures;
op = HVCPUID_VERSION_FEATURES;
cpuid(op, &eax, &ebx, &ecx, &edx);

return ecx & HV_PRESENT_BIT;
Expand All @@ -76,7 +76,7 @@ static int HvQueryHypervisorInfo(void)
ebx = 0;
ecx = 0;
edx = 0;
op = HvCpuIdFunctionHvVendorAndMaxFunction;
op = HVCPUID_VENDOR_MAXFUNCTION;
cpuid(op, &eax, &ebx, &ecx, &edx);

DPRINT_INFO(VMBUS, "Vendor ID: %c%c%c%c%c%c%c%c%c%c%c%c",
Expand All @@ -98,7 +98,7 @@ static int HvQueryHypervisorInfo(void)
ebx = 0;
ecx = 0;
edx = 0;
op = HvCpuIdFunctionHvInterface;
op = HVCPUID_INTERFACE;
cpuid(op, &eax, &ebx, &ecx, &edx);

DPRINT_INFO(VMBUS, "Interface ID: %c%c%c%c",
Expand All @@ -107,12 +107,12 @@ static int HvQueryHypervisorInfo(void)
((eax >> 16) & 0xFF),
((eax >> 24) & 0xFF));

if (maxLeaf >= HvCpuIdFunctionMsHvVersion) {
if (maxLeaf >= HVCPUID_VERSION) {
eax = 0;
ebx = 0;
ecx = 0;
edx = 0;
op = HvCpuIdFunctionMsHvVersion;
op = HVCPUID_VERSION;
cpuid(op, &eax, &ebx, &ecx, &edx);
DPRINT_INFO(VMBUS, "OS Build:%d-%d.%d-%d-%d.%d",\
eax,
Expand Down Expand Up @@ -222,7 +222,7 @@ int HvInit(void)
gHvContext.GuestId = HV_LINUX_GUEST_ID;

/* See if the hypercall page is already set */
rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64);
rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64);

/*
* Allocate the hypercall page memory
Expand All @@ -236,16 +236,16 @@ int HvInit(void)
goto Cleanup;
}

hypercallMsr.Enable = 1;
hypercallMsr.enable = 1;

hypercallMsr.GuestPhysicalAddress = vmalloc_to_pfn(virtAddr);
wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64);
hypercallMsr.guest_physical_address = vmalloc_to_pfn(virtAddr);
wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64);

/* Confirm that hypercall page did get setup. */
hypercallMsr.AsUINT64 = 0;
rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64);
hypercallMsr.as_uint64 = 0;
rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64);

if (!hypercallMsr.Enable) {
if (!hypercallMsr.enable) {
DPRINT_ERR(VMBUS, "unable to set hypercall page!!");
goto Cleanup;
}
Expand All @@ -254,7 +254,7 @@ int HvInit(void)

DPRINT_INFO(VMBUS, "Hypercall page VA=%p, PA=0x%0llx",
gHvContext.HypercallPage,
(u64)hypercallMsr.GuestPhysicalAddress << PAGE_SHIFT);
(u64)hypercallMsr.guest_physical_address << PAGE_SHIFT);

/* Setup the global signal event param for the signal event hypercall */
gHvContext.SignalEventBuffer =
Expand All @@ -267,19 +267,19 @@ int HvInit(void)
(struct hv_input_signal_event *)
(ALIGN_UP((unsigned long)gHvContext.SignalEventBuffer,
HV_HYPERCALL_PARAM_ALIGN));
gHvContext.SignalEventParam->ConnectionId.Asu32 = 0;
gHvContext.SignalEventParam->ConnectionId.u.Id =
gHvContext.SignalEventParam->connectionid.asu32 = 0;
gHvContext.SignalEventParam->connectionid.u.id =
VMBUS_EVENT_CONNECTION_ID;
gHvContext.SignalEventParam->FlagNumber = 0;
gHvContext.SignalEventParam->RsvdZ = 0;
gHvContext.SignalEventParam->flag_number = 0;
gHvContext.SignalEventParam->rsvdz = 0;

return ret;

Cleanup:
if (virtAddr) {
if (hypercallMsr.Enable) {
hypercallMsr.AsUINT64 = 0;
wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64);
if (hypercallMsr.enable) {
hypercallMsr.as_uint64 = 0;
wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64);
}

vfree(virtAddr);
Expand All @@ -302,8 +302,8 @@ void HvCleanup(void)
gHvContext.SignalEventParam = NULL;

if (gHvContext.HypercallPage) {
hypercallMsr.AsUINT64 = 0;
wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64);
hypercallMsr.as_uint64 = 0;
wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64);
vfree(gHvContext.HypercallPage);
gHvContext.HypercallPage = NULL;
}
Expand Down Expand Up @@ -337,12 +337,12 @@ u16 HvPostMessage(union hv_connection_id connectionId,
alignedMsg = (struct hv_input_post_message *)
(ALIGN_UP(addr, HV_HYPERCALL_PARAM_ALIGN));

alignedMsg->ConnectionId = connectionId;
alignedMsg->MessageType = messageType;
alignedMsg->PayloadSize = payloadSize;
memcpy((void *)alignedMsg->Payload, payload, payloadSize);
alignedMsg->connectionid = connectionId;
alignedMsg->message_type = messageType;
alignedMsg->payload_size = payloadSize;
memcpy((void *)alignedMsg->payload, payload, payloadSize);

status = HvDoHypercall(HvCallPostMessage, alignedMsg, NULL) & 0xFFFF;
status = HvDoHypercall(HVCALL_POST_MESSAGE, alignedMsg, NULL) & 0xFFFF;

kfree((void *)addr);

Expand All @@ -359,7 +359,7 @@ u16 HvSignalEvent(void)
{
u16 status;

status = HvDoHypercall(HvCallSignalEvent, gHvContext.SignalEventParam,
status = HvDoHypercall(HVCALL_SIGNAL_EVENT, gHvContext.SignalEventParam,
NULL) & 0xFFFF;
return status;
}
Expand Down Expand Up @@ -407,47 +407,47 @@ void HvSynicInit(void *irqarg)
}

/* Setup the Synic's message page */
rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64);
simp.SimpEnabled = 1;
simp.BaseSimpGpa = virt_to_phys(gHvContext.synICMessagePage[cpu])
rdmsrl(HV_X64_MSR_SIMP, simp.as_uint64);
simp.simp_enabled = 1;
simp.base_simp_gpa = virt_to_phys(gHvContext.synICMessagePage[cpu])
>> PAGE_SHIFT;

DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.AsUINT64);
DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.as_uint64);

wrmsrl(HV_X64_MSR_SIMP, simp.AsUINT64);
wrmsrl(HV_X64_MSR_SIMP, simp.as_uint64);

/* Setup the Synic's event page */
rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64);
siefp.SiefpEnabled = 1;
siefp.BaseSiefpGpa = virt_to_phys(gHvContext.synICEventPage[cpu])
rdmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64);
siefp.siefp_enabled = 1;
siefp.base_siefp_gpa = virt_to_phys(gHvContext.synICEventPage[cpu])
>> PAGE_SHIFT;

DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.AsUINT64);
DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.as_uint64);

wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64);
wrmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64);

/* Setup the interception SINT. */
/* wrmsrl((HV_X64_MSR_SINT0 + HV_SYNIC_INTERCEPTION_SINT_INDEX), */
/* interceptionSint.AsUINT64); */
/* interceptionSint.as_uint64); */

/* Setup the shared SINT. */
rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64);
rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64);

sharedSint.AsUINT64 = 0;
sharedSint.Vector = irqVector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */
sharedSint.Masked = false;
sharedSint.AutoEoi = true;
sharedSint.as_uint64 = 0;
sharedSint.vector = irqVector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */
sharedSint.masked = false;
sharedSint.auto_eoi = true;

DPRINT_DBG(VMBUS, "HV_X64_MSR_SINT1 msr set to: %llx",
sharedSint.AsUINT64);
sharedSint.as_uint64);

wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64);
wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64);

/* Enable the global synic bit */
rdmsrl(HV_X64_MSR_SCONTROL, sctrl.AsUINT64);
sctrl.Enable = 1;
rdmsrl(HV_X64_MSR_SCONTROL, sctrl.as_uint64);
sctrl.enable = 1;

wrmsrl(HV_X64_MSR_SCONTROL, sctrl.AsUINT64);
wrmsrl(HV_X64_MSR_SCONTROL, sctrl.as_uint64);

gHvContext.SynICInitialized = true;
return;
Expand All @@ -474,25 +474,25 @@ void HvSynicCleanup(void *arg)
if (!gHvContext.SynICInitialized)
return;

rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64);
rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64);

sharedSint.Masked = 1;
sharedSint.masked = 1;

/* Need to correctly cleanup in the case of SMP!!! */
/* Disable the interrupt */
wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64);
wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64);

rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64);
simp.SimpEnabled = 0;
simp.BaseSimpGpa = 0;
rdmsrl(HV_X64_MSR_SIMP, simp.as_uint64);
simp.simp_enabled = 0;
simp.base_simp_gpa = 0;

wrmsrl(HV_X64_MSR_SIMP, simp.AsUINT64);
wrmsrl(HV_X64_MSR_SIMP, simp.as_uint64);

rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64);
siefp.SiefpEnabled = 0;
siefp.BaseSiefpGpa = 0;
rdmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64);
siefp.siefp_enabled = 0;
siefp.base_siefp_gpa = 0;

wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64);
wrmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64);

osd_PageFree(gHvContext.synICMessagePage[cpu], 1);
osd_PageFree(gHvContext.synICEventPage[cpu], 1);
Expand Down
Loading

0 comments on commit 16ec042

Please sign in to comment.