[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] FW: [PATCH 2/3] Attempt to reset event channel ABI to 2-Layer


  • To: "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Wed, 25 Feb 2015 10:30:18 +0000
  • Accept-language: en-US
  • Delivery-date: Wed, 25 Feb 2015 10:30:23 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Thread-index: AQHQUFxzgkyzUBME+U60+Jx7CFmwJZ0BK1hQ
  • Thread-topic: [PATCH 2/3] Attempt to reset event channel ABI to 2-Layer

Sent to wrong address!

> -----Original Message-----
> From: Owen Smith [mailto:owen.smith@xxxxxxxxxx]
> Sent: 24 February 2015 18:05
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxx
> Cc: Owen Smith
> Subject: [PATCH 2/3] Attempt to reset event channel ABI to 2-Layer
> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
> ---
>  src/xencrsh/evtchn.c | 96
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  src/xencrsh/evtchn.h | 19 +++++++++++
>  src/xencrsh/store.c  | 33 +++++++++++++++---
>  3 files changed, 144 insertions(+), 4 deletions(-)
> 
> diff --git a/src/xencrsh/evtchn.c b/src/xencrsh/evtchn.c index
> b0b5b93..ecf100b 100644
> --- a/src/xencrsh/evtchn.c
> +++ b/src/xencrsh/evtchn.c
> @@ -87,6 +87,102 @@ fail1:
>  }
> 
>  NTSTATUS
> +EventChannelReset(
> +    VOID
> +    )
> +{
> +    struct evtchn_reset op;
> +    LONG_PTR            rc;
> +    NTSTATUS            status;
> +
> +    op.dom = DOMID_SELF;
> +
> +    rc = EventChannelOp(EVTCHNOP_reset, &op);
> +
> +    if (rc < 0) {
> +        ERRNO_TO_STATUS(-rc, status);
> +        goto fail1;
> +    }
> +
> +    return STATUS_SUCCESS;
> +
> +fail1:
> +    LogError("fail1 (%08x)\n", status);
> +
> +    return status;
> +}
> +
> +NTSTATUS
> +EventChannelBindInterDomain(
> +    IN  USHORT                      RemoteDomain,
> +    IN  ULONG                       RemotePort,
> +    OUT PULONG                      LocalPort
> +    )
> +{
> +    struct evtchn_bind_interdomain  op;
> +    LONG_PTR                        rc;
> +    NTSTATUS                        status;
> +
> +    op.remote_dom = RemoteDomain,
> +    op.remote_port = RemotePort;
> +
> +    rc = EventChannelOp(EVTCHNOP_bind_interdomain, &op);
> +
> +    if (rc < 0) {
> +        ERRNO_TO_STATUS(-rc, status);
> +        goto fail1;
> +    }
> +
> +    *LocalPort = op.local_port;
> +
> +    return STATUS_SUCCESS;
> +
> +fail1:
> +    LogError("fail1 (%08x)\n", status);
> +
> +    return status;
> +}
> +
> +NTSTATUS
> +EventChannelQueryInterDomain(
> +    IN  ULONG               LocalPort,
> +    OUT PUSHORT             RemoteDomain,
> +    OUT PULONG              RemotePort
> +    )
> +{
> +    struct evtchn_status    op;
> +    LONG_PTR                rc;
> +    NTSTATUS                status;
> +
> +    op.dom = DOMID_SELF;
> +    op.port = LocalPort;
> +
> +    rc = EventChannelOp(EVTCHNOP_status, &op);
> +
> +    if (rc < 0) {
> +        ERRNO_TO_STATUS(-rc, status);
> +        goto fail1;
> +    }
> +
> +    status = STATUS_INVALID_PARAMETER;
> +    if (op.status != EVTCHNSTAT_interdomain)
> +        goto fail2;
> +
> +    *RemoteDomain = op.u.interdomain.dom;
> +    *RemotePort = op.u.interdomain.port;
> +
> +    return STATUS_SUCCESS;
> +
> +fail2:
> +    LogError("fail2\n");
> +
> +fail1:
> +    LogError("fail1 (%08x)\n", status);
> +
> +    return status;
> +}
> +
> +NTSTATUS
>  EventChannelAllocate(
>      IN  ULONG           Domain,
>      OUT PULONG          LocalPort
> diff --git a/src/xencrsh/evtchn.h b/src/xencrsh/evtchn.h index
> 2fa3812..9540bd8 100644
> --- a/src/xencrsh/evtchn.h
> +++ b/src/xencrsh/evtchn.h
> @@ -42,6 +42,25 @@ EventChannelSend(
>      );
> 
>  NTSTATUS
> +EventChannelReset(
> +    VOID
> +    );
> +
> +NTSTATUS
> +EventChannelBindInterDomain(
> +    IN  USHORT          RemoteDomain,
> +    IN  ULONG           RemotePort,
> +    OUT PULONG          LocalPort
> +    );
> +
> +NTSTATUS
> +EventChannelQueryInterDomain(
> +    IN  ULONG           LocalPort,
> +    OUT PUSHORT         RemoteDomain,
> +    OUT PULONG          RemotePort
> +    );
> +
> +NTSTATUS
>  EventChannelAllocate(
>      IN  ULONG           Domain,
>      OUT PULONG          LocalPort
> diff --git a/src/xencrsh/store.c b/src/xencrsh/store.c index d474d5e..163dcc5
> 100644
> --- a/src/xencrsh/store.c
> +++ b/src/xencrsh/store.c
> @@ -1063,7 +1063,10 @@ NTSTATUS
>  StoreInitialize()
>  {
>      ULONGLONG                   Mfn;
> -    ULONGLONG                   Port;
> +    ULONGLONG                   Value;
> +    ULONG                       LocalPort;
> +    ULONG                       RemotePort;
> +    USHORT                      RemoteDomain;
>      PHYSICAL_ADDRESS            PhysAddr;
>      NTSTATUS                    Status;
>      struct xenstore_domain_interface*  StoreRingPtr; @@ -1071,12 +1074,34
> @@ StoreInitialize()
>      InitializeListHead(&StoreContext.SubmittedList);
>      InitializeListHead(&StoreContext.PendingList);
> 
> -    Status = HvmGetParameter(HVM_PARAM_STORE_EVTCHN, &Port);
> +    Status = HvmGetParameter(HVM_PARAM_STORE_EVTCHN, &Value);
>      if (!NT_SUCCESS(Status))
>          goto fail1;
> 
> -    LogVerbose("HVM_PARAM_STORE_EVTCHN = %08x\n", (ULONG)Port);
> -    StoreContext.Port = (evtchn_port_t)Port;
> +    LocalPort = (ULONG)Value;
> +
> +    LogVerbose("OLD HVM_PARAM_STORE_EVTCHN = %08x\n", LocalPort);
> +
> +    Status = EventChannelQueryInterDomain(LocalPort,
> +                                          &RemoteDomain,
> +                                          &RemotePort);
> +    LogTrace("EventChannelQueryInterDomain(&u) (%08x) %u:%u\n",
> +             LocalPort, Status, RemoteDomain, RemotePort);
> +
> +    Status = EventChannelReset();
> +    LogTrace("EventChannelReset() (%08x)\n", Status);
> +
> +    Status = EventChannelBindInterDomain(RemoteDomain,
> +                                         RemotePort,
> +                                         &LocalPort);
> +    LogTrace("EventChannelBindInterDomain(%u:%u) (%08x) %u\n",
> +             RemoteDomain, RemotePort, Status, LocalPort);
> +
> +    Value = LocalPort;
> +    Status = HvmSetParameter(HVM_PARAM_STORE_EVTCHN, Value);
> +    LogTrace("HvmSetParameter(STORE_EVTCHN, %u) (%08x)\n", Value,
> + Status);
> +
> +    StoreContext.Port = (evtchn_port_t)LocalPort;
> 
>      Status = HvmGetParameter(HVM_PARAM_STORE_PFN, &Mfn);
>      if (!NT_SUCCESS(Status))
> --
> 1.9.4.msysgit.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.