From win-pv-devel-bounces@lists.xenproject.org Thu Nov 05 21:39:13 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 05 Nov 2020 21:39:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.20203.45909 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kamyM-0005U5-Nf; Thu, 05 Nov 2020 21:39:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 20203.45909; Thu, 05 Nov 2020 21:39:10 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kamyM-0005Tx-KY; Thu, 05 Nov 2020 21:39:10 +0000
Received: by outflank-mailman (input) for mailman id 20203;
 Thu, 05 Nov 2020 21:39:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kL65=EL=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kamyM-0005Ts-33
 for win-pv-devel@lists.xenproject.org; Thu, 05 Nov 2020 21:39:10 +0000
Received: from mail-qt1-x82a.google.com (unknown [2607:f8b0:4864:20::82a])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 17d9a5a5-019a-4baa-8ca9-a5ccdb059cd3;
 Thu, 05 Nov 2020 21:39:09 +0000 (UTC)
Received: by mail-qt1-x82a.google.com with SMTP id g17so2251989qts.5
 for <win-pv-devel@lists.xenproject.org>; Thu, 05 Nov 2020 13:39:09 -0800 (PST)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net.
 [24.188.117.166])
 by smtp.gmail.com with ESMTPSA id o5sm1788362qtt.3.2020.11.05.13.39.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 05 Nov 2020 13:39:07 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=kL65=EL=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kamyM-0005Ts-33
	for win-pv-devel@lists.xenproject.org; Thu, 05 Nov 2020 21:39:10 +0000
X-Inumbo-ID: 17d9a5a5-019a-4baa-8ca9-a5ccdb059cd3
Received: from mail-qt1-x82a.google.com (unknown [2607:f8b0:4864:20::82a])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 17d9a5a5-019a-4baa-8ca9-a5ccdb059cd3;
	Thu, 05 Nov 2020 21:39:09 +0000 (UTC)
Received: by mail-qt1-x82a.google.com with SMTP id g17so2251989qts.5
        for <win-pv-devel@lists.xenproject.org>; Thu, 05 Nov 2020 13:39:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=27LEkKoRMAo9NLAx+prJdHMq9Ykt3kHfpOEU8PZ4XYE=;
        b=D+mJpKYXfjJcFfX6y/KMARx9qGkabyk/Y3M+jjMHKuDBv+6UAha1is9LTE866yH9HT
         0FJAq1lEnMYakcN7T1wvcJyGkDd1YNXPg2UPd/M0rYcSL5pXBrzTiAKxRt6lVjnvdtde
         rpFVqHWsSCVyD3cJcqlqRKToCJMf+lsDMIhBhp1BulgudbXxbGIFiV86pyAGB8BVU3bx
         pnTh5Mt8ULQaTHV8p9/L66gAwPgbh/Ve+0RT9cdMgbzSmNifuz1G2O0Olbhqlk9LHUVp
         wE8YfvHflLg2vWm2eFAYgM89YT2/90EgvsmyqpeyfpK55grvBWyPdbvM2gv3RI8AsdV0
         0Gtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=27LEkKoRMAo9NLAx+prJdHMq9Ykt3kHfpOEU8PZ4XYE=;
        b=QHqGKk0osnURkLKbDkJY2hT8tdt/6UMSZAMUX+QT2x6bNayUZxLnEzyOv9b0AsIElq
         Vu6Itas2U+Nqs4eymBdcOC8tQK6ZA3SXC6/LTdcpCKSNClSKDtXNYGJviV0OEiJsW5f/
         oQcMairO+yd7RFYUrc8QKgDLy36b+oOri4Qc63KpyWAIt6N9qe0EpxADjf9C6+zdGjbA
         6Z/5yblez3Tv1juvLk3ebw8Ej6pA3H9BRy527wc9NgtVNJkzii1BBwbPZfWWoGRo73Fq
         BZMXJAn5BRYooqFSkXgWt8syHjvN+X+XvKJ4h7jVMnaMqhnIH3ngCwoii/ytuRLpL/t6
         z/cg==
X-Gm-Message-State: AOAM532oQgmLP5bxjCHIZRzvr5j8lO5kSWFRvNkUKB03DNd9E2va8sVu
	Gh0p3+KI6MtwOvaA2HJpVLVYrznon7A=
X-Google-Smtp-Source: ABdhPJypA7dkeEFp9CNUms7f0LdxRMUo0YJf+Pz1oexZ8Op7rnmVG9kSumO+g2jIH0+6rc9lak1cEQ==
X-Received: by 2002:ac8:6747:: with SMTP id n7mr4088068qtp.79.1604612348614;
        Thu, 05 Nov 2020 13:39:08 -0800 (PST)
Received: from localhost.localdomain (ool-18bc75a6.dyn.optonline.net. [24.188.117.166])
        by smtp.gmail.com with ESMTPSA id o5sm1788362qtt.3.2020.11.05.13.39.07
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 05 Nov 2020 13:39:07 -0800 (PST)
From: Troy Crosley <troycrosley@gmail.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Troy Crosley <troycrosley@gmail.com>,
	Joel Upham <uphamj@ainfosec.com>
Subject: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
Date: Thu,  5 Nov 2020 16:38:31 -0500
Message-Id: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines
do not get called on driver uninstall. In previous versions of Windows,
this occurs as part of the uninstall during the null device install and
is the only time DifRemove gets called to perform cleanup. Work around
this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which is
the only coinstaller request that seems to happen on uninstall in
Windows 10 version 2004. In addition, improve the null driver test to
also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER or
SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at
least Windows 10 version 1803).

Co-authored-by: Joel Upham <uphamj@ainfosec.com>
Co-authored-by: Troy Crosley <troycrosley@gmail.com>
---
 src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
index 7b96f59..b9b60bd 100644
--- a/src/coinst/coinst.c
+++ b/src/coinst/coinst.c
@@ -1959,6 +1959,9 @@ Entry(
     )
 {
     HRESULT                         Error;
+    SP_DRVINFO_DATA                 DriverInfoData;
+    BOOLEAN                         DriverInfoAvailable;
+    BOOLEAN                         IsNullDriver;
 
     Log("%s (%s) ===>",
         MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
@@ -1973,23 +1976,28 @@ Entry(
             Context->InstallResult);
     }
 
+    DriverInfoData.cbSize = sizeof(DriverInfoData);
+    DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
+                                                   DeviceInfoData,
+                                                   &DriverInfoData) ?
+                          TRUE :
+                          FALSE;
+    IsNullDriver = !(DriverInfoAvailable &&
+                    (DriverInfoData.DriverType == SPDIT_CLASSDRIVER || DriverInfoData.DriverType == SPDIT_COMPATDRIVER));
+
     switch (Function) {
+	case DIF_SELECTBESTCOMPATDRV: {
+        // If the NULL driver will be installed, treat this as we would a DIF_REMOVE
+        // to work around the fact that Windows 10 2004 doesn't call DIF_INSTALLDEVICE on uninstall.
+        Error = (IsNullDriver) ?
+                DifRemove(DeviceInfoSet, DeviceInfoData, Context) :
+                NO_ERROR;
+        break;
+    }
     case DIF_INSTALLDEVICE: {
-        SP_DRVINFO_DATA         DriverInfoData;
-        BOOLEAN                 DriverInfoAvailable;
-
-        DriverInfoData.cbSize = sizeof (DriverInfoData);
-        DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
-                                                       DeviceInfoData,
-                                                       &DriverInfoData) ?
-                              TRUE :
-                              FALSE;
-
-        // If there is no driver information then the NULL driver is being
-        // installed. Treat this as we would a DIF_REMOVE.
-        Error = (DriverInfoAvailable) ?
-                DifInstall(DeviceInfoSet, DeviceInfoData, Context) :
-                DifRemove(DeviceInfoSet, DeviceInfoData, Context);
+        Error = (IsNullDriver) ?
+                NO_ERROR :
+                DifInstall(DeviceInfoSet, DeviceInfoData, Context);
         break;
     }
     case DIF_REMOVE:
-- 
2.25.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 05 21:40:03 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 05 Nov 2020 21:40:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.20206.45912 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kamzD-0005qn-RI; Thu, 05 Nov 2020 21:40:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 20206.45912; Thu, 05 Nov 2020 21:40:03 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kamzD-0005qI-O0; Thu, 05 Nov 2020 21:40:03 +0000
Received: by outflank-mailman (input) for mailman id 20206;
 Thu, 05 Nov 2020 21:40:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kL65=EL=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kamzD-0005k4-9Y
 for win-pv-devel@lists.xenproject.org; Thu, 05 Nov 2020 21:40:03 +0000
Received: from mail-ej1-x641.google.com (unknown [2a00:1450:4864:20::641])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0bd20fa0-4c81-43b5-b964-df0f17bb342c;
 Thu, 05 Nov 2020 21:40:02 +0000 (UTC)
Received: by mail-ej1-x641.google.com with SMTP id dk16so4755201ejb.12
 for <win-pv-devel@lists.xenproject.org>; Thu, 05 Nov 2020 13:40:02 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=kL65=EL=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kamzD-0005k4-9Y
	for win-pv-devel@lists.xenproject.org; Thu, 05 Nov 2020 21:40:03 +0000
X-Inumbo-ID: 0bd20fa0-4c81-43b5-b964-df0f17bb342c
Received: from mail-ej1-x641.google.com (unknown [2a00:1450:4864:20::641])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0bd20fa0-4c81-43b5-b964-df0f17bb342c;
	Thu, 05 Nov 2020 21:40:02 +0000 (UTC)
Received: by mail-ej1-x641.google.com with SMTP id dk16so4755201ejb.12
        for <win-pv-devel@lists.xenproject.org>; Thu, 05 Nov 2020 13:40:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=MKHfVgC5LVvehb7xkeUdcgfFLCZV2wtoHLpGlgL1uME=;
        b=R+9hQjG5Sv5KljRTAud/MdWBjoSsDYUnSVndWXZPTJNmJj1CqIEwzmozqWamp0BVaS
         TBd4i/3WK7EpXOXCTe6pEWPAP8fCNujF/2ZIgVPEG4eMzM3gnQNXwHZ2epvBEjwHxCOw
         0hxmFxKspoWG706I8OOi+7DcOpoQLWvOLiLta6mi9VvPi/YifphQHnM7PXNkE1YPsuy9
         qKb44c4kfMFkMBXsEAx17pxXFd8cClEkPah9N39yZY/0tEUjRkznbeGOqDBwtZxtcWmp
         sFPgXJMsZkCYDiPXV3lEOCW2EZGynJZuoSxgxm+x+aeCdy3jfDgUdM0HJ3qdnifCU/j8
         OZdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=MKHfVgC5LVvehb7xkeUdcgfFLCZV2wtoHLpGlgL1uME=;
        b=Z+tl1YSzhi1xccPooYTqb+nmjcuJ3/CJyXFPRiJt4xY2C8iL9Q++QsmqD1psg3R9YR
         lNDaN/+zssECIH+CcFKsIr9Q8ldRuIAGOwybgLPAL9vlOSzqz1m4dgrTzZf6+hSVQ4OZ
         sFs/87GzX1eWRgy0HcoeaD+bXav9QcHeDAjxF6IS/ejmbQk02TeCejtKp8/4BhSN9Mh9
         7uB1PVO9uach942FEQrrO2eYeX0zlrSCSDkGi0nY83JLb6mNEMs/4kr3CLHHpxxxFVty
         VlspDuYcBL4mCF24lEsdyE8VbcMN8QSCkyc2XZJ2/h32xIFkdYgp6ivtavP9t0CxynsH
         5/xw==
X-Gm-Message-State: AOAM533N2fRT0MPY2LTe/fCrlw/CpV7D7h/el83VqKpVKji1r3yALF/k
	a6SLF9+TQEmyER4uFPU5eQt0QuJlfbCjgWx67cgrbhBRPYE=
X-Google-Smtp-Source: ABdhPJxL8COO2XueGyHUNLbtoZcGE9Zpi5040tJUJfwtSgoIjUJf7QsCGH+oUvd6c5nx0/2WGO8IXIOrSQ1heon9eXc=
X-Received: by 2002:a17:906:138c:: with SMTP id f12mr73069ejc.108.1604612401173;
 Thu, 05 Nov 2020 13:40:01 -0800 (PST)
MIME-Version: 1.0
References: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
In-Reply-To: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
From: Troy Crosley <troycrosley@gmail.com>
Date: Thu, 5 Nov 2020 16:39:50 -0500
Message-ID: <CAOBjErKUrroVbX_icybNB1YFrWLzzHgcC1jSFcqpQcj_aWVY0A@mail.gmail.com>
Subject: Re: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org, Ben Chalmers <ben.chalmers@citrix.com>, 
	Owen Smith <owen.smith@citrix.com>, Joel Upham <uphamj@ainfosec.com>
Content-Type: multipart/alternative; boundary="0000000000002c97c005b362f07a"

--0000000000002c97c005b362f07a
Content-Type: text/plain; charset="UTF-8"

I've submitted only the patch for xenbus to avoid spamming the mailing
list; If this patch is okay, then submissions for the others can follow.

On Thu, Nov 5, 2020 at 4:39 PM Troy Crosley <troycrosley@gmail.com> wrote:

> In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines
> do not get called on driver uninstall. In previous versions of Windows,
> this occurs as part of the uninstall during the null device install and
> is the only time DifRemove gets called to perform cleanup. Work around
> this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which is
> the only coinstaller request that seems to happen on uninstall in
> Windows 10 version 2004. In addition, improve the null driver test to
> also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER or
> SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at
> least Windows 10 version 1803).
>
> Co-authored-by: Joel Upham <uphamj@ainfosec.com>
> Co-authored-by: Troy Crosley <troycrosley@gmail.com>
> ---
>  src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------
>  1 file changed, 23 insertions(+), 15 deletions(-)
>
> diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
> index 7b96f59..b9b60bd 100644
> --- a/src/coinst/coinst.c
> +++ b/src/coinst/coinst.c
> @@ -1959,6 +1959,9 @@ Entry(
>      )
>  {
>      HRESULT                         Error;
> +    SP_DRVINFO_DATA                 DriverInfoData;
> +    BOOLEAN                         DriverInfoAvailable;
> +    BOOLEAN                         IsNullDriver;
>
>      Log("%s (%s) ===>",
>          MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "."
> BUILD_NUMBER_STR,
> @@ -1973,23 +1976,28 @@ Entry(
>              Context->InstallResult);
>      }
>
> +    DriverInfoData.cbSize = sizeof(DriverInfoData);
> +    DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
> +                                                   DeviceInfoData,
> +                                                   &DriverInfoData) ?
> +                          TRUE :
> +                          FALSE;
> +    IsNullDriver = !(DriverInfoAvailable &&
> +                    (DriverInfoData.DriverType == SPDIT_CLASSDRIVER ||
> DriverInfoData.DriverType == SPDIT_COMPATDRIVER));
> +
>      switch (Function) {
> +       case DIF_SELECTBESTCOMPATDRV: {
> +        // If the NULL driver will be installed, treat this as we would a
> DIF_REMOVE
> +        // to work around the fact that Windows 10 2004 doesn't call
> DIF_INSTALLDEVICE on uninstall.
> +        Error = (IsNullDriver) ?
> +                DifRemove(DeviceInfoSet, DeviceInfoData, Context) :
> +                NO_ERROR;
> +        break;
> +    }
>      case DIF_INSTALLDEVICE: {
> -        SP_DRVINFO_DATA         DriverInfoData;
> -        BOOLEAN                 DriverInfoAvailable;
> -
> -        DriverInfoData.cbSize = sizeof (DriverInfoData);
> -        DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
> -                                                       DeviceInfoData,
> -                                                       &DriverInfoData) ?
> -                              TRUE :
> -                              FALSE;
> -
> -        // If there is no driver information then the NULL driver is being
> -        // installed. Treat this as we would a DIF_REMOVE.
> -        Error = (DriverInfoAvailable) ?
> -                DifInstall(DeviceInfoSet, DeviceInfoData, Context) :
> -                DifRemove(DeviceInfoSet, DeviceInfoData, Context);
> +        Error = (IsNullDriver) ?
> +                NO_ERROR :
> +                DifInstall(DeviceInfoSet, DeviceInfoData, Context);
>          break;
>      }
>      case DIF_REMOVE:
> --
> 2.25.1
>
>

--0000000000002c97c005b362f07a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;ve submitted only the patch for xenbus to avoid spam=
ming the mailing list; If this patch is okay, then submissions for the othe=
rs can follow.<br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Thu, Nov 5, 2020 at 4:39 PM Troy Crosley &lt;<a href=
=3D"mailto:troycrosley@gmail.com">troycrosley@gmail.com</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">In Windows 10 versio=
n 2004, The coinstallers&#39; DIF_INSTALLDEVICE routines<br>
do not get called on driver uninstall. In previous versions of Windows,<br>
this occurs as part of the uninstall during the null device install and<br>
is the only time DifRemove gets called to perform cleanup. Work around<br>
this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which is<br>
the only coinstaller request that seems to happen on uninstall in<br>
Windows 10 version 2004. In addition, improve the null driver test to<br>
also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER or<br=
>
SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at<br>
least Windows 10 version 1803).<br>
<br>
Co-authored-by: Joel Upham &lt;<a href=3D"mailto:uphamj@ainfosec.com" targe=
t=3D"_blank">uphamj@ainfosec.com</a>&gt;<br>
Co-authored-by: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.com" t=
arget=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
---<br>
=C2=A0src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------<br>
=C2=A01 file changed, 23 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c<br>
index 7b96f59..b9b60bd 100644<br>
--- a/src/coinst/coinst.c<br>
+++ b/src/coinst/coinst.c<br>
@@ -1959,6 +1959,9 @@ Entry(<br>
=C2=A0 =C2=A0 =C2=A0)<br>
=C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0HRESULT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Error;<br>
+=C2=A0 =C2=A0 SP_DRVINFO_DATA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0DriverInfoData;<br>
+=C2=A0 =C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DriverInfoAvailable;<br>
+=C2=A0 =C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0IsNullDriver;<br>
<br>
=C2=A0 =C2=A0 =C2=A0Log(&quot;%s (%s) =3D=3D=3D&gt;&quot;,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MAJOR_VERSION_STR &quot;.&quot; MINOR_VER=
SION_STR &quot;.&quot; MICRO_VERSION_STR &quot;.&quot; BUILD_NUMBER_STR,<br=
>
@@ -1973,23 +1976,28 @@ Entry(<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Context-&gt;InstallResult);=
<br>
=C2=A0 =C2=A0 =C2=A0}<br>
<br>
+=C2=A0 =C2=A0 DriverInfoData.cbSize =3D sizeof(DriverInfoData);<br>
+=C2=A0 =C2=A0 DriverInfoAvailable =3D SetupDiGetSelectedDriver(DeviceInfoS=
et,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DeviceInfoData,<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;DriverInfoData) ?<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 TRUE :<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 FALSE;<br>
+=C2=A0 =C2=A0 IsNullDriver =3D !(DriverInfoAvailable &amp;&amp;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (Dri=
verInfoData.DriverType =3D=3D SPDIT_CLASSDRIVER || DriverInfoData.DriverTyp=
e =3D=3D SPDIT_COMPATDRIVER));<br>
+<br>
=C2=A0 =C2=A0 =C2=A0switch (Function) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0case DIF_SELECTBESTCOMPATDRV: {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 // If the NULL driver will be installed, treat=
 this as we would a DIF_REMOVE<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 // to work around the fact that Windows 10 200=
4 doesn&#39;t call DIF_INSTALLDEVICE on uninstall.<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error =3D (IsNullDriver) ?<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifRemove(DeviceIn=
foSet, DeviceInfoData, Context) :<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NO_ERROR;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
+=C2=A0 =C2=A0 }<br>
=C2=A0 =C2=A0 =C2=A0case DIF_INSTALLDEVICE: {<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 SP_DRVINFO_DATA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0DriverInfoData;<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0DriverInfoAvailable;<br>
-<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 DriverInfoData.cbSize =3D sizeof (DriverInfoDa=
ta);<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 DriverInfoAvailable =3D SetupDiGetSelectedDriv=
er(DeviceInfoSet,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DeviceInfoData,<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;DriverInfoData) ?<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TRUE :<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FALSE;<br>
-<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 // If there is no driver information then the =
NULL driver is being<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 // installed. Treat this as we would a DIF_REM=
OVE.<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error =3D (DriverInfoAvailable) ?<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifInstall(DeviceI=
nfoSet, DeviceInfoData, Context) :<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifRemove(DeviceIn=
foSet, DeviceInfoData, Context);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error =3D (IsNullDriver) ?<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NO_ERROR :<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifInstall(DeviceI=
nfoSet, DeviceInfoData, Context);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
=C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0 =C2=A0 =C2=A0case DIF_REMOVE:<br>
-- <br>
2.25.1<br>
<br>
</blockquote></div>

--0000000000002c97c005b362f07a--


From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 08:08:03 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 08:08:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22079.48429 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2DZ-00019t-DC; Mon, 09 Nov 2020 08:08:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22079.48429; Mon, 09 Nov 2020 08:08:01 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2DZ-00019m-AC; Mon, 09 Nov 2020 08:08:01 +0000
Received: by outflank-mailman (input) for mailman id 22079;
 Mon, 09 Nov 2020 08:07:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=p0I9=EP=citrix.com=owen.smith@srs-us1.protection.inumbo.net>)
 id 1kc2DX-00019f-I6
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 08:07:59 +0000
Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 21791b1b-cf36-4d58-8423-de9e8d6cf26f;
 Mon, 09 Nov 2020 08:07:56 +0000 (UTC)
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=p0I9=EP=citrix.com=owen.smith@srs-us1.protection.inumbo.net>)
	id 1kc2DX-00019f-I6
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 08:07:59 +0000
X-Inumbo-ID: 21791b1b-cf36-4d58-8423-de9e8d6cf26f
Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 21791b1b-cf36-4d58-8423-de9e8d6cf26f;
	Mon, 09 Nov 2020 08:07:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1604909276;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=k8+fEGxLKAQ8KnQl5qHdUj0jCxhSJw105W6mPOl9g+A=;
  b=HkefhT4qS5EJFRhaQgtEKmUO1XS+NHC61aF357IwR0XPyNu5BIH2ySLW
   UcMikEN3AXEHJfh6FWviXTN0ph63P0BUDR0GohHIE5rD9AOhWCjTu/oRo
   jFqQFHyVG1BW16vLr1fu4ZH+67OcNx56L2JJI0MbY6usb2hfxlwwA5shX
   M=;
Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
IronPort-SDR: 3i5+QI52im9pG3m0N7VRDxdfK1TFvO0lqxmPdmcRqOxxVDQ2Q42OAVVr7lVJdKNVhBc+UONqQ1
 ZncVukkDMA3iNMs4UK38niRI7bgGejJ3HV/NF5p5r5LrKdw48W78CQ4pC/4XK9zqiy+8brA3Ls
 dlpZ4lj2AzhJgv92QOil1ZUobBr6Q0LQo7Z6lXxRhkTn3xxGGy99ejKuWFw9mzmUbXqZ4cJGST
 erJpo+RI0HN5XLtvnDOwEMkAjaTZJ4zFP+6Ku6DBuFzSkiwoTMWsCEOIgLz+LgKSU63RGaS51n
 +Tg=
X-SBRS: None
X-MesageID: 31075005
X-Ironport-Server: esa1.hc3370-68.iphmx.com
X-Remote-IP: 162.221.158.21
X-Policy: $RELAYED
X-IronPort-AV: E=Sophos;i="5.77,463,1596513600"; 
   d="scan'208";a="31075005"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Tg0D3Eqku2A2vh+iApATRBtE5sVrEmJalTbbOvNCU9f5+74sL9e5wbc/d7z0Z2ZbFCY61jNTuO+BPpgoyT8S8ZS71scJgwBksUnxC7EtcLIVtgfcMfGL8txvaX9ghQ46IKXtX4kf+Dnk45mwzJRL7RJhkOMk+wUNZ+Vp9tJOuv9XEGkaBWS5OUflxJKtsU+WHSu5xze1YgTlN+slJFkPcTUCgNQtjjOIMxMwj4jxh2qR3o88rvzwc7vGds2PgSDp5wfcYHRCS6lbpp73OuMIrwwSZkHUiyb86wqXrWeB+TgLgJSf3zD4n8+24R7QbnuZMArIyikEuIKghkPh9E7KJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XXNtx4HZIH1s/GlQQJyv45y1wFzMdYuhdlSQbNvHw2Q=;
 b=BizfD2DI8+ufOvelwk+ufMxiUEfTduq6Lc6m70FUbI6Z46lfkxoPWL/IZNP+SH0t40E2HD4ID/UDDPFd9W4+MZwDj3uUrDrgJzmnxIbYNCg5H+YrIxVFNHzRvKXB1T5t3ant+HI1BWMHTT/DodelqIrU4sm7mJ+feidXsLfUXejCTLU2/nsU4G1oBbUpCkIMbl7MYMb1refyQseO0muVHsO5pbDbrImqJumPyN9OTulQ1ye/BHaJlbgjOF4auAwTquZ8Nno38cNnLwrymlUOmYbxncdT6T22YFgiXnpdNgn6+OVsHla24xVIrAcH74UtnJ7zBaqo2ppIDVQiXDstxg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XXNtx4HZIH1s/GlQQJyv45y1wFzMdYuhdlSQbNvHw2Q=;
 b=cnta97ROTQwzBqWm/pi4qm1X3+j6FvF+VBxcWSDblP1Ph3ynxEbg+iiOkewrNyCPZPWTc+fP//1oYo9aXVtwi8dzxIaaEk5Y3FfQKdhnp6Aueud72GagMWJxMzlNjlQVNmRqHU61efzfawCvZs2GVVIfN4Tdv8STQDuiQQKGPVM=
From: Owen Smith <owen.smith@citrix.com>
To: Nicholas Tsirakis <niko.tsirakis@gmail.com>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
CC: "paul@xen.org" <paul@xen.org>, Ben Chalmers <ben.chalmers@citrix.com>,
	Nicholas Tsirakis <tsirakisn@ainfosec.com>
Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
Thread-Topic: [PATCH 1/2] Allow user to specify desired build architecture
Thread-Index: AQHWtH5BJf25pae+0UWo81C4mchDeam/dNoQ
Date: Mon, 9 Nov 2020 08:07:52 +0000
Message-ID: <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
In-Reply-To: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 0ced5cdf-523f-434f-a0cf-08d884868e65
x-ms-traffictypediagnostic: BYAPR03MB4743:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <BYAPR03MB4743BBF12515F01B8D359D29FEEA0@BYAPR03MB4743.namprd03.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:6790;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: bTC+ht+jfSUPbJ3o5D47evvxdB8B/WDwdQ+39MKkK2DtoB/6LlUa93vwz2Tk9uHQEQIIKzQx97XTGRtQhFkcaWe/x4pf88pdfvU5WUwgdV7i5MHzB00zkrkTWEqvpwl8Q/RFmvsdrIqGGK2Fc+PjP5CX2Vt5ZDnZ9t7BuVfNZmZAS5rCGTUXx6O0IDCXdstJpOz6JIYZDtfzj6hnrDjDSRYuEMSv8HqCMSKqmnr7nmwbhtX3C8apE9nTgyjYt+KKMnQ+/hul+b+R09zkVt5Eki/3MIllHPwe8DsSnoOWqQdopyxIbrL9jjkxz0ygR4pvHSaK2UdIsdyZjypaElphYg==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB4551.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39850400004)(366004)(346002)(376002)(396003)(66476007)(66946007)(316002)(54906003)(110136005)(26005)(478600001)(71200400001)(186003)(44832011)(7696005)(6506007)(53546011)(2906002)(8676002)(33656002)(8936002)(55016002)(5660300002)(9686003)(4326008)(86362001)(83380400001)(52536014)(64756008)(66556008)(66446008)(76116006);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata: NKFfyLom9ZSgIhKdj0ty9nMsDC6YVX/MgzSUgd0LU4WRmr3Tn6LLl3AVGoy8t3SNkMKp2donWladQ3JydWn7HEWDkJCTG6N5umibMVWwDYVP/3rRfT8oj0taPK8DkeZoSNC16rySetFP0sdC+om9Imdm0OetusnP4jNiCgDmaoC92RVUHWtH8r/Y1YX4D5FKv5H4FRDBOGxyioHrtJC65fu4JYNBi3h44z166v7q5t6l3IqktGqpIIw0qmxp1JoXaTE7i17VzbmnfYfkNaFLpTF7MaTpxbntZpRl1zQneUzn5KjEvLcJCUEjY0wpPYIqpVq9/5+vX+4qz/im3+bGxoPUuTGAFtJ5AL7kYIibebJpZMOrwFC5LO0mUHcHS7zjj+RQmF6hSP2R70xEJzOwTXZNuA3+oSUboBC7DRnZgAfq4uZpQF2wSrzxloJ3UsnelNT46JkC5ZzGVl9Hy7yXSu3gpKedgiRrHxos48HekPLG25LnCrjakaz2RywPT1buZ7TEjC8k0DmS0SEodclxnayH0eAL2Up87y8KRnZ3DyoeJ/G3wnfmAmsoKtX2tSA1Ya0hTk02//o6Jg6aOFU1+KUk5prcm4NzcMNT43VsVi/9a4XxEEpfqtwV7i+MAcNDyBxbOoEoaZRlvmFr8Nt13w==
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB4551.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0ced5cdf-523f-434f-a0cf-08d884868e65
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2020 08:07:52.1684
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: eaPjxld5DaArXaYbQLFCTswvIp599GxH+/EUufZRPBGeiRTBQoAk1SHdS/dja7spsqMFvNUlisv0jxWiZt3p0A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4743
X-OriginatorOrg: citrix.com

I would suggest using=20
[string]::IsNullOrEmpty($Arch)
Instead of=20
$Arch -eq ""

Owen

> -----Original Message-----
> From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> Sent: 06 November 2020 20:49
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> <owen.smith@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> Subject: [PATCH 1/2] Allow user to specify desired build architecture
>=20
> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> unless you have verified the sender and know the content is safe.
>=20
> Often times we only need to build a driver for a single targeted architec=
ture.
> Continue to build both by default, but allow the user to specify one if d=
esired.
>=20
> Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
> ---
>  build.ps1 | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>=20
> diff --git a/build.ps1 b/build.ps1
> index c66ac05..06626fd 100644
> --- a/build.ps1
> +++ b/build.ps1
> @@ -5,6 +5,7 @@
>  param(
>  	[Parameter(Mandatory =3D $true)]
>  	[string]$Type,
> +	[string]$Arch,
>  	[switch]$Sdv
>  )
>=20
> @@ -82,8 +83,13 @@ Set-Item -Path Env:MAJOR_VERSION -Value '9'
>  Set-Item -Path Env:MINOR_VERSION -Value '1'
>  Set-Item -Path Env:MICRO_VERSION -Value '0'
>=20
> -Build "x86" $Type
> -Build "x64" $Type
> +if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
> +	Build "x86" $Type
> +}
> +
> +if ($Arch -eq "" -or $Arch -eq "x64") {
> +	Build "x64" $Type
> +}
>=20
>  if ($Sdv) {
>  	SdvBuild
> --
> 2.25.4
>=20



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 08:10:49 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 08:10:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22085.48433 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2GH-0001ss-LY; Mon, 09 Nov 2020 08:10:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22085.48433; Mon, 09 Nov 2020 08:10:49 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2GH-0001sl-IS; Mon, 09 Nov 2020 08:10:49 +0000
Received: by outflank-mailman (input) for mailman id 22085;
 Mon, 09 Nov 2020 08:10:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=p0I9=EP=citrix.com=owen.smith@srs-us1.protection.inumbo.net>)
 id 1kc2GG-0001sg-L7
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 08:10:48 +0000
Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cbaaafd0-f91c-472c-b1ff-ec3a5ed2dec6;
 Mon, 09 Nov 2020 08:10:47 +0000 (UTC)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=p0I9=EP=citrix.com=owen.smith@srs-us1.protection.inumbo.net>)
	id 1kc2GG-0001sg-L7
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 08:10:48 +0000
X-Inumbo-ID: cbaaafd0-f91c-472c-b1ff-ec3a5ed2dec6
Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cbaaafd0-f91c-472c-b1ff-ec3a5ed2dec6;
	Mon, 09 Nov 2020 08:10:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
  d=citrix.com; s=securemail; t=1604909447;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=hxlftAYJsIKVnJxzzVCWb0jNc3hBoz81KqRjwviQqOo=;
  b=FztJJWSSLSfMXrIjx0aWbPflSXsC32DdYDwHLt1b0aY4IJmnpWEWqD1X
   b0nYeiS+FcUGndWBDiofsWO2/teeNxnXHC75eaZ526RXnRCAPPDBT9ytt
   fhuYqwlK1cOxuM8L4kq0eq808bYkBE4V+4co7sErffs2NpJazRmipKg2R
   M=;
Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
IronPort-SDR: tpXXgc9r0YUwf+mygiARgpkfwEI0HdXFGrwUBXRLETfToyJv8hOQBI5ft7SnWkyxgFg2gLlmRq
 VwihfaLevvITssGY5J8xOY5q0NHRmklEsOrJq2avL1frJBWqrCXSIILz+/bOBOsEB417PzV5Ft
 YO4fvSBn0L+FSBdQrE4cff3HAaDVogJg0b+SaE2dPo+TAuLatQL/Bjnggz+DDC6in48CCX0V9U
 w6oqyVYkXoKE9+89+xNGkpOYhjxjxl9XwxUDzASGU1npassW1kuzebrWcA1EgYNO/zDvCnxYTv
 aRc=
X-SBRS: None
X-MesageID: 30765292
X-Ironport-Server: esa5.hc3370-68.iphmx.com
X-Remote-IP: 162.221.158.21
X-Policy: $RELAYED
X-IronPort-AV: E=Sophos;i="5.77,463,1596513600"; 
   d="scan'208";a="30765292"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=dkfY8eVcu0ALmLKYOneC+FyZr2HnSK/OCBZHwCVytiR2dRGpWvd2nLyABjykK90A4vEkYGVHLZAytf6o/oYu5dmzcSH6aYF0MBmRPQIJt36Rzvqftqvf09cHM0FBqIVVDoQRiPIe/LQ8pqbQkbZflEbyx9vT7Ut7G2XP07ZBuKglZkjkms3ljAz7BmQtTfxjxnSiowJIVPgKj9aovU5q23k40kBLhDZak4lVKGYrQI1OwL8/Wqhjc3r7rO8zqgadpCCRvVu8jua4SZGGbBDx9hxwjxa7O29k2cANbWCE89EBqGr1kwhEmlVZpnO97kvn71YMR3ntB5jp0Hdw6VR7kw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vXAENEO4I6h42DAtyQGEtolx/4kaQTL0yxOOrpo7C28=;
 b=HxCOPYpwS9mlzw2iDT/M4EQCv3TDKWXEOWKF/H3O38yPk/pP4g1WiEUCwQHL/UgIiucujE3mmwAT38WI4U9G44bOI1tKQMoukOdf2r7Lwq/7ZD5aI4CjU6CHABoI/REz2g0qMv2rx/pRmi1TIEN3QJwyGsCHC9f66QPFBzGMZ4AqqcPzmHbjXhaAgmm+PPfvAKl5grTXnOvtdy9pHEBAx0wm/TD4zth1T4xhWFuKxe2YUFZr+COFbCRtf5VAaodaMF9Ea+VXQCro5bFhbSqumyyVytB7EAw3CTTgM6mYOgZ+xZCHhwCf9k37Dn+z9IQ8/kbPDizOAznBs4anUkyNOw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vXAENEO4I6h42DAtyQGEtolx/4kaQTL0yxOOrpo7C28=;
 b=s/tArXUMASijrR4Abwvrx253JdeJvn5FrTkwKtZE2B+q8y33HYZbaUJfG9PbRUis5mIMM2ECyHNL3HdWQ8zj7g4XGWF2ovy4V0uZr7PVPCVVjau7VOFZR2VXOSH81DlJ2vVRkuga2xEMOlPRUuTVD2gSVp9L9T3c4xyQbeOeu8U=
From: Owen Smith <owen.smith@citrix.com>
To: Nicholas Tsirakis <niko.tsirakis@gmail.com>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
CC: "paul@xen.org" <paul@xen.org>, Ben Chalmers <ben.chalmers@citrix.com>,
	Nicholas Tsirakis <tsirakisn@ainfosec.com>
Subject: RE: [PATCH 2/2] Inherit versioning info from environment if present
Thread-Topic: [PATCH 2/2] Inherit versioning info from environment if present
Thread-Index: AQHWtH5HfB/jA8n3gEaG/hbqFZSZVam/deQQ
Date: Mon, 9 Nov 2020 08:10:43 +0000
Message-ID: <BYAPR03MB4551B4DEFB9C2AA18E882667FEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
 <ffc1f0918fcf59fdf6714aec1f62403a8391dcd6.1604689382.git.tsirakisn@ainfosec.com>
In-Reply-To: <ffc1f0918fcf59fdf6714aec1f62403a8391dcd6.1604689382.git.tsirakisn@ainfosec.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 8e89b43d-db5e-461e-bcb8-08d88486f471
x-ms-traffictypediagnostic: BYAPR03MB4743:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <BYAPR03MB47437F40B340460C287AD3FFFEEA0@BYAPR03MB4743.namprd03.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7219;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: qDkNGmvNtj64g34Yk4KxGmq9pNs6SOzLbgp2XSsAN7td4b/1T+ZfkG/fZ0wm6M3SWIIr6lp4GfoCBBN0N6N5T6vqpx9xPM02hPw1JisFdZH3qJxy2X0IyBAENuEH0WMyJPg9DranYO3Ecwf9WPFVnNh7f/Hhf1Xmc7wYh+72JSy0NsvOZu9x90M/TGCkO/dWRLLuohenwHFvia574x2QSRIQr6PCwCldiDglF/hrcZXxPC7g5k0nNhMpZU/rcYIQPTRzwJwuWpC8Yix+4gQi3ie1g8m4nytKBilfaAIj7eN5bAtjh9rLo0xtb1CGvV82zdGDU5sV15KDzR3twZmkPw==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR03MB4551.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(346002)(366004)(376002)(39850400004)(136003)(33656002)(8936002)(2906002)(8676002)(44832011)(7696005)(6506007)(53546011)(83380400001)(86362001)(4326008)(66556008)(66446008)(76116006)(64756008)(52536014)(55016002)(5660300002)(9686003)(316002)(54906003)(110136005)(66476007)(66946007)(478600001)(71200400001)(186003)(26005);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata: 4fVuCcisCApXMljeWMxwrkR++9SIhQfU4ex7j7zcH0t3qJMWhMoivRVenkC17ANdDKD3C+E7q5NpudRbaPPamS0cdqkwm+G6md3ZRGVdHo/orqPU2JmY7HC9FP/cCRNvk8HOMwL4DEZCODEC/8J11m8PXiTVMgZTIJsqzae211rvXL0rlu6A8kv9bwFdLULNeqAiEoKiXeW55CX6TyqmZgZAt/qEHAaSR3RFrmBerT5ceASv3A+aQZ4AeR5WqR8MzTVet0MwXcu0fecUTjOvNlNTXTDy/lern8M8Lv4s4ws1k2cp8Yu5Ioc9c8r0tap19U/VV7KMZj+kVDpIOME2n9W3OZTIc6xJh2Vxjxu3+nfIlVNJKtkVO6Jvl7blzXJurGV2SYlomwKjxX1J4UqanUO7Z94BH6s4KmABeZwTPrYt+nu39nKNhKerRs8n/FQbO0z4G9YNiP3MGsW5dXNfB0e25Alstt1ge2VeXe0cmyibr7weu+sqn8pnea/3dLVI3/WsO2r59GXGTBOVR+M7E/C0/25GH6JrVRy73YLmSbNli7v+IuvPNlZ8ZGeg+Nis+LeMQS9acQKrlElJUBd9vNkAMtrIB/oUqlgqOfS51mjY4QUpE5XZaeCHBMqPoRolZ5rHWkPCONP5RaodUsDgsA==
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BYAPR03MB4551.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e89b43d-db5e-461e-bcb8-08d88486f471
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2020 08:10:43.3754
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: zx332eADeVtypTpns2bNLpyg7fPfJp+Qy0LPngDosBTt1JD6qQlt4t4Supgqrcp/e2SJ9SXbYpcwYrTDhFuPOg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4743
X-OriginatorOrg: citrix.com

I'm currently looking at carrying the exact same changes in my patch queue,=
 so that the patch queue version can be used. In my case, I have no intenti=
ons of changing the Major or Minor versions (for consistency)

Acked-by: Owen Smith <owen.smith@citrix.com>

> -----Original Message-----
> From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> Sent: 06 November 2020 20:49
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> <owen.smith@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> Subject: [PATCH 2/2] Inherit versioning info from environment if present
>=20
> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> unless you have verified the sender and know the content is safe.
>=20
> As the drivers stabilize and mature, there is an ever-growing chance that=
 other
> opensource virtualization projects will adopt them. Allow external projec=
ts to
> inject their own versioning into the drivers instead of hardcoding the la=
test
> winpv version.
>=20
> Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
> ---
>  build.ps1 | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>=20
> diff --git a/build.ps1 b/build.ps1
> index 06626fd..b7b015f 100644
> --- a/build.ps1
> +++ b/build.ps1
> @@ -79,9 +79,17 @@ if ([string]::IsNullOrEmpty($Env:BUILD_NUMBER)) {
>  	Set-Item -Path Env:BUILD_NUMBER -Value $BuildNum  }
>=20
> -Set-Item -Path Env:MAJOR_VERSION -Value '9'
> -Set-Item -Path Env:MINOR_VERSION -Value '1'
> -Set-Item -Path Env:MICRO_VERSION -Value '0'
> +if ([string]::IsNullOrEmpty($Env:MAJOR_VERSION)) {
> +	Set-Item -Path Env:MAJOR_VERSION -Value '9'
> +}
> +
> +if ([string]::IsNullOrEmpty($Env:MINOR_VERSION)) {
> +	Set-Item -Path Env:MINOR_VERSION -Value '1'
> +}
> +
> +if ([string]::IsNullOrEmpty($Env:MICRO_VERSION)) {
> +	Set-Item -Path Env:MICRO_VERSION -Value '0'
> +}
>=20
>  if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
>  	Build "x86" $Type
> --
> 2.25.4
>=20



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 08:28:08 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 08:28:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.21154.48455 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2X1-00035J-C8; Mon, 09 Nov 2020 08:28:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 21154.48455; Mon, 09 Nov 2020 08:28:07 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2X1-000358-6B; Mon, 09 Nov 2020 08:28:07 +0000
Received: by outflank-mailman (input) for mailman id 21154;
 Fri, 06 Nov 2020 20:48:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RN2k=EM=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
 id 1kb8fI-0008Gk-TN
 for win-pv-devel@lists.xenproject.org; Fri, 06 Nov 2020 20:48:56 +0000
Received: from mail-qk1-x741.google.com (unknown [2607:f8b0:4864:20::741])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e95dad73-8a54-4c99-adec-f0633d64203a;
 Fri, 06 Nov 2020 20:48:56 +0000 (UTC)
Received: by mail-qk1-x741.google.com with SMTP id 140so2381481qko.2
 for <win-pv-devel@lists.xenproject.org>; Fri, 06 Nov 2020 12:48:56 -0800 (PST)
Received: from FED-Ntsira-L.crux.rad.ainfosec.com.fios-router.home
 (pool-108-29-130-155.nycmny.fios.verizon.net. [108.29.130.155])
 by smtp.gmail.com with ESMTPSA id h20sm1353332qkh.114.2020.11.06.12.48.55
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 06 Nov 2020 12:48:55 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=RN2k=EM=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
	id 1kb8fI-0008Gk-TN
	for win-pv-devel@lists.xenproject.org; Fri, 06 Nov 2020 20:48:56 +0000
X-Inumbo-ID: e95dad73-8a54-4c99-adec-f0633d64203a
Received: from mail-qk1-x741.google.com (unknown [2607:f8b0:4864:20::741])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e95dad73-8a54-4c99-adec-f0633d64203a;
	Fri, 06 Nov 2020 20:48:56 +0000 (UTC)
Received: by mail-qk1-x741.google.com with SMTP id 140so2381481qko.2
        for <win-pv-devel@lists.xenproject.org>; Fri, 06 Nov 2020 12:48:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:in-reply-to:references
         :mime-version:content-transfer-encoding;
        bh=zDivATIxtkSHaeVKcZkPpjVyT/g6tW0H3GN8BO+PC60=;
        b=XTRDMXMtFGH2v5QIgW0ee4gyGfJwIXyFYktMLSfB7GXcfehIzJCTi+adYOzWo4Sbfn
         MhzHH45qWWOwPCjahoY1KMt2VFZYpt0lhzfJqrA6T5PQB+dtt0Q30XU5l8WlHg4UjtiP
         jYI3qsaKJAnhpZlqC48QrUi9BTODHHwCdJ2MX9/2FwC1r4d4AXJ0oXi6pY9HHeZQOTIt
         Bxf2YzLLvdGa+SDiPeiJaRS7FRgdn6CDhAuxkdaSi4qn1XO4oExyMj7dsdkyaDES5/zo
         rQBX2nMBc4/RYbH2v77B1T6fGSMfbtasrfLIeb0EwpF10tgj2N+x6wiwrMO1olrNBrIb
         3YGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
         :references:mime-version:content-transfer-encoding;
        bh=zDivATIxtkSHaeVKcZkPpjVyT/g6tW0H3GN8BO+PC60=;
        b=t4SnKJSERw39xZoon5BffDkGHSlTRtnO/VnIIMXqw81HoRAmR+DiE+XhBGNEmpUcA3
         OrJU9oJ/Cy0ZtmJOEjHF8SQBoj/4OOLlJUpYNRYxaiqrzr119uylH32qj8sZcTMHqTE0
         k3PQ0HIzxb+q/5y+nyCW5iJpXvbfM0+korLWu9zx4EZDYboPx8mhrQa4abTQvVFF5tA5
         4f/dlz7of0+9y65g2lKa7jC1rtMUWBBTIsI+N3WgBUCV+SNR6jmw4KZeme2w6JdudxGO
         xNGA97xSoQq9NWASoV8hhDe3Dx3zW8WWmMDpozz2AF1FRVQL9sM50t54PL8QqfIGDhe1
         i7cw==
X-Gm-Message-State: AOAM533MtN3OL0pXvmwJ32fkG8Uhgf1Z4LOIlRMYR3ygk5FHzcgvkXDt
	954uOQ0Zhcn8xfFXehaYpVag1AdzNoTZrg==
X-Google-Smtp-Source: ABdhPJyXDR5370eKapLGjf0vb/im26gx4yd09DWHbtLJU7jx+GcKX6O0ZBupKZTo82vtDvIeLcqKPQ==
X-Received: by 2002:a05:620a:16b6:: with SMTP id s22mr3284529qkj.422.1604695735870;
        Fri, 06 Nov 2020 12:48:55 -0800 (PST)
Received: from FED-Ntsira-L.crux.rad.ainfosec.com.fios-router.home (pool-108-29-130-155.nycmny.fios.verizon.net. [108.29.130.155])
        by smtp.gmail.com with ESMTPSA id h20sm1353332qkh.114.2020.11.06.12.48.55
        (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
        Fri, 06 Nov 2020 12:48:55 -0800 (PST)
From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
X-Google-Original-From: Nicholas Tsirakis <tsirakisn@ainfosec.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Nicholas Tsirakis <tsirakisn@ainfosec.com>
Subject: [PATCH 2/2] Inherit versioning info from environment if present
Date: Fri,  6 Nov 2020 15:48:44 -0500
Message-Id: <ffc1f0918fcf59fdf6714aec1f62403a8391dcd6.1604689382.git.tsirakisn@ainfosec.com>
X-Mailer: git-send-email 2.25.4
In-Reply-To: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

As the drivers stabilize and mature, there is an ever-growing
chance that other opensource virtualization projects will adopt
them. Allow external projects to inject their own versioning
into the drivers instead of hardcoding the latest winpv version.

Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
---
 build.ps1 | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 06626fd..b7b015f 100644
--- a/build.ps1
+++ b/build.ps1
@@ -79,9 +79,17 @@ if ([string]::IsNullOrEmpty($Env:BUILD_NUMBER)) {
 	Set-Item -Path Env:BUILD_NUMBER -Value $BuildNum
 }
 
-Set-Item -Path Env:MAJOR_VERSION -Value '9'
-Set-Item -Path Env:MINOR_VERSION -Value '1'
-Set-Item -Path Env:MICRO_VERSION -Value '0'
+if ([string]::IsNullOrEmpty($Env:MAJOR_VERSION)) {
+	Set-Item -Path Env:MAJOR_VERSION -Value '9'
+}
+
+if ([string]::IsNullOrEmpty($Env:MINOR_VERSION)) {
+	Set-Item -Path Env:MINOR_VERSION -Value '1'
+}
+
+if ([string]::IsNullOrEmpty($Env:MICRO_VERSION)) {
+	Set-Item -Path Env:MICRO_VERSION -Value '0'
+}
 
 if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
 	Build "x86" $Type
-- 
2.25.4



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 08:28:08 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 08:28:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.21152.48449 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2X1-000351-7s; Mon, 09 Nov 2020 08:28:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 21152.48449; Mon, 09 Nov 2020 08:28:07 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc2X1-00034u-4T; Mon, 09 Nov 2020 08:28:07 +0000
Received: by outflank-mailman (input) for mailman id 21152;
 Fri, 06 Nov 2020 20:48:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RN2k=EM=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
 id 1kb8fD-0008GT-KX
 for win-pv-devel@lists.xenproject.org; Fri, 06 Nov 2020 20:48:51 +0000
Received: from mail-qk1-x744.google.com (unknown [2607:f8b0:4864:20::744])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a9dc6c83-37a2-4d4d-80d8-f81280065356;
 Fri, 06 Nov 2020 20:48:50 +0000 (UTC)
Received: by mail-qk1-x744.google.com with SMTP id l2so2386239qkf.0
 for <win-pv-devel@lists.xenproject.org>; Fri, 06 Nov 2020 12:48:50 -0800 (PST)
Received: from FED-Ntsira-L.crux.rad.ainfosec.com.fios-router.home
 (pool-108-29-130-155.nycmny.fios.verizon.net. [108.29.130.155])
 by smtp.gmail.com with ESMTPSA id h20sm1353332qkh.114.2020.11.06.12.48.49
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 06 Nov 2020 12:48:49 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=RN2k=EM=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
	id 1kb8fD-0008GT-KX
	for win-pv-devel@lists.xenproject.org; Fri, 06 Nov 2020 20:48:51 +0000
X-Inumbo-ID: a9dc6c83-37a2-4d4d-80d8-f81280065356
Received: from mail-qk1-x744.google.com (unknown [2607:f8b0:4864:20::744])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a9dc6c83-37a2-4d4d-80d8-f81280065356;
	Fri, 06 Nov 2020 20:48:50 +0000 (UTC)
Received: by mail-qk1-x744.google.com with SMTP id l2so2386239qkf.0
        for <win-pv-devel@lists.xenproject.org>; Fri, 06 Nov 2020 12:48:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=4BEr4gIKkgiZDZ9YkEg7F5Aa55aAlIfEId8T81QW9pM=;
        b=jySEdPqLI3TTW3RO/mfGGFpxiIUl5Lcgl8gsnqJil8eAYxiPR5LzJDYl/T1c3Hf8bR
         7ugfipiLVKSR+gvy7aI/BsksLsiUGSyRH4ujLOoevNtZksyTaP7Xo3FGBztPwvczjkXD
         v6i2Jot/yTIwUjToa/Plt+dBi7UzpzEvM+v42Aa5WMZKO196LQn0N7zlqv2F15sOWzbn
         EPipqGJtlMfPiJJSD/LUMTvNntda/EIl1K+znYmYd18gNRuvf97c6ISNirxo4fFHtsgG
         nfJvpLqsq/IbJmSSyvLhQIYXIr7xz5w24bzCW0ZHxNdMC0Fr0USxT5YI+1fuGjrJUdsq
         cl9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
         :content-transfer-encoding;
        bh=4BEr4gIKkgiZDZ9YkEg7F5Aa55aAlIfEId8T81QW9pM=;
        b=gEV8xeiQOea7MfDVqncOzv3yrolkpBUCn3vC1ACoC5uIALY68z87Qe/5LYW2f14VVk
         uShsDhwRhRJWnct2S/GNWAzqqwjOkyHlf09PHVYr4EhlZ/aReV036/EsE4Dpagb4w1+x
         TFvvpm8I7AngeEe6yIwETSGy1xsHmhSUs3CHq0IABjPodETlhQ9y0ji9g266kVur1/nh
         7I/zAoSn+JwhWSgvJzXT+ouIIFuUkRrhnA7SQXdg8Lg9dhtvlN6B9AJ/8Y7IMLvgpES7
         3x/GT/jF/ZNgle+e98AGaNEr4KO4FUlfB4Jsy0vDned2VZDm6+Q2cowZEnmZ2INAUzoz
         4Tlg==
X-Gm-Message-State: AOAM532oONLvqoNZ9sieOtStsXJvNP/3E8zD7nf/9m5L6/6xR6O2DCeM
	U07rJ0WW46WOpDk70RN3C8DSXnXKhe0=
X-Google-Smtp-Source: ABdhPJw8mJP3cf+VM+Z+G9OBTWPHuoWls85hd1fxR+1xMGXcgGowSnUwNWhY2AZCHzarA1nuPeLlkg==
X-Received: by 2002:a05:620a:a09:: with SMTP id i9mr3234988qka.119.1604695730358;
        Fri, 06 Nov 2020 12:48:50 -0800 (PST)
Received: from FED-Ntsira-L.crux.rad.ainfosec.com.fios-router.home (pool-108-29-130-155.nycmny.fios.verizon.net. [108.29.130.155])
        by smtp.gmail.com with ESMTPSA id h20sm1353332qkh.114.2020.11.06.12.48.49
        (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
        Fri, 06 Nov 2020 12:48:49 -0800 (PST)
From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
X-Google-Original-From: Nicholas Tsirakis <tsirakisn@ainfosec.com>
To: win-pv-devel@lists.xenproject.org
Cc: paul@xen.org,
	ben.chalmers@citrix.com,
	owen.smith@citrix.com,
	Nicholas Tsirakis <tsirakisn@ainfosec.com>
Subject: [PATCH 1/2] Allow user to specify desired build architecture
Date: Fri,  6 Nov 2020 15:48:43 -0500
Message-Id: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
X-Mailer: git-send-email 2.25.4
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Often times we only need to build a driver for a single
targeted architecture. Continue to build both by default,
but allow the user to specify one if desired.

Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
---
 build.ps1 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/build.ps1 b/build.ps1
index c66ac05..06626fd 100644
--- a/build.ps1
+++ b/build.ps1
@@ -5,6 +5,7 @@
 param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
+	[string]$Arch,
 	[switch]$Sdv
 )
 
@@ -82,8 +83,13 @@ Set-Item -Path Env:MAJOR_VERSION -Value '9'
 Set-Item -Path Env:MINOR_VERSION -Value '1'
 Set-Item -Path Env:MICRO_VERSION -Value '0'
 
-Build "x86" $Type
-Build "x64" $Type
+if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
+	Build "x86" $Type
+}
+
+if ($Arch -eq "" -or $Arch -eq "x64") {
+	Build "x64" $Type
+}
 
 if ($Sdv) {
 	SdvBuild
-- 
2.25.4



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 09:05:46 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 09:05:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22211.48481 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc37R-0006mV-PT; Mon, 09 Nov 2020 09:05:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22211.48481; Mon, 09 Nov 2020 09:05:45 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc37R-0006mO-MO; Mon, 09 Nov 2020 09:05:45 +0000
Received: by outflank-mailman (input) for mailman id 22211;
 Mon, 09 Nov 2020 09:05:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rjml=EP=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kc37P-0006mJ-VD
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 09:05:44 +0000
Received: from mail-wm1-x334.google.com (unknown [2a00:1450:4864:20::334])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6982582c-dd59-47cf-a628-42c55301c1de;
 Mon, 09 Nov 2020 09:05:43 +0000 (UTC)
Received: by mail-wm1-x334.google.com with SMTP id t67so2849220wmt.5
 for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 01:05:43 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id x63sm1502082wmb.48.2020.11.09.01.05.41
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 09 Nov 2020 01:05:41 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Rjml=EP=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kc37P-0006mJ-VD
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 09:05:44 +0000
X-Inumbo-ID: 6982582c-dd59-47cf-a628-42c55301c1de
Received: from mail-wm1-x334.google.com (unknown [2a00:1450:4864:20::334])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6982582c-dd59-47cf-a628-42c55301c1de;
	Mon, 09 Nov 2020 09:05:43 +0000 (UTC)
Received: by mail-wm1-x334.google.com with SMTP id t67so2849220wmt.5
        for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 01:05:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=Hev4iffyA86jfHsJEYV+rQhh4JM5jb+4joUeFEN/rXI=;
        b=ArzEq5PIGmjg62R+WAFF7zu4mqZRNn6+4xruYzzpKPr9wyqGgz12rRuoRlyeqd0zIt
         5bmdMQiBVHtciojUHz/ebHOmOJVQZ9djmNgFFo91ik66eJntTmyd4pLzStx5DMBt9JSD
         XgnQhKWDKPKcD4V1joF203sFdUL5xsTzYfUEtdaGROHYvy2BbcTAdzneXmpfffIeSA3H
         ckEEvEpVOs7lNPUqA8u1iGDmXJqU5nRCBLH0IQdw0/mpth0npTaDclVLTI1k2ouMNW0a
         LkVLvPUsT1GXZTO2n1jyc0cGExNqZ4dD4iNiPP3GVYjol/ibvSrKk4nJ0caW/LOo2uzO
         gVUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=Hev4iffyA86jfHsJEYV+rQhh4JM5jb+4joUeFEN/rXI=;
        b=YGDDMFNsFADM6bPuUToFukYCG0HogtBnQX19XSI6sb3pMAK0rEzHn4jQ2Pcn1rTSPX
         00Qt1K0E3XdABGUUqr6+2ZvkB2HMQuvv4kkMmZmHG4DLuEqz4CSL1Bw+Yg/NxEQJU6rc
         No0tIhjbMS9U9b6LZSq4XM1jziK3urJZk62NAnE18utFnDIhm7CmrV4G2lXXI3uXp3zH
         hYBmPDCvj9a9vS96WFJqt+rkPntOcNidpX5cJEjs8KrITts7Rc0s6Nwd8VZ73uTPoSuX
         n5zbxraKptCc0/c1ClDZKwuRevJ8L2no5/F4anzBtVbm4s6gjmEdRyvo/mBcSX7nYBWF
         HGhA==
X-Gm-Message-State: AOAM530GNVN4HTKjVEWRyfIJAEUngYHlt7ls4kwm325P2T07VAisE0TG
	znLy6wdnIYDJe6nIVep6Icw=
X-Google-Smtp-Source: ABdhPJyZQu7UwhaPOooXgJRwOZVWUIyeVInEg4/X75k60mgOYNHPPzf6SEOQgAoCMVpt53GX1hsnkQ==
X-Received: by 2002:a7b:cbcf:: with SMTP id n15mr13183012wmi.156.1604912742304;
        Mon, 09 Nov 2020 01:05:42 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
        by smtp.gmail.com with ESMTPSA id x63sm1502082wmb.48.2020.11.09.01.05.41
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 09 Nov 2020 01:05:41 -0800 (PST)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Owen Smith'" <owen.smith@citrix.com>,
	"'Nicholas Tsirakis'" <niko.tsirakis@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: "'Ben Chalmers'" <ben.chalmers@citrix.com>,
	"'Nicholas Tsirakis'" <tsirakisn@ainfosec.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com> <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
In-Reply-To: <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
Date: Mon, 9 Nov 2020 09:05:40 -0000
Message-ID: <005d01d6b677$7feed3d0$7fcc7b70$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQI/RIkef6OMRpKkPO4DwuXKMajMtwHiVPV9qN9SuZA=
Content-Language: en-gb

> -----Original Message-----
> From: Owen Smith <owen.smith@citrix.com>
> Sent: 09 November 2020 08:08
> To: Nicholas Tsirakis <niko.tsirakis@gmail.com>; win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
> 

Let's try to avoid top-posting :-)

> I would suggest using
> [string]::IsNullOrEmpty($Arch)
> Instead of
> $Arch -eq ""
> 

Agreed. I can make the change while committing so no need for a v2.

Acked-by: Paul Durrant <paul@xen.org>

> Owen
> 
> > -----Original Message-----
> > From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> > Sent: 06 November 2020 20:49
> > To: win-pv-devel@lists.xenproject.org
> > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> > <owen.smith@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > Subject: [PATCH 1/2] Allow user to specify desired build architecture
> >
> > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> > unless you have verified the sender and know the content is safe.
> >
> > Often times we only need to build a driver for a single targeted architecture.
> > Continue to build both by default, but allow the user to specify one if desired.
> >
> > Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > ---
> >  build.ps1 | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/build.ps1 b/build.ps1
> > index c66ac05..06626fd 100644
> > --- a/build.ps1
> > +++ b/build.ps1
> > @@ -5,6 +5,7 @@
> >  param(
> >  	[Parameter(Mandatory = $true)]
> >  	[string]$Type,
> > +	[string]$Arch,
> >  	[switch]$Sdv
> >  )
> >
> > @@ -82,8 +83,13 @@ Set-Item -Path Env:MAJOR_VERSION -Value '9'
> >  Set-Item -Path Env:MINOR_VERSION -Value '1'
> >  Set-Item -Path Env:MICRO_VERSION -Value '0'
> >
> > -Build "x86" $Type
> > -Build "x64" $Type
> > +if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
> > +	Build "x86" $Type
> > +}
> > +
> > +if ($Arch -eq "" -or $Arch -eq "x64") {
> > +	Build "x64" $Type
> > +}
> >
> >  if ($Sdv) {
> >  	SdvBuild
> > --
> > 2.25.4
> >




From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 09:06:06 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 09:06:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22215.48485 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc37m-0006o4-SZ; Mon, 09 Nov 2020 09:06:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22215.48485; Mon, 09 Nov 2020 09:06:06 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc37m-0006nx-PY; Mon, 09 Nov 2020 09:06:06 +0000
Received: by outflank-mailman (input) for mailman id 22215;
 Mon, 09 Nov 2020 09:06:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rjml=EP=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kc37l-0006ns-E2
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 09:06:05 +0000
Received: from mail-wm1-x334.google.com (unknown [2a00:1450:4864:20::334])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cdce5323-0f58-49c5-882f-e1a28322d63d;
 Mon, 09 Nov 2020 09:06:04 +0000 (UTC)
Received: by mail-wm1-x334.google.com with SMTP id h62so7192385wme.3
 for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 01:06:04 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id l24sm1260000wmi.7.2020.11.09.01.06.02
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 09 Nov 2020 01:06:03 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Rjml=EP=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kc37l-0006ns-E2
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 09:06:05 +0000
X-Inumbo-ID: cdce5323-0f58-49c5-882f-e1a28322d63d
Received: from mail-wm1-x334.google.com (unknown [2a00:1450:4864:20::334])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cdce5323-0f58-49c5-882f-e1a28322d63d;
	Mon, 09 Nov 2020 09:06:04 +0000 (UTC)
Received: by mail-wm1-x334.google.com with SMTP id h62so7192385wme.3
        for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 01:06:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=zchXSdp+ZOHLaE02aTd2Y0Q36zd2D8g61GhSt4gZTmQ=;
        b=Gcj8ATL1/lvcHyaprbkF6eqRZM4k9SyAhHKi555mwiWezBZkbttM4lihI5zdH4Z973
         logzXnJiMeVkHt7sIor66p4L7XGzYBDkueIfgwWsWZo2bEKrguSGAVl6ogACptSWdhB6
         AQ2zPu+iHsPqyoEdE3vqCJAnHzK9uYPBhiz3bZkXyhx5E+G98cG4fl8ljoxNJnq2W5i8
         LyNfXXS94itkIpijgvaG8vSdEeidjR/O5gjbJx74XM+reUA6Fj1PLSYQZDm5f+27/6pG
         cgZtCrT10CXk9cU7zpsVwiVUaUqcBJnoJDEHjKQ7CWukcxzQzFn0p4t3zRnuRLQcC5z9
         gMzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=zchXSdp+ZOHLaE02aTd2Y0Q36zd2D8g61GhSt4gZTmQ=;
        b=NU58t7E3zdaIiFUNjZUVJGv1vhci4CqXy+n6yHZ8wiQlrA+N6SKBHZb/tRXW8fwl5G
         F8f7zBezcsZq+bNeUNjkfNahznWbjVF9oO/FUVY4s1uFwHARbvTaTZ3bsBEBepPYfOLk
         wTMJPupj/HyRrnX2jiqQKdVEdeOO4S/QdeywR109vkep4UvFbU/E8TBDTe6cZogcuP/q
         avANuS0mveTlSds7ACAC8La5umA/i5KRw71Jzvb41tcSRuUo87fhAMclPN4bItTR+Pk8
         iu+BKQuj9NRJMjc3ke+1nq/VmnT6Z8ocVNc8mQgvhZ+JkCJcNruDczktMThGzUUsGwdV
         BsGA==
X-Gm-Message-State: AOAM531SsjsG0kQAG9pFKjfMd2uRAei3a/ZcxeS4VLhNZ2oAUbwevaey
	pDniKAXRLp0A3CF3wCbBmEs=
X-Google-Smtp-Source: ABdhPJxMbd82KQw6t/lmAF5HxUKmeRY+VZXnrH7fYCBPeNHv/6Sch7KEUTs2MKO3g2OmlAYki+LOfw==
X-Received: by 2002:a05:600c:288:: with SMTP id 8mr13378583wmk.106.1604912763650;
        Mon, 09 Nov 2020 01:06:03 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-227.amazon.com. [54.240.197.227])
        by smtp.gmail.com with ESMTPSA id l24sm1260000wmi.7.2020.11.09.01.06.02
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 09 Nov 2020 01:06:03 -0800 (PST)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Owen Smith'" <owen.smith@citrix.com>,
	"'Nicholas Tsirakis'" <niko.tsirakis@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: "'Ben Chalmers'" <ben.chalmers@citrix.com>,
	"'Nicholas Tsirakis'" <tsirakisn@ainfosec.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com> <ffc1f0918fcf59fdf6714aec1f62403a8391dcd6.1604689382.git.tsirakisn@ainfosec.com> <BYAPR03MB4551B4DEFB9C2AA18E882667FEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
In-Reply-To: <BYAPR03MB4551B4DEFB9C2AA18E882667FEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
Subject: RE: [PATCH 2/2] Inherit versioning info from environment if present
Date: Mon, 9 Nov 2020 09:06:02 -0000
Message-ID: <005e01d6b677$8c99ee30$a5cdca90$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQI/RIkef6OMRpKkPO4DwuXKMajMtwHiVDhWAuuzY+uox/WkoA==
Content-Language: en-gb

> -----Original Message-----
> From: Owen Smith <owen.smith@citrix.com>
> Sent: 09 November 2020 08:11
> To: Nicholas Tsirakis <niko.tsirakis@gmail.com>; win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> Subject: RE: [PATCH 2/2] Inherit versioning info from environment if present
> 
> I'm currently looking at carrying the exact same changes in my patch queue, so that the patch queue
> version can be used. In my case, I have no intentions of changing the Major or Minor versions (for
> consistency)
> 
> Acked-by: Owen Smith <owen.smith@citrix.com>
> 
> > -----Original Message-----
> > From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> > Sent: 06 November 2020 20:49
> > To: win-pv-devel@lists.xenproject.org
> > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> > <owen.smith@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > Subject: [PATCH 2/2] Inherit versioning info from environment if present
> >
> > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> > unless you have verified the sender and know the content is safe.
> >
> > As the drivers stabilize and mature, there is an ever-growing chance that other
> > opensource virtualization projects will adopt them. Allow external projects to
> > inject their own versioning into the drivers instead of hardcoding the latest
> > winpv version.
> >
> > Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>

Also...

Acked-by: Paul Durrant <paul@xen.org>

> > ---
> >  build.ps1 | 14 +++++++++++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> >
> > diff --git a/build.ps1 b/build.ps1
> > index 06626fd..b7b015f 100644
> > --- a/build.ps1
> > +++ b/build.ps1
> > @@ -79,9 +79,17 @@ if ([string]::IsNullOrEmpty($Env:BUILD_NUMBER)) {
> >  	Set-Item -Path Env:BUILD_NUMBER -Value $BuildNum  }
> >
> > -Set-Item -Path Env:MAJOR_VERSION -Value '9'
> > -Set-Item -Path Env:MINOR_VERSION -Value '1'
> > -Set-Item -Path Env:MICRO_VERSION -Value '0'
> > +if ([string]::IsNullOrEmpty($Env:MAJOR_VERSION)) {
> > +	Set-Item -Path Env:MAJOR_VERSION -Value '9'
> > +}
> > +
> > +if ([string]::IsNullOrEmpty($Env:MINOR_VERSION)) {
> > +	Set-Item -Path Env:MINOR_VERSION -Value '1'
> > +}
> > +
> > +if ([string]::IsNullOrEmpty($Env:MICRO_VERSION)) {
> > +	Set-Item -Path Env:MICRO_VERSION -Value '0'
> > +}
> >
> >  if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
> >  	Build "x86" $Type
> > --
> > 2.25.4
> >




From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 12:31:54 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 12:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22456.48759 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc6Kv-0002D5-9A; Mon, 09 Nov 2020 12:31:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22456.48759; Mon, 09 Nov 2020 12:31:53 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc6Kv-0002Cy-6H; Mon, 09 Nov 2020 12:31:53 +0000
Received: by outflank-mailman (input) for mailman id 22456;
 Mon, 09 Nov 2020 12:31:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rjml=EP=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kc6Ku-0002Ct-2G
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 12:31:52 +0000
Received: from mail-wr1-x42e.google.com (unknown [2a00:1450:4864:20::42e])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d987de91-31f9-4d67-82e8-242ea8419d19;
 Mon, 09 Nov 2020 12:31:51 +0000 (UTC)
Received: by mail-wr1-x42e.google.com with SMTP id 23so8486864wrc.8
 for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 04:31:51 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-227.amazon.com. [54.240.197.227])
 by smtp.gmail.com with ESMTPSA id c6sm10109839wrh.74.2020.11.09.04.31.49
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 09 Nov 2020 04:31:49 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Rjml=EP=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kc6Ku-0002Ct-2G
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 12:31:52 +0000
X-Inumbo-ID: d987de91-31f9-4d67-82e8-242ea8419d19
Received: from mail-wr1-x42e.google.com (unknown [2a00:1450:4864:20::42e])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d987de91-31f9-4d67-82e8-242ea8419d19;
	Mon, 09 Nov 2020 12:31:51 +0000 (UTC)
Received: by mail-wr1-x42e.google.com with SMTP id 23so8486864wrc.8
        for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 04:31:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=dCEMxVzlBZ4IHi2586rukeYOBnZVxTZj59AnBLkNFxg=;
        b=jslErGoC7+ABC/Zdin4Qi0tHhKQGqyQ1Uxn94el1U7/cdOuaeTlSROcVZqPBfbkaKn
         sDYP2cThmfaAGjXFCzMfc09CrEUzIX/qk5evacSnMBekJr3zxpSKLXCG+CciOLYmosGB
         HVL5N4atqubJtOTxQX0qxYWjrZDaZjUqspSnUYEqr9xeHl9cv6PxkXbnYHla4LrTzVPL
         zG7KCqHcbVN2YLUjk/jyItOhcls04saO/5wk5VXt6i4+R08A4rgFxJ2vUGIBWq99oXM0
         D6YN28NF05OSq633/45thkWuW6328cK3/HHzLBGA+oKQYvk9ULtMkd8X+2HxGB59ez02
         j8zQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=dCEMxVzlBZ4IHi2586rukeYOBnZVxTZj59AnBLkNFxg=;
        b=Ae2/SDTyojE6XMgfipyCplW+nughuu83AkX/tyi7klysYSe7jCiuxkCwKRtEKygWsF
         u86uFPitmJnz7jweTKAvvxk6gfj3t11J0Ps+RNZnQHuzXi4ItY7XdKDGb2DcwVwhVYpU
         hTD/1CXDyuFJAipHgfmoQyiSDmbqTAaiUEIbvKOL2F89qDTOfQvtGwHwscIAyPasE+3Y
         6tiVCoCCE/ctKRax6GyLde6dcptww7KrmfeHgAcfKQL+idB9VBxQs7Shd5kh+L0fU6tE
         QHtPVq9QXePiIQ+K7ckACWauGnqXGGrBqz2AYJYrXPHnykGSeGVxwIiWX8genYqCPYLP
         zdZQ==
X-Gm-Message-State: AOAM531AOxnmWHe14nxNgR7RhKfqq0al4HeILOwTqRewjA4oatqrkCSt
	7uJ8ktdxz4kdBHljiekQ+TE=
X-Google-Smtp-Source: ABdhPJyOYBhZc6pX/y1co5v5Ec33V8G/bHooOTomtK2f/Kb1RsZNsr5UYxI1N5k1viVqS/trmidlYQ==
X-Received: by 2002:a5d:68cb:: with SMTP id p11mr8733563wrw.89.1604925110359;
        Mon, 09 Nov 2020 04:31:50 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-227.amazon.com. [54.240.197.227])
        by smtp.gmail.com with ESMTPSA id c6sm10109839wrh.74.2020.11.09.04.31.49
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 09 Nov 2020 04:31:49 -0800 (PST)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: <paul@xen.org>,
	"'Owen Smith'" <owen.smith@citrix.com>,
	"'Nicholas Tsirakis'" <niko.tsirakis@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: "'Ben Chalmers'" <ben.chalmers@citrix.com>,
	"'Nicholas Tsirakis'" <tsirakisn@ainfosec.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com> <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com> <005d01d6b677$7feed3d0$7fcc7b70$@xen.org>
In-Reply-To: <005d01d6b677$7feed3d0$7fcc7b70$@xen.org>
Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
Date: Mon, 9 Nov 2020 12:31:48 -0000
Message-ID: <006d01d6b694$4bcd2940$e3677bc0$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQI/RIkef6OMRpKkPO4DwuXKMajMtwHiVPV9AaVc1K+o0mDWwA==
Content-Language: en-gb

> -----Original Message-----
> From: Paul Durrant <xadimgnik@gmail.com>
> Sent: 09 November 2020 09:06
> To: 'Owen Smith' <owen.smith@citrix.com>; 'Nicholas Tsirakis' <niko.tsirakis@gmail.com>; win-pv-
> devel@lists.xenproject.org
> Cc: 'Ben Chalmers' <ben.chalmers@citrix.com>; 'Nicholas Tsirakis' <tsirakisn@ainfosec.com>
> Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
> 
> > -----Original Message-----
> > From: Owen Smith <owen.smith@citrix.com>
> > Sent: 09 November 2020 08:08
> > To: Nicholas Tsirakis <niko.tsirakis@gmail.com>; win-pv-devel@lists.xenproject.org
> > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
> >
> 
> Let's try to avoid top-posting :-)
> 
> > I would suggest using
> > [string]::IsNullOrEmpty($Arch)
> > Instead of
> > $Arch -eq ""
> >
> 
> Agreed. I can make the change while committing so no need for a v2.
> 
> Acked-by: Paul Durrant <paul@xen.org>

Actually, I jumped the gun here. Having started to apply this I realize it's not going to work because of the optional '$Sdv'
parameter after it. IOW how do we do a default (IOW both x86 and x64) build with the sdv option?

  Paul

> 
> > Owen
> >
> > > -----Original Message-----
> > > From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> > > Sent: 06 November 2020 20:49
> > > To: win-pv-devel@lists.xenproject.org
> > > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> > > <owen.smith@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > > Subject: [PATCH 1/2] Allow user to specify desired build architecture
> > >
> > > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> > > unless you have verified the sender and know the content is safe.
> > >
> > > Often times we only need to build a driver for a single targeted architecture.
> > > Continue to build both by default, but allow the user to specify one if desired.
> > >
> > > Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > > ---
> > >  build.ps1 | 10 ++++++++--
> > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/build.ps1 b/build.ps1
> > > index c66ac05..06626fd 100644
> > > --- a/build.ps1
> > > +++ b/build.ps1
> > > @@ -5,6 +5,7 @@
> > >  param(
> > >  	[Parameter(Mandatory = $true)]
> > >  	[string]$Type,
> > > +	[string]$Arch,
> > >  	[switch]$Sdv
> > >  )
> > >
> > > @@ -82,8 +83,13 @@ Set-Item -Path Env:MAJOR_VERSION -Value '9'
> > >  Set-Item -Path Env:MINOR_VERSION -Value '1'
> > >  Set-Item -Path Env:MICRO_VERSION -Value '0'
> > >
> > > -Build "x86" $Type
> > > -Build "x64" $Type
> > > +if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
> > > +	Build "x86" $Type
> > > +}
> > > +
> > > +if ($Arch -eq "" -or $Arch -eq "x64") {
> > > +	Build "x64" $Type
> > > +}
> > >
> > >  if ($Sdv) {
> > >  	SdvBuild
> > > --
> > > 2.25.4
> > >
> 




From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 16:19:32 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 16:19:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22705.49096 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc9tC-0007cd-3k; Mon, 09 Nov 2020 16:19:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22705.49096; Mon, 09 Nov 2020 16:19:30 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc9tC-0007cW-0m; Mon, 09 Nov 2020 16:19:30 +0000
Received: by outflank-mailman (input) for mailman id 22705;
 Mon, 09 Nov 2020 16:19:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Zrvl=EP=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
 id 1kc9tA-0007cR-IE
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 16:19:28 +0000
Received: from mail-oo1-xc44.google.com (unknown [2607:f8b0:4864:20::c44])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2b57825-8867-4814-a2e3-a9552b5644c9;
 Mon, 09 Nov 2020 16:19:27 +0000 (UTC)
Received: by mail-oo1-xc44.google.com with SMTP id j41so2327487oof.12
 for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 08:19:27 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Zrvl=EP=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
	id 1kc9tA-0007cR-IE
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 16:19:28 +0000
X-Inumbo-ID: a2b57825-8867-4814-a2e3-a9552b5644c9
Received: from mail-oo1-xc44.google.com (unknown [2607:f8b0:4864:20::c44])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2b57825-8867-4814-a2e3-a9552b5644c9;
	Mon, 09 Nov 2020 16:19:27 +0000 (UTC)
Received: by mail-oo1-xc44.google.com with SMTP id j41so2327487oof.12
        for <win-pv-devel@lists.xenproject.org>; Mon, 09 Nov 2020 08:19:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=D9GXiFhIvn6JAr0LkZpfVCxSoZNsU+APMao3htHFDc4=;
        b=Omw61kTKuF1DBASR62ABO7872BCtZREpew8yop4NOTVt4RbOOKwh1TCmWcn49OrSOR
         Z5XOiUlSjRcBmhDfClNk/PRVmPvWLPsceBfV9NsDufh9ofN4B8KpWTcx5jR454pdUz6u
         ApyBG7Xh51ZhvLzFaDJ6vEv7BjKRBUH4c3KF/cY8uYk+8N/cP2p/q+pwLyzYMFs6Oiu6
         wXYjIIUsli+HcGmckElZdPxFa1LxgI8RNTTiPPIwWybN3xyaD8qi+z8kzJYeJdKVstt2
         BjFrs3fhXjQ2AE6FsXYu283HjsMSZuAYvCPoxSD4tU3dkzA7rRRj3Xs8H8Yy1nb1PoKj
         G+fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=D9GXiFhIvn6JAr0LkZpfVCxSoZNsU+APMao3htHFDc4=;
        b=Fw2LMaSMf5GDzUhdsqUPKi1Hu4mwVQ5NE5GKEMah/Kmm46BLp2FTRWm9AmcT0Hg6xA
         ueF/PGMKOzrD+PIMpal1PyC+bEF7ASnutjY2DSVyZCNo/J4uS/ZTvh/RpcueVpHizbXL
         9SlaVbs1K6LepQ5J6XSrZvfndbfYGknaNL2mAkkyUOiDBrTrG8QX56iT1lrrgLfwBSme
         8xE91qaJC5aRIT/7yuOL4bL3aA58YcitCEKrx/L/77/24pf8IYRG4ggIG9mSqDUZsnSR
         EXQDwKmLPfaGEaAnCgSTs83WUROy+ZBHofVGHfYJVQhbBAq02Hklx6IC1FlYHVMreuqr
         LylA==
X-Gm-Message-State: AOAM531K6gwQYvUC6ViJXNVIHrAHsTolilRIZSzP1Ox78Oy3djLWmqxa
	YcpYDw/kgMG3gN9jzgZH9LDB4J3HnMCAfcfl4AQ=
X-Google-Smtp-Source: ABdhPJxpc4KpF/GXY/vFbwc/wMwNknQAZ7r7Cq23/GKY9dB8tGlxSHqgKs4vuX53wGHXhaOeL+k27CZ5hzCA4rUJNHI=
X-Received: by 2002:a4a:8519:: with SMTP id k25mr10574832ooh.32.1604938767111;
 Mon, 09 Nov 2020 08:19:27 -0800 (PST)
MIME-Version: 1.0
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
 <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
 <005d01d6b677$7feed3d0$7fcc7b70$@xen.org> <006d01d6b694$4bcd2940$e3677bc0$@xen.org>
In-Reply-To: <006d01d6b694$4bcd2940$e3677bc0$@xen.org>
From: Niko Tsirakis <niko.tsirakis@gmail.com>
Date: Mon, 9 Nov 2020 11:19:16 -0500
Message-ID: <CAFqpmVLWJa95CHswy0PrNukjbTViFjxescrCvTJQKn2Bcgr-RQ@mail.gmail.com>
Subject: Re: [PATCH 1/2] Allow user to specify desired build architecture
To: paul@xen.org
Cc: Owen Smith <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org, 
	Ben Chalmers <ben.chalmers@citrix.com>, Nicholas Tsirakis <tsirakisn@ainfosec.com>
Content-Type: text/plain; charset="UTF-8"

On Mon, Nov 9, 2020 at 7:31 AM Paul Durrant <xadimgnik@gmail.com> wrote:
>
> > -----Original Message-----
> > From: Paul Durrant <xadimgnik@gmail.com>
> > Sent: 09 November 2020 09:06
> > To: 'Owen Smith' <owen.smith@citrix.com>; 'Nicholas Tsirakis' <niko.tsirakis@gmail.com>; win-pv-
> > devel@lists.xenproject.org
> > Cc: 'Ben Chalmers' <ben.chalmers@citrix.com>; 'Nicholas Tsirakis' <tsirakisn@ainfosec.com>
> > Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
> >
> > > -----Original Message-----
> > > From: Owen Smith <owen.smith@citrix.com>
> > > Sent: 09 November 2020 08:08
> > > To: Nicholas Tsirakis <niko.tsirakis@gmail.com>; win-pv-devel@lists.xenproject.org
> > > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > > Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
> > >
> >
> > Let's try to avoid top-posting :-)
> >
> > > I would suggest using
> > > [string]::IsNullOrEmpty($Arch)
> > > Instead of
> > > $Arch -eq ""
> > >
> >
> > Agreed. I can make the change while committing so no need for a v2.
> >
> > Acked-by: Paul Durrant <paul@xen.org>
>
> Actually, I jumped the gun here. Having started to apply this I realize it's not going to work because of the optional '$Sdv'
> parameter after it. IOW how do we do a default (IOW both x86 and x64) build with the sdv option?
>
>   Paul
>

Admittedly my powershell isn't too strong, but wouldn't ".\build.ps1
<free/checked> -sdv" do the trick? The SDV param is a switch.

--Niko

> >
> > > Owen
> > >
> > > > -----Original Message-----
> > > > From: Nicholas Tsirakis <niko.tsirakis@gmail.com>
> > > > Sent: 06 November 2020 20:49
> > > > To: win-pv-devel@lists.xenproject.org
> > > > Cc: paul@xen.org; Ben Chalmers <ben.chalmers@citrix.com>; Owen Smith
> > > > <owen.smith@citrix.com>; Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > > > Subject: [PATCH 1/2] Allow user to specify desired build architecture
> > > >
> > > > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> > > > unless you have verified the sender and know the content is safe.
> > > >
> > > > Often times we only need to build a driver for a single targeted architecture.
> > > > Continue to build both by default, but allow the user to specify one if desired.
> > > >
> > > > Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
> > > > ---
> > > >  build.ps1 | 10 ++++++++--
> > > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/build.ps1 b/build.ps1
> > > > index c66ac05..06626fd 100644
> > > > --- a/build.ps1
> > > > +++ b/build.ps1
> > > > @@ -5,6 +5,7 @@
> > > >  param(
> > > >   [Parameter(Mandatory = $true)]
> > > >   [string]$Type,
> > > > + [string]$Arch,
> > > >   [switch]$Sdv
> > > >  )
> > > >
> > > > @@ -82,8 +83,13 @@ Set-Item -Path Env:MAJOR_VERSION -Value '9'
> > > >  Set-Item -Path Env:MINOR_VERSION -Value '1'
> > > >  Set-Item -Path Env:MICRO_VERSION -Value '0'
> > > >
> > > > -Build "x86" $Type
> > > > -Build "x64" $Type
> > > > +if ($Arch -eq "" -or $Arch -eq "x86" -or $Arch -eq "Win32") {
> > > > + Build "x86" $Type
> > > > +}
> > > > +
> > > > +if ($Arch -eq "" -or $Arch -eq "x64") {
> > > > + Build "x64" $Type
> > > > +}
> > > >
> > > >  if ($Sdv) {
> > > >   SdvBuild
> > > > --
> > > > 2.25.4
> > > >
> >
>
>


From win-pv-devel-bounces@lists.xenproject.org Mon Nov 09 16:25:14 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 09 Nov 2020 16:25:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.22711.49100 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc9yj-0008PU-IG; Mon, 09 Nov 2020 16:25:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 22711.49100; Mon, 09 Nov 2020 16:25:13 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kc9yj-0008PN-FW; Mon, 09 Nov 2020 16:25:13 +0000
Received: by outflank-mailman (input) for mailman id 22711;
 Mon, 09 Nov 2020 16:25:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=D2bs=EP=amazon.co.uk=prvs=575a90100=pdurrant@srs-us1.protection.inumbo.net>)
 id 1kc9yh-0008PI-Md
 for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 16:25:11 +0000
Received: from smtp-fw-6001.amazon.com (unknown [52.95.48.154])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b81a27d3-787a-42f3-94a9-e4909758cc60;
 Mon, 09 Nov 2020 16:25:10 +0000 (UTC)
Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO
 email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com) ([10.43.8.6])
 by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP;
 09 Nov 2020 16:25:03 +0000
Received: from EX13D32EUB003.ant.amazon.com
 (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198])
 by email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com (Postfix) with ESMTPS
 id 99468A17C7; Mon,  9 Nov 2020 16:25:02 +0000 (UTC)
Received: from EX13D32EUB003.ant.amazon.com (10.43.166.165) by
 EX13D32EUB003.ant.amazon.com (10.43.166.165) with Microsoft SMTP Server (TLS)
 id 15.0.1497.2; Mon, 9 Nov 2020 16:25:00 +0000
Received: from EX13D32EUB003.ant.amazon.com ([10.43.166.165]) by
 EX13D32EUB003.ant.amazon.com ([10.43.166.165]) with mapi id 15.00.1497.006;
 Mon, 9 Nov 2020 16:25:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=D2bs=EP=amazon.co.uk=prvs=575a90100=pdurrant@srs-us1.protection.inumbo.net>)
	id 1kc9yh-0008PI-Md
	for win-pv-devel@lists.xenproject.org; Mon, 09 Nov 2020 16:25:11 +0000
X-Inumbo-ID: b81a27d3-787a-42f3-94a9-e4909758cc60
Received: from smtp-fw-6001.amazon.com (unknown [52.95.48.154])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b81a27d3-787a-42f3-94a9-e4909758cc60;
	Mon, 09 Nov 2020 16:25:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=amazon.co.uk; i=@amazon.co.uk; q=dns/txt;
  s=amazon201209; t=1604939110; x=1636475110;
  h=from:to:cc:date:message-id:references:in-reply-to:
   content-transfer-encoding:mime-version:subject;
  bh=WG86Jkt6Tq8hLa0SDicWalIDQW6wNrPkO+9vBVQFCHc=;
  b=cieseOCU5bIutJjikBFQY4d0L0sqmfKdY/KIrUdF8oW7WREZWOZIui7Z
   eswBew25pxT8hDZJNr7g3ku8a59VtdfvdYA1jkHVmPhN0joy+0nBUMC7s
   3BV1D9iRMzLHtAAsvl1sYrzZ2xRhvakDgrxD/LZiMNEAwzrIVgfWRP71B
   g=;
X-IronPort-AV: E=Sophos;i="5.77,463,1596499200"; 
   d="scan'208";a="65559136"
Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
Thread-Topic: [PATCH 1/2] Allow user to specify desired build architecture
Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com) ([10.43.8.6])
  by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 09 Nov 2020 16:25:03 +0000
Received: from EX13D32EUB003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198])
	by email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com (Postfix) with ESMTPS id 99468A17C7;
	Mon,  9 Nov 2020 16:25:02 +0000 (UTC)
Received: from EX13D32EUB003.ant.amazon.com (10.43.166.165) by
 EX13D32EUB003.ant.amazon.com (10.43.166.165) with Microsoft SMTP Server (TLS)
 id 15.0.1497.2; Mon, 9 Nov 2020 16:25:00 +0000
Received: from EX13D32EUB003.ant.amazon.com ([10.43.166.165]) by
 EX13D32EUB003.ant.amazon.com ([10.43.166.165]) with mapi id 15.00.1497.006;
 Mon, 9 Nov 2020 16:25:00 +0000
From: "Durrant, Paul" <pdurrant@amazon.co.uk>
To: Niko Tsirakis <niko.tsirakis@gmail.com>, "paul@xen.org" <paul@xen.org>
CC: Owen Smith <owen.smith@citrix.com>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>, Ben Chalmers <ben.chalmers@citrix.com>,
	Nicholas Tsirakis <tsirakisn@ainfosec.com>
Thread-Index: AQHWtH5BJf25pae+0UWo81C4mchDeam/dNoQgAARJwCAADmYAIAAP40AgAABLSA=
Date: Mon, 9 Nov 2020 16:25:00 +0000
Message-ID: <8b4ae4a1912544b791dbfd62e2b2f0c7@EX13D32EUB003.ant.amazon.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
 <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
 <005d01d6b677$7feed3d0$7fcc7b70$@xen.org>
 <006d01d6b694$4bcd2940$e3677bc0$@xen.org>
 <CAFqpmVLWJa95CHswy0PrNukjbTViFjxescrCvTJQKn2Bcgr-RQ@mail.gmail.com>
In-Reply-To: <CAFqpmVLWJa95CHswy0PrNukjbTViFjxescrCvTJQKn2Bcgr-RQ@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.43.166.231]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiB3aW4tcHYtZGV2ZWwgPHdpbi1w
di1kZXZlbC1ib3VuY2VzQGxpc3RzLnhlbnByb2plY3Qub3JnPiBPbiBCZWhhbGYgT2YgTmlrbyBU
c2lyYWtpcw0KPiBTZW50OiAwOSBOb3ZlbWJlciAyMDIwIDE2OjE5DQo+IFRvOiBwYXVsQHhlbi5v
cmcNCj4gQ2M6IE93ZW4gU21pdGggPG93ZW4uc21pdGhAY2l0cml4LmNvbT47IHdpbi1wdi1kZXZl
bEBsaXN0cy54ZW5wcm9qZWN0Lm9yZzsgQmVuIENoYWxtZXJzDQo+IDxiZW4uY2hhbG1lcnNAY2l0
cml4LmNvbT47IE5pY2hvbGFzIFRzaXJha2lzIDx0c2lyYWtpc25AYWluZm9zZWMuY29tPg0KPiBT
dWJqZWN0OiBSRTogW0VYVEVSTkFMXSBbUEFUQ0ggMS8yXSBBbGxvdyB1c2VyIHRvIHNwZWNpZnkg
ZGVzaXJlZCBidWlsZCBhcmNoaXRlY3R1cmUNCj4gDQo+IENBVVRJT046IFRoaXMgZW1haWwgb3Jp
Z2luYXRlZCBmcm9tIG91dHNpZGUgb2YgdGhlIG9yZ2FuaXphdGlvbi4gRG8gbm90IGNsaWNrIGxp
bmtzIG9yIG9wZW4NCj4gYXR0YWNobWVudHMgdW5sZXNzIHlvdSBjYW4gY29uZmlybSB0aGUgc2Vu
ZGVyIGFuZCBrbm93IHRoZSBjb250ZW50IGlzIHNhZmUuDQo+IA0KPiANCj4gDQo+IE9uIE1vbiwg
Tm92IDksIDIwMjAgYXQgNzozMSBBTSBQYXVsIER1cnJhbnQgPHhhZGltZ25pa0BnbWFpbC5jb20+
IHdyb3RlOg0KPiA+DQo+ID4gPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiA+ID4gRnJv
bTogUGF1bCBEdXJyYW50IDx4YWRpbWduaWtAZ21haWwuY29tPg0KPiA+ID4gU2VudDogMDkgTm92
ZW1iZXIgMjAyMCAwOTowNg0KPiA+ID4gVG86ICdPd2VuIFNtaXRoJyA8b3dlbi5zbWl0aEBjaXRy
aXguY29tPjsgJ05pY2hvbGFzIFRzaXJha2lzJyA8bmlrby50c2lyYWtpc0BnbWFpbC5jb20+OyB3
aW4tcHYtDQo+ID4gPiBkZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZw0KPiA+ID4gQ2M6ICdCZW4g
Q2hhbG1lcnMnIDxiZW4uY2hhbG1lcnNAY2l0cml4LmNvbT47ICdOaWNob2xhcyBUc2lyYWtpcycg
PHRzaXJha2lzbkBhaW5mb3NlYy5jb20+DQo+ID4gPiBTdWJqZWN0OiBSRTogW1BBVENIIDEvMl0g
QWxsb3cgdXNlciB0byBzcGVjaWZ5IGRlc2lyZWQgYnVpbGQgYXJjaGl0ZWN0dXJlDQo+ID4gPg0K
PiA+ID4gPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiA+ID4gPiBGcm9tOiBPd2VuIFNt
aXRoIDxvd2VuLnNtaXRoQGNpdHJpeC5jb20+DQo+ID4gPiA+IFNlbnQ6IDA5IE5vdmVtYmVyIDIw
MjAgMDg6MDgNCj4gPiA+ID4gVG86IE5pY2hvbGFzIFRzaXJha2lzIDxuaWtvLnRzaXJha2lzQGdt
YWlsLmNvbT47IHdpbi1wdi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZw0KPiA+ID4gPiBDYzog
cGF1bEB4ZW4ub3JnOyBCZW4gQ2hhbG1lcnMgPGJlbi5jaGFsbWVyc0BjaXRyaXguY29tPjsgTmlj
aG9sYXMgVHNpcmFraXMNCj4gPHRzaXJha2lzbkBhaW5mb3NlYy5jb20+DQo+ID4gPiA+IFN1Ympl
Y3Q6IFJFOiBbUEFUQ0ggMS8yXSBBbGxvdyB1c2VyIHRvIHNwZWNpZnkgZGVzaXJlZCBidWlsZCBh
cmNoaXRlY3R1cmUNCj4gPiA+ID4NCj4gPiA+DQo+ID4gPiBMZXQncyB0cnkgdG8gYXZvaWQgdG9w
LXBvc3RpbmcgOi0pDQo+ID4gPg0KPiA+ID4gPiBJIHdvdWxkIHN1Z2dlc3QgdXNpbmcNCj4gPiA+
ID4gW3N0cmluZ106OklzTnVsbE9yRW1wdHkoJEFyY2gpDQo+ID4gPiA+IEluc3RlYWQgb2YNCj4g
PiA+ID4gJEFyY2ggLWVxICIiDQo+ID4gPiA+DQo+ID4gPg0KPiA+ID4gQWdyZWVkLiBJIGNhbiBt
YWtlIHRoZSBjaGFuZ2Ugd2hpbGUgY29tbWl0dGluZyBzbyBubyBuZWVkIGZvciBhIHYyLg0KPiA+
ID4NCj4gPiA+IEFja2VkLWJ5OiBQYXVsIER1cnJhbnQgPHBhdWxAeGVuLm9yZz4NCj4gPg0KPiA+
IEFjdHVhbGx5LCBJIGp1bXBlZCB0aGUgZ3VuIGhlcmUuIEhhdmluZyBzdGFydGVkIHRvIGFwcGx5
IHRoaXMgSSByZWFsaXplIGl0J3Mgbm90IGdvaW5nIHRvIHdvcmsNCj4gYmVjYXVzZSBvZiB0aGUg
b3B0aW9uYWwgJyRTZHYnDQo+ID4gcGFyYW1ldGVyIGFmdGVyIGl0LiBJT1cgaG93IGRvIHdlIGRv
IGEgZGVmYXVsdCAoSU9XIGJvdGggeDg2IGFuZCB4NjQpIGJ1aWxkIHdpdGggdGhlIHNkdiBvcHRp
b24/DQo+ID4NCj4gPiAgIFBhdWwNCj4gPg0KPiANCj4gQWRtaXR0ZWRseSBteSBwb3dlcnNoZWxs
IGlzbid0IHRvbyBzdHJvbmcsIGJ1dCB3b3VsZG4ndCAiLlxidWlsZC5wczENCj4gPGZyZWUvY2hl
Y2tlZD4gLXNkdiIgZG8gdGhlIHRyaWNrPyBUaGUgU0RWIHBhcmFtIGlzIGEgc3dpdGNoLg0KPiAN
Cg0KR29vZCBwb2ludC4uLiBtaXNyZWFkIGl0IChhbmQgSSdtIG5vdCBwYXJ0aWN1bGFybHkgYXUg
ZmFpdCB3aXRoIHBvd2Vyc2hlbGwgZWl0aGVyKS4gTGV0IG1lIGNoZWNrIGl0IHdvcmtzIHByb3Bl
cmx5LiBUaGFua3MhDQoNCiAgUGF1bA0KDQo+IC0tTmlrbw0KPiANCj4gPiA+DQo+ID4gPiA+IE93
ZW4NCj4gPiA+ID4NCj4gPiA+ID4gPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiA+ID4g
PiA+IEZyb206IE5pY2hvbGFzIFRzaXJha2lzIDxuaWtvLnRzaXJha2lzQGdtYWlsLmNvbT4NCj4g
PiA+ID4gPiBTZW50OiAwNiBOb3ZlbWJlciAyMDIwIDIwOjQ5DQo+ID4gPiA+ID4gVG86IHdpbi1w
di1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZw0KPiA+ID4gPiA+IENjOiBwYXVsQHhlbi5vcmc7
IEJlbiBDaGFsbWVycyA8YmVuLmNoYWxtZXJzQGNpdHJpeC5jb20+OyBPd2VuIFNtaXRoDQo+ID4g
PiA+ID4gPG93ZW4uc21pdGhAY2l0cml4LmNvbT47IE5pY2hvbGFzIFRzaXJha2lzIDx0c2lyYWtp
c25AYWluZm9zZWMuY29tPg0KPiA+ID4gPiA+IFN1YmplY3Q6IFtQQVRDSCAxLzJdIEFsbG93IHVz
ZXIgdG8gc3BlY2lmeSBkZXNpcmVkIGJ1aWxkIGFyY2hpdGVjdHVyZQ0KPiA+ID4gPiA+DQo+ID4g
PiA+ID4gW0NBVVRJT04gLSBFWFRFUk5BTCBFTUFJTF0gRE8gTk9UIHJlcGx5LCBjbGljayBsaW5r
cywgb3Igb3BlbiBhdHRhY2htZW50cw0KPiA+ID4gPiA+IHVubGVzcyB5b3UgaGF2ZSB2ZXJpZmll
ZCB0aGUgc2VuZGVyIGFuZCBrbm93IHRoZSBjb250ZW50IGlzIHNhZmUuDQo+ID4gPiA+ID4NCj4g
PiA+ID4gPiBPZnRlbiB0aW1lcyB3ZSBvbmx5IG5lZWQgdG8gYnVpbGQgYSBkcml2ZXIgZm9yIGEg
c2luZ2xlIHRhcmdldGVkIGFyY2hpdGVjdHVyZS4NCj4gPiA+ID4gPiBDb250aW51ZSB0byBidWls
ZCBib3RoIGJ5IGRlZmF1bHQsIGJ1dCBhbGxvdyB0aGUgdXNlciB0byBzcGVjaWZ5IG9uZSBpZiBk
ZXNpcmVkLg0KPiA+ID4gPiA+DQo+ID4gPiA+ID4gU2lnbmVkLW9mZi1ieTogTmljaG9sYXMgVHNp
cmFraXMgPHRzaXJha2lzbkBhaW5mb3NlYy5jb20+DQo+ID4gPiA+ID4gLS0tDQo+ID4gPiA+ID4g
IGJ1aWxkLnBzMSB8IDEwICsrKysrKysrLS0NCj4gPiA+ID4gPiAgMSBmaWxlIGNoYW5nZWQsIDgg
aW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkNCj4gPiA+ID4gPg0KPiA+ID4gPiA+IGRpZmYg
LS1naXQgYS9idWlsZC5wczEgYi9idWlsZC5wczENCj4gPiA+ID4gPiBpbmRleCBjNjZhYzA1Li4w
NjYyNmZkIDEwMDY0NA0KPiA+ID4gPiA+IC0tLSBhL2J1aWxkLnBzMQ0KPiA+ID4gPiA+ICsrKyBi
L2J1aWxkLnBzMQ0KPiA+ID4gPiA+IEBAIC01LDYgKzUsNyBAQA0KPiA+ID4gPiA+ICBwYXJhbSgN
Cj4gPiA+ID4gPiAgIFtQYXJhbWV0ZXIoTWFuZGF0b3J5ID0gJHRydWUpXQ0KPiA+ID4gPiA+ICAg
W3N0cmluZ10kVHlwZSwNCj4gPiA+ID4gPiArIFtzdHJpbmddJEFyY2gsDQo+ID4gPiA+ID4gICBb
c3dpdGNoXSRTZHYNCj4gPiA+ID4gPiAgKQ0KPiA+ID4gPiA+DQo+ID4gPiA+ID4gQEAgLTgyLDgg
KzgzLDEzIEBAIFNldC1JdGVtIC1QYXRoIEVudjpNQUpPUl9WRVJTSU9OIC1WYWx1ZSAnOScNCj4g
PiA+ID4gPiAgU2V0LUl0ZW0gLVBhdGggRW52Ok1JTk9SX1ZFUlNJT04gLVZhbHVlICcxJw0KPiA+
ID4gPiA+ICBTZXQtSXRlbSAtUGF0aCBFbnY6TUlDUk9fVkVSU0lPTiAtVmFsdWUgJzAnDQo+ID4g
PiA+ID4NCj4gPiA+ID4gPiAtQnVpbGQgIng4NiIgJFR5cGUNCj4gPiA+ID4gPiAtQnVpbGQgIng2
NCIgJFR5cGUNCj4gPiA+ID4gPiAraWYgKCRBcmNoIC1lcSAiIiAtb3IgJEFyY2ggLWVxICJ4ODYi
IC1vciAkQXJjaCAtZXEgIldpbjMyIikgew0KPiA+ID4gPiA+ICsgQnVpbGQgIng4NiIgJFR5cGUN
Cj4gPiA+ID4gPiArfQ0KPiA+ID4gPiA+ICsNCj4gPiA+ID4gPiAraWYgKCRBcmNoIC1lcSAiIiAt
b3IgJEFyY2ggLWVxICJ4NjQiKSB7DQo+ID4gPiA+ID4gKyBCdWlsZCAieDY0IiAkVHlwZQ0KPiA+
ID4gPiA+ICt9DQo+ID4gPiA+ID4NCj4gPiA+ID4gPiAgaWYgKCRTZHYpIHsNCj4gPiA+ID4gPiAg
IFNkdkJ1aWxkDQo+ID4gPiA+ID4gLS0NCj4gPiA+ID4gPiAyLjI1LjQNCj4gPiA+ID4gPg0KPiA+
ID4NCj4gPg0KPiA+DQoNCg==


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 09:22:31 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 09:22:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23109.49682 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcPrB-0004Go-JR; Tue, 10 Nov 2020 09:22:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23109.49682; Tue, 10 Nov 2020 09:22:29 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcPrB-0004Gh-Gd; Tue, 10 Nov 2020 09:22:29 +0000
Received: by outflank-mailman (input) for mailman id 23109;
 Tue, 10 Nov 2020 09:22:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BGQT=EQ=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kcPrA-0004Gc-HI
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 09:22:28 +0000
Received: from mail-wr1-x433.google.com (unknown [2a00:1450:4864:20::433])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eda7150f-9dd0-4645-813d-c71f35562064;
 Tue, 10 Nov 2020 09:22:27 +0000 (UTC)
Received: by mail-wr1-x433.google.com with SMTP id d12so10340443wrr.13
 for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 01:22:27 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id t23sm2294902wmn.4.2020.11.10.01.22.25
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 10 Nov 2020 01:22:25 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=BGQT=EQ=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kcPrA-0004Gc-HI
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 09:22:28 +0000
X-Inumbo-ID: eda7150f-9dd0-4645-813d-c71f35562064
Received: from mail-wr1-x433.google.com (unknown [2a00:1450:4864:20::433])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eda7150f-9dd0-4645-813d-c71f35562064;
	Tue, 10 Nov 2020 09:22:27 +0000 (UTC)
Received: by mail-wr1-x433.google.com with SMTP id d12so10340443wrr.13
        for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 01:22:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=PU4jt5AgZklDL0P5G0PXRSe8MGZOnxL5vx/S9wMPTWg=;
        b=qlIiVzsk2jHOGchMW19pNNBnAtTJDCokDF4xyqcP//FMbummzS6RHiKTQTRPgPQ00S
         lE2UKkwwhn4OLnebTGaEI795Rdj9PEQIrYKl9bYbseBxqfH5hDKGI42pR7UT1c6/Ct4P
         wGP1hxosAQc6m+bcgFozRo+LnB62RvlSo1RrCgH2eF2rZFK0tp5FDbT1AWk8pML25rwK
         jb8P0vcK1u+KvzE/DgnMIknfpcfg4hN4dxU5rJBXdU8NeeRwP9HbYLAUod1T7aiVYtId
         0WPI4+wLAry8Em+UJL6KfkqGxiqdajZL0jxEL2vvgDSASLFuzVJXzaYoWNfxutFXVBfL
         fePw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=PU4jt5AgZklDL0P5G0PXRSe8MGZOnxL5vx/S9wMPTWg=;
        b=Hzp7kP+gqisJHMSjo+e+nN+7r1uwJZARujhadQf8Iqqg/kjUX7FgL66TyYe0YmgvcA
         gf/VlMgTP61sbJBPHpZijklcYD84CsAxEBAZ8gYMeLcc32uzMBNsCO1a3PGMIo2a7M+2
         1Nr2PapMoL/BskBFzsglO6dejqbk3o63kK2IBIN0Z/deGtbnc1e/CIijQOjU2lAdOLcZ
         cchbU7lpLp6MYwlwFf9gHSJTeRHw0aiyGEnnsYTaym+0tr5ITW6iuX3dBZOYHPkQvs47
         x9Ilvqh0l270NXn+abMpZenYfob05yHyx5xnB80seQaPw0PnKWZP4rB7opZCslfCdS4X
         LybA==
X-Gm-Message-State: AOAM5337jjCJPZM5QQ26keLctMyJmBP6v3LBz4tzAT2x/Ic+7OiWFPZB
	ai9GidBgb9yKaCOnsr/8F7Q=
X-Google-Smtp-Source: ABdhPJxaNFVVwQ5OkY90fCr/PEezaG3dV5nZNlzlrsEBMGGmOApnvAyH+4YcKKw77SGH7H63m2HHcA==
X-Received: by 2002:adf:80c8:: with SMTP id 66mr22933410wrl.415.1605000146702;
        Tue, 10 Nov 2020 01:22:26 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
        by smtp.gmail.com with ESMTPSA id t23sm2294902wmn.4.2020.11.10.01.22.25
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 10 Nov 2020 01:22:25 -0800 (PST)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Durrant, Paul'" <pdurrant@amazon.co.uk>,
	"'Niko Tsirakis'" <niko.tsirakis@gmail.com>
Cc: "'Owen Smith'" <owen.smith@citrix.com>,
	<win-pv-devel@lists.xenproject.org>,
	"'Ben Chalmers'" <ben.chalmers@citrix.com>,
	"'Nicholas Tsirakis'" <tsirakisn@ainfosec.com>
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com> <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com> <005d01d6b677$7feed3d0$7fcc7b70$@xen.org> <006d01d6b694$4bcd2940$e3677bc0$@xen.org> <CAFqpmVLWJa95CHswy0PrNukjbTViFjxescrCvTJQKn2Bcgr-RQ@mail.gmail.com> <8b4ae4a1912544b791dbfd62e2b2f0c7@EX13D32EUB003.ant.amazon.com>
In-Reply-To: <8b4ae4a1912544b791dbfd62e2b2f0c7@EX13D32EUB003.ant.amazon.com>
Subject: RE: [PATCH 1/2] Allow user to specify desired build architecture
Date: Tue, 10 Nov 2020 09:22:24 -0000
Message-ID: <00bd01d6b743$00df62e0$029e28a0$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQI/RIkef6OMRpKkPO4DwuXKMajMtwHiVPV9AaVc1K8CM30ligKSt3IJASJ7XDCopHmckA==
Content-Language: en-gb

[snip]
> > > >
> > > > > I would suggest using
> > > > > [string]::IsNullOrEmpty($Arch)
> > > > > Instead of
> > > > > $Arch -eq ""
> > > > >
> > > >
> > > > Agreed. I can make the change while committing so no need for a v2.
> > > >
> > > > Acked-by: Paul Durrant <paul@xen.org>
> > >
> > > Actually, I jumped the gun here. Having started to apply this I realize it's not going to work
> > because of the optional '$Sdv'
> > > parameter after it. IOW how do we do a default (IOW both x86 and x64) build with the sdv option?
> > >
> > >   Paul
> > >
> >
> > Admittedly my powershell isn't too strong, but wouldn't ".\build.ps1
> > <free/checked> -sdv" do the trick? The SDV param is a switch.
> >
> 
> Good point... misread it (and I'm not particularly au fait with powershell either). Let me check it
> works properly. Thanks!
> 

All good. I'll apply these changes for all drivers.

  Paul



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 11:59:33 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 11:59:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23305.49974 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcSJ8-0002eR-S3; Tue, 10 Nov 2020 11:59:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23305.49974; Tue, 10 Nov 2020 11:59:30 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcSJ8-0002eK-PL; Tue, 10 Nov 2020 11:59:30 +0000
Received: by outflank-mailman (input) for mailman id 23305;
 Tue, 10 Nov 2020 11:59:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BGQT=EQ=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
 id 1kcSJ7-0002eF-PW
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 11:59:29 +0000
Received: from mail-wm1-x329.google.com (unknown [2a00:1450:4864:20::329])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d6a6c239-424d-4d8c-a4f0-aac8102ad707;
 Tue, 10 Nov 2020 11:59:28 +0000 (UTC)
Received: by mail-wm1-x329.google.com with SMTP id a65so2741125wme.1
 for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 03:59:28 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
 by smtp.gmail.com with ESMTPSA id t2sm17491203wrq.56.2020.11.10.03.59.26
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 10 Nov 2020 03:59:27 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=BGQT=EQ=gmail.com=xadimgnik@srs-us1.protection.inumbo.net>)
	id 1kcSJ7-0002eF-PW
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 11:59:29 +0000
X-Inumbo-ID: d6a6c239-424d-4d8c-a4f0-aac8102ad707
Received: from mail-wm1-x329.google.com (unknown [2a00:1450:4864:20::329])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d6a6c239-424d-4d8c-a4f0-aac8102ad707;
	Tue, 10 Nov 2020 11:59:28 +0000 (UTC)
Received: by mail-wm1-x329.google.com with SMTP id a65so2741125wme.1
        for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 03:59:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id
         :mime-version:content-transfer-encoding:thread-index
         :content-language;
        bh=cmQwsAS482m9hFHnZRklOzLlTmI0isVMvqR0QO/iLwM=;
        b=I3Ncau3cJKX/OlwZ14Dgmv60YSjPdeMpMwhPrJs7OIq0anSYjdjlBRgT/tm/wPUcF6
         AFLEgF++RyCk7eIlAVuIUgyryp22MTNp9SQ3icoFRDXs4WPn7/iiXFecSyqii3kyW1/Y
         KFA+dIRWO0xrC+gb2IY+Y9zwmXW/gxkqqYosK5Ule0wVUhvTHiKiwAtZ6G3tEXY0ornP
         zn45FMJJiJA8npyeSBEhHq85pb7fAYg/GSmwkb31+7iFCCLua65bh9wvHCbNnpbo6xdS
         rtg6nSPX00Xzc45clDgDyA1yNZRG6h8sEdW27hRujIUI/tCHTKTlG5KI5GhmaYUI/3GR
         gFYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to
         :subject:date:message-id:mime-version:content-transfer-encoding
         :thread-index:content-language;
        bh=cmQwsAS482m9hFHnZRklOzLlTmI0isVMvqR0QO/iLwM=;
        b=kt7x7JSFFCkutkBxu9tbQZFZACpml4zAMzygrT96yff1JtvQuHqCBVYl+OEiH1CwQJ
         usCIJnkfpKbcNGGBWlHFS73A+H+Dd4Bozah7gZOzC8uxBFQRUROdgwwtyE3VWTJX8YJF
         Afp3phqHjclbSRkUGXLqFDT19pnp+PVYpqT6G9FmEHXRhvSP2jCC9H14iPJAKBhyGfhP
         M7tATYNm12malY9JpqJDQlR1oO/lgxbKzMlHw1ZxuxGFDv8an9W9166SLsiHgMUud18u
         7NN/aZ71cGTvpYt45wixIaIMlvnl+fHFAmznuberMuw9jhxYR6Jg3EMx0NlTPaXy4F2q
         ObMw==
X-Gm-Message-State: AOAM531hgpekvT9vqg3u/KYhfP3oHAA7MYQGGNxtrPW5gxhdq0pyj/Nt
	6CteZNoxhtctxwPluUZZito=
X-Google-Smtp-Source: ABdhPJxYDy3p+nUUWc/CsRcPcGaixVdxoPPl83P+BTJkN0o34WfLL124jYYFIGX7aFFm494oeyMGvw==
X-Received: by 2002:a7b:c8c9:: with SMTP id f9mr4230777wml.3.1605009567952;
        Tue, 10 Nov 2020 03:59:27 -0800 (PST)
Received: from CBGR90WXYV0 (54-240-197-235.amazon.com. [54.240.197.235])
        by smtp.gmail.com with ESMTPSA id t2sm17491203wrq.56.2020.11.10.03.59.26
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 10 Nov 2020 03:59:27 -0800 (PST)
From: Paul Durrant <xadimgnik@gmail.com>
X-Google-Original-From: "Paul Durrant" <paul@xen.org>
Reply-To: <paul@xen.org>
To: "'Troy Crosley'" <troycrosley@gmail.com>,
	<win-pv-devel@lists.xenproject.org>
Cc: <ben.chalmers@citrix.com>,
	<owen.smith@citrix.com>,
	"'Joel Upham'" <uphamj@ainfosec.com>
References: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
In-Reply-To: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
Subject: RE: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
Date: Tue, 10 Nov 2020 11:59:26 -0000
Message-ID: <00cf01d6b758$f0739500$d15abf00$@xen.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQIRekLrUGvXih/GiB1yUwWtKfjri6lLvNFg
Content-Language: en-gb

> -----Original Message-----
> From: Troy Crosley <troycrosley@gmail.com>
> Sent: 05 November 2020 21:39
> To: win-pv-devel@lists.xenproject.org
> Cc: paul@xen.org; ben.chalmers@citrix.com; owen.smith@citrix.com; Troy Crosley
> <troycrosley@gmail.com>; Joel Upham <uphamj@ainfosec.com>
> Subject: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
> 
> In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines
> do not get called on driver uninstall. In previous versions of Windows,
> this occurs as part of the uninstall during the null device install and
> is the only time DifRemove gets called to perform cleanup. Work around
> this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which is
> the only coinstaller request that seems to happen on uninstall in
> Windows 10 version 2004. In addition, improve the null driver test to
> also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER or
> SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at
> least Windows 10 version 1803).
> 
> Co-authored-by: Joel Upham <uphamj@ainfosec.com>
> Co-authored-by: Troy Crosley <troycrosley@gmail.com>

We've never used 'Co-authored-by'. Are you ok with me translating both of these to 'Signed-off-by'?

Acked-by: Paul Durrant <paul@xen.org>

> ---
>  src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------
>  1 file changed, 23 insertions(+), 15 deletions(-)
> 
> diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
> index 7b96f59..b9b60bd 100644
> --- a/src/coinst/coinst.c
> +++ b/src/coinst/coinst.c
> @@ -1959,6 +1959,9 @@ Entry(
>      )
>  {
>      HRESULT                         Error;
> +    SP_DRVINFO_DATA                 DriverInfoData;
> +    BOOLEAN                         DriverInfoAvailable;
> +    BOOLEAN                         IsNullDriver;
> 
>      Log("%s (%s) ===>",
>          MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR "." BUILD_NUMBER_STR,
> @@ -1973,23 +1976,28 @@ Entry(
>              Context->InstallResult);
>      }
> 
> +    DriverInfoData.cbSize = sizeof(DriverInfoData);
> +    DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
> +                                                   DeviceInfoData,
> +                                                   &DriverInfoData) ?
> +                          TRUE :
> +                          FALSE;
> +    IsNullDriver = !(DriverInfoAvailable &&
> +                    (DriverInfoData.DriverType == SPDIT_CLASSDRIVER || DriverInfoData.DriverType ==
> SPDIT_COMPATDRIVER));
> +
>      switch (Function) {
> +	case DIF_SELECTBESTCOMPATDRV: {
> +        // If the NULL driver will be installed, treat this as we would a DIF_REMOVE
> +        // to work around the fact that Windows 10 2004 doesn't call DIF_INSTALLDEVICE on uninstall.
> +        Error = (IsNullDriver) ?
> +                DifRemove(DeviceInfoSet, DeviceInfoData, Context) :
> +                NO_ERROR;
> +        break;
> +    }
>      case DIF_INSTALLDEVICE: {
> -        SP_DRVINFO_DATA         DriverInfoData;
> -        BOOLEAN                 DriverInfoAvailable;
> -
> -        DriverInfoData.cbSize = sizeof (DriverInfoData);
> -        DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
> -                                                       DeviceInfoData,
> -                                                       &DriverInfoData) ?
> -                              TRUE :
> -                              FALSE;
> -
> -        // If there is no driver information then the NULL driver is being
> -        // installed. Treat this as we would a DIF_REMOVE.
> -        Error = (DriverInfoAvailable) ?
> -                DifInstall(DeviceInfoSet, DeviceInfoData, Context) :
> -                DifRemove(DeviceInfoSet, DeviceInfoData, Context);
> +        Error = (IsNullDriver) ?
> +                NO_ERROR :
> +                DifInstall(DeviceInfoSet, DeviceInfoData, Context);
>          break;
>      }
>      case DIF_REMOVE:
> --
> 2.25.1




From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 12:22:37 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 12:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23324.49995 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcSfU-0005ER-4W; Tue, 10 Nov 2020 12:22:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23324.49995; Tue, 10 Nov 2020 12:22:36 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcSfU-0005EJ-1M; Tue, 10 Nov 2020 12:22:36 +0000
Received: by outflank-mailman (input) for mailman id 23324;
 Tue, 10 Nov 2020 12:22:35 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcSfT-0005EE-4R
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 12:22:35 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcSfT-0005EE-4R
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 12:22:35 +0000
Date: Tue, 10 Nov 2020 12:22:16 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <7664176.1.1605010939059.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENBUS-master - Build #206 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_0_2765128.1605010938356"
X-Jenkins-Job: XENBUS-master
X-Jenkins-Result: SUCCESS


------=_Part_0_2765128.1605010938356
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #206.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/206/console to view the results.
------=_Part_0_2765128.1605010938356--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 14:29:01 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 14:29:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23455.50232 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcUdm-0000al-SX; Tue, 10 Nov 2020 14:28:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23455.50232; Tue, 10 Nov 2020 14:28:58 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcUdm-0000ad-PS; Tue, 10 Nov 2020 14:28:58 +0000
Received: by outflank-mailman (input) for mailman id 23455;
 Tue, 10 Nov 2020 14:28:57 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcUdl-0000aX-MW
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 14:28:57 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcUdl-0000aX-MW
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 14:28:57 +0000
Date: Tue, 10 Nov 2020 14:28:41 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <18864072.3.1605018521548.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENNET-master - Build #112 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2_27897471.1605018521251"
X-Jenkins-Job: XENNET-master
X-Jenkins-Result: SUCCESS


------=_Part_2_27897471.1605018521251
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #112.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENNET-master/112/console to view the results.
------=_Part_2_27897471.1605018521251--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 15:39:41 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 15:39:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23472.50293 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcVkC-0006xl-C3; Tue, 10 Nov 2020 15:39:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23472.50293; Tue, 10 Nov 2020 15:39:40 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcVkC-0006xe-9L; Tue, 10 Nov 2020 15:39:40 +0000
Received: by outflank-mailman (input) for mailman id 23472;
 Tue, 10 Nov 2020 14:34:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aJ2b=EQ=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
 id 1kcUjM-0001VT-CG
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 14:34:44 +0000
Received: from mail-ot1-x341.google.com (unknown [2607:f8b0:4864:20::341])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 48ea1ac9-ace9-4fea-8817-e56fcb255df0;
 Tue, 10 Nov 2020 14:34:43 +0000 (UTC)
Received: by mail-ot1-x341.google.com with SMTP id g19so12647763otp.13
 for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 06:34:43 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=aJ2b=EQ=gmail.com=niko.tsirakis@srs-us1.protection.inumbo.net>)
	id 1kcUjM-0001VT-CG
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 14:34:44 +0000
X-Inumbo-ID: 48ea1ac9-ace9-4fea-8817-e56fcb255df0
Received: from mail-ot1-x341.google.com (unknown [2607:f8b0:4864:20::341])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 48ea1ac9-ace9-4fea-8817-e56fcb255df0;
	Tue, 10 Nov 2020 14:34:43 +0000 (UTC)
Received: by mail-ot1-x341.google.com with SMTP id g19so12647763otp.13
        for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 06:34:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=rVygNwSO85yE51lr2rMfqyDUuwwxbEwMfPV0BBaqpJo=;
        b=Hk3kGJzb+zJWUCAEIJ+SI37gzM83veNDx5hR1akXnhZ+o3z4n1l/LhQ+c4GwYd1BrQ
         Y0mMKjJ3ya7Rqzs7H1ijuTWgyouP/miHdZ8lp4I9xeHNsCC5k4Yx0jn3EXYXZUoqfjhZ
         VL9zac7+BQEIJUGrKf92trcr6uFt6ACkOEX9wRdDGZ+y61tJiPRcJGnaCvi48Ej7RiVC
         B6BAy2ko96RLi64FnFijDg3eP3R4P87PNb2lBm9LAfw/iTFYIq0YaqsKgR5DgDfHnxjy
         fRfK6P0OC1CRDqYBm5j+PYpVofmsoYcbRvRWGsA7P9iTO0x//SHfhlPFL4Tz9T7Ef3Gr
         vplg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=rVygNwSO85yE51lr2rMfqyDUuwwxbEwMfPV0BBaqpJo=;
        b=bG1I/Ez1yqCnTKKHGEKfLF/sWx2suFw9RfCEziK0MOKuqXlYE5JsOUPwwUs2qy7zbC
         ajLRkSuK7QaQQiYZkkOdI5Usn0Z4WPT73h/HFDZ1P3EUUcpG/WQR4GmfxotXrDbp4KZh
         qXvbqi+E37Fwk2vTvhhyFeH4iN8KreqCEIhGkpXjIjOpeKc4fZymWFtthOkm13iIS9Sn
         U8C9zbtQXcgfrvJAm5T7s8mh7etNAMy/8jDV4FzoTCAJ/7HsWOH1YtvYJhRFO4NVYWcN
         LE2qtJO3TV88z7w0zv+jZnaCfy9qHM3/SNMI0wqzpXGx2WfChlUWGM5eFNoYj8VPpQA8
         Y4jw==
X-Gm-Message-State: AOAM5330mOwiJIw/i6UWFa2ErscIIi1hKIy3JqFYpEmydgimSTK/5tPw
	TgGvFeqUcJf3T5Pwnkw0OIh0L9NdCVMJfr6cDnE=
X-Google-Smtp-Source: ABdhPJyHcFJ/E/T+PMMDFBfaCNg/Hqe/0NrPOvQcskSFltfUtADNokoH6Oiott8E/0KCunAkn48daPZQTCpbwiVxNV0=
X-Received: by 2002:a05:6830:789:: with SMTP id w9mr14293248ots.243.1605018883274;
 Tue, 10 Nov 2020 06:34:43 -0800 (PST)
MIME-Version: 1.0
References: <f69d6be3eef3f4fd82155eaa80cf4b8357bbb0dd.1604689382.git.tsirakisn@ainfosec.com>
 <BYAPR03MB45517064C86598ED82C3D46EFEEA0@BYAPR03MB4551.namprd03.prod.outlook.com>
 <005d01d6b677$7feed3d0$7fcc7b70$@xen.org> <006d01d6b694$4bcd2940$e3677bc0$@xen.org>
 <CAFqpmVLWJa95CHswy0PrNukjbTViFjxescrCvTJQKn2Bcgr-RQ@mail.gmail.com>
 <8b4ae4a1912544b791dbfd62e2b2f0c7@EX13D32EUB003.ant.amazon.com> <00bd01d6b743$00df62e0$029e28a0$@xen.org>
In-Reply-To: <00bd01d6b743$00df62e0$029e28a0$@xen.org>
From: Niko Tsirakis <niko.tsirakis@gmail.com>
Date: Tue, 10 Nov 2020 09:34:32 -0500
Message-ID: <CAFqpmVKhMFfnyn4qesvcio0qSmnCFyJJQ4yFi8NXO7j1g9NMQg@mail.gmail.com>
Subject: Re: [PATCH 1/2] Allow user to specify desired build architecture
To: paul@xen.org
Cc: "Durrant, Paul" <pdurrant@amazon.co.uk>, Owen Smith <owen.smith@citrix.com>, 
	win-pv-devel@lists.xenproject.org, Ben Chalmers <ben.chalmers@citrix.com>, 
	Nicholas Tsirakis <tsirakisn@ainfosec.com>
Content-Type: text/plain; charset="UTF-8"

Awesome - thank you!

--Niko

On Tue, Nov 10, 2020 at 4:22 AM Paul Durrant <xadimgnik@gmail.com> wrote:
>
> [snip]
> > > > >
> > > > > > I would suggest using
> > > > > > [string]::IsNullOrEmpty($Arch)
> > > > > > Instead of
> > > > > > $Arch -eq ""
> > > > > >
> > > > >
> > > > > Agreed. I can make the change while committing so no need for a v2.
> > > > >
> > > > > Acked-by: Paul Durrant <paul@xen.org>
> > > >
> > > > Actually, I jumped the gun here. Having started to apply this I realize it's not going to work
> > > because of the optional '$Sdv'
> > > > parameter after it. IOW how do we do a default (IOW both x86 and x64) build with the sdv option?
> > > >
> > > >   Paul
> > > >
> > >
> > > Admittedly my powershell isn't too strong, but wouldn't ".\build.ps1
> > > <free/checked> -sdv" do the trick? The SDV param is a switch.
> > >
> >
> > Good point... misread it (and I'm not particularly au fait with powershell either). Let me check it
> > works properly. Thanks!
> >
>
> All good. I'll apply these changes for all drivers.
>
>   Paul
>


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 16:12:23 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 16:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23529.50327 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcWFq-0002Yj-8s; Tue, 10 Nov 2020 16:12:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23529.50327; Tue, 10 Nov 2020 16:12:22 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcWFq-0002Yc-5v; Tue, 10 Nov 2020 16:12:22 +0000
Received: by outflank-mailman (input) for mailman id 23529;
 Tue, 10 Nov 2020 16:12:21 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcWFo-0002YX-Vh
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 16:12:21 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcWFo-0002YX-Vh
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 16:12:21 +0000
Date: Tue, 10 Nov 2020 16:12:04 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <13854477.5.1605024724879.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENIFACE-master - Build #101 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_4_356253.1605024724426"
X-Jenkins-Job: XENIFACE-master
X-Jenkins-Result: SUCCESS


------=_Part_4_356253.1605024724426
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #101.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENIFACE-master/101/console to view the results.
------=_Part_4_356253.1605024724426--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 18:57:06 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 18:57:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23815.50796 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcYpE-0003zg-Tt; Tue, 10 Nov 2020 18:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23815.50796; Tue, 10 Nov 2020 18:57:04 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcYpE-0003zZ-Qv; Tue, 10 Nov 2020 18:57:04 +0000
Received: by outflank-mailman (input) for mailman id 23815;
 Tue, 10 Nov 2020 18:57:04 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcYpE-0003zU-8L
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 18:57:04 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcYpE-0003zU-8L
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 18:57:04 +0000
Date: Tue, 10 Nov 2020 18:56:47 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <1744609.7.1605034608228.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENCONS-master - Build #32 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_6_14436191.1605034608009"
X-Jenkins-Job: XENCONS-master
X-Jenkins-Result: SUCCESS


------=_Part_6_14436191.1605034608009
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #32.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENCONS-master/32/console to view the results.
------=_Part_6_14436191.1605034608009--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 19:37:00 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 19:37:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23904.50881 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcZRq-0008SP-KB; Tue, 10 Nov 2020 19:36:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23904.50881; Tue, 10 Nov 2020 19:36:58 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcZRq-0008SI-H9; Tue, 10 Nov 2020 19:36:58 +0000
Received: by outflank-mailman (input) for mailman id 23904;
 Tue, 10 Nov 2020 19:36:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6TsO=EQ=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
 id 1kcZRo-0008SD-JW
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 19:36:56 +0000
Received: from mail-ed1-x542.google.com (unknown [2a00:1450:4864:20::542])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f09d66ad-b725-4033-82ba-a6d65570900a;
 Tue, 10 Nov 2020 19:36:55 +0000 (UTC)
Received: by mail-ed1-x542.google.com with SMTP id l5so7573818edq.11
 for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 11:36:55 -0800 (PST)
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=6TsO=EQ=gmail.com=troycrosley@srs-us1.protection.inumbo.net>)
	id 1kcZRo-0008SD-JW
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 19:36:56 +0000
X-Inumbo-ID: f09d66ad-b725-4033-82ba-a6d65570900a
Received: from mail-ed1-x542.google.com (unknown [2a00:1450:4864:20::542])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f09d66ad-b725-4033-82ba-a6d65570900a;
	Tue, 10 Nov 2020 19:36:55 +0000 (UTC)
Received: by mail-ed1-x542.google.com with SMTP id l5so7573818edq.11
        for <win-pv-devel@lists.xenproject.org>; Tue, 10 Nov 2020 11:36:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc;
        bh=mdcbGlUg/3dLSOqdXskPyUxUiiL+duYMQno0N1bHIZ8=;
        b=kN61+DMqEaFSNprtbISqBUJDkSghw9XEjs+ChFNPvaSOzl46ciaPU7r4jOW+NzuMyq
         wzkVHxd/zadnkNQIwLuI4uwJBtQ0mNstD8ODMU2ilOT8GxcSO0LVNgbjU+45VavWGOWg
         pnbY6P8hlg9kzXaqkE+org72fALInFUCrUD8yONSD2vhzjPn7aPOHgLoFBiw59uQLVVz
         Y74RlL1oZhElSTaV8yMn8Pl+GJRyO1MZoc/n/JfIt9pkoHdTk8XJ51SEjT3o/444e98C
         pwgDdHGujxMDdfykcoJgyZFAatWuZF2CRJWSMbqlYmPRViy4t1Fwh9QpXvQ1KdFwZHmK
         z3nQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=mdcbGlUg/3dLSOqdXskPyUxUiiL+duYMQno0N1bHIZ8=;
        b=XfFZ+b/BT4qCm2C8wb7rDZ28y6xbGgJJb6TJ0jMpPvmxWiqfg4gxf4A7mjg2MQessF
         8dOro04odC6TFCPA89HwwY5Um5NBSoCv5zdxQlyv3FZMCFXb+doG9aq6Ih5cSqCrqPQL
         MgwLZsXrw6dQCECaeeSiG8mbsITtcgvP6/iAKvXgJZNc0SrZCEvm3/owimw/4Rbt6lP7
         uNrxOX175ihgXtW16FtPHYTv2IBRmH9Wamk2ceMhIuqUuRtretVQoJ4hGTdZHmssZiqr
         H2at+VxI53ggnXftFheDzdSXuuQABQJkwU8R7OhVq6yeQeD64Rdfqql/aC8rJU26rR2h
         5knQ==
X-Gm-Message-State: AOAM533gM1uFCoy9IfwbWch7nV2VbzblmPFPJEoPOaVN9qtfJs6gCyuS
	h4GfxQV4IwWSCYLfpAzFB8tyNiu0VxTn7/H5h2I=
X-Google-Smtp-Source: ABdhPJwWARl2/hNTle8hQAAa+irWaiM2xsUPedY16GZHPPBLJsca5hDGG+pY3L3SvtyWNEigL5diLcnHH2f3YeOH6jE=
X-Received: by 2002:a05:6402:1a58:: with SMTP id bf24mr1009179edb.191.1605037014334;
 Tue, 10 Nov 2020 11:36:54 -0800 (PST)
MIME-Version: 1.0
References: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
 <00cf01d6b758$f0739500$d15abf00$@xen.org>
In-Reply-To: <00cf01d6b758$f0739500$d15abf00$@xen.org>
From: Troy Crosley <troycrosley@gmail.com>
Date: Tue, 10 Nov 2020 14:36:42 -0500
Message-ID: <CAOBjErJSLKNGFiP6XLKkcthq0i1bTrPbpke=O1OneSvGfV5oaQ@mail.gmail.com>
Subject: Re: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
To: paul@xen.org
Cc: win-pv-devel@lists.xenproject.org, Ben Chalmers <ben.chalmers@citrix.com>, 
	Owen Smith <owen.smith@citrix.com>, Joel Upham <uphamj@ainfosec.com>
Content-Type: multipart/alternative; boundary="00000000000017425005b3c5cd8b"

--00000000000017425005b3c5cd8b
Content-Type: text/plain; charset="UTF-8"

Sure, that would be ok.

Troy

On Tue, Nov 10, 2020 at 6:59 AM Paul Durrant <xadimgnik@gmail.com> wrote:

> > -----Original Message-----
> > From: Troy Crosley <troycrosley@gmail.com>
> > Sent: 05 November 2020 21:39
> > To: win-pv-devel@lists.xenproject.org
> > Cc: paul@xen.org; ben.chalmers@citrix.com; owen.smith@citrix.com; Troy
> Crosley
> > <troycrosley@gmail.com>; Joel Upham <uphamj@ainfosec.com>
> > Subject: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
> >
> > In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routines
> > do not get called on driver uninstall. In previous versions of Windows,
> > this occurs as part of the uninstall during the null device install and
> > is the only time DifRemove gets called to perform cleanup. Work around
> > this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which is
> > the only coinstaller request that seems to happen on uninstall in
> > Windows 10 version 2004. In addition, improve the null driver test to
> > also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER or
> > SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at
> > least Windows 10 version 1803).
> >
> > Co-authored-by: Joel Upham <uphamj@ainfosec.com>
> > Co-authored-by: Troy Crosley <troycrosley@gmail.com>
>
> We've never used 'Co-authored-by'. Are you ok with me translating both of
> these to 'Signed-off-by'?
>
> Acked-by: Paul Durrant <paul@xen.org>
>
> > ---
> >  src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------
> >  1 file changed, 23 insertions(+), 15 deletions(-)
> >
> > diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
> > index 7b96f59..b9b60bd 100644
> > --- a/src/coinst/coinst.c
> > +++ b/src/coinst/coinst.c
> > @@ -1959,6 +1959,9 @@ Entry(
> >      )
> >  {
> >      HRESULT                         Error;
> > +    SP_DRVINFO_DATA                 DriverInfoData;
> > +    BOOLEAN                         DriverInfoAvailable;
> > +    BOOLEAN                         IsNullDriver;
> >
> >      Log("%s (%s) ===>",
> >          MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR
> "." BUILD_NUMBER_STR,
> > @@ -1973,23 +1976,28 @@ Entry(
> >              Context->InstallResult);
> >      }
> >
> > +    DriverInfoData.cbSize = sizeof(DriverInfoData);
> > +    DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
> > +                                                   DeviceInfoData,
> > +                                                   &DriverInfoData) ?
> > +                          TRUE :
> > +                          FALSE;
> > +    IsNullDriver = !(DriverInfoAvailable &&
> > +                    (DriverInfoData.DriverType == SPDIT_CLASSDRIVER ||
> DriverInfoData.DriverType ==
> > SPDIT_COMPATDRIVER));
> > +
> >      switch (Function) {
> > +     case DIF_SELECTBESTCOMPATDRV: {
> > +        // If the NULL driver will be installed, treat this as we would
> a DIF_REMOVE
> > +        // to work around the fact that Windows 10 2004 doesn't call
> DIF_INSTALLDEVICE on uninstall.
> > +        Error = (IsNullDriver) ?
> > +                DifRemove(DeviceInfoSet, DeviceInfoData, Context) :
> > +                NO_ERROR;
> > +        break;
> > +    }
> >      case DIF_INSTALLDEVICE: {
> > -        SP_DRVINFO_DATA         DriverInfoData;
> > -        BOOLEAN                 DriverInfoAvailable;
> > -
> > -        DriverInfoData.cbSize = sizeof (DriverInfoData);
> > -        DriverInfoAvailable = SetupDiGetSelectedDriver(DeviceInfoSet,
> > -                                                       DeviceInfoData,
> > -                                                       &DriverInfoData)
> ?
> > -                              TRUE :
> > -                              FALSE;
> > -
> > -        // If there is no driver information then the NULL driver is
> being
> > -        // installed. Treat this as we would a DIF_REMOVE.
> > -        Error = (DriverInfoAvailable) ?
> > -                DifInstall(DeviceInfoSet, DeviceInfoData, Context) :
> > -                DifRemove(DeviceInfoSet, DeviceInfoData, Context);
> > +        Error = (IsNullDriver) ?
> > +                NO_ERROR :
> > +                DifInstall(DeviceInfoSet, DeviceInfoData, Context);
> >          break;
> >      }
> >      case DIF_REMOVE:
> > --
> > 2.25.1
>
>
>

--00000000000017425005b3c5cd8b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sure, that would be ok.<div><br></div><div>Troy</div></div=
><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tu=
e, Nov 10, 2020 at 6:59 AM Paul Durrant &lt;<a href=3D"mailto:xadimgnik@gma=
il.com">xadimgnik@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">&gt; -----Original Message-----<br>
&gt; From: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.com" target=
=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
&gt; Sent: 05 November 2020 21:39<br>
&gt; To: <a href=3D"mailto:win-pv-devel@lists.xenproject.org" target=3D"_bl=
ank">win-pv-devel@lists.xenproject.org</a><br>
&gt; Cc: <a href=3D"mailto:paul@xen.org" target=3D"_blank">paul@xen.org</a>=
; <a href=3D"mailto:ben.chalmers@citrix.com" target=3D"_blank">ben.chalmers=
@citrix.com</a>; <a href=3D"mailto:owen.smith@citrix.com" target=3D"_blank"=
>owen.smith@citrix.com</a>; Troy Crosley<br>
&gt; &lt;<a href=3D"mailto:troycrosley@gmail.com" target=3D"_blank">troycro=
sley@gmail.com</a>&gt;; Joel Upham &lt;<a href=3D"mailto:uphamj@ainfosec.co=
m" target=3D"_blank">uphamj@ainfosec.com</a>&gt;<br>
&gt; Subject: [PATCH] Ensure DifRemove coinst routine runs on uninstall.<br=
>
&gt; <br>
&gt; In Windows 10 version 2004, The coinstallers&#39; DIF_INSTALLDEVICE ro=
utines<br>
&gt; do not get called on driver uninstall. In previous versions of Windows=
,<br>
&gt; this occurs as part of the uninstall during the null device install an=
d<br>
&gt; is the only time DifRemove gets called to perform cleanup. Work around=
<br>
&gt; this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which i=
s<br>
&gt; the only coinstaller request that seems to happen on uninstall in<br>
&gt; Windows 10 version 2004. In addition, improve the null driver test to<=
br>
&gt; also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER =
or<br>
&gt; SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at<=
br>
&gt; least Windows 10 version 1803).<br>
&gt; <br>
&gt; Co-authored-by: Joel Upham &lt;<a href=3D"mailto:uphamj@ainfosec.com" =
target=3D"_blank">uphamj@ainfosec.com</a>&gt;<br>
&gt; Co-authored-by: Troy Crosley &lt;<a href=3D"mailto:troycrosley@gmail.c=
om" target=3D"_blank">troycrosley@gmail.com</a>&gt;<br>
<br>
We&#39;ve never used &#39;Co-authored-by&#39;. Are you ok with me translati=
ng both of these to &#39;Signed-off-by&#39;?<br>
<br>
Acked-by: Paul Durrant &lt;<a href=3D"mailto:paul@xen.org" target=3D"_blank=
">paul@xen.org</a>&gt;<br>
<br>
&gt; ---<br>
&gt;=C2=A0 src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------<=
br>
&gt;=C2=A0 1 file changed, 23 insertions(+), 15 deletions(-)<br>
&gt; <br>
&gt; diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c<br>
&gt; index 7b96f59..b9b60bd 100644<br>
&gt; --- a/src/coinst/coinst.c<br>
&gt; +++ b/src/coinst/coinst.c<br>
&gt; @@ -1959,6 +1959,9 @@ Entry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 )<br>
&gt;=C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 HRESULT=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Error;<br>
&gt; +=C2=A0 =C2=A0 SP_DRVINFO_DATA=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0DriverInfoData;<br>
&gt; +=C2=A0 =C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DriverInfoAvailable;<br>
&gt; +=C2=A0 =C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0IsNullDriver;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Log(&quot;%s (%s) =3D=3D=3D&gt;&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MAJOR_VERSION_STR &quot;.&quot; MINO=
R_VERSION_STR &quot;.&quot; MICRO_VERSION_STR &quot;.&quot; BUILD_NUMBER_ST=
R,<br>
&gt; @@ -1973,23 +1976,28 @@ Entry(<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Context-&gt;InstallRes=
ult);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt; <br>
&gt; +=C2=A0 =C2=A0 DriverInfoData.cbSize =3D sizeof(DriverInfoData);<br>
&gt; +=C2=A0 =C2=A0 DriverInfoAvailable =3D SetupDiGetSelectedDriver(Device=
InfoSet,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DeviceInfoData,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;DriverInfoData) ?<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 TRUE :<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 FALSE;<br>
&gt; +=C2=A0 =C2=A0 IsNullDriver =3D !(DriverInfoAvailable &amp;&amp;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 (DriverInfoData.DriverType =3D=3D SPDIT_CLASSDRIVER || DriverInfoData.Driv=
erType =3D=3D<br>
&gt; SPDIT_COMPATDRIVER));<br>
&gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0 switch (Function) {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0case DIF_SELECTBESTCOMPATDRV: {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 // If the NULL driver will be installed, =
treat this as we would a DIF_REMOVE<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 // to work around the fact that Windows 1=
0 2004 doesn&#39;t call DIF_INSTALLDEVICE on uninstall.<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error =3D (IsNullDriver) ?<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifRemove(Dev=
iceInfoSet, DeviceInfoData, Context) :<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NO_ERROR;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt; +=C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 case DIF_INSTALLDEVICE: {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 SP_DRVINFO_DATA=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0DriverInfoData;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 BOOLEAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0DriverInfoAvailable;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 DriverInfoData.cbSize =3D sizeof (DriverI=
nfoData);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 DriverInfoAvailable =3D SetupDiGetSelecte=
dDriver(DeviceInfoSet,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DeviceInfoData,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;DriverInfoData) ?<=
br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TRUE :<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FALSE;<br>
&gt; -<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 // If there is no driver information then=
 the NULL driver is being<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 // installed. Treat this as we would a DI=
F_REMOVE.<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error =3D (DriverInfoAvailable) ?<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifInstall(De=
viceInfoSet, DeviceInfoData, Context) :<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifRemove(Dev=
iceInfoSet, DeviceInfoData, Context);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error =3D (IsNullDriver) ?<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NO_ERROR :<br=
>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DifInstall(De=
viceInfoSet, DeviceInfoData, Context);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 case DIF_REMOVE:<br>
&gt; --<br>
&gt; 2.25.1<br>
<br>
<br>
</blockquote></div>

--00000000000017425005b3c5cd8b--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 20:49:56 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 20:49:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.23940.50940 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcaaP-0006lo-Ta; Tue, 10 Nov 2020 20:49:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 23940.50940; Tue, 10 Nov 2020 20:49:53 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcaaP-0006lh-Qi; Tue, 10 Nov 2020 20:49:53 +0000
Received: by outflank-mailman (input) for mailman id 23940;
 Tue, 10 Nov 2020 20:49:52 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcaaO-0006lc-34
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 20:49:52 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcaaO-0006lc-34
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 20:49:52 +0000
Date: Tue, 10 Nov 2020 20:49:35 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <6591312.9.1605041376122.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENVBD-master - Build #149 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_8_25888151.1605041375716"
X-Jenkins-Job: XENVBD-master
X-Jenkins-Result: SUCCESS


------=_Part_8_25888151.1605041375716
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #149.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVBD-master/149/console to view the results.
------=_Part_8_25888151.1605041375716--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 21:48:06 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 21:48:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.24001.51031 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcbUj-0004Es-M3; Tue, 10 Nov 2020 21:48:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 24001.51031; Tue, 10 Nov 2020 21:48:05 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcbUj-0004Ej-Iq; Tue, 10 Nov 2020 21:48:05 +0000
Received: by outflank-mailman (input) for mailman id 24001;
 Tue, 10 Nov 2020 21:48:05 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcbUj-0004Ee-27
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 21:48:05 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcbUj-0004Ee-27
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 21:48:05 +0000
Date: Tue, 10 Nov 2020 21:47:48 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <1181641.11.1605044869108.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENVIF-master - Build #182 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_10_7465502.1605044868983"
X-Jenkins-Job: XENVIF-master
X-Jenkins-Result: SUCCESS


------=_Part_10_7465502.1605044868983
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #182.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVIF-master/182/console to view the results.
------=_Part_10_7465502.1605044868983--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 22:24:06 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 22:24:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.24033.51068 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcc3Y-00082A-Nm; Tue, 10 Nov 2020 22:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 24033.51068; Tue, 10 Nov 2020 22:24:04 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcc3Y-000823-Kl; Tue, 10 Nov 2020 22:24:04 +0000
Received: by outflank-mailman (input) for mailman id 24033;
 Tue, 10 Nov 2020 22:24:03 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcc3X-00081y-Ku
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 22:24:03 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcc3X-00081y-Ku
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 22:24:03 +0000
Date: Tue, 10 Nov 2020 22:23:47 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <23283666.13.1605047027718.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENHID-master - Build #25 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_12_24477012.1605047027609"
X-Jenkins-Job: XENHID-master
X-Jenkins-Result: SUCCESS


------=_Part_12_24477012.1605047027609
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #25.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENHID-master/25/console to view the results.
------=_Part_12_24477012.1605047027609--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 22:27:24 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 22:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.24041.51078 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcc6m-000881-1s; Tue, 10 Nov 2020 22:27:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 24041.51078; Tue, 10 Nov 2020 22:27:24 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcc6l-00087t-VD; Tue, 10 Nov 2020 22:27:23 +0000
Received: by outflank-mailman (input) for mailman id 24041;
 Tue, 10 Nov 2020 22:27:22 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcc6k-00087o-IA
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 22:27:22 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcc6k-00087o-IA
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 22:27:22 +0000
Date: Tue, 10 Nov 2020 22:27:06 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <17415003.15.1605047226625.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENVKBD-master - Build #27 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_14_3745208.1605047226562"
X-Jenkins-Job: XENVKBD-master
X-Jenkins-Result: SUCCESS


------=_Part_14_3745208.1605047226562
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #27.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVKBD-master/27/console to view the results.
------=_Part_14_3745208.1605047226562--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 10 23:27:23 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 10 Nov 2020 23:27:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.24079.51147 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcd2o-0005TK-Ih; Tue, 10 Nov 2020 23:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 24079.51147; Tue, 10 Nov 2020 23:27:22 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kcd2o-0005TD-Fu; Tue, 10 Nov 2020 23:27:22 +0000
Received: by outflank-mailman (input) for mailman id 24079;
 Tue, 10 Nov 2020 23:27:21 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kcd2n-0005T5-8v
 for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 23:27:21 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kcd2n-0005T5-8v
	for win-pv-devel@lists.xenproject.org; Tue, 10 Nov 2020 23:27:21 +0000
Date: Tue, 10 Nov 2020 23:27:05 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <19247822.17.1605050825377.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENIFACE-master - Build #102 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_16_17517223.1605050825252"
X-Jenkins-Job: XENIFACE-master
X-Jenkins-Result: SUCCESS


------=_Part_16_17517223.1605050825252
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #102.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENIFACE-master/102/console to view the results.
------=_Part_16_17517223.1605050825252--


From win-pv-devel-bounces@lists.xenproject.org Mon Nov 16 17:13:08 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 16 Nov 2020 17:13:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.28551.57648 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kei3t-00070D-Oe; Mon, 16 Nov 2020 17:13:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 28551.57648; Mon, 16 Nov 2020 17:13:05 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kei3t-000706-Le; Mon, 16 Nov 2020 17:13:05 +0000
Received: by outflank-mailman (input) for mailman id 28551;
 Mon, 16 Nov 2020 17:13:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QQFW=EW=amazon.co.uk=prvs=582591b4d=pdurrant@srs-us1.protection.inumbo.net>)
 id 1kei3s-000701-1X
 for win-pv-devel@lists.xenproject.org; Mon, 16 Nov 2020 17:13:04 +0000
Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 06b6493e-cfea-43ee-bdc2-1337145bb669;
 Mon, 16 Nov 2020 17:13:01 +0000 (UTC)
Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO
 email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com) ([10.43.8.2])
 by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP;
 16 Nov 2020 17:12:55 +0000
Received: from EX13D32EUC002.ant.amazon.com
 (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198])
 by email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com (Postfix) with ESMTPS
 id 01ECFA23B7; Mon, 16 Nov 2020 17:12:53 +0000 (UTC)
Received: from EX13D32EUC003.ant.amazon.com (10.43.164.24) by
 EX13D32EUC002.ant.amazon.com (10.43.164.94) with Microsoft SMTP Server (TLS)
 id 15.0.1497.2; Mon, 16 Nov 2020 17:12:52 +0000
Received: from EX13D32EUC003.ant.amazon.com ([10.43.164.24]) by
 EX13D32EUC003.ant.amazon.com ([10.43.164.24]) with mapi id 15.00.1497.006;
 Mon, 16 Nov 2020 17:12:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=QQFW=EW=amazon.co.uk=prvs=582591b4d=pdurrant@srs-us1.protection.inumbo.net>)
	id 1kei3s-000701-1X
	for win-pv-devel@lists.xenproject.org; Mon, 16 Nov 2020 17:13:04 +0000
X-Inumbo-ID: 06b6493e-cfea-43ee-bdc2-1337145bb669
Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 06b6493e-cfea-43ee-bdc2-1337145bb669;
	Mon, 16 Nov 2020 17:13:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=amazon.co.uk; i=@amazon.co.uk; q=dns/txt;
  s=amazon201209; t=1605546782; x=1637082782;
  h=from:to:cc:date:message-id:references:in-reply-to:
   content-transfer-encoding:mime-version:subject;
  bh=mnQrS59jdOlXAwOuiPpSxoctm2tIB+lws8CHMHrVTbQ=;
  b=G86twpMXAn9a3UoQssrzMrfnjAy+4gOmHoqA0IQAyVQzNwc/8uQCVghY
   XMQrfn1z7kSJuGQ6hppM5+grzp2Xploolgml0UR82ea1gzproGpSNOJKL
   cjEq41GAgkCq2gO9yS9TUfm4WEtpr5PJcbbKPm0PqQiDZftSshFAWkXZ5
   w=;
X-IronPort-AV: E=Sophos;i="5.77,483,1596499200"; 
   d="scan'208";a="65306032"
Subject: RE: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
Thread-Topic: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com) ([10.43.8.2])
  by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 16 Nov 2020 17:12:55 +0000
Received: from EX13D32EUC002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198])
	by email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com (Postfix) with ESMTPS id 01ECFA23B7;
	Mon, 16 Nov 2020 17:12:53 +0000 (UTC)
Received: from EX13D32EUC003.ant.amazon.com (10.43.164.24) by
 EX13D32EUC002.ant.amazon.com (10.43.164.94) with Microsoft SMTP Server (TLS)
 id 15.0.1497.2; Mon, 16 Nov 2020 17:12:52 +0000
Received: from EX13D32EUC003.ant.amazon.com ([10.43.164.24]) by
 EX13D32EUC003.ant.amazon.com ([10.43.164.24]) with mapi id 15.00.1497.006;
 Mon, 16 Nov 2020 17:12:52 +0000
From: "Durrant, Paul" <pdurrant@amazon.co.uk>
To: "paul@xen.org" <paul@xen.org>, 'Troy Crosley' <troycrosley@gmail.com>,
	"win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
CC: "ben.chalmers@citrix.com" <ben.chalmers@citrix.com>,
	"owen.smith@citrix.com" <owen.smith@citrix.com>, 'Joel Upham'
	<uphamj@ainfosec.com>
Thread-Index: AQIRekLrUGvXih/GiB1yUwWtKfjriwIzNiH1qUPna5A=
Date: Mon, 16 Nov 2020 17:12:52 +0000
Message-ID: <a6da635401a94d0695b2167192cb5443@EX13D32EUC003.ant.amazon.com>
References: <82e3dc7cc67ba5915b3baedd5e94336d7903f5b4.1604610184.git.troycrosley@gmail.com>
 <00cf01d6b758$f0739500$d15abf00$@xen.org>
In-Reply-To: <00cf01d6b758$f0739500$d15abf00$@xen.org>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.43.164.90]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

> -----Original Message-----
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> On Behalf =
Of Paul Durrant
> Sent: 10 November 2020 11:59
> To: 'Troy Crosley' <troycrosley@gmail.com>; win-pv-devel@lists.xenproject=
.org
> Cc: ben.chalmers@citrix.com; owen.smith@citrix.com; 'Joel Upham' <uphamj@=
ainfosec.com>
> Subject: RE: [EXTERNAL] [PATCH] Ensure DifRemove coinst routine runs on u=
ninstall.
>=20
> CAUTION: This email originated from outside of the organization. Do not c=
lick links or open
> attachments unless you can confirm the sender and know the content is saf=
e.
>=20
>=20
>=20
> > -----Original Message-----
> > From: Troy Crosley <troycrosley@gmail.com>
> > Sent: 05 November 2020 21:39
> > To: win-pv-devel@lists.xenproject.org
> > Cc: paul@xen.org; ben.chalmers@citrix.com; owen.smith@citrix.com; Troy =
Crosley
> > <troycrosley@gmail.com>; Joel Upham <uphamj@ainfosec.com>
> > Subject: [PATCH] Ensure DifRemove coinst routine runs on uninstall.
> >
> > In Windows 10 version 2004, The coinstallers' DIF_INSTALLDEVICE routine=
s
> > do not get called on driver uninstall. In previous versions of Windows,
> > this occurs as part of the uninstall during the null device install and
> > is the only time DifRemove gets called to perform cleanup. Work around
> > this change by calling DifRemove from DIF_SELECTBESTCOMPATDRV, which is
> > the only coinstaller request that seems to happen on uninstall in
> > Windows 10 version 2004. In addition, improve the null driver test to
> > also check if DriverInfoData.DriverType is equal to SPDIT_CLASSDRIVER o=
r
> > SPDIT_COMPATDRIVER, which is necessary as of some Windows version (at
> > least Windows 10 version 1803).
> >
> > Co-authored-by: Joel Upham <uphamj@ainfosec.com>
> > Co-authored-by: Troy Crosley <troycrosley@gmail.com>
> > ---
> >  src/coinst/coinst.c | 38 +++++++++++++++++++++++---------------
> >  1 file changed, 23 insertions(+), 15 deletions(-)
> >
> > diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c
> > index 7b96f59..b9b60bd 100644
> > --- a/src/coinst/coinst.c
> > +++ b/src/coinst/coinst.c
> > @@ -1959,6 +1959,9 @@ Entry(
> >      )
> >  {
> >      HRESULT                         Error;
> > +    SP_DRVINFO_DATA                 DriverInfoData;
> > +    BOOLEAN                         DriverInfoAvailable;
> > +    BOOLEAN                         IsNullDriver;
> >
> >      Log("%s (%s) =3D=3D=3D>",
> >          MAJOR_VERSION_STR "." MINOR_VERSION_STR "." MICRO_VERSION_STR =
"." BUILD_NUMBER_STR,
> > @@ -1973,23 +1976,28 @@ Entry(
> >              Context->InstallResult);
> >      }
> >
> > +    DriverInfoData.cbSize =3D sizeof(DriverInfoData);
> > +    DriverInfoAvailable =3D SetupDiGetSelectedDriver(DeviceInfoSet,
> > +                                                   DeviceInfoData,
> > +                                                   &DriverInfoData) ?
> > +                          TRUE :
> > +                          FALSE;
> > +    IsNullDriver =3D !(DriverInfoAvailable &&
> > +                    (DriverInfoData.DriverType =3D=3D SPDIT_CLASSDRIVE=
R || DriverInfoData.DriverType =3D=3D
> > SPDIT_COMPATDRIVER));
> > +
> >      switch (Function) {
> > +     case DIF_SELECTBESTCOMPATDRV: {
> > +        // If the NULL driver will be installed, treat this as we woul=
d a DIF_REMOVE
> > +        // to work around the fact that Windows 10 2004 doesn't call D=
IF_INSTALLDEVICE on
> uninstall.
> > +        Error =3D (IsNullDriver) ?
> > +                DifRemove(DeviceInfoSet, DeviceInfoData, Context) :
> > +                NO_ERROR;
> > +        break;
> > +    }

When I came to test this, my system (which is actually an old 1809 VM) got =
into an endless loop of startup repair. This appears to because returning E=
RROR_DI_POSTPROCESSING_REQUIRED from DIF_SELECTBESTCOMPATDRV pre-processing=
 leads to post-processing getting an InstallResult of ERROR_NO_COMPAT_DRIVE=
RS, which then causes DifRemove() to bail out early and that error gets ret=
urned.

AFAICT ERROR_NO_COMPAT_DRIVERS is exactly what we'd expect if the NULL driv=
er is being installed so I added the following hunk:

1995        // An InstallResult value of ERROR_NO_COMPAT_DRIVERS simply mea=
ns     =20
1996        // that the NULL driver was selected, and so should not be trea=
ted    =20
1997        // as an error.                                                =
       =20
1998        //                                                             =
       =20
1999        if (Context->PostProcessing &&
2000            Context->InstallResult =3D=3D ERROR_NO_COMPAT_DRIVERS)
2001            Context->InstallResult =3D NO_ERROR;

This seems to make everything work correctly me.

I'll fold it into the patch you sent and apply it.

  Paul

> >      case DIF_INSTALLDEVICE: {
> > -        SP_DRVINFO_DATA         DriverInfoData;
> > -        BOOLEAN                 DriverInfoAvailable;
> > -
> > -        DriverInfoData.cbSize =3D sizeof (DriverInfoData);
> > -        DriverInfoAvailable =3D SetupDiGetSelectedDriver(DeviceInfoSet=
,
> > -                                                       DeviceInfoData,
> > -                                                       &DriverInfoData=
) ?
> > -                              TRUE :
> > -                              FALSE;
> > -
> > -        // If there is no driver information then the NULL driver is b=
eing
> > -        // installed. Treat this as we would a DIF_REMOVE.
> > -        Error =3D (DriverInfoAvailable) ?
> > -                DifInstall(DeviceInfoSet, DeviceInfoData, Context) :
> > -                DifRemove(DeviceInfoSet, DeviceInfoData, Context);
> > +        Error =3D (IsNullDriver) ?
> > +                NO_ERROR :
> > +                DifInstall(DeviceInfoSet, DeviceInfoData, Context);
> >          break;
> >      }
> >      case DIF_REMOVE:
> > --
> > 2.25.1
>=20
>=20



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 16 17:54:15 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 16 Nov 2020 17:54:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.28567.57665 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1keihh-0002SP-Vs; Mon, 16 Nov 2020 17:54:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 28567.57665; Mon, 16 Nov 2020 17:54:13 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1keihh-0002SH-Su; Mon, 16 Nov 2020 17:54:13 +0000
Received: by outflank-mailman (input) for mailman id 28567;
 Mon, 16 Nov 2020 17:54:11 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1keihf-0002SC-M1
 for win-pv-devel@lists.xenproject.org; Mon, 16 Nov 2020 17:54:11 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1keihf-0002SC-M1
	for win-pv-devel@lists.xenproject.org; Mon, 16 Nov 2020 17:54:11 +0000
Date: Mon, 16 Nov 2020 17:53:55 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <32779563.1.1605549237048.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENBUS-master - Build #207 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_18750933.1605549236079"
X-Jenkins-Job: XENBUS-master
X-Jenkins-Result: SUCCESS


------=_Part_0_18750933.1605549236079
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #207.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/207/console to view the results.
------=_Part_0_18750933.1605549236079--


From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:44 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30690.60867 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRX-0008Ir-MC; Thu, 19 Nov 2020 12:53:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30690.60867; Thu, 19 Nov 2020 12:53:43 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRX-0008Ik-IH; Thu, 19 Nov 2020 12:53:43 +0000
Received: by outflank-mailman (input) for mailman id 30690;
 Thu, 19 Nov 2020 12:53:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRW-0008Hx-G3
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRW-0003My-6M; Thu, 19 Nov 2020 12:53:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRV-0003sT-Tp; Thu, 19 Nov 2020 12:53:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRW-0008Hx-G3
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:42 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=rVoePQ5n2bWvYd127HlrQStDnJRPwC2fTAVfPxQWW50=; b=wvy0ygejqAUJp8924j2AFB2PJ
	yORbJeltJtUlBGdcYtA0EeJnOnlLla6qgNZTjP05teoVRzuFDm8aSb3cuRlwhr08EEecq6hKdxLRW
	k4gWpGMkKaSA5zU6111xqvFw7/v9Rnrtm/d1KPDoH0byknta8UO3AEozKKtOriSkbabm8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRW-0003My-6M; Thu, 19 Nov 2020 12:53:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRV-0003sT-Tp; Thu, 19 Nov 2020 12:53:42 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 02/12] s/Index/Cpu in the EVTCHN code where 'Index' relates to a processor
Date: Thu, 19 Nov 2020 12:53:27 +0000
Message-Id: <20201119125337.29003-3-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

This is a purely cosmetic patch which helps to avoid confusion and will avoid
a name-clash in a subsequent patch.

No functional change.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/evtchn.c | 92 ++++++++++++++++++++++-----------------------
 1 file changed, 46 insertions(+), 46 deletions(-)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 8a819f35de2d..d0546c067639 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -442,17 +442,17 @@ EvtchnPollCallback(
     )
 {
     PXENBUS_EVTCHN_CONTEXT      Context = Argument;
-    ULONG                       Index;
+    ULONG                       Cpu;
     PXENBUS_EVTCHN_PROCESSOR    Processor;
     PXENBUS_EVTCHN_CHANNEL      Channel;
     BOOLEAN                     Pending;
     NTSTATUS                    status;
 
     ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
-    Index = KeGetCurrentProcessorNumberEx(NULL);
+    Cpu = KeGetCurrentProcessorNumberEx(NULL);
 
-    ASSERT3U(Index, <, Context->ProcessorCount);
-    Processor = &Context->Processor[Index];
+    ASSERT3U(Cpu, <, Context->ProcessorCount);
+    Processor = &Context->Processor[Cpu];
 
     status = HashTableLookup(Context->Table,
                              LocalPort,
@@ -475,7 +475,7 @@ done:
 static BOOLEAN
 EvtchnPoll(
     IN  PXENBUS_EVTCHN_CONTEXT  Context,
-    IN  ULONG                   Index,
+    IN  ULONG                   Cpu,
     IN  PLIST_ENTRY             List
     )
 {
@@ -483,12 +483,12 @@ EvtchnPoll(
     BOOLEAN                     DoneSomething;
     PLIST_ENTRY                 ListEntry;
 
-    ASSERT3U(Index, <, Context->ProcessorCount);
-    Processor = &Context->Processor[Index];
+    ASSERT3U(Cpu, <, Context->ProcessorCount);
+    Processor = &Context->Processor[Cpu];
 
     (VOID) XENBUS_EVTCHN_ABI(Poll,
                              &Context->EvtchnAbi,
-                             Index,
+                             Cpu,
                              EvtchnPollCallback,
                              Context);
 
@@ -545,7 +545,7 @@ EvtchnPoll(
 static VOID
 EvtchnFlush(
     IN  PXENBUS_EVTCHN_CONTEXT  Context,
-    IN  ULONG                   Index
+    IN  ULONG                   Cpu
     )
 {
     PXENBUS_EVTCHN_PROCESSOR    Processor;
@@ -553,8 +553,8 @@ EvtchnFlush(
     PXENBUS_INTERRUPT           Interrupt;
     KIRQL                       Irql;
 
-    ASSERT3U(Index, <, Context->ProcessorCount);
-    Processor = &Context->Processor[Index];
+    ASSERT3U(Cpu, <, Context->ProcessorCount);
+    Processor = &Context->Processor[Cpu];
 
     Interrupt = (Processor->UpcallEnabled) ?
                 Processor->Interrupt :
@@ -563,7 +563,7 @@ EvtchnFlush(
     InitializeListHead(&List);
 
     Irql = FdoAcquireInterruptLock(Context->Fdo, Interrupt);
-    (VOID) EvtchnPoll(Context, Index, &List);
+    (VOID) EvtchnPoll(Context, Cpu, &List);
     FdoReleaseInterruptLock(Context->Fdo, Interrupt, Irql);
 
     while (!IsListEmpty(&List)) {
@@ -600,21 +600,21 @@ EvtchnDpc(
     )
 {
     PXENBUS_EVTCHN_CONTEXT  Context = _Context;
-    ULONG                   Index;
+    ULONG                   Cpu;
 
     UNREFERENCED_PARAMETER(Dpc);
     UNREFERENCED_PARAMETER(Argument1);
     UNREFERENCED_PARAMETER(Argument2);
 
     ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
-    Index = KeGetCurrentProcessorNumberEx(NULL);
+    Cpu = KeGetCurrentProcessorNumberEx(NULL);
 
     KeAcquireSpinLockAtDpcLevel(&Context->Lock);
 
     if (Context->References == 0)
         goto done;
 
-    EvtchnFlush(Context, Index);
+    EvtchnFlush(Context, Cpu);
 
 done:
     KeReleaseSpinLockFromDpcLevel(&Context->Lock);
@@ -629,7 +629,7 @@ EvtchnTrigger(
     PXENBUS_EVTCHN_CONTEXT      Context = Interface->Context;
     KIRQL                       Irql;
     PROCESSOR_NUMBER            ProcNumber;
-    ULONG                       Index;
+    ULONG                       Cpu;
     PXENBUS_EVTCHN_PROCESSOR    Processor;
     PXENBUS_INTERRUPT           Interrupt;
     BOOLEAN                     Pending;
@@ -640,10 +640,10 @@ EvtchnTrigger(
     ProcNumber = Channel->ProcNumber;
     KeReleaseSpinLock(&Channel->Lock, Irql);
 
-    Index = KeGetProcessorIndexFromNumber(&ProcNumber);
+    Cpu = KeGetProcessorIndexFromNumber(&ProcNumber);
 
-    ASSERT3U(Index, <, Context->ProcessorCount);
-    Processor = &Context->Processor[Index];
+    ASSERT3U(Cpu, <, Context->ProcessorCount);
+    Processor = &Context->Processor[Cpu];
 
     Interrupt = (Processor->UpcallEnabled) ?
                 Processor->Interrupt :
@@ -675,7 +675,7 @@ EvtchnBind(
 {
     PXENBUS_EVTCHN_CONTEXT      Context = Interface->Context;
     PROCESSOR_NUMBER            ProcNumber;
-    ULONG                       Index;
+    ULONG                       Cpu;
     PXENBUS_EVTCHN_PROCESSOR    Processor;
     ULONG                       LocalPort;
     unsigned int                vcpu_id;
@@ -688,10 +688,10 @@ EvtchnBind(
     ProcNumber.Group = Group;
     ProcNumber.Number = Number;
 
-    Index = KeGetProcessorIndexFromNumber(&ProcNumber);
+    Cpu = KeGetProcessorIndexFromNumber(&ProcNumber);
 
-    ASSERT3U(Index, <, Context->ProcessorCount);
-    Processor = &Context->Processor[Index];
+    ASSERT3U(Cpu, <, Context->ProcessorCount);
+    Processor = &Context->Processor[Cpu];
 
     status = STATUS_NOT_SUPPORTED;
     if (!Processor->UpcallEnabled)
@@ -708,7 +708,7 @@ EvtchnBind(
 
     LocalPort = Channel->LocalPort;
 
-    status = SystemVirtualCpuIndex(Index, &vcpu_id);
+    status = SystemVirtualCpuIndex(Cpu, &vcpu_id);
     ASSERT(NT_SUCCESS(status));
 
     status = EventChannelBindVirtualCpu(LocalPort, vcpu_id);
@@ -1026,19 +1026,19 @@ EvtchnInterruptCallback(
     )
 {
     PXENBUS_EVTCHN_CONTEXT  Context = Argument;
-    ULONG                   Index;
+    ULONG                   Cpu;
     BOOLEAN                 DoneSomething;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
     ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
-    Index = KeGetCurrentProcessorNumberEx(NULL);
+    Cpu = KeGetCurrentProcessorNumberEx(NULL);
 
     DoneSomething = FALSE;
     while (XENBUS_SHARED_INFO(UpcallPending,
                               &Context->SharedInfoInterface,
-                              Index))
-        DoneSomething |= EvtchnPoll(Context, Index, NULL);
+                              Cpu))
+        DoneSomething |= EvtchnPoll(Context, Cpu, NULL);
 
     return DoneSomething;
 }
@@ -1210,24 +1210,24 @@ EvtchnInterruptEnable(
     IN  PXENBUS_EVTCHN_CONTEXT  Context
     )
 {
-    ULONG                       Index;
+    ULONG                       Cpu;
     ULONG                       Line;
     NTSTATUS                    status;
 
     Trace("====>\n");
 
-    for (Index = 0; Index < Context->ProcessorCount; Index++) {
+    for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
         PXENBUS_EVTCHN_PROCESSOR    Processor;
         unsigned int                vcpu_id;
         UCHAR                       Vector;
         PROCESSOR_NUMBER            ProcNumber;
 
-        Processor = &Context->Processor[Index];
+        Processor = &Context->Processor[Cpu];
 
         if (Processor->Interrupt == NULL)
             continue;
 
-        status = SystemVirtualCpuIndex(Index, &vcpu_id);
+        status = SystemVirtualCpuIndex(Cpu, &vcpu_id);
         ASSERT(NT_SUCCESS(status));
 
         Vector = FdoGetInterruptVector(Context->Fdo, Processor->Interrupt);
@@ -1241,7 +1241,7 @@ EvtchnInterruptEnable(
             break;
         }
 
-        status = KeGetProcessorNumberFromIndex(Index, &ProcNumber);
+        status = KeGetProcessorNumberFromIndex(Cpu, &ProcNumber);
         ASSERT(NT_SUCCESS(status));
 
         Info("CPU %u:%u (Vector = %u)\n",
@@ -1266,7 +1266,7 @@ EvtchnInterruptDisable(
     IN  PXENBUS_EVTCHN_CONTEXT  Context
     )
 {
-    ULONG                       Index;
+    ULONG                       Cpu;
     NTSTATUS                    status;
 
     UNREFERENCED_PARAMETER(Context);
@@ -1276,16 +1276,16 @@ EvtchnInterruptDisable(
     status = HvmSetParam(HVM_PARAM_CALLBACK_IRQ, 0);
     ASSERT(NT_SUCCESS(status));
 
-    for (Index = 0; Index < Context->ProcessorCount; Index++) {
+    for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
         PXENBUS_EVTCHN_PROCESSOR    Processor;
         unsigned int                vcpu_id;
 
-        Processor = &Context->Processor[Index];
+        Processor = &Context->Processor[Cpu];
 
         if (!Processor->UpcallEnabled)
             continue;
 
-        status = SystemVirtualCpuIndex(Index, &vcpu_id);
+        status = SystemVirtualCpuIndex(Cpu, &vcpu_id);
         ASSERT(NT_SUCCESS(status));
 
         (VOID) HvmSetEvtchnUpcallVector(vcpu_id, 0);
@@ -1442,7 +1442,7 @@ EvtchnAcquire(
     PXENBUS_FDO             Fdo = Context->Fdo;
     KIRQL                   Irql;
     PROCESSOR_NUMBER        ProcNumber;
-    ULONG                   Index;
+    ULONG                   Cpu;
     NTSTATUS                status;
 
     KeAcquireSpinLock(&Context->Lock, &Irql);
@@ -1516,18 +1516,18 @@ EvtchnAcquire(
     if (Context->Processor == NULL)
         goto fail9;
 
-    for (Index = 0; Index < Context->ProcessorCount; Index++) {
+    for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
         PXENBUS_EVTCHN_PROCESSOR    Processor;
 
         if (!XENBUS_EVTCHN_ABI(IsProcessorEnabled,
                                &Context->EvtchnAbi,
-                               Index))
+                               Cpu))
             continue;
 
-        status = KeGetProcessorNumberFromIndex(Index, &ProcNumber);
+        status = KeGetProcessorNumberFromIndex(Cpu, &ProcNumber);
         ASSERT(NT_SUCCESS(status));
 
-        Processor = &Context->Processor[Index];
+        Processor = &Context->Processor[Cpu];
 
         Processor->Interrupt = FdoAllocateInterrupt(Fdo,
                                                     Latched,
@@ -1621,7 +1621,7 @@ EvtchnRelease(
     PXENBUS_EVTCHN_CONTEXT  Context = Interface->Context;
     PXENBUS_FDO             Fdo = Context->Fdo;
     KIRQL                   Irql;
-    ULONG                   Index;
+    ULONG                   Cpu;
 
     KeAcquireSpinLock(&Context->Lock, &Irql);
 
@@ -1632,16 +1632,16 @@ EvtchnRelease(
 
     EvtchnInterruptDisable(Context);
 
-    for (Index = 0; Index < Context->ProcessorCount; Index++) {
+    for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
         PXENBUS_EVTCHN_PROCESSOR Processor;
 
         ASSERT(Context->Processor != NULL);
-        Processor = &Context->Processor[Index];
+        Processor = &Context->Processor[Cpu];
 
         if (Processor->Interrupt == NULL)
             continue;
 
-        EvtchnFlush(Context, Index);
+        EvtchnFlush(Context, Cpu);
 
         (VOID) KeRemoveQueueDpc(&Processor->Dpc);
         RtlZeroMemory(&Processor->Dpc, sizeof (KDPC));
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:44 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30691.60873 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRX-0008JC-Qy; Thu, 19 Nov 2020 12:53:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30691.60873; Thu, 19 Nov 2020 12:53:43 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRX-0008Iv-KD; Thu, 19 Nov 2020 12:53:43 +0000
Received: by outflank-mailman (input) for mailman id 30691;
 Thu, 19 Nov 2020 12:53:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRW-0008Ia-Pb
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRW-0003N2-Of; Thu, 19 Nov 2020 12:53:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRW-0003sT-Gy; Thu, 19 Nov 2020 12:53:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRW-0008Ia-Pb
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:42 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=8AOlbGzer/9v2YgGq5rnWE9Ax8L6NOfcFGpltHGpi4I=; b=sRYwkzDKQ8JzTvs6UfN3V8Yko
	tbiR5ntdI3kfP//Xb0vhCBp4igp64iYixRkm+OoULFPjJQgO92xyjLmXpPss9Sv1E9HuSVcW1UoWa
	6vdfk0Rn7GV3Gv5LohGEydu38PPpb3fEp10o1e6vY5u2JGL6f96C40fGXRAUtk5yXHcjk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRW-0003N2-Of; Thu, 19 Nov 2020 12:53:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRW-0003sT-Gy; Thu, 19 Nov 2020 12:53:42 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 03/12] Fix formatting in include/xen.h
Date: Thu, 19 Nov 2020 12:53:28 +0000
Message-Id: <20201119125337.29003-4-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

This is a purely cosmetic patch removing some unnecessary indentation.

Subsequent patches will modify this file, hence this patch pre-emptively fixes
bad formatting that would otherwise end up diff context.

No functional change.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 include/xen.h | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/xen.h b/include/xen.h
index 171fa4ef43b9..2b74fe691e41 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -201,15 +201,15 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelExpandArray(
-    IN  PFN_NUMBER              Pfn
+    IN  PFN_NUMBER  Pfn
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 EventChannelInitControl(
-    IN  PFN_NUMBER              Pfn,
-    IN  unsigned int            vcpu_id
+    IN  PFN_NUMBER      Pfn,
+    IN  unsigned int    vcpu_id
     );
 
 __checkReturn
@@ -223,8 +223,8 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelBindVirtualCpu(
-    IN  ULONG               LocalPort,
-    IN  unsigned int        vcpu_id
+    IN  ULONG           LocalPort,
+    IN  unsigned int    vcpu_id
     );
 
 __checkReturn
@@ -262,27 +262,27 @@ __checkReturn
 XEN_API
 NTSTATUS
 GrantTableMapForeignPage(
-    IN  USHORT                  Domain,
-    IN  ULONG                   GrantRef,
-    IN  PHYSICAL_ADDRESS        Address,
-    IN  BOOLEAN                 ReadOnly,
-    OUT ULONG                   *Handle
+    IN  USHORT              Domain,
+    IN  ULONG               GrantRef,
+    IN  PHYSICAL_ADDRESS    Address,
+    IN  BOOLEAN             ReadOnly,
+    OUT ULONG               *Handle
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 GrantTableUnmapForeignPage(
-    IN  ULONG                   Handle,
-    IN  PHYSICAL_ADDRESS        Address
+    IN  ULONG               Handle,
+    IN  PHYSICAL_ADDRESS    Address
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 GrantTableQuerySize(
-    OUT uint32_t                *Current OPTIONAL,
-    OUT uint32_t                *Maximum OPTIONAL
+    OUT uint32_t    *Current OPTIONAL,
+    OUT uint32_t    *Maximum OPTIONAL
     );
 
 // SCHED
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:44 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30689.60864 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRW-0008IQ-Nt; Thu, 19 Nov 2020 12:53:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30689.60864; Thu, 19 Nov 2020 12:53:42 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRW-0008I2-Gx; Thu, 19 Nov 2020 12:53:42 +0000
Received: by outflank-mailman (input) for mailman id 30689;
 Thu, 19 Nov 2020 12:53:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRV-0008Hi-SY
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRV-0003Mu-Ky; Thu, 19 Nov 2020 12:53:41 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRV-0003sT-AN; Thu, 19 Nov 2020 12:53:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRV-0008Hi-SY
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:41 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=jMeXLqOwfAsk2HbuM7ecyYxoxwxH3j0LCrS0oNnTi5o=; b=fL4jWfoOmomCpxeRCBY1QBeXM
	NC0x70MnrDIA0Ev7CmJ+eiRR3F8ReJA+QFE8salia6nW+5QWZwmo9PYj0QVA6Z/RonaALDchrWw7z
	xc4ApQqyfBhEMQeQWcQnn5LQ6FUacfsp6TAucpJz7ZhEt/N04cBe7bK6y7c8ZUF4PVWM4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRV-0003Mu-Ky; Thu, 19 Nov 2020 12:53:41 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRV-0003sT-AN; Thu, 19 Nov 2020 12:53:41 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 01/12] Introduce a new XENBUS_VIRQ structure and new functions...
Date: Thu, 19 Nov 2020 12:53:26 +0000
Message-Id: <20201119125337.29003-2-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

... for creation/destruction of VIRQ event channels.

Currently XENBUS only opens a DEBUG_VIRQ channel, which is used to trigger
a dump of diagnostics information when sent by the 'q' key handler in Xen.

Subsequent patches will open other VIRQ channels and hence this patch lays
the groundwork for those modifications.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/common/names.h |  22 ++++++
 src/xenbus/fdo.c   | 192 ++++++++++++++++++++++++++++++++++-----------
 2 files changed, 169 insertions(+), 45 deletions(-)

diff --git a/src/common/names.h b/src/common/names.h
index 90636bb86d74..84267d18fe5e 100644
--- a/src/common/names.h
+++ b/src/common/names.h
@@ -33,6 +33,7 @@
 #define _COMMON_NAMES_H_
 
 #include <ntddk.h>
+#include <xen.h>
 
 static FORCEINLINE const CHAR *
 PowerStateTypeName(
@@ -472,4 +473,25 @@ ProcessorChangeName(
 #undef _PROCESSOR_CHANGE_NAME
 }
 
+static FORCEINLINE const CHAR *
+VirqName(
+    IN  ULONG   Type
+    )
+{
+#define _VIRQ_NAME(_Type) \
+    case VIRQ_ ## _Type:  \
+        return #_Type;
+
+    switch (Type) {
+    _VIRQ_NAME(DEBUG);
+    _VIRQ_NAME(TIMER);
+    default:
+        break;
+    }
+
+    return "UNKNOWN";
+
+#undef _VIRQ_NAME
+}
+
 #endif // _COMMON_NAMES_H_
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 27837b293587..cdcfc85d6090 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -80,6 +80,13 @@ struct _XENBUS_INTERRUPT {
     PVOID               Argument;
 };
 
+typedef struct _XENBUS_VIRQ {
+    PXENBUS_FDO             Fdo;
+    LIST_ENTRY              ListEntry;
+    ULONG                   Type;
+    PXENBUS_EVTCHN_CHANNEL  Channel;
+} XENBUS_VIRQ, *PXENBUS_VIRQ;
+
 struct _XENBUS_FDO {
     PXENBUS_DX                      Dx;
     PDEVICE_OBJECT                  LowerDeviceObject;
@@ -143,7 +150,7 @@ struct _XENBUS_FDO {
     PXENBUS_RANGE_SET               RangeSet;
     LIST_ENTRY                      InterruptList;
 
-    PXENBUS_EVTCHN_CHANNEL          Channel;
+    LIST_ENTRY                      VirqList;
     PXENBUS_SUSPEND_CALLBACK        SuspendCallbackLate;
     PLOG_DISPOSITION                LogDisposition;
 };
@@ -2491,27 +2498,6 @@ FdoDestroyInterrupt(
     RtlZeroMemory(&Fdo->InterruptList, sizeof (LIST_ENTRY));
 }
 
-static
-_Function_class_(KSERVICE_ROUTINE)
-_IRQL_requires_(HIGH_LEVEL)
-_IRQL_requires_same_
-BOOLEAN
-FdoEvtchnCallback(
-    IN  PKINTERRUPT         InterruptObject,
-    IN  PVOID               Argument
-    )
-{
-    PXENBUS_FDO             Fdo = Argument;
-
-    UNREFERENCED_PARAMETER(InterruptObject);
-
-    ASSERT(Fdo != NULL);
-
-    XENBUS_DEBUG(Trigger, &Fdo->DebugInterface, NULL);
-
-    return TRUE;
-}
-
 static FORCEINLINE BOOLEAN
 __FdoMatchDistribution(
     IN  PXENBUS_FDO Fdo,
@@ -2767,6 +2753,141 @@ FdoOutputBuffer(
                           (ULONG)(Cursor - FdoOutBuffer));
 }
 
+static
+_Function_class_(KSERVICE_ROUTINE)
+_IRQL_requires_(HIGH_LEVEL)
+_IRQL_requires_same_
+BOOLEAN
+FdoVirqCallback(
+    IN  PKINTERRUPT InterruptObject,
+    IN  PVOID       Argument
+    )
+{
+    PXENBUS_VIRQ    Virq = Argument;
+    PXENBUS_FDO     Fdo;
+
+    UNREFERENCED_PARAMETER(InterruptObject);
+
+    ASSERT(Virq != NULL);
+    Fdo = Virq->Fdo;
+
+    ASSERT3U(Virq->Type, ==, VIRQ_DEBUG);
+    XENBUS_DEBUG(Trigger, &Fdo->DebugInterface, NULL);
+
+    return TRUE;
+}
+
+static FORCEINLINE VOID
+__FdoVirqDestroy(
+    IN  PXENBUS_VIRQ    Virq
+    )
+{
+    PXENBUS_FDO         Fdo = Virq->Fdo;
+
+    Info("%s\n", VirqName(Virq->Type));
+
+    XENBUS_EVTCHN(Close,
+                  &Fdo->EvtchnInterface,
+                  Virq->Channel);
+
+    __FdoFree(Virq);
+}
+
+static FORCEINLINE NTSTATUS
+__FdoVirqCreate(
+    IN  PXENBUS_FDO     Fdo,
+    IN  ULONG           Type,
+    OUT PXENBUS_VIRQ    *Virq
+    )
+{
+    NTSTATUS            status;
+
+    *Virq = __FdoAllocate(sizeof (XENBUS_VIRQ));
+
+    status = STATUS_NO_MEMORY;
+    if (*Virq == NULL)
+        goto fail1;
+
+    (*Virq)->Fdo = Fdo;
+    (*Virq)->Type = Type;
+    (*Virq)->Channel = XENBUS_EVTCHN(Open,
+                                     &Fdo->EvtchnInterface,
+                                     XENBUS_EVTCHN_TYPE_VIRQ,
+                                     FdoVirqCallback,
+                                     *Virq,
+                                     Type);
+
+    status = STATUS_UNSUCCESSFUL;
+    if ((*Virq)->Channel == NULL)
+        goto fail2;
+
+    (VOID) XENBUS_EVTCHN(Unmask,
+                         &Fdo->EvtchnInterface,
+                         (*Virq)->Channel,
+                         FALSE,
+                         TRUE);
+
+    Info("%s\n", VirqName((*Virq)->Type));
+
+    return STATUS_SUCCESS;
+
+fail2:
+    Error("fail2\n");
+
+    __FdoFree(*Virq);
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+static VOID
+FdoVirqTeardown(
+    IN  PXENBUS_FDO Fdo
+    )
+{
+    while (!IsListEmpty(&Fdo->VirqList)) {
+        PLIST_ENTRY     ListEntry;
+        PXENBUS_VIRQ    Virq;
+
+        ListEntry = RemoveHeadList(&Fdo->VirqList);
+        ASSERT(ListEntry != &Fdo->VirqList);
+
+        RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY));
+
+        Virq = CONTAINING_RECORD(ListEntry, XENBUS_VIRQ, ListEntry);
+
+        __FdoVirqDestroy(Virq);
+    }
+
+    RtlZeroMemory(&Fdo->VirqList, sizeof (LIST_ENTRY));
+}
+
+static NTSTATUS
+FdoVirqInitialize(
+    IN  PXENBUS_FDO Fdo
+    )
+{
+    PXENBUS_VIRQ    Virq;
+    NTSTATUS        status;
+
+    InitializeListHead(&Fdo->VirqList);
+
+    status = __FdoVirqCreate(Fdo, VIRQ_DEBUG, &Virq);
+    if (!NT_SUCCESS(status))
+        goto fail1;
+
+    InsertTailList(&Fdo->VirqList, &Virq->ListEntry);
+
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
 static FORCEINLINE NTSTATUS
 __FdoD3ToD0(
     IN  PXENBUS_FDO Fdo
@@ -2780,23 +2901,10 @@ __FdoD3ToD0(
 
     (VOID) FdoSetDistribution(Fdo);
 
-    Fdo->Channel = XENBUS_EVTCHN(Open,
-                                 &Fdo->EvtchnInterface,
-                                 XENBUS_EVTCHN_TYPE_VIRQ,
-                                 FdoEvtchnCallback,
-                                 Fdo,
-                                 VIRQ_DEBUG);
-
-    status = STATUS_UNSUCCESSFUL;
-    if (Fdo->Channel == NULL)
+    status = FdoVirqInitialize(Fdo);
+    if (!NT_SUCCESS(status))
         goto fail1;
 
-    (VOID) XENBUS_EVTCHN(Unmask,
-                         &Fdo->EvtchnInterface,
-                         Fdo->Channel,
-                         FALSE,
-                         TRUE);
-
     status = LogAddDisposition(DriverGetConsoleLogLevel(),
                                FdoOutputBuffer,
                                Fdo,
@@ -2880,10 +2988,7 @@ fail2:
     LogRemoveDisposition(Fdo->LogDisposition);
     Fdo->LogDisposition = NULL;
 
-    XENBUS_EVTCHN(Close,
-                  &Fdo->EvtchnInterface,
-                  Fdo->Channel);
-    Fdo->Channel = NULL;
+    FdoVirqTeardown(Fdo);
 
 fail1:
     Error("fail1 (%08x)\n", status);
@@ -2932,10 +3037,7 @@ __FdoD0ToD3(
     LogRemoveDisposition(Fdo->LogDisposition);
     Fdo->LogDisposition = NULL;
 
-    XENBUS_EVTCHN(Close,
-                  &Fdo->EvtchnInterface,
-                  Fdo->Channel);
-    Fdo->Channel = NULL;
+    FdoVirqTeardown(Fdo);
 
     FdoClearDistribution(Fdo);
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:44 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30692.60876 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRY-0008KK-RN; Thu, 19 Nov 2020 12:53:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30692.60876; Thu, 19 Nov 2020 12:53:44 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRY-0008K0-Me; Thu, 19 Nov 2020 12:53:44 +0000
Received: by outflank-mailman (input) for mailman id 30692;
 Thu, 19 Nov 2020 12:53:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRX-0008If-GL
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRX-0003N6-Bb; Thu, 19 Nov 2020 12:53:43 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRX-0003sT-4B; Thu, 19 Nov 2020 12:53:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRX-0008If-GL
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:43 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=k+RDTSUWgtwKgRn95WR5Gk3n++NJjz+4y1F69bljvCw=; b=hu5CdhvmjwFhdmJffESl+8TDa
	sTwLU8hVGCjdq0Tzzdf04xWr0FZN3VY9GBt73S6CHJzjtKRYrbsqYmkEJ9Aw4bGhGNtgDkSyNg48M
	X0LWMWXNj6dHR0YDJzigUKmNgxDuOGV73yDRncoYWeUjLQwCv69665pkVRw+3WpiQMYs0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRX-0003N6-Bb; Thu, 19 Nov 2020 12:53:43 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRX-0003sT-4B; Thu, 19 Nov 2020 12:53:43 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 04/12] Use Windows types in XEN_API event channel functions
Date: Thu, 19 Nov 2020 12:53:29 +0000
Message-Id: <20201119125337.29003-5-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

Other XEN_API functions use Windows types rather than Xen types in most cases.
There is no good reason why functions related to event channels need expose
types such as 'domid_t' or 'evtchn_port_t' to callers, especially when the
callers already use USHORT and ULONG types (respectively) for those quantities.

No functional change.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 include/xen.h           | 24 ++++++++++++------------
 src/xen/event_channel.c | 30 +++++++++++++++---------------
 src/xenbus/evtchn.c     | 16 ++++++++--------
 3 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/include/xen.h b/include/xen.h
index 2b74fe691e41..c2babc0c0280 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -153,48 +153,48 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelSend(
-    IN  evtchn_port_t   Port
+    IN  ULONG   Port
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 EventChannelAllocateUnbound(
-    IN  domid_t         Domain,
-    OUT evtchn_port_t   *Port
+    IN  USHORT  Domain,
+    OUT ULONG   *Port
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 EventChannelBindInterDomain(
-    IN  domid_t         RemoteDomain,
-    IN  evtchn_port_t   RemotePort,
-    OUT evtchn_port_t   *LocalPort
+    IN  USHORT  RemoteDomain,
+    IN  ULONG   RemotePort,
+    OUT ULONG   *LocalPort
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 EventChannelBindVirq(
-    IN  uint32_t        Virq,
-    OUT evtchn_port_t   *LocalPort
+    IN  ULONG   Virq,
+    OUT ULONG   *LocalPort
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 EventChannelQueryInterDomain(
-    IN  evtchn_port_t   LocalPort,
-    OUT domid_t         *RemoteDomain,
-    OUT evtchn_port_t   *RemotePort
+    IN  ULONG   LocalPort,
+    OUT USHORT  *RemoteDomain,
+    OUT ULONG   *RemotePort
     );
 
 __checkReturn
 XEN_API
 NTSTATUS
 EventChannelClose(
-    IN  evtchn_port_t   LocalPort
+    IN  ULONG   LocalPort
     );
 
 __checkReturn
diff --git a/src/xen/event_channel.c b/src/xen/event_channel.c
index aa9fb4859c7b..c2ce6a241c8b 100644
--- a/src/xen/event_channel.c
+++ b/src/xen/event_channel.c
@@ -51,7 +51,7 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelSend(
-    IN  evtchn_port_t   LocalPort
+    IN  ULONG           LocalPort
     )
 {
     struct evtchn_send  op;
@@ -79,8 +79,8 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelAllocateUnbound(
-    IN  domid_t                 Domain,
-    OUT evtchn_port_t           *LocalPort
+    IN  USHORT                  Domain,
+    OUT ULONG                   *LocalPort
     )
 {
     struct evtchn_alloc_unbound op;
@@ -111,9 +111,9 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelBindInterDomain(
-    IN  domid_t                     RemoteDomain,
-    IN  evtchn_port_t               RemotePort,
-    OUT evtchn_port_t               *LocalPort
+    IN  USHORT                      RemoteDomain,
+    IN  ULONG                       RemotePort,
+    OUT ULONG                       *LocalPort
     )
 {
     struct evtchn_bind_interdomain  op;
@@ -144,8 +144,8 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelBindVirq(
-    IN  uint32_t            Virq,
-    OUT evtchn_port_t       *LocalPort
+    IN  ULONG               Virq,
+    OUT ULONG               *LocalPort
     )
 {
     struct evtchn_bind_virq op;
@@ -176,14 +176,14 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelQueryInterDomain(
-    IN  evtchn_port_t               LocalPort,
-    OUT domid_t                     *RemoteDomain,
-    OUT evtchn_port_t               *RemotePort
+    IN  ULONG               LocalPort,
+    OUT USHORT              *RemoteDomain,
+    OUT ULONG               *RemotePort
     )
 {
-    struct evtchn_status            op;
-    LONG_PTR                        rc;
-    NTSTATUS                        status;
+    struct evtchn_status    op;
+    LONG_PTR                rc;
+    NTSTATUS                status;
 
     op.dom = DOMID_SELF;
     op.port = LocalPort;
@@ -217,7 +217,7 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelClose(
-    IN  evtchn_port_t   LocalPort
+    IN  ULONG           LocalPort
     )
 {
     struct evtchn_close op;
diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index d0546c067639..8c8c1648d007 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -1074,8 +1074,8 @@ EvtchnReset(
         Console.LocalPort = (ULONG)Value;
 
     if (Store.LocalPort != 0) {
-        domid_t         RemoteDomain;
-        evtchn_port_t   RemotePort;
+        USHORT  RemoteDomain;
+        ULONG   RemotePort;
 
         status = EventChannelQueryInterDomain(Store.LocalPort,
                                               &RemoteDomain,
@@ -1092,8 +1092,8 @@ EvtchnReset(
     }
 
     if (Console.LocalPort != 0) {
-        domid_t         RemoteDomain;
-        evtchn_port_t   RemotePort;
+        USHORT  RemoteDomain;
+        ULONG   RemotePort;
 
         status = EventChannelQueryInterDomain(Console.LocalPort,
                                               &RemoteDomain,
@@ -1113,8 +1113,8 @@ EvtchnReset(
     LogPrintf(LOG_LEVEL_INFO, "EVTCHN_RESET: RESET\n");
 
     if (Store.LocalPort != 0) {
-        domid_t         RemoteDomain;
-        evtchn_port_t   RemotePort;
+        USHORT  RemoteDomain;
+        ULONG   RemotePort;
 
         RemoteDomain = Store.Parameters.InterDomain.RemoteDomain;
         RemotePort = Store.Parameters.InterDomain.RemotePort;
@@ -1134,8 +1134,8 @@ EvtchnReset(
     }
 
     if (Console.LocalPort != 0) {
-        domid_t         RemoteDomain;
-        evtchn_port_t   RemotePort;
+        USHORT  RemoteDomain;
+        ULONG   RemotePort;
 
         RemoteDomain = Console.Parameters.InterDomain.RemoteDomain;
         RemotePort = Console.Parameters.InterDomain.RemotePort;
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:45 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30688.60859 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRW-0008Hv-Ix; Thu, 19 Nov 2020 12:53:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30688.60859; Thu, 19 Nov 2020 12:53:42 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRW-0008Hn-F6; Thu, 19 Nov 2020 12:53:42 +0000
Received: by outflank-mailman (input) for mailman id 30688;
 Thu, 19 Nov 2020 12:53:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRV-0008Hd-6f
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRU-0003Mq-W0; Thu, 19 Nov 2020 12:53:40 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRU-0003sT-N2; Thu, 19 Nov 2020 12:53:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRV-0008Hd-6f
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:41 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From;
	bh=OyHkzpFb7Bh/bvM4bqze5+2+fyIPG3ER+52QfrbSKDw=; b=W+Ertiq7GFRLBu80GZSkweRWou
	3GF/jqKTMbsoepWpduJxxiRyXVXJsoyUL3zRaCaVsLBN+6vZ3r+VvhmhHABaG1NUzLkOPxpB5syHB
	WqXBTx+9mW+OtJJ5seCnP24nyQhjlDI+TLA88HLRR+4oET261JRlRpAFSVXyKqYT2Ybw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRU-0003Mq-W0; Thu, 19 Nov 2020 12:53:40 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRU-0003sT-N2; Thu, 19 Nov 2020 12:53:40 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 00/12] Add watchdog functionality
Date: Thu, 19 Nov 2020 12:53:25 +0000
Message-Id: <20201119125337.29003-1-paul@xen.org>
X-Mailer: git-send-email 2.17.1

From: Paul Durrant <pdurrant@amazon.com>

Also clean up the documentation a bit.

Paul Durrant (12):
  Introduce a new XENBUS_VIRQ structure and new functions...
  s/Index/Cpu in the EVTCHN code where 'Index' relates to a processor
  Fix formatting in include/xen.h
  Use Windows types in XEN_API event channel functions
  Update the XENBUS_EVTCHN interface...
  Add functions to XEN_API to facilitate use of a domain watchdog
  Add support for Xen (VCPUOP) periodic timers
  Add XENBUS_DEBUG callback into fdo.c to dump VIRQ information
  Slightly modify the way balloon initialization is done in fdo.c
  Add "XEN:WATCHDOG=" system start option to specify a watchdog time-out
  Remove documention for python helpers that are no longer present
  Document system start options...

 README.md                  |  44 +++-
 include/evtchn_interface.h |  25 +-
 include/revision.h         |   3 +-
 include/xen.h              |  83 ++++---
 include/xen/public/vcpu.h  | 248 ++++++++++++++++++++
 src/common/names.h         |  22 ++
 src/xen/event_channel.c    |  33 +--
 src/xen/log.c              |   2 +
 src/xen/sched.c            |  36 ++-
 src/xen/system.c           |  62 +++++
 src/xen/unplug.c           |   2 +
 src/xen/vcpu.c             |  82 +++++++
 src/xenbus/evtchn.c        | 207 ++++++++++++-----
 src/xenbus/fdo.c           | 464 ++++++++++++++++++++++++++++++++-----
 vs2015/xen/xen.vcxproj     |   1 +
 vs2017/xen/xen.vcxproj     |   1 +
 vs2019/xen/xen.vcxproj     |   1 +
 17 files changed, 1138 insertions(+), 178 deletions(-)
 create mode 100644 include/xen/public/vcpu.h
 create mode 100644 src/xen/vcpu.c

-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:45 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30693.60878 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRZ-0008L4-RE; Thu, 19 Nov 2020 12:53:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30693.60878; Thu, 19 Nov 2020 12:53:45 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRZ-0008Kx-O4; Thu, 19 Nov 2020 12:53:45 +0000
Received: by outflank-mailman (input) for mailman id 30693;
 Thu, 19 Nov 2020 12:53:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRY-0008JW-2v
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRX-0003NA-V3; Thu, 19 Nov 2020 12:53:43 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRX-0003sT-Na; Thu, 19 Nov 2020 12:53:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRY-0008JW-2v
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:44 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=dHAN5BE5q5/MZpBBUt8iRuJz0yoJarBCbAzgxURSFvY=; b=UJNkBGjWRDcziIPjowBW2+m4e
	G6lhcLqgpW2Kl1MWOkAx55mfw0cG0hbSSTxrTFgsIkc0Td/uVp3AuOCBywCE3AgeWZcxoH5gVZXD9
	YbguaOvO4zci3CjN0CegupsN4BoUyt3imWcfC6O+vVt5JRrKUQ3eWTmvwB+0cKuK4WT0A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRX-0003NA-V3; Thu, 19 Nov 2020 12:53:43 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRX-0003sT-Na; Thu, 19 Nov 2020 12:53:43 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 05/12] Update the XENBUS_EVTCHN interface...
Date: Thu, 19 Nov 2020 12:53:30 +0000
Message-Id: <20201119125337.29003-6-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

... to allow 'vcpu_id' to be sepcified to the EvtchnOpen() method, when
opening a VIRQ channel.

Non-global VIRQ channels (such as VIRQ_DEBUG and VIRQ_TIMER) can be bound to
a specific vCPU. To allow callers of EvtchnOpen() to do this, it is necessary
for extra arguments to be passed to EvtchnOpenVirq().

This patch updates the version of XENBUS_EVTCHN from 8 to 9, despite there
being no function type change (since EvtchnOpen() is a variadic method) and
modifies the implemention of EvtchnOpen() to pass the number of arguments to
its type-specific helpers. Hence EvtchnOpenVirq() can determine whether or
not it is being supplied with vCPU infomation.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 include/evtchn_interface.h | 25 +++++++++-
 include/revision.h         |  3 +-
 include/xen.h              |  5 +-
 src/xen/event_channel.c    |  3 +-
 src/xenbus/evtchn.c        | 99 +++++++++++++++++++++++++++++++++++---
 src/xenbus/fdo.c           | 15 ++++--
 6 files changed, 135 insertions(+), 15 deletions(-)

diff --git a/include/evtchn_interface.h b/include/evtchn_interface.h
index ade725902421..fffde05bf1da 100644
--- a/include/evtchn_interface.h
+++ b/include/evtchn_interface.h
@@ -100,6 +100,8 @@ typedef VOID
 
     \b VIRQ:
     \param Index The index number of the VIRQ
+    \param Group The group number of the CPU that should handle the VIRQ
+    \param Number The relative number of the CPU that should handle the VIRQ
 
     \return Event channel handle
 */  
@@ -340,7 +342,26 @@ struct _XENBUS_EVTCHN_INTERFACE_V8 {
     XENBUS_EVTCHN_CLOSE     EvtchnClose;
 };
 
-typedef struct _XENBUS_EVTCHN_INTERFACE_V8 XENBUS_EVTCHN_INTERFACE, *PXENBUS_EVTCHN_INTERFACE;
+/*! \struct _XENBUS_EVTCHN_INTERFACE_V9
+    \brief EVTCHN interface version 9
+    \ingroup interfaces
+*/
+struct _XENBUS_EVTCHN_INTERFACE_V9 {
+    INTERFACE               Interface;
+    XENBUS_EVTCHN_ACQUIRE   EvtchnAcquire;
+    XENBUS_EVTCHN_RELEASE   EvtchnRelease;
+    XENBUS_EVTCHN_OPEN      EvtchnOpen;
+    XENBUS_EVTCHN_BIND      EvtchnBind;
+    XENBUS_EVTCHN_UNMASK    EvtchnUnmask;
+    XENBUS_EVTCHN_SEND      EvtchnSend;
+    XENBUS_EVTCHN_TRIGGER   EvtchnTrigger;
+    XENBUS_EVTCHN_GET_COUNT EvtchnGetCount;
+    XENBUS_EVTCHN_WAIT      EvtchnWait;
+    XENBUS_EVTCHN_GET_PORT  EvtchnGetPort;
+    XENBUS_EVTCHN_CLOSE     EvtchnClose;
+};
+
+typedef struct _XENBUS_EVTCHN_INTERFACE_V9 XENBUS_EVTCHN_INTERFACE, *PXENBUS_EVTCHN_INTERFACE;
 
 /*! \def XENBUS_EVTCHN
     \brief Macro at assist in method invocation
@@ -351,7 +372,7 @@ typedef struct _XENBUS_EVTCHN_INTERFACE_V8 XENBUS_EVTCHN_INTERFACE, *PXENBUS_EVT
 #endif  // _WINDLL
 
 #define XENBUS_EVTCHN_INTERFACE_VERSION_MIN 4
-#define XENBUS_EVTCHN_INTERFACE_VERSION_MAX 8
+#define XENBUS_EVTCHN_INTERFACE_VERSION_MAX 9
 
 #endif  // _XENBUS_EVTCHN_INTERFACE_H
 
diff --git a/include/revision.h b/include/revision.h
index 01b673722374..3a6b398e93a3 100644
--- a/include/revision.h
+++ b/include/revision.h
@@ -57,6 +57,7 @@
     DEFINE_REVISION(0x09000004,  1,  2,  8,  1,  2,  1,  1,  3,  1,  1,  1), \
     DEFINE_REVISION(0x09000005,  1,  2,  8,  1,  2,  1,  2,  4,  1,  1,  1), \
     DEFINE_REVISION(0x09000006,  1,  3,  8,  1,  2,  1,  2,  4,  1,  1,  1), \
-    DEFINE_REVISION(0x09000007,  1,  3,  8,  1,  2,  1,  2,  4,  1,  1,  2)
+    DEFINE_REVISION(0x09000007,  1,  3,  8,  1,  2,  1,  2,  4,  1,  1,  2), \
+    DEFINE_REVISION(0x09000008,  1,  3,  9,  1,  2,  1,  2,  4,  1,  1,  2)
 
 #endif  // _REVISION_H
diff --git a/include/xen.h b/include/xen.h
index c2babc0c0280..3532de839176 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -177,8 +177,9 @@ __checkReturn
 XEN_API
 NTSTATUS
 EventChannelBindVirq(
-    IN  ULONG   Virq,
-    OUT ULONG   *LocalPort
+    IN  ULONG           Virq,
+    IN  unsigned int    vcpu_id,
+    OUT ULONG           *LocalPort
     );
 
 __checkReturn
diff --git a/src/xen/event_channel.c b/src/xen/event_channel.c
index c2ce6a241c8b..2bce1c1c163b 100644
--- a/src/xen/event_channel.c
+++ b/src/xen/event_channel.c
@@ -145,6 +145,7 @@ XEN_API
 NTSTATUS
 EventChannelBindVirq(
     IN  ULONG               Virq,
+    IN  unsigned int        vcpu_id,
     OUT ULONG               *LocalPort
     )
 {
@@ -153,7 +154,7 @@ EventChannelBindVirq(
     NTSTATUS                status;
 
     op.virq = Virq;
-    op.vcpu = 0;
+    op.vcpu = vcpu_id;
 
     rc = EventChannelOp(EVTCHNOP_bind_virq, &op);
 
diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 8c8c1648d007..4a764c071433 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -138,13 +138,18 @@ __EvtchnFree(
 
 static NTSTATUS
 EvtchnOpenFixed(
+    IN  PXENBUS_EVTCHN_CONTEXT  Context,
     IN  PXENBUS_EVTCHN_CHANNEL  Channel,
+    IN  ULONG                   Count,
     IN  va_list                 Arguments
     )
 {
     ULONG                       LocalPort;
     BOOLEAN                     Mask;
 
+    UNREFERENCED_PARAMETER(Context);
+
+    ASSERT3U(Count, ==, 2);
     LocalPort = va_arg(Arguments, ULONG);
     Mask = va_arg(Arguments, BOOLEAN);
 
@@ -156,7 +161,9 @@ EvtchnOpenFixed(
 
 static NTSTATUS
 EvtchnOpenUnbound(
+    IN  PXENBUS_EVTCHN_CONTEXT  Context,
     IN  PXENBUS_EVTCHN_CHANNEL  Channel,
+    IN  ULONG                   Count,
     IN  va_list                 Arguments
     )
 {
@@ -165,6 +172,9 @@ EvtchnOpenUnbound(
     ULONG                       LocalPort;
     NTSTATUS                    status;
 
+    UNREFERENCED_PARAMETER(Context);
+
+    ASSERT3U(Count, ==, 2);
     RemoteDomain = va_arg(Arguments, USHORT);
     Mask = va_arg(Arguments, BOOLEAN);
 
@@ -187,7 +197,9 @@ fail1:
 
 static NTSTATUS
 EvtchnOpenInterDomain(
+    IN  PXENBUS_EVTCHN_CONTEXT  Context,
     IN  PXENBUS_EVTCHN_CHANNEL  Channel,
+    IN  ULONG                   Count,
     IN  va_list                 Arguments
     )
 {
@@ -197,6 +209,9 @@ EvtchnOpenInterDomain(
     ULONG                       LocalPort;
     NTSTATUS                    status;
 
+    UNREFERENCED_PARAMETER(Context);
+
+    ASSERT3U(Count, ==, 3);
     RemoteDomain = va_arg(Arguments, USHORT);
     RemotePort = va_arg(Arguments, ULONG);
     Mask = va_arg(Arguments, BOOLEAN);
@@ -223,26 +238,63 @@ fail1:
 
 static NTSTATUS
 EvtchnOpenVirq(
+    IN  PXENBUS_EVTCHN_CONTEXT  Context,
     IN  PXENBUS_EVTCHN_CHANNEL  Channel,
+    IN  ULONG                   Count,
     IN  va_list                 Arguments
     )
 {
     ULONG                       Index;
+    USHORT                      Group;
+    UCHAR                       Number;
+    PROCESSOR_NUMBER            ProcNumber;
+    ULONG                       Cpu;
+    PXENBUS_EVTCHN_PROCESSOR    Processor;
+    unsigned int                vcpu_id;
     ULONG                       LocalPort;
     NTSTATUS                    status;
 
     Index = va_arg(Arguments, ULONG);
 
-    status = EventChannelBindVirq(Index, &LocalPort);
-    if (!NT_SUCCESS(status))
+    if (Count == 1) {
+        Group = 0;
+        Number = 0;
+    } else {
+        ASSERT3U(Count, ==, 3);
+
+        Group = va_arg(Arguments, USHORT);
+        Number = va_arg(Arguments, UCHAR);
+    }
+
+    RtlZeroMemory(&ProcNumber, sizeof (PROCESSOR_NUMBER));
+    ProcNumber.Group = Group;
+    ProcNumber.Number = Number;
+
+    Cpu = KeGetProcessorIndexFromNumber(&ProcNumber);
+
+    ASSERT3U(Cpu, <, Context->ProcessorCount);
+    Processor = &Context->Processor[Cpu];
+
+    status = STATUS_NOT_SUPPORTED;
+    if (!Processor->UpcallEnabled)
         goto fail1;
 
+    status = SystemVirtualCpuIndex(Cpu, &vcpu_id);
+    ASSERT(NT_SUCCESS(status));
+
+    status = EventChannelBindVirq(Index, vcpu_id, &LocalPort);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
     Channel->Parameters.Virq.Index = Index;
 
     Channel->LocalPort = LocalPort;
 
     return STATUS_SUCCESS;
 
+fail2:
+    Error("fail2\n");
+
 fail1:
     Error("fail1 (%08x)\n", status);
 
@@ -292,19 +344,22 @@ EvtchnOpen(
     va_start(Arguments, Argument);
     switch (Type) {
     case XENBUS_EVTCHN_TYPE_FIXED:
-        status = EvtchnOpenFixed(Channel, Arguments);
+        status = EvtchnOpenFixed(Context, Channel, 2, Arguments);
         break;
 
     case XENBUS_EVTCHN_TYPE_UNBOUND:
-        status = EvtchnOpenUnbound(Channel, Arguments);
+        status = EvtchnOpenUnbound(Context, Channel, 2, Arguments);
         break;
 
     case XENBUS_EVTCHN_TYPE_INTER_DOMAIN:
-        status = EvtchnOpenInterDomain(Channel, Arguments);
+        status = EvtchnOpenInterDomain(Context, Channel, 3, Arguments);
         break;
 
     case XENBUS_EVTCHN_TYPE_VIRQ:
-        status = EvtchnOpenVirq(Channel, Arguments);
+        // Processor information only specified from version 9 onwards
+        status = EvtchnOpenVirq(Context, Channel,
+                                (Interface->Version < 9) ? 1 : 3,
+                                Arguments);
         break;
 
     default:
@@ -1762,6 +1817,21 @@ static struct _XENBUS_EVTCHN_INTERFACE_V8 EvtchnInterfaceVersion8 = {
     EvtchnClose,
 };
 
+static struct _XENBUS_EVTCHN_INTERFACE_V9 EvtchnInterfaceVersion9 = {
+    { sizeof (struct _XENBUS_EVTCHN_INTERFACE_V9), 9, NULL, NULL, NULL },
+    EvtchnAcquire,
+    EvtchnRelease,
+    EvtchnOpen,
+    EvtchnBind,
+    EvtchnUnmask,
+    EvtchnSend,
+    EvtchnTrigger,
+    EvtchnGetCount,
+    EvtchnWait,
+    EvtchnGetPort,
+    EvtchnClose,
+};
+
 NTSTATUS
 EvtchnInitialize(
     IN  PXENBUS_FDO             Fdo,
@@ -1955,6 +2025,23 @@ EvtchnGetInterface(
         status = STATUS_SUCCESS;
         break;
     }
+    case 9: {
+        struct _XENBUS_EVTCHN_INTERFACE_V9  *EvtchnInterface;
+
+        EvtchnInterface = (struct _XENBUS_EVTCHN_INTERFACE_V9 *)Interface;
+
+        status = STATUS_BUFFER_OVERFLOW;
+        if (Size < sizeof (struct _XENBUS_EVTCHN_INTERFACE_V9))
+            break;
+
+        *EvtchnInterface = EvtchnInterfaceVersion9;
+
+        ASSERT3U(Interface->Version, ==, Version);
+        Interface->Context = Context;
+
+        status = STATUS_SUCCESS;
+        break;
+    }
     default:
         status = STATUS_NOT_SUPPORTED;
         break;
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index cdcfc85d6090..852f2b85c7ee 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -2797,9 +2797,11 @@ static FORCEINLINE NTSTATUS
 __FdoVirqCreate(
     IN  PXENBUS_FDO     Fdo,
     IN  ULONG           Type,
+    IN  ULONG           Cpu,
     OUT PXENBUS_VIRQ    *Virq
     )
 {
+    PROCESSOR_NUMBER    ProcNumber;
     NTSTATUS            status;
 
     *Virq = __FdoAllocate(sizeof (XENBUS_VIRQ));
@@ -2810,12 +2812,18 @@ __FdoVirqCreate(
 
     (*Virq)->Fdo = Fdo;
     (*Virq)->Type = Type;
+
+    status = KeGetProcessorNumberFromIndex(Cpu, &ProcNumber);
+    ASSERT(NT_SUCCESS(status));
+
     (*Virq)->Channel = XENBUS_EVTCHN(Open,
                                      &Fdo->EvtchnInterface,
                                      XENBUS_EVTCHN_TYPE_VIRQ,
                                      FdoVirqCallback,
                                      *Virq,
-                                     Type);
+                                     Type,
+                                     ProcNumber.Group,
+                                     ProcNumber.Number);
 
     status = STATUS_UNSUCCESSFUL;
     if ((*Virq)->Channel == NULL)
@@ -2827,7 +2835,8 @@ __FdoVirqCreate(
                          FALSE,
                          TRUE);
 
-    Info("%s\n", VirqName((*Virq)->Type));
+    Info("%s: CPU %u:%u\n", VirqName((*Virq)->Type),
+         ProcNumber.Group, ProcNumber.Number);
 
     return STATUS_SUCCESS;
 
@@ -2874,7 +2883,7 @@ FdoVirqInitialize(
 
     InitializeListHead(&Fdo->VirqList);
 
-    status = __FdoVirqCreate(Fdo, VIRQ_DEBUG, &Virq);
+    status = __FdoVirqCreate(Fdo, VIRQ_DEBUG, 0, &Virq);
     if (!NT_SUCCESS(status))
         goto fail1;
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:46 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30694.60884 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRZ-0008LK-VZ; Thu, 19 Nov 2020 12:53:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30694.60884; Thu, 19 Nov 2020 12:53:45 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRZ-0008L8-Pl; Thu, 19 Nov 2020 12:53:45 +0000
Received: by outflank-mailman (input) for mailman id 30694;
 Thu, 19 Nov 2020 12:53:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRY-0008K2-Ml
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRY-0003NE-IR; Thu, 19 Nov 2020 12:53:44 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRY-0003sT-Ap; Thu, 19 Nov 2020 12:53:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRY-0008K2-Ml
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:44 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=6Zd8JxNcOPMIlQJjZ36w8a/RkkwXlDOOp+MOinLqb74=; b=aSxEMe3yxD1b9vDzaMEvYU9sU
	Is2wk4bVwfTzOBnYq0Mym0RQb53t1fWSTo7J2pq/gwN/zCNVpIeAQTG2h6nzsGEQ/B+ROvjc6iSCn
	yFM29wlf/tPuF7Da5v9AFcay/M5Q4k0GM5r5WAc9vrh/fkUJZpbcPoCHfr/B8TGv1RIAQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRY-0003NE-IR; Thu, 19 Nov 2020 12:53:44 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRY-0003sT-Ap; Thu, 19 Nov 2020 12:53:44 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 06/12] Add functions to XEN_API to facilitate use of a domain watchdog
Date: Thu, 19 Nov 2020 12:53:31 +0000
Message-Id: <20201119125337.29003-7-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

The SCHEDOP_watchdog hypercall allows a domain to program a watchdog time-
out (in seconds) after which it will be shut down.

This patch adds a helper function into sched.c to make the hypercall and also
adds new SystemSetWatchdog() and SystemStopWatchdog() functions that provide
a more friendly API to the functionality.

This patch does not introduce callers of the new API. Those will be
introduced in a subsequent patch.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 include/xen.h    | 19 +++++++++++++++
 src/xen/sched.c  | 36 ++++++++++++++++++++++++++--
 src/xen/system.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 115 insertions(+), 2 deletions(-)

diff --git a/include/xen.h b/include/xen.h
index 3532de839176..4594db975332 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -308,6 +308,13 @@ SchedYield(
     VOID
     );
 
+XEN_API
+NTSTATUS
+SchedWatchdog(
+    IN OUT  PULONG  Id,
+    IN      ULONG   Seconds
+    );
+
 // XEN VERSION
 
 __checkReturn
@@ -465,4 +472,16 @@ SystemRealTimeIsUniversal(
     VOID
     );
 
+XEN_API
+NTSTATUS
+SystemSetWatchdog(
+    IN  ULONG       Seconds
+    );
+
+XEN_API
+VOID
+SystemStopWatchdog(
+    VOID
+    );
+
 #endif  // _XEN_H
diff --git a/src/xen/sched.c b/src/xen/sched.c
index 56cbcf7b3345..11ca52241650 100644
--- a/src/xen/sched.c
+++ b/src/xen/sched.c
@@ -51,7 +51,7 @@ __checkReturn
 XEN_API
 NTSTATUS
 SchedShutdownCode(
-    ULONG                   Reason
+    IN  ULONG               Reason
     )
 {
     struct sched_shutdown   op;
@@ -79,7 +79,7 @@ __checkReturn
 XEN_API
 NTSTATUS
 SchedShutdown(
-    ULONG                   Reason
+    IN  ULONG               Reason
     )
 {
     struct sched_shutdown   op;
@@ -119,3 +119,35 @@ SchedYield(
 {
     (VOID) SchedOp(SCHEDOP_yield, NULL);
 }
+
+XEN_API
+NTSTATUS
+SchedWatchdog(
+    IN OUT  PULONG          Id,
+    IN      ULONG           Seconds
+    )
+{
+    struct sched_watchdog   op;
+    LONG_PTR                rc;
+    NTSTATUS                status;
+
+    op.id = *Id;
+    op.timeout = Seconds;
+
+    rc = SchedOp(SCHEDOP_watchdog, &op);
+
+    if (rc < 0) {
+        ERRNO_TO_STATUS(-rc, status);
+        goto fail1;
+    }
+
+    if (*Id == 0)
+        *Id = (ULONG)rc;
+
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
diff --git a/src/xen/system.c b/src/xen/system.c
index 45fe3b6c31bb..5a8ba16a6660 100644
--- a/src/xen/system.c
+++ b/src/xen/system.c
@@ -55,6 +55,11 @@ typedef struct _SYSTEM_PROCESSOR {
     UCHAR   ProcessorID;
 } SYSTEM_PROCESSOR, *PSYSTEM_PROCESSOR;
 
+typedef struct _SYSTEM_WATCHDOG {
+    ULONG   Id;
+    ULONG   Seconds;
+} SYSTEM_WATCHDOG, *PSYSTEM_WATCHDOG;
+
 typedef struct _SYSTEM_CONTEXT {
     LONG                References;
     PACPI_MADT          Madt;
@@ -64,6 +69,7 @@ typedef struct _SYSTEM_CONTEXT {
     PVOID               ProcessorChangeHandle;
     PHYSICAL_ADDRESS    MaximumPhysicalAddress;
     BOOLEAN             RealTimeIsUniversal;
+    SYSTEM_WATCHDOG     Watchdog;
 } SYSTEM_CONTEXT, *PSYSTEM_CONTEXT;
 
 static SYSTEM_CONTEXT   SystemContext;
@@ -1104,6 +1110,62 @@ SystemRealTimeIsUniversal(
     return Context->RealTimeIsUniversal;
 }
 
+XEN_API
+NTSTATUS
+SystemSetWatchdog(
+    IN  ULONG       Seconds
+    )
+{
+    PSYSTEM_CONTEXT Context = &SystemContext;
+    ULONG           Id = Context->Watchdog.Id;
+    NTSTATUS        status;
+
+    status = STATUS_INVALID_PARAMETER;
+    if (Seconds == 0)
+        goto fail1;
+
+    status = SchedWatchdog(&Id, Seconds);
+    if (!NT_SUCCESS(status))
+        goto fail2;
+
+    if (Context->Watchdog.Id == 0 || Context->Watchdog.Seconds != Seconds)
+        Info("%u: %us\n", Id, Seconds);
+
+    Context->Watchdog.Id = Id;
+    Context->Watchdog.Seconds = Seconds;
+
+    return STATUS_SUCCESS;
+
+fail2:
+    Error("fail2\n");
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
+
+XEN_API
+VOID
+SystemStopWatchdog(
+    VOID
+    )
+{
+    PSYSTEM_CONTEXT Context = &SystemContext;
+    NTSTATUS        status;
+
+    if (Context->Watchdog.Id == 0)
+        return;
+
+    status = SchedWatchdog(&Context->Watchdog.Id, 0);
+    ASSERT(NT_SUCCESS(status));
+
+    Info("%u\n", Context->Watchdog.Id);
+
+    Context->Watchdog.Id = 0;
+    Context->Watchdog.Seconds = 0;
+}
+
 VOID
 SystemTeardown(
     VOID
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:47 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30695.60886 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRa-0008Ml-VL; Thu, 19 Nov 2020 12:53:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30695.60886; Thu, 19 Nov 2020 12:53:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRa-0008Md-RB; Thu, 19 Nov 2020 12:53:46 +0000
Received: by outflank-mailman (input) for mailman id 30695;
 Thu, 19 Nov 2020 12:53:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRZ-0008Ko-EE
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRZ-0003NI-5V; Thu, 19 Nov 2020 12:53:45 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRY-0003sT-UE; Thu, 19 Nov 2020 12:53:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRZ-0008Ko-EE
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:45 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=QgD93Qsi8pCeQ3F8b9OuJfI5iftKkV7q4YZpSReQeUk=; b=PdNUxxM5K6vS/YmL137X8JANF
	egW30U2vaOqKSeh6N+SFZdu8k9wTWnD52LUlCsjRUoOdRveiwDUkp/YCMxqLBhRvMbnSE5tXCsH6g
	IUV7BhAm7xtT8hRec97Lhr7ZbJK6oY18clHhv7lnmOmYGOhvSLVbDY37s3VWE8IG6474g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRZ-0003NI-5V; Thu, 19 Nov 2020 12:53:45 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRY-0003sT-UE; Thu, 19 Nov 2020 12:53:45 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 07/12] Add support for Xen (VCPUOP) periodic timers
Date: Thu, 19 Nov 2020 12:53:32 +0000
Message-Id: <20201119125337.29003-8-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

This patch imports the Xen VCPUOP public header (public/vcpu.h) and adds a new
source module in to the XEN_API implementation (vcpu.c) containing a new
VcpuSetPeriodicTimer() helper function.

This patch does not introduce callers of the new API. Those will be
introduced in a subsequent patch.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 include/xen.h             |  11 ++
 include/xen/public/vcpu.h | 248 ++++++++++++++++++++++++++++++++++++++
 src/xen/vcpu.c            |  82 +++++++++++++
 vs2015/xen/xen.vcxproj    |   1 +
 vs2017/xen/xen.vcxproj    |   1 +
 vs2019/xen/xen.vcxproj    |   1 +
 6 files changed, 344 insertions(+)
 create mode 100644 include/xen/public/vcpu.h
 create mode 100644 src/xen/vcpu.c

diff --git a/include/xen.h b/include/xen.h
index 4594db975332..31e95da6fc22 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -45,6 +45,7 @@
 #include <public/event_channel.h>
 #include <public/grant_table.h>
 #include <public/sched.h>
+#include <public/vcpu.h>
 #include <public/hvm/params.h>
 #include <public/hvm/hvm_info_table.h>
 
@@ -484,4 +485,14 @@ SystemStopWatchdog(
     VOID
     );
 
+// VCPU
+
+__checkReturn
+XEN_API
+NTSTATUS
+VcpuSetPeriodicTimer(
+    IN  unsigned int    vcpu_id,
+    IN  PLARGE_INTEGER  Period
+    );
+
 #endif  // _XEN_H
diff --git a/include/xen/public/vcpu.h b/include/xen/public/vcpu.h
new file mode 100644
index 000000000000..3623af932f7e
--- /dev/null
+++ b/include/xen/public/vcpu.h
@@ -0,0 +1,248 @@
+/******************************************************************************
+ * vcpu.h
+ *
+ * VCPU initialisation, query, and hotplug.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
+ */
+
+#ifndef __XEN_PUBLIC_VCPU_H__
+#define __XEN_PUBLIC_VCPU_H__
+
+#include "xen.h"
+
+/*
+ * Prototype for this hypercall is:
+ *  long vcpu_op(int cmd, unsigned int vcpuid, void *extra_args)
+ * @cmd        == VCPUOP_??? (VCPU operation).
+ * @vcpuid     == VCPU to operate on.
+ * @extra_args == Operation-specific extra arguments (NULL if none).
+ */
+
+/*
+ * Initialise a VCPU. Each VCPU can be initialised only once. A
+ * newly-initialised VCPU will not run until it is brought up by VCPUOP_up.
+ *
+ * @extra_arg == For PV or ARM guests this is a pointer to a vcpu_guest_context
+ *               structure containing the initial state for the VCPU. For x86
+ *               HVM based guests this is a pointer to a vcpu_hvm_context
+ *               structure.
+ */
+#define VCPUOP_initialise            0
+
+/*
+ * Bring up a VCPU. This makes the VCPU runnable. This operation will fail
+ * if the VCPU has not been initialised (VCPUOP_initialise).
+ */
+#define VCPUOP_up                    1
+
+/*
+ * Bring down a VCPU (i.e., make it non-runnable).
+ * There are a few caveats that callers should observe:
+ *  1. This operation may return, and VCPU_is_up may return false, before the
+ *     VCPU stops running (i.e., the command is asynchronous). It is a good
+ *     idea to ensure that the VCPU has entered a non-critical loop before
+ *     bringing it down. Alternatively, this operation is guaranteed
+ *     synchronous if invoked by the VCPU itself.
+ *  2. After a VCPU is initialised, there is currently no way to drop all its
+ *     references to domain memory. Even a VCPU that is down still holds
+ *     memory references via its pagetable base pointer and GDT. It is good
+ *     practise to move a VCPU onto an 'idle' or default page table, LDT and
+ *     GDT before bringing it down.
+ */
+#define VCPUOP_down                  2
+
+/* Returns 1 if the given VCPU is up. */
+#define VCPUOP_is_up                 3
+
+/*
+ * Return information about the state and running time of a VCPU.
+ * @extra_arg == pointer to vcpu_runstate_info structure.
+ */
+#define VCPUOP_get_runstate_info     4
+struct vcpu_runstate_info {
+    /* VCPU's current state (RUNSTATE_*). */
+    int      state;
+    /* When was current state entered (system time, ns)? */
+    uint64_t state_entry_time;
+    /*
+     * Update indicator set in state_entry_time:
+     * When activated via VMASST_TYPE_runstate_update_flag, set during
+     * updates in guest memory mapped copy of vcpu_runstate_info.
+     */
+#define XEN_RUNSTATE_UPDATE          (xen_mk_ullong(1) << 63)
+    /*
+     * Time spent in each RUNSTATE_* (ns). The sum of these times is
+     * guaranteed not to drift from system time.
+     */
+    uint64_t time[4];
+};
+typedef struct vcpu_runstate_info vcpu_runstate_info_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_t);
+
+/* VCPU is currently running on a physical CPU. */
+#define RUNSTATE_running  0
+
+/* VCPU is runnable, but not currently scheduled on any physical CPU. */
+#define RUNSTATE_runnable 1
+
+/* VCPU is blocked (a.k.a. idle). It is therefore not runnable. */
+#define RUNSTATE_blocked  2
+
+/*
+ * VCPU is not runnable, but it is not blocked.
+ * This is a 'catch all' state for things like hotplug and pauses by the
+ * system administrator (or for critical sections in the hypervisor).
+ * RUNSTATE_blocked dominates this state (it is the preferred state).
+ */
+#define RUNSTATE_offline  3
+
+/*
+ * Register a shared memory area from which the guest may obtain its own
+ * runstate information without needing to execute a hypercall.
+ * Notes:
+ *  1. The registered address may be virtual or physical or guest handle,
+ *     depending on the platform. Virtual address or guest handle should be
+ *     registered on x86 systems.
+ *  2. Only one shared area may be registered per VCPU. The shared area is
+ *     updated by the hypervisor each time the VCPU is scheduled. Thus
+ *     runstate.state will always be RUNSTATE_running and
+ *     runstate.state_entry_time will indicate the system time at which the
+ *     VCPU was last scheduled to run.
+ * @extra_arg == pointer to vcpu_register_runstate_memory_area structure.
+ */
+#define VCPUOP_register_runstate_memory_area 5
+struct vcpu_register_runstate_memory_area {
+    union {
+        XEN_GUEST_HANDLE(vcpu_runstate_info_t) h;
+        struct vcpu_runstate_info *v;
+        uint64_t p;
+    } addr;
+};
+typedef struct vcpu_register_runstate_memory_area vcpu_register_runstate_memory_area_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_register_runstate_memory_area_t);
+
+/*
+ * Set or stop a VCPU's periodic timer. Every VCPU has one periodic timer
+ * which can be set via these commands. Periods smaller than one millisecond
+ * may not be supported.
+ */
+#define VCPUOP_set_periodic_timer    6 /* arg == vcpu_set_periodic_timer_t */
+#define VCPUOP_stop_periodic_timer   7 /* arg == NULL */
+struct vcpu_set_periodic_timer {
+    uint64_t period_ns;
+};
+typedef struct vcpu_set_periodic_timer vcpu_set_periodic_timer_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_set_periodic_timer_t);
+
+/*
+ * Set or stop a VCPU's single-shot timer. Every VCPU has one single-shot
+ * timer which can be set via these commands.
+ */
+#define VCPUOP_set_singleshot_timer  8 /* arg == vcpu_set_singleshot_timer_t */
+#define VCPUOP_stop_singleshot_timer 9 /* arg == NULL */
+struct vcpu_set_singleshot_timer {
+    uint64_t timeout_abs_ns;   /* Absolute system time value in nanoseconds. */
+    uint32_t flags;            /* VCPU_SSHOTTMR_??? */
+};
+typedef struct vcpu_set_singleshot_timer vcpu_set_singleshot_timer_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_set_singleshot_timer_t);
+
+/* Flags to VCPUOP_set_singleshot_timer. */
+ /* Require the timeout to be in the future (return -ETIME if it's passed). */
+#define _VCPU_SSHOTTMR_future (0)
+#define VCPU_SSHOTTMR_future  (1U << _VCPU_SSHOTTMR_future)
+
+/*
+ * Register a memory location in the guest address space for the
+ * vcpu_info structure.  This allows the guest to place the vcpu_info
+ * structure in a convenient place, such as in a per-cpu data area.
+ * The pointer need not be page aligned, but the structure must not
+ * cross a page boundary.
+ *
+ * This may be called only once per vcpu.
+ */
+#define VCPUOP_register_vcpu_info   10  /* arg == vcpu_register_vcpu_info_t */
+struct vcpu_register_vcpu_info {
+    uint64_t mfn;    /* mfn of page to place vcpu_info */
+    uint32_t offset; /* offset within page */
+    uint32_t rsvd;   /* unused */
+};
+typedef struct vcpu_register_vcpu_info vcpu_register_vcpu_info_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_register_vcpu_info_t);
+
+/* Send an NMI to the specified VCPU. @extra_arg == NULL. */
+#define VCPUOP_send_nmi             11
+
+/*
+ * Get the physical ID information for a pinned vcpu's underlying physical
+ * processor.  The physical ID informmation is architecture-specific.
+ * On x86: id[31:0]=apic_id, id[63:32]=acpi_id.
+ * This command returns -EINVAL if it is not a valid operation for this VCPU.
+ */
+#define VCPUOP_get_physid           12 /* arg == vcpu_get_physid_t */
+struct vcpu_get_physid {
+    uint64_t phys_id;
+};
+typedef struct vcpu_get_physid vcpu_get_physid_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_get_physid_t);
+#define xen_vcpu_physid_to_x86_apicid(physid) ((uint32_t)(physid))
+#define xen_vcpu_physid_to_x86_acpiid(physid) ((uint32_t)((physid) >> 32))
+
+/*
+ * Register a memory location to get a secondary copy of the vcpu time
+ * parameters.  The master copy still exists as part of the vcpu shared
+ * memory area, and this secondary copy is updated whenever the master copy
+ * is updated (and using the same versioning scheme for synchronisation).
+ *
+ * The intent is that this copy may be mapped (RO) into userspace so
+ * that usermode can compute system time using the time info and the
+ * tsc.  Usermode will see an array of vcpu_time_info structures, one
+ * for each vcpu, and choose the right one by an existing mechanism
+ * which allows it to get the current vcpu number (such as via a
+ * segment limit).  It can then apply the normal algorithm to compute
+ * system time from the tsc.
+ *
+ * @extra_arg == pointer to vcpu_register_time_info_memory_area structure.
+ */
+#define VCPUOP_register_vcpu_time_memory_area   13
+DEFINE_XEN_GUEST_HANDLE(vcpu_time_info_t);
+struct vcpu_register_time_memory_area {
+    union {
+        XEN_GUEST_HANDLE(vcpu_time_info_t) h;
+        struct vcpu_time_info *v;
+        uint64_t p;
+    } addr;
+};
+typedef struct vcpu_register_time_memory_area vcpu_register_time_memory_area_t;
+DEFINE_XEN_GUEST_HANDLE(vcpu_register_time_memory_area_t);
+
+#endif /* __XEN_PUBLIC_VCPU_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/src/xen/vcpu.c b/src/xen/vcpu.c
new file mode 100644
index 000000000000..a1881cf37b0c
--- /dev/null
+++ b/src/xen/vcpu.c
@@ -0,0 +1,82 @@
+/* Copyright Amazon.com Inc. or its affiliates.
+ *
+ * Redistribution and use in source and binary forms,
+ * with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ * *   Redistributions of source code must retain the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer.
+ * *   Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the
+ *     following disclaimer in the documentation and/or other
+ *     materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#define XEN_API __declspec(dllexport)
+
+#include <ntddk.h>
+#include <xen.h>
+
+#include "hypercall.h"
+#include "dbg_print.h"
+#include "assert.h"
+
+static LONG_PTR
+VcpuOp(
+    IN  ULONG           Command,
+    IN  unsigned int    vcpu_id,
+    IN  PVOID           Argument
+    )
+{
+    return HYPERCALL(LONG_PTR, vcpu_op, 3, Command, vcpu_id, Argument);
+}
+
+__checkReturn
+XEN_API
+NTSTATUS
+VcpuSetPeriodicTimer(
+    IN  unsigned int                vcpu_id,
+    IN  PLARGE_INTEGER              Period
+    )
+{
+    LONG_PTR                        rc;
+    NTSTATUS                        status;
+
+    if (Period != NULL) {
+        struct vcpu_set_periodic_timer  op;
+
+        op.period_ns = Period->QuadPart * 100ull;
+
+        rc = VcpuOp(VCPUOP_set_periodic_timer, vcpu_id, &op);
+    } else {
+        rc = VcpuOp(VCPUOP_stop_periodic_timer, vcpu_id, NULL);
+    }
+
+    if (rc < 0) {
+        ERRNO_TO_STATUS(-rc, status);
+        goto fail1;
+    }
+
+    return STATUS_SUCCESS;
+
+fail1:
+    Error("fail1 (%08x)\n", status);
+
+    return status;
+}
diff --git a/vs2015/xen/xen.vcxproj b/vs2015/xen/xen.vcxproj
index 40d1d5b5e97f..65be5010f451 100644
--- a/vs2015/xen/xen.vcxproj
+++ b/vs2015/xen/xen.vcxproj
@@ -68,6 +68,7 @@
     <ClCompile Include="..\..\src\xen\acpi.c" />
     <ClCompile Include="..\..\src\xen\system.c" />
     <ClCompile Include="..\..\src\xen\unplug.c" />
+    <ClCompile Include="..\..\src\xen\vcpu.c" />
   </ItemGroup>
   <ItemGroup>
     <MASM Include="..\..\src\xen\amd64\hypercall_thunk.asm">
diff --git a/vs2017/xen/xen.vcxproj b/vs2017/xen/xen.vcxproj
index 39a738d99467..9fec76255ca3 100644
--- a/vs2017/xen/xen.vcxproj
+++ b/vs2017/xen/xen.vcxproj
@@ -76,6 +76,7 @@
     <ClCompile Include="..\..\src\xen\acpi.c" />
     <ClCompile Include="..\..\src\xen\system.c" />
     <ClCompile Include="..\..\src\xen\unplug.c" />
+    <ClCompile Include="..\..\src\xen\vcpu.c" />
   </ItemGroup>
   <ItemGroup>
     <MASM Include="..\..\src\xen\amd64\hypercall_thunk.asm">
diff --git a/vs2019/xen/xen.vcxproj b/vs2019/xen/xen.vcxproj
index fda1b06c2c35..56de3d25b6ea 100644
--- a/vs2019/xen/xen.vcxproj
+++ b/vs2019/xen/xen.vcxproj
@@ -76,6 +76,7 @@
     <ClCompile Include="..\..\src\xen\acpi.c" />
     <ClCompile Include="..\..\src\xen\system.c" />
     <ClCompile Include="..\..\src\xen\unplug.c" />
+    <ClCompile Include="..\..\src\xen\vcpu.c" />
   </ItemGroup>
   <ItemGroup>
     <MASM Include="..\..\src\xen\amd64\hypercall_thunk.asm">
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:47 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30696.60890 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRb-0008N2-2V; Thu, 19 Nov 2020 12:53:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30696.60890; Thu, 19 Nov 2020 12:53:47 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRa-0008Mq-Sg; Thu, 19 Nov 2020 12:53:46 +0000
Received: by outflank-mailman (input) for mailman id 30696;
 Thu, 19 Nov 2020 12:53:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRZ-0008LW-Tk
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:45 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRZ-0003NP-Ol; Thu, 19 Nov 2020 12:53:45 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRZ-0003sT-HR; Thu, 19 Nov 2020 12:53:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRZ-0008LW-Tk
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:45 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=nAhlDc7Qh62BUPrpiFVFhhPHhEMZCwyK9Yi+Wi+WqTk=; b=f7Quiwzfa6jfi3dqF5ltGITvI
	HzXo5ZndJQuzZ2thTrqmPNKSueAOvd9EWI57aSzsXy3/bsNFVu2DBUqHUau+M0rsQpPlth0EjRWYh
	GyiAMCWRb0qhmi0ul+K2ZSAtkd4jQjrStcJ5z6I1ZPTw/+iB00Z/MSee3gnGAGNMdKp00=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRZ-0003NP-Ol; Thu, 19 Nov 2020 12:53:45 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRZ-0003sT-HR; Thu, 19 Nov 2020 12:53:45 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 08/12] Add XENBUS_DEBUG callback into fdo.c to dump VIRQ information
Date: Thu, 19 Nov 2020 12:53:33 +0000
Message-Id: <20201119125337.29003-9-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

The callback iterates the list of open VIRQ channels and dumps information
about each. This is currently limited to its vCPU binding, and to enable
this information to be dumped it is necessary to save that information in the
XENBUS_VIRQ structure.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/fdo.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 852f2b85c7ee..831ff463d6ce 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -85,6 +85,7 @@ typedef struct _XENBUS_VIRQ {
     LIST_ENTRY              ListEntry;
     ULONG                   Type;
     PXENBUS_EVTCHN_CHANNEL  Channel;
+    ULONG                   Cpu;
 } XENBUS_VIRQ, *PXENBUS_VIRQ;
 
 struct _XENBUS_FDO {
@@ -151,6 +152,7 @@ struct _XENBUS_FDO {
     LIST_ENTRY                      InterruptList;
 
     LIST_ENTRY                      VirqList;
+    PXENBUS_DEBUG_CALLBACK          DebugCallback;
     PXENBUS_SUSPEND_CALLBACK        SuspendCallbackLate;
     PLOG_DISPOSITION                LogDisposition;
 };
@@ -2812,6 +2814,7 @@ __FdoVirqCreate(
 
     (*Virq)->Fdo = Fdo;
     (*Virq)->Type = Type;
+    (*Virq)->Cpu = Cpu;
 
     status = KeGetProcessorNumberFromIndex(Cpu, &ProcNumber);
     ASSERT(NT_SUCCESS(status));
@@ -3244,6 +3247,45 @@ done:
     Fdo->RangeSet = NULL;
 }
 
+static VOID
+FdoDebugCallback(
+    IN  PVOID   Argument,
+    IN  BOOLEAN Crashing
+    )
+{
+    PXENBUS_FDO Fdo = Argument;
+
+    UNREFERENCED_PARAMETER(Crashing);
+
+    if (!IsListEmpty(&Fdo->VirqList)) {
+        PLIST_ENTRY ListEntry;
+
+        XENBUS_DEBUG(Printf,
+                     &Fdo->DebugInterface,
+                     "VIRQS:\n");
+
+        for (ListEntry = Fdo->VirqList.Flink;
+             ListEntry != &Fdo->VirqList;
+             ListEntry = ListEntry->Flink) {
+            PXENBUS_VIRQ        Virq;
+            PROCESSOR_NUMBER    ProcNumber;
+            NTSTATUS            status;
+
+            Virq = CONTAINING_RECORD(ListEntry, XENBUS_VIRQ, ListEntry);
+
+            status = KeGetProcessorNumberFromIndex(Virq->Cpu, &ProcNumber);
+            ASSERT(NT_SUCCESS(status));
+
+            XENBUS_DEBUG(Printf,
+                         &Fdo->DebugInterface,
+                         "- %s: (%u:%u)\n",
+                         VirqName(Virq->Type),
+                         ProcNumber.Group,
+                         ProcNumber.Number);
+        }
+    }
+}
+
 // This function must not touch pageable code or data
 static NTSTATUS
 FdoD3ToD0(
@@ -3313,6 +3355,15 @@ FdoD3ToD0(
     if (!NT_SUCCESS(status))
         goto fail10;
 
+    status = XENBUS_DEBUG(Register,
+                          &Fdo->DebugInterface,
+                          __MODULE__ "|FDO",
+                          FdoDebugCallback,
+                          Fdo,
+                          &Fdo->DebugCallback);
+    if (!NT_SUCCESS(status))
+        goto fail11;
+
     KeLowerIrql(Irql);
 
 not_active:
@@ -3342,6 +3393,14 @@ not_active:
 
     return STATUS_SUCCESS;
 
+fail11:
+    Error("fail11\n");
+
+    XENBUS_SUSPEND(Deregister,
+                   &Fdo->SuspendInterface,
+                   Fdo->SuspendCallbackLate);
+    Fdo->SuspendCallbackLate = NULL;
+
 fail10:
     Error("fail10\n");
 
@@ -3470,6 +3529,11 @@ FdoD0ToD3(
 
     KeRaiseIrql(DISPATCH_LEVEL, &Irql);
 
+    XENBUS_DEBUG(Deregister,
+                 &Fdo->DebugInterface,
+                 Fdo->DebugCallback);
+    Fdo->DebugCallback = NULL;
+
     XENBUS_SUSPEND(Deregister,
                    &Fdo->SuspendInterface,
                    Fdo->SuspendCallbackLate);
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 12:53:48 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 12:53:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30697.60895 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRc-0008OV-2Z; Thu, 19 Nov 2020 12:53:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30697.60895; Thu, 19 Nov 2020 12:53:48 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjRb-0008ON-VZ; Thu, 19 Nov 2020 12:53:47 +0000
Received: by outflank-mailman (input) for mailman id 30697;
 Thu, 19 Nov 2020 12:53:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjRa-0008MU-JF
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:46 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRa-0003NW-Bo; Thu, 19 Nov 2020 12:53:46 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRa-0003sT-4a; Thu, 19 Nov 2020 12:53:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRa-0008MU-JF
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 12:53:46 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=wVEkgr78UmDVToWmTRqZ5HjyVJeotELESIn/qZ0pc9s=; b=FGyfvHkMiHeXtLkhVcDThJcua
	spkx4IeDxE4jvU2e1mMRmsqwTKNW/06uAyCHl1VdWXm77Ka+rNoIUnXSWZswUm6/uPJmX1NhB8xQW
	RExyc7ewcWDLAcQDuhZKgov7ir7pm3IkpVDniLfiONv7XNjyJVLhf1msba+XQjav+9B0g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRa-0003NW-Bo; Thu, 19 Nov 2020 12:53:46 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRa-0003sT-4a; Thu, 19 Nov 2020 12:53:46 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 09/12] Slightly modify the way balloon initialization is done in fdo.c
Date: Thu, 19 Nov 2020 12:53:34 +0000
Message-Id: <20201119125337.29003-10-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

Currently only one system start option "XEN:BALLOON=" modifies the behaviour
of FDO creation. A subsequent patch will add another option. This patch is
to avoid inconsistency in the code when that is done.

The FdoIsBalloonEnabled() function is replaced with FdoBalloonInitialize(),
which inlines what FdoCreate() would previously have done when
FdoIsBalloonEnabled() returned TRUE. A matching FdoBalloonTeardown()
function is also introduced for the sake of symmetry.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/fdo.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 831ff463d6ce..231748f14bdf 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -5431,8 +5431,8 @@ __FdoFreeBuffer(
     Fdo->Buffer = NULL;
 }
 
-static BOOLEAN
-FdoIsBalloonEnabled(
+static NTSTATUS
+FdoBalloonInitialize(
     IN  PXENBUS_FDO Fdo
     )
 {
@@ -5442,8 +5442,6 @@ FdoIsBalloonEnabled(
     BOOLEAN         Enabled;
     NTSTATUS        status;
 
-    UNREFERENCED_PARAMETER(Fdo);
-
     Enabled = TRUE;
 
     status = RegistryQuerySystemStartOption(Key, &Option);
@@ -5458,9 +5456,22 @@ FdoIsBalloonEnabled(
     RegistryFreeSzValue(Option);
 
 done:
-    return Enabled;
+    return Enabled ?
+           BalloonInitialize(Fdo, &Fdo->BalloonContext) :
+           STATUS_SUCCESS;
 }
 
+static VOID
+FdoBalloonTeardown(
+    IN  PXENBUS_FDO Fdo
+    )
+{
+    if (Fdo->BalloonContext == NULL)
+        return;
+
+    BalloonTeardown(Fdo->BalloonContext);
+    Fdo->BalloonContext = NULL;
+}
 NTSTATUS
 FdoCreate(
     IN  PDEVICE_OBJECT          PhysicalDeviceObject
@@ -5581,11 +5592,9 @@ FdoCreate(
     if (!NT_SUCCESS(status))
         goto fail19;
 
-    if (FdoIsBalloonEnabled(Fdo)) {
-        status = BalloonInitialize(Fdo, &Fdo->BalloonContext);
-        if (!NT_SUCCESS(status))
-            goto fail20;
-    }
+    status = FdoBalloonInitialize(Fdo);
+    if (!NT_SUCCESS(status))
+        goto fail20;
 
     status = DebugGetInterface(__FdoGetDebugContext(Fdo),
                                XENBUS_DEBUG_INTERFACE_VERSION_MAX,
@@ -5826,10 +5835,7 @@ FdoDestroy(
         RtlZeroMemory(&Fdo->DebugInterface,
                       sizeof (XENBUS_DEBUG_INTERFACE));
 
-        if (Fdo->BalloonContext != NULL) {
-            BalloonTeardown(Fdo->BalloonContext);
-            Fdo->BalloonContext = NULL;
-        }
+        FdoBalloonTeardown(Fdo);
 
         UnplugTeardown(Fdo->UnplugContext);
         Fdo->UnplugContext = NULL;
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 13:00:45 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 13:00:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30754.60906 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjYK-00019N-RB; Thu, 19 Nov 2020 13:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30754.60906; Thu, 19 Nov 2020 13:00:44 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjYK-00018z-Jo; Thu, 19 Nov 2020 13:00:44 +0000
Received: by outflank-mailman (input) for mailman id 30754;
 Thu, 19 Nov 2020 13:00:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjYJ-00018T-6M
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 13:00:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjYJ-0003Xy-1I; Thu, 19 Nov 2020 13:00:43 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRa-0003sT-O1; Thu, 19 Nov 2020 12:53:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjYJ-00018T-6M
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 13:00:43 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=HaeLqrh6N8yLISoKjk0VMt1+8Kd2GV3mLWssO0Ezg7E=; b=yjpIKMtHhcXW43njsvENwcodT
	mXD08lbnBc+bZoklEqRRGjL99N4S5CL+q+8BVjC4B+bUm2LYGEad+xtKq0cuQBiIxx79Jfs1U3q1c
	cTDUEtaShU5hqpXqhJH3ip5SJw8aM1TUZHVTkarTkPvRj/SX1Z49+rsXkgzvClvaezcUY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjYJ-0003Xy-1I; Thu, 19 Nov 2020 13:00:43 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRa-0003sT-O1; Thu, 19 Nov 2020 12:53:46 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 10/12] Add "XEN:WATCHDOG=" system start option to specify a watchdog time-out
Date: Thu, 19 Nov 2020 12:53:35 +0000
Message-Id: <20201119125337.29003-11-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

When this option supplies a non-zero value (in seconds) for the time-out,
XENBUS will open a VIRQ_TIMER channel bound to each active processor (unless
prevent from doing so by the lack of a FIFO Xen event channel ABI, in which
case there will only be one VIRQ_TIMER on vCPU 0). The Xen domain watchdog
will be programmed to shut the domain down after the time-out period has
elapsed and each VIRQ_TIMER will be programmed to fire at intervals of half
the watchdog period in order that the last vCPU to receive the event
notification will pat the watchdog.

This option will therefore cause lengthy event delivery or processing stalls
to be fatal to the domain, which can be useful for debugging and in some I/O
fail-over cluster scenarios.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/fdo.c | 171 +++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 167 insertions(+), 4 deletions(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 231748f14bdf..d164aab8a604 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -86,6 +86,7 @@ typedef struct _XENBUS_VIRQ {
     ULONG                   Type;
     PXENBUS_EVTCHN_CHANNEL  Channel;
     ULONG                   Cpu;
+    ULONG                   Count;
 } XENBUS_VIRQ, *PXENBUS_VIRQ;
 
 struct _XENBUS_FDO {
@@ -152,6 +153,10 @@ struct _XENBUS_FDO {
     LIST_ENTRY                      InterruptList;
 
     LIST_ENTRY                      VirqList;
+    HIGH_LOCK                       VirqLock;
+
+    ULONG                           Watchdog;
+
     PXENBUS_DEBUG_CALLBACK          DebugCallback;
     PXENBUS_SUSPEND_CALLBACK        SuspendCallbackLate;
     PLOG_DISPOSITION                LogDisposition;
@@ -2755,6 +2760,45 @@ FdoOutputBuffer(
                           (ULONG)(Cursor - FdoOutBuffer));
 }
 
+static FORCEINLINE BOOLEAN
+__FdoVirqPatWatchdog(
+    IN  PXENBUS_VIRQ    Virq
+    )
+{
+    PXENBUS_FDO         Fdo = Virq->Fdo;
+    ULONG               Cpu;
+    ULONG               Count;
+    BOOLEAN             Pat;
+    KIRQL               Irql;
+    PLIST_ENTRY         ListEntry;
+
+    AcquireHighLock(&Fdo->VirqLock, &Irql);
+
+    Cpu = Virq->Cpu;
+    Count = Virq->Count++;
+    Pat = TRUE;
+
+    if (Virq->Count == 0) // wrapped
+        goto out;
+
+    for (ListEntry = Fdo->VirqList.Flink;
+         ListEntry != &Fdo->VirqList;
+         ListEntry = ListEntry->Flink) {
+        Virq = CONTAINING_RECORD(ListEntry, XENBUS_VIRQ, ListEntry);
+
+        if (Virq->Type != VIRQ_TIMER || Virq->Cpu == Cpu)
+            continue;
+
+        if (Virq->Count <= Count)
+            Pat = FALSE;
+    }
+
+out:
+    ReleaseHighLock(&Fdo->VirqLock, Irql);
+
+    return Pat;
+}
+
 static
 _Function_class_(KSERVICE_ROUTINE)
 _IRQL_requires_(HIGH_LEVEL)
@@ -2773,8 +2817,22 @@ FdoVirqCallback(
     ASSERT(Virq != NULL);
     Fdo = Virq->Fdo;
 
-    ASSERT3U(Virq->Type, ==, VIRQ_DEBUG);
-    XENBUS_DEBUG(Trigger, &Fdo->DebugInterface, NULL);
+    switch (Virq->Type) {
+    case VIRQ_DEBUG:
+        Virq->Count++;
+        XENBUS_DEBUG(Trigger, &Fdo->DebugInterface, NULL);
+        break;
+
+    case VIRQ_TIMER:
+        if (__FdoVirqPatWatchdog(Virq))
+            SystemSetWatchdog(Fdo->Watchdog);
+
+        break;
+
+    default:
+        ASSERT(FALSE);
+        break;
+    }
 
     return TRUE;
 }
@@ -2788,6 +2846,16 @@ __FdoVirqDestroy(
 
     Info("%s\n", VirqName(Virq->Type));
 
+    if (Virq->Type == VIRQ_TIMER) {
+        unsigned int    vcpu_id;
+        NTSTATUS        status;
+
+        status = SystemVirtualCpuIndex(Virq->Cpu, &vcpu_id);
+        ASSERT(NT_SUCCESS(status));
+
+        (VOID) VcpuSetPeriodicTimer(vcpu_id, NULL);
+    }
+
     XENBUS_EVTCHN(Close,
                   &Fdo->EvtchnInterface,
                   Virq->Channel);
@@ -2804,6 +2872,7 @@ __FdoVirqCreate(
     )
 {
     PROCESSOR_NUMBER    ProcNumber;
+    unsigned int        vcpu_id;
     NTSTATUS            status;
 
     *Virq = __FdoAllocate(sizeof (XENBUS_VIRQ));
@@ -2832,6 +2901,20 @@ __FdoVirqCreate(
     if ((*Virq)->Channel == NULL)
         goto fail2;
 
+    if (Type == VIRQ_TIMER) {
+        LARGE_INTEGER   Period;
+
+        status = SystemVirtualCpuIndex(Cpu, &vcpu_id);
+        ASSERT(NT_SUCCESS(status));
+
+        BUG_ON(Fdo->Watchdog == 0);
+        Period.QuadPart = TIME_S(Fdo->Watchdog / 2);
+
+        status = VcpuSetPeriodicTimer(vcpu_id, &Period);
+        if (!NT_SUCCESS(status))
+            goto fail3;
+    }
+
     (VOID) XENBUS_EVTCHN(Unmask,
                          &Fdo->EvtchnInterface,
                          (*Virq)->Channel,
@@ -2843,6 +2926,13 @@ __FdoVirqCreate(
 
     return STATUS_SUCCESS;
 
+fail3:
+    Error("fail3\n");
+
+    XENBUS_EVTCHN(Close,
+                  &Fdo->EvtchnInterface,
+                  (*Virq)->Channel);
+
 fail2:
     Error("fail2\n");
 
@@ -2859,6 +2949,9 @@ FdoVirqTeardown(
     IN  PXENBUS_FDO Fdo
     )
 {
+    if (Fdo->Watchdog != 0)
+        SystemStopWatchdog();
+
     while (!IsListEmpty(&Fdo->VirqList)) {
         PLIST_ENTRY     ListEntry;
         PXENBUS_VIRQ    Virq;
@@ -2882,9 +2975,12 @@ FdoVirqInitialize(
     )
 {
     PXENBUS_VIRQ    Virq;
+    ULONG           Count;
+    ULONG           Index;
     NTSTATUS        status;
 
     InitializeListHead(&Fdo->VirqList);
+    InitializeHighLock(&Fdo->VirqLock);
 
     status = __FdoVirqCreate(Fdo, VIRQ_DEBUG, 0, &Virq);
     if (!NT_SUCCESS(status))
@@ -2892,8 +2988,38 @@ FdoVirqInitialize(
 
     InsertTailList(&Fdo->VirqList, &Virq->ListEntry);
 
+    if (Fdo->Watchdog == 0)
+        goto done;
+
+    Count = KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS);
+
+    for (Index = 0; Index < Count; Index++) {
+        status = __FdoVirqCreate(Fdo, VIRQ_TIMER, Index, &Virq);
+        if (!NT_SUCCESS(status)) {
+            if (status != STATUS_NOT_SUPPORTED )
+                continue;
+
+            goto fail2;
+        }
+
+        InsertTailList(&Fdo->VirqList, &Virq->ListEntry);
+    }
+
+    status = SystemSetWatchdog(Fdo->Watchdog);
+    if (!NT_SUCCESS(status))
+        goto fail3;
+
+done:
     return STATUS_SUCCESS;
 
+fail3:
+    Error("fail3\n");
+
+fail2:
+    Error("fail2\n");
+
+    FdoVirqTeardown(Fdo);
+
 fail1:
     Error("fail1 (%08x)\n", status);
 
@@ -3278,10 +3404,11 @@ FdoDebugCallback(
 
             XENBUS_DEBUG(Printf,
                          &Fdo->DebugInterface,
-                         "- %s: (%u:%u)\n",
+                         "- %s: (%u:%u) Count = %u\n",
                          VirqName(Virq->Type),
                          ProcNumber.Group,
-                         ProcNumber.Number);
+                         ProcNumber.Number,
+                         Virq->Count);
         }
     }
 }
@@ -5472,6 +5599,38 @@ FdoBalloonTeardown(
     BalloonTeardown(Fdo->BalloonContext);
     Fdo->BalloonContext = NULL;
 }
+
+static VOID
+FdoSetWatchdog(
+    IN  PXENBUS_FDO Fdo
+    )
+{
+    CHAR            Key[] = "XEN:WATCHDOG=";
+    PANSI_STRING    Option;
+    ULONG           Value;
+    NTSTATUS        status;
+
+    status = RegistryQuerySystemStartOption(Key, &Option);
+    if (!NT_SUCCESS(status))
+        return;
+
+    Value = strtoul(Option->Buffer + sizeof (Key) - 1, NULL, 0);
+
+    RegistryFreeSzValue(Option);
+
+    if (Value && Value < 10) {
+        Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
+        Value = 10;
+    }
+
+    Fdo->Watchdog = Value;
+
+    if (Fdo->Watchdog != 0)
+        Info("WATCHDOG ENABLED (%us)\n", Fdo->Watchdog);
+    else
+        Info("WATCHDOG DISABLED\n");
+}
+
 NTSTATUS
 FdoCreate(
     IN  PDEVICE_OBJECT          PhysicalDeviceObject
@@ -5651,6 +5810,8 @@ done:
 
     (VOID) FdoSetFriendlyName(Fdo, Header.DeviceID);
 
+    FdoSetWatchdog(Fdo);
+
     Info("%p (%s) %s\n",
          FunctionDeviceObject,
          __FdoGetName(Fdo),
@@ -5810,6 +5971,8 @@ FdoDestroy(
 
     Dx->Fdo = NULL;
 
+    Fdo->Watchdog = 0;
+
     RtlZeroMemory(&Fdo->List, sizeof (LIST_ENTRY));
     RtlZeroMemory(&Fdo->Mutex, sizeof (MUTEX));
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 13:00:45 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 13:00:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30753.60905 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjYK-000196-QV; Thu, 19 Nov 2020 13:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30753.60905; Thu, 19 Nov 2020 13:00:44 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjYK-00018p-I9; Thu, 19 Nov 2020 13:00:44 +0000
Received: by outflank-mailman (input) for mailman id 30753;
 Thu, 19 Nov 2020 13:00:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjYJ-00018U-6N
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 13:00:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjYI-0003Xu-U8; Thu, 19 Nov 2020 13:00:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRb-0003sT-Uc; Thu, 19 Nov 2020 12:53:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjYJ-00018U-6N
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 13:00:43 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=TAEeiXdj7s/M7Uo7NdH0gc/5JPgoniPh26+gfylJNuQ=; b=ZmVPFTO//iQfZXZYCGX1M+sSX
	vrokpVeTibPLc52ciNPnsULzwEkmIdyIpdwLQDC529rGI7LJVJkOHMR+Wmn478N1hHizEJL46mKDt
	Dm2hlMWP/KBphlhjufGoCEKdMVQSB3rO5293v/WNS0zXrSQgIOgYD4W7SnSwRiBcrfAlU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjYI-0003Xu-U8; Thu, 19 Nov 2020 13:00:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRb-0003sT-Uc; Thu, 19 Nov 2020 12:53:48 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 12/12] Document system start options...
Date: Thu, 19 Nov 2020 12:53:37 +0000
Message-Id: <20201119125337.29003-13-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

... and warn if bad values are specified.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 README.md        | 32 ++++++++++++++++++++++++++++++++
 src/xen/log.c    |  2 ++
 src/xen/unplug.c |  2 ++
 src/xenbus/fdo.c |  2 ++
 4 files changed, 38 insertions(+)

diff --git a/README.md b/README.md
index 7bb3a8344941..547628e76c86 100644
--- a/README.md
+++ b/README.md
@@ -42,3 +42,35 @@ get_xen_headers.py
 
 This will import any necessary headers from a given tag of that Xen
 repository at git://xenbits.xen.org/xen.git.
+
+System Start Options
+====================
+
+Behaviour in both the xen.sys and xenbus.sys can be configured by 'system
+start options'. These options can be supplied on the Windows loader 'command
+line', which can be set by hitting F10 during early boot or appended to by
+setting the value of 'loadptions' using bcdedit.
+
+XEN:DBG_PRINT=ON|OFF (default: ON)
+
+This option determines with DbgPrint() output is intercepted and logged.
+(To reduce noise, messages not prefixed with 'XEN' are ignored).
+
+XEN:BOOT_EMULATED=TRUE|FALSE (default: FALSE)
+
+This option avoids unplugging the first emulated IDE device, which is
+useful when debugging the XENVBD driver (since the system disk remains
+emulated).
+
+XEN:BALLOON=ON|OFF (default: ON)
+
+This option controls whether the XENBUS_BALLOON interface and thread is
+enabled.
+
+XEN:WATCHDOG=<TIME-OUT> (default: 0 minimum: 10)
+
+This options determine whether the domain watchdog is enabled. If a non-zero
+time-out (in seconds) is specified then the watchdog will be enabled. The
+watchdog is patted by VIRQ_TIMER handlers and hence this is useful to
+detect length stalls in event delivery or handling. The minimum time-out
+value is 10s.
diff --git a/src/xen/log.c b/src/xen/log.c
index ed7e484cddc7..5044070392f2 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -695,6 +695,8 @@ __LogDbgPrintCallbackEnable(
 
     if (strcmp(Value, "OFF") == 0)
         Enable = FALSE;
+    else if (strcmp(Value, "ON") != 0)
+        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
 
     RegistryFreeSzValue(Option);
 
diff --git a/src/xen/unplug.c b/src/xen/unplug.c
index cf17b69b2442..c9a29a6a3c89 100644
--- a/src/xen/unplug.c
+++ b/src/xen/unplug.c
@@ -93,6 +93,8 @@ UnplugSetBootEmulated(
 
     if (strcmp(Value, "TRUE") == 0)
         Context->BootEmulated = TRUE;
+    else if (strcmp(Value, "FALSE") != 0)
+        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
 
     RegistryFreeSzValue(Option);
 }
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index d164aab8a604..5419be4911ce 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -5579,6 +5579,8 @@ FdoBalloonInitialize(
 
     if (strcmp(Value, "OFF") == 0)
         Enabled = FALSE;
+    else if (strcmp(Value, "ON") != 0)
+        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
 
     RegistryFreeSzValue(Option);
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 13:00:45 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 13:00:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30752.60898 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjYK-00018l-Jp; Thu, 19 Nov 2020 13:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30752.60898; Thu, 19 Nov 2020 13:00:44 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfjYK-00018d-Gd; Thu, 19 Nov 2020 13:00:44 +0000
Received: by outflank-mailman (input) for mailman id 30752;
 Thu, 19 Nov 2020 13:00:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kfjYJ-00018O-1X
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 13:00:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjYI-0003Xs-RB; Thu, 19 Nov 2020 13:00:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kfjRb-0003sT-B9; Thu, 19 Nov 2020 12:53:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjYJ-00018O-1X
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 13:00:43 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=EAQv4ruVNlfxxHlc6vqBseicOYDWKSLSovtVxX2azvU=; b=soFxxi4ahNyaalRgKBWNgYGFw
	jutoCO1BgTX+WWMG+jR0wsVztc+YGcy44HJvIoRvpdb6m4TszSIoT1W24CMe2pqJBAmBwgpAC69I+
	kg/fZ4wLk+1FIV+Yu2TMmeR7UEV4cbzXeOCwQjhj6sCQLzmU6MUM0D70qhpUassK8gFTg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjYI-0003Xs-RB; Thu, 19 Nov 2020 13:00:42 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kfjRb-0003sT-B9; Thu, 19 Nov 2020 12:53:47 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 11/12] Remove documention for python helpers that are no longer present
Date: Thu, 19 Nov 2020 12:53:36 +0000
Message-Id: <20201119125337.29003-12-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201119125337.29003-1-paul@xen.org>
References: <20201119125337.29003-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

kdfiles.py and clean.py were removed some time ago but are still documented
in README.md. This patch rectifies the situation.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 README.md | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/README.md b/README.md
index 8df387b4d407..7bb3a8344941 100644
--- a/README.md
+++ b/README.md
@@ -37,18 +37,6 @@ Miscellaneous
 
 For convenience the source repository includes some other scripts:
 
-kdfiles.py
-----------
-
-This generates two files called kdfiles32.txt and kdfiles64.txt which can
-be used as map files for the .kdfiles WinDBG command.
-
-clean.py
---------
-
-This removes any files not checked into the repository and not covered by
-the .gitignore file.
-
 get_xen_headers.py
 ------------------
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 14:55:06 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 14:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.30872.61061 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kflKz-0005py-Fu; Thu, 19 Nov 2020 14:55:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 30872.61061; Thu, 19 Nov 2020 14:55:05 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kflKz-0005pq-Cf; Thu, 19 Nov 2020 14:55:05 +0000
Received: by outflank-mailman (input) for mailman id 30872;
 Thu, 19 Nov 2020 14:55:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kflKy-0005pj-MO
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 14:55:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kflKy-0005x0-Ey; Thu, 19 Nov 2020 14:55:04 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com
 ([109.146.187.185] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kflKy-0003Qe-6N; Thu, 19 Nov 2020 14:55:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kflKy-0005pj-MO
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 14:55:04 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From;
	bh=610kUGBS9OwjVu46yrwgSFt+3ihmaqSuH3+IlosIJ6s=; b=XuyuJco8iUvRoWoHfedaHUmnc9
	1asA8oKg7NcXk6RhYDQiaFMw+G18Qy3Zgj5WTk+ijaAPRsSsJcUEjlBmWzfBKn25YgJ++GlHNsnar
	eF/pQ8PtceNd9htdZIXeBIDCPufOdnyVb5DekQky5i2M2mACL28+0pkQjzsr6Y8Cw/qE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kflKy-0005x0-Ey; Thu, 19 Nov 2020 14:55:04 +0000
Received: from host109-146-187-185.range109-146.btcentralplus.com ([109.146.187.185] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kflKy-0003Qe-6N; Thu, 19 Nov 2020 14:55:04 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenvbd] Introduce a BlkifRing watchdog
Date: Thu, 19 Nov 2020 14:55:01 +0000
Message-Id: <20201119145501.29249-1-paul@xen.org>
X-Mailer: git-send-email 2.17.1

From: Paul Durrant <pdurrant@amazon.com>

Analogous to similar watchdog threads for XENVIF transmitter and receiver
rings, this patch introduces code to start a watchdog thread for blkif rings.
The thread wakes every 30s and checks for responses remaining pending on the
ring (without the frontend making progress) across two consecutive iterations.
If the ring appears to be 'stuck' in this manner then the ring DebugCallback()
function is triggered, the ring is polled and an event is send to wake up
the backend.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenvbd/ring.c | 102 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)

diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 4bb7475ddc3a..07aa841274ad 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -47,6 +47,7 @@
 #include "srbext.h"
 #include "driver.h"
 #include "granter.h"
+#include "thread.h"
 
 #include "util.h"
 #include "debug.h"
@@ -90,6 +91,7 @@ typedef struct _XENVBD_BLKIF_RING {
     ULONG                           ResponsesProcessed;
     PXENBUS_DEBUG_CALLBACK          DebugCallback;
     LARGE_INTEGER                   TimeOfLastErrorLog;
+    PXENVBD_THREAD                  WatchdogThread;
 } XENVBD_BLKIF_RING, *PXENVBD_BLKIF_RING;
 
 typedef enum _XENVBD_STAT {
@@ -1623,6 +1625,90 @@ BlkifRingDpc(
                   TRUE);
 }
 
+#define TIME_US(_us)        ((_us) * 10)
+#define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
+#define TIME_RELATIVE(_t)   (-(_t))
+
+#define XENVBD_WATCHDOG_PERIOD 30
+
+static NTSTATUS
+RingWatchdog(
+    IN  PXENVBD_THREAD  Self,
+    IN  PVOID           Context
+    )
+{
+    PXENVBD_BLKIF_RING  BlkifRing = Context;
+    PXENVBD_RING        Ring = BlkifRing->Ring;
+    PROCESSOR_NUMBER    ProcNumber;
+    GROUP_AFFINITY      Affinity;
+    LARGE_INTEGER       Timeout;
+    RING_IDX            rsp_prod;
+    RING_IDX            rsp_cons;
+    NTSTATUS            status;
+
+    Verbose("====> (%u)\n", BlkifRing->Index);
+
+    status = KeGetProcessorNumberFromIndex(BlkifRing->Index, &ProcNumber);
+    ASSERT(NT_SUCCESS(status));
+
+    Affinity.Group = ProcNumber.Group;
+    Affinity.Mask = (KAFFINITY)1 << ProcNumber.Number;
+    KeSetSystemGroupAffinityThread(&Affinity, NULL);
+
+    Timeout.QuadPart = TIME_RELATIVE(TIME_S(XENVBD_WATCHDOG_PERIOD));
+
+    rsp_prod = 0;
+    rsp_cons = 0;
+
+    for (;;) {
+        PKEVENT Event;
+        KIRQL   Irql;
+
+        Event = ThreadGetEvent(Self);
+
+        (VOID) KeWaitForSingleObject(Event,
+                                     Executive,
+                                     KernelMode,
+                                     FALSE,
+                                     &Timeout);
+        KeClearEvent(Event);
+
+        if (ThreadIsAlerted(Self))
+            break;
+
+        KeRaiseIrql(DISPATCH_LEVEL, &Irql);
+        __BlkifRingAcquireLock(BlkifRing);
+
+        if (BlkifRing->Enabled) {
+            KeMemoryBarrier();
+
+            if (BlkifRing->Shared->rsp_prod != rsp_prod &&
+                BlkifRing->Front.rsp_cons == rsp_cons) {
+                XENBUS_DEBUG(Trigger,
+                             &Ring->DebugInterface,
+                             BlkifRing->DebugCallback);
+
+                // Try to move things along
+                __BlkifRingSend(BlkifRing);
+                (VOID) BlkifRingPoll(BlkifRing);
+            }
+
+            KeMemoryBarrier();
+
+            rsp_prod = BlkifRing->Shared->rsp_prod;
+            rsp_cons = BlkifRing->Front.rsp_cons;
+        }
+
+        __BlkifRingReleaseLock(BlkifRing);
+        KeLowerIrql(Irql);
+    }
+
+    Verbose("<====\n");
+
+    return STATUS_SUCCESS;
+}
+
 static NTSTATUS
 BlkifRingCreate(
     IN  PXENVBD_RING        Ring,
@@ -1739,8 +1825,20 @@ BlkifRingCreate(
     if (!NT_SUCCESS(status))
         goto fail9;
 
+    status = ThreadCreate(RingWatchdog,
+                          *BlkifRing,
+                          &(*BlkifRing)->WatchdogThread);
+    if (!NT_SUCCESS(status))
+        goto fail10;
+
     return STATUS_SUCCESS;
 
+fail10:
+    Error("fail10\n");
+    XENBUS_CACHE(Destroy,
+                 &Ring->CacheInterface,
+                 (*BlkifRing)->IndirectCache);
+    (*BlkifRing)->IndirectCache = NULL;
 fail9:
     Error("fail9\n");
 fail8:
@@ -1794,6 +1892,10 @@ BlkifRingDestroy(
 {
     PXENVBD_RING            Ring = BlkifRing->Ring;
 
+    ThreadAlert(BlkifRing->WatchdogThread);
+    ThreadJoin(BlkifRing->WatchdogThread);
+    BlkifRing->WatchdogThread = NULL;
+
     XENBUS_CACHE(Destroy,
                  &Ring->CacheInterface,
                  BlkifRing->IndirectCache);
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 19 16:38:32 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 19 Nov 2020 16:38:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.31144.61395 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfmx5-0003Js-QZ; Thu, 19 Nov 2020 16:38:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 31144.61395; Thu, 19 Nov 2020 16:38:31 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kfmx5-0003Jk-NQ; Thu, 19 Nov 2020 16:38:31 +0000
Received: by outflank-mailman (input) for mailman id 31144;
 Thu, 19 Nov 2020 16:38:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rCZC=EZ=websitemanagers.com.au=mailinglists@srs-us1.protection.inumbo.net>)
 id 1kfmx4-0003Jf-Sb
 for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 16:38:30 +0000
Received: from hammer.websitemanagers.com.au (unknown [59.100.172.130])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a1e8b2b0-7ff2-4053-9f15-7c0a6d1c87fa;
 Thu, 19 Nov 2020 16:38:29 +0000 (UTC)
Received: (qmail 4941 invoked by uid 1011); 19 Nov 2020 16:11:46 -0000
Received: from 192.168.5.112 by hammer (envelope-from
 <mailinglists@websitemanagers.com.au>, uid 1008) with qmail-scanner-1.24 
 (clamdscan: 0.102.4/25878. spamassassin: 3.4.2.  
 Clear:RC:1(192.168.5.112):. 
 Processed in 0.135992 secs); 19 Nov 2020 16:11:46 -0000
Received: from unknown (HELO ADAM-MBP.local)
 (adamg+websitemanagers.com.au@192.168.5.112)
 by 0 with ESMTPA; 19 Nov 2020 16:11:46 -0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=rCZC=EZ=websitemanagers.com.au=mailinglists@srs-us1.protection.inumbo.net>)
	id 1kfmx4-0003Jf-Sb
	for win-pv-devel@lists.xenproject.org; Thu, 19 Nov 2020 16:38:30 +0000
X-Inumbo-ID: a1e8b2b0-7ff2-4053-9f15-7c0a6d1c87fa
Received: from hammer.websitemanagers.com.au (unknown [59.100.172.130])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a1e8b2b0-7ff2-4053-9f15-7c0a6d1c87fa;
	Thu, 19 Nov 2020 16:38:29 +0000 (UTC)
Received: (qmail 4941 invoked by uid 1011); 19 Nov 2020 16:11:46 -0000
Received: from 192.168.5.112 by hammer (envelope-from <mailinglists@websitemanagers.com.au>, uid 1008) with qmail-scanner-1.24 
 (clamdscan: 0.102.4/25878. spamassassin: 3.4.2.  
 Clear:RC:1(192.168.5.112):. 
 Processed in 0.135992 secs); 19 Nov 2020 16:11:46 -0000
Received: from unknown (HELO ADAM-MBP.local) (adamg+websitemanagers.com.au@192.168.5.112)
  by 0 with ESMTPA; 19 Nov 2020 16:11:46 -0000
Subject: Re: [PATCH xenbus 12/12] Document system start options...
To: win-pv-devel@lists.xenproject.org
References: <20201119125337.29003-1-paul@xen.org>
 <20201119125337.29003-13-paul@xen.org>
From: Adam Goryachev <mailinglists@websitemanagers.com.au>
Organization: Website Managers
Message-ID: <968a69f8-c731-6209-6fa2-b1bccd93398e@websitemanagers.com.au>
Date: Fri, 20 Nov 2020 03:11:46 +1100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0)
 Gecko/20100101 Thunderbird/78.4.1
MIME-Version: 1.0
In-Reply-To: <20201119125337.29003-13-paul@xen.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-AU


On 19/11/20 23:53, Paul Durrant wrote:
> From: Paul Durrant <pdurrant@amazon.com>
>
> ... and warn if bad values are specified.
>
> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
> ---
>   README.md        | 32 ++++++++++++++++++++++++++++++++
>   src/xen/log.c    |  2 ++
>   src/xen/unplug.c |  2 ++
>   src/xenbus/fdo.c |  2 ++
>   4 files changed, 38 insertions(+)
>
> diff --git a/README.md b/README.md
> index 7bb3a8344941..547628e76c86 100644
> --- a/README.md
> +++ b/README.md
> @@ -42,3 +42,35 @@ get_xen_headers.py
>   
>   This will import any necessary headers from a given tag of that Xen
>   repository at git://xenbits.xen.org/xen.git.
> +
> +System Start Options
> +====================
> +
> +Behaviour in both the xen.sys and xenbus.sys can be configured by 'system
> +start options'. These options can be supplied on the Windows loader 'command
> +line', which can be set by hitting F10 during early boot or appended to by
> +setting the value of 'loadptions' using bcdedit.

Apologies, but just wondering if that is a type and should be loadoptions ?

I really know nothing of windows programming, but keep an eye on the 
list to see how the driver development is going. I hope this is useful 
feedback.

Regards,
Adam

> +
> +XEN:DBG_PRINT=ON|OFF (default: ON)
> +
> +This option determines with DbgPrint() output is intercepted and logged.
> +(To reduce noise, messages not prefixed with 'XEN' are ignored).
> +
> +XEN:BOOT_EMULATED=TRUE|FALSE (default: FALSE)
> +
> +This option avoids unplugging the first emulated IDE device, which is
> +useful when debugging the XENVBD driver (since the system disk remains
> +emulated).
> +
> +XEN:BALLOON=ON|OFF (default: ON)
> +
> +This option controls whether the XENBUS_BALLOON interface and thread is
> +enabled.
> +
> +XEN:WATCHDOG=<TIME-OUT> (default: 0 minimum: 10)
> +
> +This options determine whether the domain watchdog is enabled. If a non-zero
> +time-out (in seconds) is specified then the watchdog will be enabled. The
> +watchdog is patted by VIRQ_TIMER handlers and hence this is useful to
> +detect length stalls in event delivery or handling. The minimum time-out
> +value is 10s.
> diff --git a/src/xen/log.c b/src/xen/log.c
> index ed7e484cddc7..5044070392f2 100644
> --- a/src/xen/log.c
> +++ b/src/xen/log.c
> @@ -695,6 +695,8 @@ __LogDbgPrintCallbackEnable(
>   
>       if (strcmp(Value, "OFF") == 0)
>           Enable = FALSE;
> +    else if (strcmp(Value, "ON") != 0)
> +        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
>   
>       RegistryFreeSzValue(Option);
>   
> diff --git a/src/xen/unplug.c b/src/xen/unplug.c
> index cf17b69b2442..c9a29a6a3c89 100644
> --- a/src/xen/unplug.c
> +++ b/src/xen/unplug.c
> @@ -93,6 +93,8 @@ UnplugSetBootEmulated(
>   
>       if (strcmp(Value, "TRUE") == 0)
>           Context->BootEmulated = TRUE;
> +    else if (strcmp(Value, "FALSE") != 0)
> +        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
>   
>       RegistryFreeSzValue(Option);
>   }
> diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
> index d164aab8a604..5419be4911ce 100644
> --- a/src/xenbus/fdo.c
> +++ b/src/xenbus/fdo.c
> @@ -5579,6 +5579,8 @@ FdoBalloonInitialize(
>   
>       if (strcmp(Value, "OFF") == 0)
>           Enabled = FALSE;
> +    else if (strcmp(Value, "ON") != 0)
> +        Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
>   
>       RegistryFreeSzValue(Option);
>   


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 24 12:07:29 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 24 Nov 2020 12:07:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.35848.67504 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1khX6W-0000Ov-4A; Tue, 24 Nov 2020 12:07:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 35848.67504; Tue, 24 Nov 2020 12:07:28 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1khX6W-0000On-1B; Tue, 24 Nov 2020 12:07:28 +0000
Received: by outflank-mailman (input) for mailman id 35848;
 Tue, 24 Nov 2020 12:07:26 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1khX6U-0000OV-Mt
 for win-pv-devel@lists.xenproject.org; Tue, 24 Nov 2020 12:07:26 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1khX6U-0000OV-Mt
	for win-pv-devel@lists.xenproject.org; Tue, 24 Nov 2020 12:07:26 +0000
Date: Tue, 24 Nov 2020 12:07:28 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <11440119.3.1606219649046.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENBUS-master - Build #208 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_2_5379176.1606219648593"
X-Jenkins-Job: XENBUS-master
X-Jenkins-Result: SUCCESS


------=_Part_2_5379176.1606219648593
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #208.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/208/console to view the results.
------=_Part_2_5379176.1606219648593--


From win-pv-devel-bounces@lists.xenproject.org Tue Nov 24 12:38:08 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 24 Nov 2020 12:38:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.35915.67580 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1khXaC-0003mg-82; Tue, 24 Nov 2020 12:38:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 35915.67580; Tue, 24 Nov 2020 12:38:08 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1khXaC-0003mY-56; Tue, 24 Nov 2020 12:38:08 +0000
Received: by outflank-mailman (input) for mailman id 35915;
 Tue, 24 Nov 2020 12:38:07 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1khXaB-0003mP-CK
 for win-pv-devel@lists.xenproject.org; Tue, 24 Nov 2020 12:38:07 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1khXaB-0003mP-CK
	for win-pv-devel@lists.xenproject.org; Tue, 24 Nov 2020 12:38:07 +0000
Date: Tue, 24 Nov 2020 12:38:09 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <29012481.5.1606221489734.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENVBD-master - Build #150 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4_29690167.1606221489562"
X-Jenkins-Job: XENVBD-master
X-Jenkins-Result: SUCCESS


------=_Part_4_29690167.1606221489562
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #150.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVBD-master/150/console to view the results.
------=_Part_4_29690167.1606221489562--


From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 13:05:15 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 13:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38496.71239 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxV-0004A6-8W; Thu, 26 Nov 2020 13:05:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38496.71239; Thu, 26 Nov 2020 13:05:13 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxV-00049y-5E; Thu, 26 Nov 2020 13:05:13 +0000
Received: by outflank-mailman (input) for mailman id 38496;
 Thu, 26 Nov 2020 13:05:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiGxT-00049N-DD
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxT-0001l9-93; Thu, 26 Nov 2020 13:05:11 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxT-0002Mq-0w; Thu, 26 Nov 2020 13:05:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxT-00049N-DD
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:11 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=5xTiDzpcGZIjjzCl8ZPvkxYTDHcFDdlPoZEYjjznUbE=; b=Zv4YIROpQrbH/JhpAgAYe5JeX
	w5sfC/JoTdTUqsCtmtThCoLG7Yth0X7K3L/A7Ev/pQAubwDVLdSAg9nXMWKdZ+CRvy9m6rIcm6aGc
	ZZzIG5MPOMRwWni6z2grc7PR1blXPgJMOcLqjKtF6G4eioxdcE/2d3/HxY1ZaFWSgEzcI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxT-0001l9-93; Thu, 26 Nov 2020 13:05:11 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxT-0002Mq-0w; Thu, 26 Nov 2020 13:05:11 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 1/4] Avoid non-zero memory ASSERTion if FdoVirqInitialize() fails
Date: Thu, 26 Nov 2020 13:05:04 +0000
Message-Id: <20201126130507.9144-2-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126130507.9144-1-paul@xen.org>
References: <20201126130507.9144-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

FdoVirqTeardown() should also be called from the 'fail1' label to clean up
'VirqList'. This patch also modifies FdoVirqTeardown() to make sure 'VirqLock'
is properly zeroed.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/fdo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 5419be4911ce..18f936baae38 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -2966,6 +2966,7 @@ FdoVirqTeardown(
         __FdoVirqDestroy(Virq);
     }
 
+    RtlZeroMemory(&Fdo->VirqLock, sizeof (HIGH_LOCK));
     RtlZeroMemory(&Fdo->VirqList, sizeof (LIST_ENTRY));
 }
 
@@ -3018,11 +3019,11 @@ fail3:
 fail2:
     Error("fail2\n");
 
-    FdoVirqTeardown(Fdo);
-
 fail1:
     Error("fail1 (%08x)\n", status);
 
+    FdoVirqTeardown(Fdo);
+
     return status;
 }
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 13:05:15 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 13:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38495.71235 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxU-00049Z-7I; Thu, 26 Nov 2020 13:05:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38495.71235; Thu, 26 Nov 2020 13:05:12 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxU-00049S-3i; Thu, 26 Nov 2020 13:05:12 +0000
Received: by outflank-mailman (input) for mailman id 38495;
 Thu, 26 Nov 2020 13:05:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiGxT-00049I-0X
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxS-0001l5-MS; Thu, 26 Nov 2020 13:05:10 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxS-0002Mq-D9; Thu, 26 Nov 2020 13:05:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxT-00049I-0X
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:11 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From;
	bh=ejSpsK0Rnhza4ojkssDeF3rBgcNhTK63EUUnKnBiI0A=; b=3YlJVIFwarl/yGFLU1P96di0Nm
	9WL7eTgaJxNBYpOuaS2G2yGDa8X97+qMCQBpPZXLhI/44Rba4H3dNjhu0AR+XqZKomfZolR7um02c
	jwN4OfLpSPU8RQLOj+fevIw3YmDd6ad+aXZJyMI0iOxOSpDxBv0bCPt/4ahRdZrWWyIU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxS-0001l5-MS; Thu, 26 Nov 2020 13:05:10 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxS-0002Mq-D9; Thu, 26 Nov 2020 13:05:10 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 0/4] Support disabling of per-vcpu evtchn upcalls
Date: Thu, 26 Nov 2020 13:05:03 +0000
Message-Id: <20201126130507.9144-1-paul@xen.org>
X-Mailer: git-send-email 2.17.1

From: Paul Durrant <pdurrant@amazon.com>

Paul Durrant (4):
  Avoid non-zero memory ASSERTion if FdoVirqInitialize() fails
  Don't veto event channel binding if it's not necessary
  Tolerate any failure of __FdoVirqCreate() in the VIRQ_TIMER case
  Provide a registry override to disable use of per-vcpu event channel
    upcalls

 src/xenbus/evtchn.c | 22 ++++++++++++++++++++--
 src/xenbus/fdo.c    | 27 +++++++++++++--------------
 2 files changed, 33 insertions(+), 16 deletions(-)

-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 13:05:15 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 13:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38498.71247 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxW-0004Ap-Df; Thu, 26 Nov 2020 13:05:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38498.71247; Thu, 26 Nov 2020 13:05:14 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxW-0004Aa-89; Thu, 26 Nov 2020 13:05:14 +0000
Received: by outflank-mailman (input) for mailman id 38498;
 Thu, 26 Nov 2020 13:05:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiGxU-00049t-QT
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxU-0001lH-IC; Thu, 26 Nov 2020 13:05:12 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxU-0002Mq-8g; Thu, 26 Nov 2020 13:05:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxU-00049t-QT
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:12 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=yv8KwX7NVwFJLkEGPN7TKlkNnHKcxNgr3gIPwtYDF04=; b=aUFfAw/pNxqI5bKVUxDVT/1La
	547YbWaeeeM/lC2x+SLDzDZFXbEQJknYZuGMoKjcEJy94FAr2/BxviUcq3YqDmdOfrHkoByGwlgJR
	Bioxdb3T3rANxFoOUy3ZjXicJ/QAovtiCcsaHetWTb7IR0XT2pLgFBpsU0vxJLfh8MeGU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxU-0001lH-IC; Thu, 26 Nov 2020 13:05:12 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxU-0002Mq-8g; Thu, 26 Nov 2020 13:05:12 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 3/4] Tolerate any failure of __FdoVirqCreate() in the VIRQ_TIMER case
Date: Thu, 26 Nov 2020 13:05:06 +0000
Message-Id: <20201126130507.9144-4-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126130507.9144-1-paul@xen.org>
References: <20201126130507.9144-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

In pratice __FdoVirqCreate() won't return STATUS_NOT_SUPPORTED since the
XENBUS_EVTCHN(Open, ...) doesn't return a status code and ERRNO_TO_STATUS()
(inside VcpuSetPeriodicTimer()) doesn't translate any Xen errno to that
status code, therefore the check in FdoVirqInitialize() is actually bogus.

This patch simply tolerates any status code returned by __FdoVirqCreate()
when creating a VIRQ_TIMER and then gates enabling the watchdog on there
being at least one VIRQ_TIMER successfully created.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/fdo.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 18f936baae38..9db968de0247 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -2978,6 +2978,7 @@ FdoVirqInitialize(
     PXENBUS_VIRQ    Virq;
     ULONG           Count;
     ULONG           Index;
+    ULONG           Timer;
     NTSTATUS        status;
 
     InitializeListHead(&Fdo->VirqList);
@@ -2994,28 +2995,25 @@ FdoVirqInitialize(
 
     Count = KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS);
 
+    Timer = 0;
     for (Index = 0; Index < Count; Index++) {
         status = __FdoVirqCreate(Fdo, VIRQ_TIMER, Index, &Virq);
-        if (!NT_SUCCESS(status)) {
-            if (status != STATUS_NOT_SUPPORTED )
-                continue;
-
-            goto fail2;
-        }
+        if (!NT_SUCCESS(status))
+            continue;
 
         InsertTailList(&Fdo->VirqList, &Virq->ListEntry);
+        Timer++;
     }
 
-    status = SystemSetWatchdog(Fdo->Watchdog);
-    if (!NT_SUCCESS(status))
-        goto fail3;
+    if (Timer != 0) {
+        status = SystemSetWatchdog(Fdo->Watchdog);
+        if (!NT_SUCCESS(status))
+            goto fail2;
+    }
 
 done:
     return STATUS_SUCCESS;
 
-fail3:
-    Error("fail3\n");
-
 fail2:
     Error("fail2\n");
 
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 13:05:15 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 13:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38497.71242 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxW-0004AW-A2; Thu, 26 Nov 2020 13:05:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38497.71242; Thu, 26 Nov 2020 13:05:14 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxW-0004AP-6X; Thu, 26 Nov 2020 13:05:14 +0000
Received: by outflank-mailman (input) for mailman id 38497;
 Thu, 26 Nov 2020 13:05:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiGxU-00049j-6d
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxT-0001lD-U8; Thu, 26 Nov 2020 13:05:11 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxT-0002Mq-Kz; Thu, 26 Nov 2020 13:05:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxU-00049j-6d
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:12 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=kFNYDQRltInlcjgT7Bw35XlIm3bYymXMCsga3lclT+8=; b=ZSi3DqJAHenJuCFEjNSgNQ6We
	w1Nq6l62vWwwuhFeeKCFhVvb219uqnD0+6Xk5Oa6LMVaDAI4MTDL9ndKTlel3x0Zku9GfAdWC7EtF
	Nl2/9JHuVpCgUM8BjooYxCY9WRNOCSELIlPnCTQrGOW48qToK0f6WGXaj3RdCUPQWXZkY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxT-0001lD-U8; Thu, 26 Nov 2020 13:05:11 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxT-0002Mq-Kz; Thu, 26 Nov 2020 13:05:11 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 2/4] Don't veto event channel binding if it's not necessary
Date: Thu, 26 Nov 2020 13:05:05 +0000
Message-Id: <20201126130507.9144-3-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126130507.9144-1-paul@xen.org>
References: <20201126130507.9144-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

Currently binding is vetoed if 'UpcallEnabled' is not set, but this is not
necessary if the selected processor is 0, as the callback via will also
interrupt that CPU.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/evtchn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 4a764c071433..46227725e237 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -276,7 +276,7 @@ EvtchnOpenVirq(
     Processor = &Context->Processor[Cpu];
 
     status = STATUS_NOT_SUPPORTED;
-    if (!Processor->UpcallEnabled)
+    if (!Processor->UpcallEnabled && Cpu != 0)
         goto fail1;
 
     status = SystemVirtualCpuIndex(Cpu, &vcpu_id);
@@ -749,7 +749,7 @@ EvtchnBind(
     Processor = &Context->Processor[Cpu];
 
     status = STATUS_NOT_SUPPORTED;
-    if (!Processor->UpcallEnabled)
+    if (!Processor->UpcallEnabled && Cpu != 0)
         goto fail1;
 
     KeAcquireSpinLock(&Channel->Lock, &Irql);
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 13:05:15 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 13:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38499.71250 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxX-0004Bo-CC; Thu, 26 Nov 2020 13:05:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38499.71250; Thu, 26 Nov 2020 13:05:15 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiGxX-0004Bh-9R; Thu, 26 Nov 2020 13:05:15 +0000
Received: by outflank-mailman (input) for mailman id 38499;
 Thu, 26 Nov 2020 13:05:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiGxV-0004AK-Bx
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxV-0001lL-4N; Thu, 26 Nov 2020 13:05:13 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiGxU-0002Mq-Sm; Thu, 26 Nov 2020 13:05:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxV-0004AK-Bx
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 13:05:13 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=O2emCnJxjOKfT7unAtVrePQCdcfv4mDsxPigBRaq2K4=; b=n2dFtST3ReMcZmlJUF3fPh2zz
	cQ8Fi+jB4nOJnW8VvzWbsIbi1XxB2nludWaMWpBL6+O+qfc3dAXGJe8GcxalXPDJJVp45qBzYgqk0
	HnkiAjK09/VP5Bzon7LOWd1xFuPqAZW7E2sDAuEj3uNCKzlWvT1hiKYWYVqxpKpw/vVmU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxV-0001lL-4N; Thu, 26 Nov 2020 13:05:13 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiGxU-0002Mq-Sm; Thu, 26 Nov 2020 13:05:13 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 4/4] Provide a registry override to disable use of per-vcpu event channel upcalls
Date: Thu, 26 Nov 2020 13:05:07 +0000
Message-Id: <20201126130507.9144-5-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126130507.9144-1-paul@xen.org>
References: <20201126130507.9144-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

There is already a REG_DWORD (UseEvtchnFifoAbi) to disable use of FIFO event
channels and force a fall-back to 2-level. This patch adds another
(UseEvtchnUpcall) to disable use of per-vcpu upcalls and force a fall-back to
the callback via.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/evtchn.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index 46227725e237..f2cd61b175b9 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -114,6 +114,7 @@ struct _XENBUS_EVTCHN_CONTEXT {
     PXENBUS_EVTCHN_ABI_CONTEXT      EvtchnFifoContext;
     XENBUS_EVTCHN_ABI               EvtchnAbi;
     BOOLEAN                         UseEvtchnFifoAbi;
+    BOOLEAN                         UseEvtchnUpcall;
     PXENBUS_HASH_TABLE              Table;
     LIST_ENTRY                      List;
 };
@@ -1271,6 +1272,12 @@ EvtchnInterruptEnable(
 
     Trace("====>\n");
 
+    if (!Context->UseEvtchnUpcall)
+    {
+        Info("PER-CPU UPCALL DISABLED\n");
+        goto line;
+    }
+
     for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
         PXENBUS_EVTCHN_PROCESSOR    Processor;
         unsigned int                vcpu_id;
@@ -1306,6 +1313,7 @@ EvtchnInterruptEnable(
         Processor->UpcallEnabled = TRUE;
     }
 
+line:
     Line = FdoGetInterruptLine(Context->Fdo, Context->Interrupt);
 
     status = HvmSetParam(HVM_PARAM_CALLBACK_IRQ, Line);
@@ -1840,6 +1848,7 @@ EvtchnInitialize(
 {
     HANDLE                      ParametersKey;
     ULONG                       UseEvtchnFifoAbi;
+    ULONG                       UseEvtchnUpcall;
     NTSTATUS                    status;
 
     Trace("====>\n");
@@ -1873,6 +1882,14 @@ EvtchnInitialize(
 
     (*Context)->UseEvtchnFifoAbi = (UseEvtchnFifoAbi != 0) ? TRUE : FALSE;
 
+    status = RegistryQueryDwordValue(ParametersKey,
+                                     "UseEvtchnUpcall",
+                                     &UseEvtchnUpcall);
+    if (!NT_SUCCESS(status))
+        UseEvtchnUpcall = 1;
+
+    (*Context)->UseEvtchnUpcall = (UseEvtchnUpcall != 0) ? TRUE : FALSE;
+
     status = SuspendGetInterface(FdoGetSuspendContext(Fdo),
                                  XENBUS_SUSPEND_INTERFACE_VERSION_MAX,
                                  (PINTERFACE)&(*Context)->SuspendInterface,
@@ -2082,6 +2099,7 @@ EvtchnTeardown(
     RtlZeroMemory(&Context->SuspendInterface,
                   sizeof (XENBUS_SUSPEND_INTERFACE));
 
+    Context->UseEvtchnUpcall = FALSE;
     Context->UseEvtchnFifoAbi = FALSE;
 
     EvtchnFifoTeardown(Context->EvtchnFifoContext);
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 15:09:11 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 15:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38597.71359 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItS-0007d6-Pn; Thu, 26 Nov 2020 15:09:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38597.71359; Thu, 26 Nov 2020 15:09:10 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItS-0007cz-Ma; Thu, 26 Nov 2020 15:09:10 +0000
Received: by outflank-mailman (input) for mailman id 38597;
 Thu, 26 Nov 2020 15:09:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiItR-0007ck-BQ
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItQ-0004LU-UT; Thu, 26 Nov 2020 15:09:08 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItQ-0001nN-MR; Thu, 26 Nov 2020 15:09:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItR-0007ck-BQ
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:09 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From;
	bh=kUxvRRVghreOYwt3sRzwleo3FKlus086HDCJ02e7QHA=; b=JeuOrEMAKOQwvfV/qfac63bUfB
	y89AXO12KprkKgMgfFJHrBKEx6E4SZ2q/rHXWGYW68WDSE3t0JaSkaB0yAEoJmA67VnADf8qcXXR+
	MzfCzlf/LBFJirS+u9kjnRN5S6Zrw+MsM4zqw0C081XMRg3XEf17zTJ9ZojQcuSJh1l4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItQ-0004LU-UT; Thu, 26 Nov 2020 15:09:08 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItQ-0001nN-MR; Thu, 26 Nov 2020 15:09:08 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 0/4] Allow event channel binding with 2-level API
Date: Thu, 26 Nov 2020 15:09:02 +0000
Message-Id: <20201126150906.9602-1-paul@xen.org>
X-Mailer: git-send-email 2.17.1

From: Paul Durrant <pdurrant@amazon.com>

Paul Durrant (4):
  Use a Cpu index in XENBUS_EVTCHN_CHANNEL rather than a
    PROCESSOR_NUMBER
  Use XENBUS_EVTCHN_PROCESSOR in callback functions
  Fix typo in SharedInfoDebugCallback()
  Don't restrict event channels to vCPU 0...

 src/xenbus/evtchn.c      | 199 ++++++++++++++++++++++-----------------
 src/xenbus/evtchn_2l.c   |  16 +---
 src/xenbus/shared_info.c |  10 +-
 3 files changed, 121 insertions(+), 104 deletions(-)

-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 15:09:11 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 15:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38598.71366 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItS-0007dS-Tr; Thu, 26 Nov 2020 15:09:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38598.71366; Thu, 26 Nov 2020 15:09:10 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItS-0007dD-OF; Thu, 26 Nov 2020 15:09:10 +0000
Received: by outflank-mailman (input) for mailman id 38598;
 Thu, 26 Nov 2020 15:09:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiItR-0007cp-Qj
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItR-0004LY-IL; Thu, 26 Nov 2020 15:09:09 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItR-0001nN-9z; Thu, 26 Nov 2020 15:09:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItR-0007cp-Qj
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:09 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=A4Ed1n04CH4AHtWTgxMt2PWT5sVlDqlWs8UqeCTDXeQ=; b=tn8qWUPIwMmS1Rsil3Mz7BSl8
	/pBAQ4dg2gpWf+gHKuPsNQLDtwP+Y1fYtnuZxc5YIkNmWIlG065X/1RIqn7dU/wylvm8B8UiAurd1
	Rb51wNER2hggsSNBTgFCwPhbHfrivOSUCh44bA+jEhrOHSe1x+Ks7xwa/F77zB8L2Klsc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItR-0004LY-IL; Thu, 26 Nov 2020 15:09:09 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItR-0001nN-9z; Thu, 26 Nov 2020 15:09:09 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 1/4] Use a Cpu index in XENBUS_EVTCHN_CHANNEL rather than a PROCESSOR_NUMBER
Date: Thu, 26 Nov 2020 15:09:03 +0000
Message-Id: <20201126150906.9602-2-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126150906.9602-1-paul@xen.org>
References: <20201126150906.9602-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

It makes the code a bit simpler removing the need for some double
Group/Number comparisons.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/evtchn.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index f2cd61b175b9..aeaf95c70258 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -86,7 +86,7 @@ struct _XENBUS_EVTCHN_CHANNEL {
     XENBUS_EVTCHN_PARAMETERS    Parameters;
     BOOLEAN                     Mask;
     ULONG                       LocalPort;
-    PROCESSOR_NUMBER            ProcNumber;
+    ULONG                       Cpu;
     BOOLEAN                     Closed;
 };
 
@@ -467,7 +467,7 @@ EvtchnReap(
     RemoveEntryList(&Channel->ListEntry);
     RtlZeroMemory(&Channel->ListEntry, sizeof (LIST_ENTRY));
 
-    RtlZeroMemory(&Channel->ProcNumber, sizeof (PROCESSOR_NUMBER));
+    Channel->Cpu = 0;
 
     ASSERT(IsListEmpty(&Channel->PendingListEntry));
     RtlZeroMemory(&Channel->PendingListEntry, sizeof (LIST_ENTRY));
@@ -684,7 +684,6 @@ EvtchnTrigger(
 {
     PXENBUS_EVTCHN_CONTEXT      Context = Interface->Context;
     KIRQL                       Irql;
-    PROCESSOR_NUMBER            ProcNumber;
     ULONG                       Cpu;
     PXENBUS_EVTCHN_PROCESSOR    Processor;
     PXENBUS_INTERRUPT           Interrupt;
@@ -693,11 +692,9 @@ EvtchnTrigger(
     ASSERT3U(Channel->Magic, ==, XENBUS_EVTCHN_CHANNEL_MAGIC);
 
     KeAcquireSpinLock(&Channel->Lock, &Irql);
-    ProcNumber = Channel->ProcNumber;
+    Cpu = Channel->Cpu;
     KeReleaseSpinLock(&Channel->Lock, Irql);
 
-    Cpu = KeGetProcessorIndexFromNumber(&ProcNumber);
-
     ASSERT3U(Cpu, <, Context->ProcessorCount);
     Processor = &Context->Processor[Cpu];
 
@@ -758,8 +755,7 @@ EvtchnBind(
     if (!Channel->Active)
         goto done;
 
-    if (Channel->ProcNumber.Group == Group &&
-        Channel->ProcNumber.Number == Number)
+    if (Channel->Cpu == Cpu)
         goto done;
 
     LocalPort = Channel->LocalPort;
@@ -771,7 +767,7 @@ EvtchnBind(
     if (!NT_SUCCESS(status))
         goto fail2;
 
-    Channel->ProcNumber = ProcNumber;
+    Channel->Cpu = Cpu;
 
     Info("[%u]: CPU %u:%u\n", LocalPort, Group, Number);
 
@@ -803,7 +799,7 @@ EvtchnUnmask(
     KIRQL                       Irql = PASSIVE_LEVEL;
     BOOLEAN                     Pending;
     ULONG                       LocalPort;
-    PROCESSOR_NUMBER            ProcNumber;
+    ULONG                       Cpu;
 
     ASSERT3U(Channel->Magic, ==, XENBUS_EVTCHN_CHANNEL_MAGIC);
 
@@ -845,10 +841,9 @@ EvtchnUnmask(
     // event channel is bound, then we need to use the hypercall.
     // to schedule the upcall on the correct CPU.
     //
-    (VOID) KeGetCurrentProcessorNumberEx(&ProcNumber);
+    Cpu = KeGetCurrentProcessorNumberEx(NULL);
 
-    if (Channel->ProcNumber.Group != ProcNumber.Group ||
-        Channel->ProcNumber.Number != ProcNumber.Number) {
+    if (Channel->Cpu != Cpu) {
         XENBUS_EVTCHN_ABI(PortMask,
                           &Context->EvtchnAbi,
                           LocalPort);
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 15:09:12 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 15:09:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38599.71368 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItT-0007e0-UH; Thu, 26 Nov 2020 15:09:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38599.71368; Thu, 26 Nov 2020 15:09:11 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItT-0007dr-PV; Thu, 26 Nov 2020 15:09:11 +0000
Received: by outflank-mailman (input) for mailman id 38599;
 Thu, 26 Nov 2020 15:09:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiItS-0007cu-F0
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:10 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItS-0004Lc-6Y; Thu, 26 Nov 2020 15:09:10 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItR-0001nN-UZ; Thu, 26 Nov 2020 15:09:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItS-0007cu-F0
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:10 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=X80zaQbeOV+ndAWSUVgbLTdBrWweFF/sFtokZstSvhA=; b=ZC1Va6GMFN9BLMLfb2JKeD7Qc
	Z38BypdzrlGsgI2upeWOWuokrcIEz9uBD5TjrK71QtYPTJOSUD7Br9YG8/9sriEZ7lHis1qljAEXN
	fe9gJYGxf2W87MJnGNjarNEcA03ujJT1ktx5Xv5e4VbaMeCNPokdP1mUOIVBWyYZZn26c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItS-0004Lc-6Y; Thu, 26 Nov 2020 15:09:10 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItR-0001nN-UZ; Thu, 26 Nov 2020 15:09:10 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 2/4] Use XENBUS_EVTCHN_PROCESSOR in callback functions
Date: Thu, 26 Nov 2020 15:09:04 +0000
Message-Id: <20201126150906.9602-3-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126150906.9602-1-paul@xen.org>
References: <20201126150906.9602-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

This avoids the need for a few KeGetCurrentProcessorEx() calls

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/evtchn.c | 127 ++++++++++++++++++++++++--------------------
 1 file changed, 70 insertions(+), 57 deletions(-)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index aeaf95c70258..e32cb629a101 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -91,10 +91,12 @@ struct _XENBUS_EVTCHN_CHANNEL {
 };
 
 typedef struct _XENBUS_EVTCHN_PROCESSOR {
-    PXENBUS_INTERRUPT   Interrupt;
-    LIST_ENTRY          PendingList;
-    KDPC                Dpc;
-    BOOLEAN             UpcallEnabled;
+    PXENBUS_EVTCHN_CONTEXT  Context;
+    ULONG                   Cpu;
+    PXENBUS_INTERRUPT       Interrupt;
+    LIST_ENTRY              PendingList;
+    KDPC                    Dpc;
+    BOOLEAN                 UpcallEnabled;
 } XENBUS_EVTCHN_PROCESSOR, *PXENBUS_EVTCHN_PROCESSOR;
 
 struct _XENBUS_EVTCHN_CONTEXT {
@@ -497,19 +499,12 @@ EvtchnPollCallback(
     IN  ULONG                   LocalPort
     )
 {
-    PXENBUS_EVTCHN_CONTEXT      Context = Argument;
-    ULONG                       Cpu;
-    PXENBUS_EVTCHN_PROCESSOR    Processor;
+    PXENBUS_EVTCHN_PROCESSOR    Processor = Argument;
+    PXENBUS_EVTCHN_CONTEXT      Context = Processor->Context;
     PXENBUS_EVTCHN_CHANNEL      Channel;
     BOOLEAN                     Pending;
     NTSTATUS                    status;
 
-    ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
-    Cpu = KeGetCurrentProcessorNumberEx(NULL);
-
-    ASSERT3U(Cpu, <, Context->ProcessorCount);
-    Processor = &Context->Processor[Cpu];
-
     status = HashTableLookup(Context->Table,
                              LocalPort,
                              (PULONG_PTR)&Channel);
@@ -546,7 +541,7 @@ EvtchnPoll(
                              &Context->EvtchnAbi,
                              Cpu,
                              EvtchnPollCallback,
-                             Context);
+                             Processor);
 
     DoneSomething = FALSE;
 
@@ -649,22 +644,20 @@ _IRQL_requires_(DISPATCH_LEVEL)
 _IRQL_requires_same_
 VOID
 EvtchnDpc(
-    IN  PKDPC               Dpc,
-    IN  PVOID               _Context,
-    IN  PVOID               Argument1,
-    IN  PVOID               Argument2
+    IN  PKDPC                   Dpc,
+    IN  PVOID                   _Context,
+    IN  PVOID                   Argument1,
+    IN  PVOID                   Argument2
     )
 {
-    PXENBUS_EVTCHN_CONTEXT  Context = _Context;
-    ULONG                   Cpu;
+    PXENBUS_EVTCHN_PROCESSOR    Processor = _Context;
+    PXENBUS_EVTCHN_CONTEXT      Context = Processor->Context;
+    ULONG                       Cpu = Processor->Cpu;
 
     UNREFERENCED_PARAMETER(Dpc);
     UNREFERENCED_PARAMETER(Argument1);
     UNREFERENCED_PARAMETER(Argument2);
 
-    ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
-    Cpu = KeGetCurrentProcessorNumberEx(NULL);
-
     KeAcquireSpinLockAtDpcLevel(&Context->Lock);
 
     if (Context->References == 0)
@@ -1072,19 +1065,17 @@ _Function_class_(KSERVICE_ROUTINE)
 __drv_requiresIRQL(HIGH_LEVEL)
 BOOLEAN
 EvtchnInterruptCallback(
-    IN  PKINTERRUPT         InterruptObject,
-    IN  PVOID               Argument
+    IN  PKINTERRUPT             InterruptObject,
+    IN  PVOID                   Argument
     )
 {
-    PXENBUS_EVTCHN_CONTEXT  Context = Argument;
-    ULONG                   Cpu;
-    BOOLEAN                 DoneSomething;
+    PXENBUS_EVTCHN_PROCESSOR    Processor = Argument;
+    PXENBUS_EVTCHN_CONTEXT      Context = Processor->Context;
+    ULONG                       Cpu = Processor->Cpu;
+    BOOLEAN                     DoneSomething;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
-    ASSERT3U(KeGetCurrentIrql(), >=, DISPATCH_LEVEL);
-    Cpu = KeGetCurrentProcessorNumberEx(NULL);
-
     DoneSomething = FALSE;
     while (XENBUS_SHARED_INFO(UpcallPending,
                               &Context->SharedInfoInterface,
@@ -1553,26 +1544,12 @@ EvtchnAcquire(
     if (!NT_SUCCESS(status))
         goto fail7;
 
-    status = KeGetProcessorNumberFromIndex(0, &ProcNumber);
-    ASSERT(NT_SUCCESS(status));
-
-    Context->Interrupt = FdoAllocateInterrupt(Fdo,
-                                              LevelSensitive,
-                                              ProcNumber.Group,
-                                              ProcNumber.Number,
-                                              EvtchnInterruptCallback,
-                                              Context);
-
-    status = STATUS_UNSUCCESSFUL;
-    if (Context->Interrupt == NULL)
-        goto fail8;
-
     Context->ProcessorCount = KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS);
     Context->Processor = __EvtchnAllocate(sizeof (XENBUS_EVTCHN_PROCESSOR) * Context->ProcessorCount);
 
     status = STATUS_NO_MEMORY;
     if (Context->Processor == NULL)
-        goto fail9;
+        goto fail8;
 
     for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
         PXENBUS_EVTCHN_PROCESSOR    Processor;
@@ -1587,22 +1564,35 @@ EvtchnAcquire(
 
         Processor = &Context->Processor[Cpu];
 
+        Processor->Context = Context;
+        Processor->Cpu = Cpu;
         Processor->Interrupt = FdoAllocateInterrupt(Fdo,
                                                     Latched,
                                                     ProcNumber.Group,
                                                     ProcNumber.Number,
                                                     EvtchnInterruptCallback,
-                                                    Context);
-
-        if (Processor->Interrupt == NULL)
-            continue;
+                                                    Processor);
 
         InitializeListHead(&Processor->PendingList);
 
-        KeInitializeDpc(&Processor->Dpc, EvtchnDpc, Context);
+        KeInitializeDpc(&Processor->Dpc, EvtchnDpc, Processor);
         KeSetTargetProcessorDpcEx(&Processor->Dpc, &ProcNumber);
     }
 
+    status = KeGetProcessorNumberFromIndex(0, &ProcNumber);
+    ASSERT(NT_SUCCESS(status));
+
+    Context->Interrupt = FdoAllocateInterrupt(Fdo,
+                                              LevelSensitive,
+                                              ProcNumber.Group,
+                                              ProcNumber.Number,
+                                              EvtchnInterruptCallback,
+                                              &Context->Processor[0]);
+
+    status = STATUS_UNSUCCESSFUL;
+    if (Context->Interrupt == NULL)
+        goto fail9;
+
     EvtchnInterruptEnable(Context);
 
     Trace("<====\n");
@@ -1615,11 +1605,32 @@ done:
 fail9:
     Error("fail9\n");
 
-    Context->ProcessorCount = 0;
+    for (Cpu = 0; Cpu < Context->ProcessorCount; Cpu++) {
+        PXENBUS_EVTCHN_PROCESSOR Processor;
+
+        ASSERT(Context->Processor != NULL);
+        Processor = &Context->Processor[Cpu];
+
+        RtlZeroMemory(&Processor->Dpc, sizeof (KDPC));
+        RtlZeroMemory(&Processor->PendingList, sizeof (LIST_ENTRY));
+
+        if (Processor->Interrupt != NULL) {
+            FdoFreeInterrupt(Fdo, Processor->Interrupt);
+            Processor->Interrupt = NULL;
+        }
+
+        Processor->Cpu = 0;
+        Processor->Context = NULL;
+    }
+
+    ASSERT(IsZeroMemory(Context->Processor, sizeof (XENBUS_EVTCHN_PROCESSOR) * Context->ProcessorCount));
+    __EvtchnFree(Context->Processor);
+    Context->Processor = NULL;
 
 fail8:
     Error("fail8\n");
 
+    Context->ProcessorCount = 0;
     EvtchnAbiRelease(Context);
 
 fail7:
@@ -1696,17 +1707,19 @@ EvtchnRelease(
         ASSERT(Context->Processor != NULL);
         Processor = &Context->Processor[Cpu];
 
-        if (Processor->Interrupt == NULL)
-            continue;
-
         EvtchnFlush(Context, Cpu);
 
         (VOID) KeRemoveQueueDpc(&Processor->Dpc);
         RtlZeroMemory(&Processor->Dpc, sizeof (KDPC));
         RtlZeroMemory(&Processor->PendingList, sizeof (LIST_ENTRY));
 
-        FdoFreeInterrupt(Fdo, Processor->Interrupt);
-        Processor->Interrupt = NULL;
+        if (Processor->Interrupt != NULL) {
+            FdoFreeInterrupt(Fdo, Processor->Interrupt);
+            Processor->Interrupt = NULL;
+        }
+
+        Processor->Cpu = 0;
+        Processor->Context = NULL;
     }
 
     ASSERT(IsZeroMemory(Context->Processor, sizeof (XENBUS_EVTCHN_PROCESSOR) * Context->ProcessorCount));
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 15:09:12 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 15:09:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38600.71372 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItU-0007eF-01; Thu, 26 Nov 2020 15:09:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38600.71372; Thu, 26 Nov 2020 15:09:11 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItT-0007e2-Qq; Thu, 26 Nov 2020 15:09:11 +0000
Received: by outflank-mailman (input) for mailman id 38600;
 Thu, 26 Nov 2020 15:09:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiItT-0007dh-3e
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItS-0004Lg-RQ; Thu, 26 Nov 2020 15:09:10 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItS-0001nN-I1; Thu, 26 Nov 2020 15:09:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItT-0007dh-3e
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:11 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=mrfjtybsLxCKPNctEsEA903q+ldgiiD0B9ZQ5KPRaVY=; b=fKubfc63RAbyS5jN72AnCDpOT
	Y8SEkOx6dEypx4GtEvi1JO4kEq1PjZI+mAqkRzPdBz8xNdrucM0LwNmt2vPNsfH8fAfZ7urISQo9z
	RRRfE/VrNgJrHgG0A7s/h4dDGDXYc14I2SzKeD5He0v/hRZdmu/oWy//KJqWNGEVcrWPM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItS-0004Lg-RQ; Thu, 26 Nov 2020 15:09:10 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItS-0001nN-I1; Thu, 26 Nov 2020 15:09:10 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 3/4] Fix typo in SharedInfoDebugCallback()
Date: Thu, 26 Nov 2020 15:09:05 +0000
Message-Id: <20201126150906.9602-4-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126150906.9602-1-paul@xen.org>
References: <20201126150906.9602-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

A missing '%' in a format specifier means we don't get the correct information
for the per-vcpu selector masks in the debug output.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/shared_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
index a95318cd0a7f..aa97255cce95 100644
--- a/src/xenbus/shared_info.c
+++ b/src/xenbus/shared_info.c
@@ -512,7 +512,7 @@ SharedInfoDebugCallback(
 
             XENBUS_DEBUG(Printf,
                          &Context->DebugInterface,
-                         "CPU %u:u: SELECTOR MASK: %p\n",
+                         "CPU %u:%u: SELECTOR MASK: %p\n",
                          ProcNumber.Group,
                          ProcNumber.Number,
                          (PVOID)Shared->vcpu_info[vcpu_id].evtchn_pending_sel);
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 26 15:09:13 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 26 Nov 2020 15:09:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.38601.71376 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItV-0007fT-0B; Thu, 26 Nov 2020 15:09:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 38601.71376; Thu, 26 Nov 2020 15:09:12 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiItU-0007fM-Sp; Thu, 26 Nov 2020 15:09:12 +0000
Received: by outflank-mailman (input) for mailman id 38601;
 Thu, 26 Nov 2020 15:09:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kiItT-0007dm-Lw
 for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItT-0004Lk-Da; Thu, 26 Nov 2020 15:09:11 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kiItT-0001nN-5j; Thu, 26 Nov 2020 15:09:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItT-0007dm-Lw
	for win-pv-devel@lists.xenproject.org; Thu, 26 Nov 2020 15:09:11 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;
	 bh=Xgn9xMXG5rHU3FrfTCGKugDVyQsZh12/2Hx7ESLLOpY=; b=ea6ZmOIG9+29SKafmwKRSMRPT
	B34fIhETOa2dpSGlA0OgvzBVAMYAyDMvcA9gsprN2fz/E/xZL+7sMQzBQ7LcLMWNWHuTvUPANiT8r
	bjdx3zK4E2CzAHx85AGSC5w+H0Slvt22tAZZal8kWnil91fol4xX9nBfiBcetKPT3yzJw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItT-0004Lk-Da; Thu, 26 Nov 2020 15:09:11 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com ([86.183.162.145] helo=CBG-R90WXYV0.home)
	by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <paul@xen.org>)
	id 1kiItT-0001nN-5j; Thu, 26 Nov 2020 15:09:11 +0000
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus 4/4] Don't restrict event channels to vCPU 0...
Date: Thu, 26 Nov 2020 15:09:06 +0000
Message-Id: <20201126150906.9602-5-paul@xen.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20201126150906.9602-1-paul@xen.org>
References: <20201126150906.9602-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

... when using the 2-level event channel ABI.

With a small modification to track port numbers per-vcpu, the 2-level polling
code will happily deal with event channels bound to any vCPU up to
XEN_LEGACY_MAX_VCPUS. We just need to be careful to only process events on the
correct vCPU, to avoid list corruption. Hence, the newly introduced 'Pending'
flag needs to be set atomically in case we re-bind an event channel whilst a
poll is in progress.

The XEN_LEGACY_MAX_VCPUS limit is because the 2-level poll currently relies
on using the vcpu_info array embedded in the shared_info. This limit will be
removed in a subsequent patch.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/evtchn.c      | 51 ++++++++++++++++++++++++++--------------
 src/xenbus/evtchn_2l.c   | 16 ++++---------
 src/xenbus/shared_info.c |  8 +++----
 3 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/src/xenbus/evtchn.c b/src/xenbus/evtchn.c
index e32cb629a101..662ca038fc31 100644
--- a/src/xenbus/evtchn.c
+++ b/src/xenbus/evtchn.c
@@ -77,6 +77,7 @@ struct _XENBUS_EVTCHN_CHANNEL {
     KSPIN_LOCK                  Lock;
     LIST_ENTRY                  ListEntry;
     LIST_ENTRY                  PendingListEntry;
+    LONG                        Pending;
     PVOID                       Caller;
     PKSERVICE_ROUTINE           Callback;
     PVOID                       Argument;
@@ -378,8 +379,6 @@ EvtchnOpen(
 
     Trace("%u\n", LocalPort);
 
-    InitializeListHead(&Channel->PendingListEntry);
-
     status = XENBUS_EVTCHN_ABI(PortEnable,
                                &Context->EvtchnAbi,
                                LocalPort);
@@ -414,9 +413,6 @@ fail4:
 fail3:
     Error("fail3\n");
 
-    ASSERT(IsListEmpty(&Channel->PendingListEntry));
-    RtlZeroMemory(&Channel->PendingListEntry, sizeof (LIST_ENTRY));
-
     Channel->LocalPort = 0;
     Channel->Mask = FALSE;
     RtlZeroMemory(&Channel->Parameters, sizeof (XENBUS_EVTCHN_PARAMETERS));
@@ -471,9 +467,6 @@ EvtchnReap(
 
     Channel->Cpu = 0;
 
-    ASSERT(IsListEmpty(&Channel->PendingListEntry));
-    RtlZeroMemory(&Channel->PendingListEntry, sizeof (LIST_ENTRY));
-
     Channel->LocalPort = 0;
     Channel->Mask = FALSE;
     RtlZeroMemory(&Channel->Parameters, sizeof (XENBUS_EVTCHN_PARAMETERS));
@@ -501,8 +494,8 @@ EvtchnPollCallback(
 {
     PXENBUS_EVTCHN_PROCESSOR    Processor = Argument;
     PXENBUS_EVTCHN_CONTEXT      Context = Processor->Context;
+    ULONG                       Cpu = Processor->Cpu;
     PXENBUS_EVTCHN_CHANNEL      Channel;
-    BOOLEAN                     Pending;
     NTSTATUS                    status;
 
     status = HashTableLookup(Context->Table,
@@ -513,11 +506,15 @@ EvtchnPollCallback(
 
     ASSERT3U(Channel->LocalPort, ==, LocalPort);
 
-    Pending = !IsListEmpty(&Channel->PendingListEntry);
+    if (Channel->Cpu != Cpu)
+        goto done;
+
+    if (InterlockedBitTestAndSet(&Channel->Pending, 0) == 0) {
+        ASSERT(IsZeroMemory(&Channel->PendingListEntry, sizeof (LIST_ENTRY)));
 
-    if (!Pending)
         InsertTailList(&Processor->PendingList,
                        &Channel->PendingListEntry);
+    }
 
 done:
     return FALSE;
@@ -558,8 +555,18 @@ EvtchnPoll(
 
         KeMemoryBarrier();
         if (!Channel->Closed) {
+            ASSERT(Channel->Pending != 0);
+
             RemoveEntryList(&Channel->PendingListEntry);
-            InitializeListHead(&Channel->PendingListEntry);
+            RtlZeroMemory(&Channel->PendingListEntry, sizeof (LIST_ENTRY));
+
+            //
+            // Make sure the list removal is complete before we allow the
+            // channel to be queued again.
+            //
+            KeMemoryBarrier();
+
+            Channel->Pending = 0;
 
             if (Channel->Mask)
                 XENBUS_EVTCHN_ABI(PortMask,
@@ -583,6 +590,8 @@ EvtchnPoll(
 #pragma warning(suppress:6387)  // NULL argument
             DoneSomething |= Channel->Callback(NULL, Channel->Argument);
         } else if (List != NULL) {
+            ASSERT(Channel->Pending != 0);
+
             RemoveEntryList(&Channel->PendingListEntry);
             InsertTailList(List, &Channel->PendingListEntry);
         }
@@ -630,7 +639,12 @@ EvtchnFlush(
 
         ASSERT3U(Channel->Magic, ==, XENBUS_EVTCHN_CHANNEL_MAGIC);
 
-        InitializeListHead(&Channel->PendingListEntry);
+        ASSERT(Channel->Pending != 0);
+
+        RtlZeroMemory(&Channel->PendingListEntry, sizeof (LIST_ENTRY));
+
+        // No need to barrier as the event will not be queued again
+        Channel->Pending = 0;
 
         EvtchnReap(Context, Channel, TRUE);
     }
@@ -680,7 +694,7 @@ EvtchnTrigger(
     ULONG                       Cpu;
     PXENBUS_EVTCHN_PROCESSOR    Processor;
     PXENBUS_INTERRUPT           Interrupt;
-    BOOLEAN                     Pending;
+    BOOLEAN                     Queued;
 
     ASSERT3U(Channel->Magic, ==, XENBUS_EVTCHN_CHANNEL_MAGIC);
 
@@ -697,15 +711,16 @@ EvtchnTrigger(
 
     Irql = FdoAcquireInterruptLock(Context->Fdo, Interrupt);
 
-    Pending = !IsListEmpty(&Channel->PendingListEntry);
-
-    if (!Pending)
+    Queued = FALSE;
+    if (InterlockedBitTestAndSet(&Channel->Pending, 0) == 0) {
         InsertTailList(&Processor->PendingList,
                        &Channel->PendingListEntry);
+        Queued = TRUE;
+    }
 
     FdoReleaseInterruptLock(Context->Fdo, Interrupt, Irql);
 
-    if (Pending)
+    if (!Queued)
         return;
 
     KeInsertQueueDpc(&Processor->Dpc, NULL, NULL);
diff --git a/src/xenbus/evtchn_2l.c b/src/xenbus/evtchn_2l.c
index 0982b00c97c6..a869e150df29 100644
--- a/src/xenbus/evtchn_2l.c
+++ b/src/xenbus/evtchn_2l.c
@@ -71,19 +71,13 @@ EvtchnTwoLevelIsProcessorEnabled(
     IN  ULONG                       Index
     )
 {
-    unsigned int                    vcpu_id;
-    NTSTATUS                        status;
-
     UNREFERENCED_PARAMETER(_Context);
 
-    status = SystemVirtualCpuIndex(Index, &vcpu_id);
-    if (!NT_SUCCESS(status))
-        return FALSE;
-
-    if (vcpu_id != 0)
-        return FALSE;
-
-    return TRUE;
+    //
+    // We currently rely on using the vcpu_info array that is embedded
+    // in the shared_info.
+    //
+    return (Index < XEN_LEGACY_MAX_VCPUS) ? TRUE : FALSE;
 }
 
 static BOOLEAN
diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
index aa97255cce95..473088c18c93 100644
--- a/src/xenbus/shared_info.c
+++ b/src/xenbus/shared_info.c
@@ -48,7 +48,7 @@ struct _XENBUS_SHARED_INFO_CONTEXT {
     LONG                        References;
     PHYSICAL_ADDRESS            Address;
     shared_info_t               *Shared;
-    ULONG                       Port;
+    ULONG                       Port[HVM_MAX_VCPUS];
     XENBUS_SUSPEND_INTERFACE    SuspendInterface;
     PXENBUS_SUSPEND_CALLBACK    SuspendCallbackEarly;
     XENBUS_DEBUG_INTERFACE      DebugInterface;
@@ -204,7 +204,7 @@ SharedInfoEvtchnPoll(
 
     KeMemoryBarrier();
 
-    Port = Context->Port;
+    Port = Context->Port[vcpu_id];
 
     while (SelectorMask != 0) {
         ULONG   SelectorBit;
@@ -241,7 +241,7 @@ SharedInfoEvtchnPoll(
             Port = 0;
     }
 
-    Context->Port = Port;
+    Context->Port[vcpu_id] = Port;
 
 done:
     return DoneSomething;
@@ -652,7 +652,7 @@ SharedInfoRelease (
 
     Trace("====>\n");
 
-    Context->Port = 0;
+    RtlZeroMemory(Context->Port, sizeof (ULONG) * HVM_MAX_VCPUS);
 
     XENBUS_DEBUG(Deregister,
                  &Context->DebugInterface,
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Fri Nov 27 08:23:55 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 27 Nov 2020 08:23:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.39099.71881 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiZ2m-0003Oo-JE; Fri, 27 Nov 2020 08:23:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 39099.71881; Fri, 27 Nov 2020 08:23:52 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kiZ2m-0003Oh-GR; Fri, 27 Nov 2020 08:23:52 +0000
Received: by outflank-mailman (input) for mailman id 39099;
 Fri, 27 Nov 2020 08:23:51 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kiZ2l-0003Oc-OL
 for win-pv-devel@lists.xenproject.org; Fri, 27 Nov 2020 08:23:51 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <paul.durrant@xenproject.org>)
	id 1kiZ2l-0003Oc-OL
	for win-pv-devel@lists.xenproject.org; Fri, 27 Nov 2020 08:23:51 +0000
Date: Fri, 27 Nov 2020 08:23:54 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <11082609.7.1606465436140.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENBUS-master - Build #209 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_6_9932632.1606465434578"
X-Jenkins-Job: XENBUS-master
X-Jenkins-Result: SUCCESS


------=_Part_6_9932632.1606465434578
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #209.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/209/console to view the results.
------=_Part_6_9932632.1606465434578--


From win-pv-devel-bounces@lists.xenproject.org Sat Nov 28 17:53:18 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Sat, 28 Nov 2020 17:53:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.40099.73161 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kj4PM-0004hy-2Z; Sat, 28 Nov 2020 17:53:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 40099.73161; Sat, 28 Nov 2020 17:53:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kj4PL-0004hp-Ve; Sat, 28 Nov 2020 17:53:15 +0000
Received: by outflank-mailman (input) for mailman id 40099;
 Sat, 28 Nov 2020 17:53:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>) id 1kj4PK-0004hk-TE
 for win-pv-devel@lists.xenproject.org; Sat, 28 Nov 2020 17:53:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kj4PK-0004wU-Je; Sat, 28 Nov 2020 17:53:14 +0000
Received: from host86-183-162-145.range86-183.btcentralplus.com
 ([86.183.162.145] helo=CBG-R90WXYV0.home)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <paul@xen.org>)
 id 1kj4PK-0007L6-9s; Sat, 28 Nov 2020 17:53:14 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From;
	bh=oZPYvgdMn2GeGXYO067zfRWGfAE5x7v08oGXgzprmro=; b=QmTFKKQclKOwA2JqBVKggrXlQf
	/8T/R+GH20FhU/DFur9VWHma/aGFP73EV5vHwOj3EaB9e8ED/yErh2R70eNSNRzfRmjMeJVWMAlO6
	qDTqyu0KOk5Y4jYoYKcEGlQKJXpiQV4uuDcC8Oqc0Meb6EZIx6dnhivYZU+mZ+Wp7SC4=;
From: Paul Durrant <paul@xen.org>
To: win-pv-devel@lists.xenproject.org
Cc: Paul Durrant <pdurrant@amazon.com>
Subject: [PATCH xenbus] Re-work ASSERTion to avoid issues with VERIFIER list checks
Date: Sat, 28 Nov 2020 17:53:11 +0000
Message-Id: <20201128175311.14859-1-paul@xen.org>
X-Mailer: git-send-email 2.17.1

From: Paul Durrant <pdurrant@amazon.com>

The current mechanism of ASSERTing that there is a single item on the list
seems to fail when list checking is turned on in VERIFIER. Avoid going round
the back of the list macros by instead ASSERTing that the list is empty, once
the entry is removed.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
---
 src/xenbus/cache.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index ba0177b71223..48772d419fd0 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -385,14 +385,14 @@ CacheDestroySlab(
     // The only reason the cursor should be pointing at this slab is
     // if it is the only one in the list.
     //
-    if (Cache->Cursor == &Slab->ListEntry) {
-        ASSERT(Slab->ListEntry.Flink == &Cache->SlabList);
-        ASSERT(Slab->ListEntry.Blink == &Cache->SlabList);
+    if (Cache->Cursor == &Slab->ListEntry)
         Cache->Cursor = &Cache->SlabList;
-    }
 
     RemoveEntryList(&Slab->ListEntry);
 
+    ASSERT(Cache->Cursor != &Cache->SlabList ||
+           IsListEmpty(&Cache->SlabList));
+
     Index = Slab->MaximumOccupancy;
     while (--Index >= 0) {
         PVOID Object = (PVOID)&Slab->Buffer[Index * Cache->Size];
-- 
2.17.1



From win-pv-devel-bounces@lists.xenproject.org Sat Nov 28 20:52:42 2020
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Sat, 28 Nov 2020 20:52:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.40141.73191 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kj7Cy-0004k2-Ct; Sat, 28 Nov 2020 20:52:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 40141.73191; Sat, 28 Nov 2020 20:52:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1kj7Cy-0004jv-9w; Sat, 28 Nov 2020 20:52:40 +0000
Received: by outflank-mailman (input) for mailman id 40141;
 Sat, 28 Nov 2020 20:52:38 +0000
Received: from winpvdrvbuild.xenproject.org ([162.242.160.44])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <paul.durrant@xenproject.org>) id 1kj7Cw-0004jq-9S
 for win-pv-devel@lists.xenproject.org; Sat, 28 Nov 2020 20:52:38 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
Date: Sat, 28 Nov 2020 20:52:38 +0000 (UTC)
From: paul.durrant@xenproject.org
To: win-pv-devel@lists.xenproject.org
Message-ID: <18533360.9.1606596758711.JavaMail.WINPVDRVBUILD$@winpvdrvbuild>
Subject: XENBUS-master - Build #210 - Successful
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_8_3320508.1606596758555"
X-Jenkins-Job: XENBUS-master
X-Jenkins-Result: SUCCESS


------=_Part_8_3320508.1606596758555
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The build system has completed build #210.

Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/210/console to view the results.
------=_Part_8_3320508.1606596758555--


