From win-pv-devel-bounces@lists.xenproject.org Wed May 04 15:33:41 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 04 May 2022 15:33:41 +0000 Received: from list by lists.xenproject.org with outflank-mailman.320846.541797 (Exim 4.92) (envelope-from ) id 1nmH0V-0000bE-Hj; Wed, 04 May 2022 15:33:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 320846.541797; Wed, 04 May 2022 15:33:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmH0V-0000b7-Ev; Wed, 04 May 2022 15:33:39 +0000 Received: by outflank-mailman (input) for mailman id 320846; Wed, 04 May 2022 15:33:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmH0T-0000b1-7Z for win-pv-devel@lists.xenproject.org; Wed, 04 May 2022 15:33:37 +0000 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8e1dc124-cbbf-11ec-a406-831a346695d4; Wed, 04 May 2022 17:33:35 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 26E3B320096B for ; Wed, 4 May 2022 11:33:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 04 May 2022 11:33:31 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 4 May 2022 11:33:29 -0400 (EDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 8e1dc124-cbbf-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1651678410; x=1651764810; bh=MTTRnXjSPCa/M CeEX1Q9Csy06c4jTone6EPZO47T+e0=; b=wIP3ZHUhgCoVI5OYEmcxucJoTzWc4 p7DKOhdsgFBViTXT5GiMSjVGFaUz3ai1clzzCBT9QmJweKK8+weMEXag8Bdl/zHe nF4t3a9970l9hXm/AfXU+gbv5oo1WCkmiqwGHbP6mlXAx8ds4BW1WWtbhMOLwLWJ aOWsAUnPyy6Atj+GLBH6ROTs0lpVt2bU4rKBVGX2gt1UmQDplKCtk4nvjoWeL9Lr l/i00ALa3871w4RzkLH2OzSUxvCMdD4zlj4SGnO5trH0n7dVI65U2g548FtWlicJ Z5L9g6UDFKyXh64mAT3Oq8cfsHMrxKR17iGdlxTwO+ilXOju0DmD6HGgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdelgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggusehgtderredttd ejnecuhfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcu oehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenuc ggtffrrghtthgvrhhnpeejgfdugfeltdekfffhtedvgfekieehleehfeduffehvdfffeeg ieehffevveektdenucffohhmrghinhepgigvnhdrohhrghdpghhithhhuhgsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhm rghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Date: Wed, 4 May 2022 17:33:26 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: win-pv-devel@lists.xenproject.org Subject: control/shutdown node removed on suspend? Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jmt91llA1zUPsBnj" Content-Disposition: inline --jmt91llA1zUPsBnj Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Wed, 4 May 2022 17:33:26 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: win-pv-devel@lists.xenproject.org Subject: control/shutdown node removed on suspend? Hi, I've just got an interesting bug report - it seems Windows PV drivers (or something else?) remove control/shutdown xenstore node on suspend, instead of just writing empty string there (to ack the request). This makes subsequent suspend to fail, because toolstack does not adjust permissions of that node when writing to it (assuming it was set correctly during domain construction), which means domU has no longer write access to it and cannot acknowledge the request. TBH, I'm not sure where exactly this happens, could be also outside of PV drivers. But the issue doesn't apply for Linux VMs - that's why I think it is related to Windows PV drivers. https://xenbits.xen.org/gitweb/?p=3Dpvdrivers/win/xeniface.git;a=3Dblob;f= =3Dsrc/xenagent/service.cpp;h=3D9bc5c20767454eaeae4760308d7655580a08e4cb;hb= =3D5c6adcaa423c465de279158c4cc42500627c20a0 seems to use StoreWrite("control/shutdown", ""), which sounds correct (if it really does what it suggests to do). But that's just cursory look at the code, I'm not sure if that's even the correct file. The system is using official build of 8.2.2 drivers. Original bug report can be found here: https://github.com/QubesOS/qubes-issues/issues/7404#issuecomment-1117231111 (see subsequent comments for details) Any idea? --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --jmt91llA1zUPsBnj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmJynMYACgkQ24/THMrX 1yxiKAgAjwpxoGab0Zh0OlIE+eQIQYiaeYEbf+Td/d2gw7bUM018NVOA7AfqFymd dKI5MDMdudmPEsKOpu5F0CB0IZh2nW52bdY9e1H/3i2Vf6SIcyMmaFRofRhs1gjq 0rOrfayTHZzbbVDqlN5f8v7jVgDaUu78thuvieg+Yku/a8+nj6B9YA38HSCUMgDZ 1jA9UmQ1ZDhCpwf3xa+y4fjs+Ld8/LwJIBv75TsrUoLKYeAgD11xkMfSsyeFUoSL x18LZzUdXPYvoBp//qkkFk1XOhL9Kq3WaS8WFvnuAa/NTlAmDes/2RDIEDMOgFhX dlk0ykWZubTR7oaxtM8/LWkTbh3ijg== =L/Mk -----END PGP SIGNATURE----- --jmt91llA1zUPsBnj-- From win-pv-devel-bounces@lists.xenproject.org Wed May 04 16:37:26 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 04 May 2022 16:37:26 +0000 Received: from list by lists.xenproject.org with outflank-mailman.320906.541891 (Exim 4.92) (envelope-from ) id 1nmI0D-00039r-K9; Wed, 04 May 2022 16:37:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 320906.541891; Wed, 04 May 2022 16:37:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmI0D-00039k-Gd; Wed, 04 May 2022 16:37:25 +0000 Received: by outflank-mailman (input) for mailman id 320906; Wed, 04 May 2022 16:37:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmI0B-00039e-EW for win-pv-devel@lists.xenproject.org; Wed, 04 May 2022 16:37:23 +0000 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [2a00:1450:4864:20::430]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 78ae99f6-cbc8-11ec-a406-831a346695d4; Wed, 04 May 2022 18:37:22 +0200 (CEST) Received: by mail-wr1-x430.google.com with SMTP id u3so2796434wrg.3 for ; Wed, 04 May 2022 09:37:22 -0700 (PDT) Received: from [10.7.237.9] (54-240-197-225.amazon.com. [54.240.197.225]) by smtp.gmail.com with ESMTPSA id g9-20020a05600c000900b003942a244ec8sm4114717wmc.13.2022.05.04.09.37.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 May 2022 09:37:21 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 78ae99f6-cbc8-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=LB5VLDjm5J46W1K3MtTGZ4QBetOZc2k0QCpnOf19CPQ=; b=n3u4yTDHzCShSevbr1tl6fTfefKyIZ1YnTEdMFT4bdZ64pe8C+t+K/IIX/gr96sDaI ja7Rx6HXcMsZF9FZMBjSVO64doblKKHNcnaIUpNumPdPOQr5R7lLLLEJii5mN8b/zO6C 7EOIV9h+0wKbVQrEJceSRlNkZQdIKKmP5GAVu2VsJqVsZ8BQRGR3bH9m7a4jlg/H2/u/ Q68tZryis2llLZFCl9fedgmIydquji/shd+L/d58zlM72VNmG1nEIU8gMTSHMf4Hx4nE YcNrBbX4ZBVovNkTfjV2Dw2Z+Usz057cgO31ag+rsvMT65Q6IOKUeJGqmQlI9EJxuuMc nqvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=LB5VLDjm5J46W1K3MtTGZ4QBetOZc2k0QCpnOf19CPQ=; b=hp5a1/losAfCxk8vTQ3puuT0LZSXPXSAhOUChJMHvKVR6MfjUSCMlJZH2H5HT4MiY8 0fElTi8ZdgWffePW2FzLTSj2xu13LZ3XPFls4k7YDZmeAWoQIl0yeWjAn5Xwb4zFPNH6 KdhC1BN/RzZHmTfrzqEzHDboE0gaONw+GQMJnvi/2kTUsg8rHL6hG8BzZsS0mykIJP9C 5JUo9ocfqYcdEFurBaKl1GoHFDJZ3x2S+Tof2vvOCvj2Fe8h0A7a79GYHJsfe1jtBMRn aSnO2dgkyvil4mpvLDwMXD9DCylxLFR8xWL7C+RWLO8wwtUTFUHYy8TX9m0XZtYlixpn 8TPw== X-Gm-Message-State: AOAM530c1Z908GnOTth1diSEZbYEwNdIXnKl6WiBJ7xoJYpsvR+YBswe RDN4oCjfLqIqJs8z8WhC0Yc= X-Google-Smtp-Source: ABdhPJz79t9LBimEvXjT6RhLluzFaiGY5tPRdhk/d7qy89k6Em2YltlBGcncqbLURSt4ZGGfdh0fUg== X-Received: by 2002:a05:6000:1e1a:b0:20c:565d:ca1c with SMTP id bj26-20020a0560001e1a00b0020c565dca1cmr15424327wrb.643.1651682241693; Wed, 04 May 2022 09:37:21 -0700 (PDT) Message-ID: Date: Wed, 4 May 2022 17:37:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Reply-To: paul@xen.org Subject: Re: RFC Add extra sync release step for late callbacks. Content-Language: en-US To: Martin Harvey , "paul@xen.org" , "win-pv-devel@lists.xenproject.org" Cc: Owen Smith References: <356386bb-cb26-a1bf-57aa-dd0820b4275c@gmail.com> From: "Durrant, Paul" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 29/04/2022 14:42, Martin Harvey wrote: > - "main" thread waits for "reached count = cpu count", and then sets "target next state = current state" > > Oops > > - "main" thread waits for "reached count = cpu count", and then sets "current state = target next state" I went with requests/commands rather then state and I do seem to have something functional now but am seeing stalls in the xenstore datapath after restore from a saved image. There's also quite a bit of tidying to do. Aiming to have something by the end of the week (day-job allowing). Paul From win-pv-devel-bounces@lists.xenproject.org Wed May 04 16:42:57 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 04 May 2022 16:42:57 +0000 Received: from list by lists.xenproject.org with outflank-mailman.320914.541895 (Exim 4.92) (envelope-from ) id 1nmI5Z-0004B9-20; Wed, 04 May 2022 16:42:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 320914.541895; Wed, 04 May 2022 16:42:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmI5Y-0004B2-VW; Wed, 04 May 2022 16:42:56 +0000 Received: by outflank-mailman (input) for mailman id 320914; Wed, 04 May 2022 16:42:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmI5X-0004Ag-Ak for win-pv-devel@lists.xenproject.org; Wed, 04 May 2022 16:42:55 +0000 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [2a00:1450:4864:20::42d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3de41877-cbc9-11ec-8fc4-03012f2f19d4; Wed, 04 May 2022 18:42:54 +0200 (CEST) Received: by mail-wr1-x42d.google.com with SMTP id b19so2786601wrh.11 for ; Wed, 04 May 2022 09:42:53 -0700 (PDT) Received: from [10.7.237.9] (54-240-197-225.amazon.com. [54.240.197.225]) by smtp.gmail.com with ESMTPSA id t16-20020a05600c2f9000b003942a244f50sm4809589wmn.41.2022.05.04.09.42.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 May 2022 09:42:52 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 3de41877-cbc9-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=fwUmFvkK9BWgg/nCULwEH8tUp1ITkxUlw2aHc8zOuFI=; b=W2AMwDp76fEHWonPTwIYGUIzdT6BvJ44mBEcwbY85guWIPomTaYfFpJC3bp8uF3hXb ISpU2GxpFsRwI5bYd4myElyfyFX6SYCyZzA1edtisBGA6+4IN6VWBSfoc+dIlfHehgjK dLQazmBoVXxiunPgj2Jc94N80BqmkuNHAy1GWJmY/gYUQOFyej/Ub8y5E7boIK2kAT+I jG7g1pXypsd4Er2KyXFaWfBBkXFo4X66ftu6mGUfsIEoDvLtINeJR2/zz7aMJaRT4HG8 HplK418P4EE4ORpFpVKBuFbu4uqMWJ8nBhmyphOnFIfLxFcYXbDWbUQ/rVQIgIh4NQ9S d35g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=fwUmFvkK9BWgg/nCULwEH8tUp1ITkxUlw2aHc8zOuFI=; b=1eltabSP1394vt8HFPfheZ/dz++iwfKIGsyEuxuJ4zpaqAW86SCjq8bGpXRfAsKXRr 3YGFjc7iGOsK1p7vSk3uKUO0bksjjuRkohi1+YOxUObBzbgHzcJ0e3Y2UAUGyUAvTU+T q5oBGecxBk0tCsT9rb2L4cSe/rLKCHAst1XX4rjLGmb3+t31h7RvPGiSLKLCZ13Gf3Im DQCCb+DwxaQEulo6IVQLU4/wn6GjTADKAV+LJ1B5qGONHTnEAx7+8P8pgvZki6e1Y859 A2Yeb6k6nhp+Bjy2yDQfVFaoxHIRmXO+efSC3DEh5ny3KyIsqxDQJrccyGEkNwGEvQOV Ui8g== X-Gm-Message-State: AOAM533kIegn+Cv71GcBfYcDAx8ZJOHSMYKQ3ROxEFuCYJRcIiGggooW e2il82n1zsFJIsuCiNbyokhPeMnVrHtiJw== X-Google-Smtp-Source: ABdhPJxPvl1wUX5kBB9o6xn7wwD84wkUguySVKe6av5zd6/sla2VppVJh8klJzR4eG7UsWNqZWPv+w== X-Received: by 2002:a05:6000:2a2:b0:20c:734f:d38a with SMTP id l2-20020a05600002a200b0020c734fd38amr7295759wry.417.1651682572607; Wed, 04 May 2022 09:42:52 -0700 (PDT) Message-ID: <2ca11218-b716-fb84-55d4-7d0aa0da8de8@gmail.com> Date: Wed, 4 May 2022 17:42:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Reply-To: paul@xen.org Subject: Re: control/shutdown node removed on suspend? Content-Language: en-US To: win-pv-devel@lists.xenproject.org References: From: "Durrant, Paul" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 04/05/2022 16:33, Marek Marczykowski-Górecki wrote: > Hi, > > I've just got an interesting bug report - it seems Windows PV drivers (or > something else?) remove control/shutdown xenstore node on suspend, > instead of just writing empty string there (to ack the request). > This makes subsequent suspend to fail, because toolstack does not adjust > permissions of that node when writing to it (assuming it was set > correctly during domain construction), which means domU has no longer > write access to it and cannot acknowledge the request. > > TBH, I'm not sure where exactly this happens, could be also outside of > PV drivers. But the issue doesn't apply for Linux VMs - that's why I > think it is related to Windows PV drivers. > https://xenbits.xen.org/gitweb/?p=pvdrivers/win/xeniface.git;a=blob;f=src/xenagent/service.cpp;h=9bc5c20767454eaeae4760308d7655580a08e4cb;hb=5c6adcaa423c465de279158c4cc42500627c20a0 > seems to use StoreWrite("control/shutdown", ""), which sounds correct > (if it really does what it suggests to do). But that's just cursory look > at the code, I'm not sure if that's even the correct file. > > The system is using official build of 8.2.2 drivers. > > Original bug report can be found here: > https://github.com/QubesOS/qubes-issues/issues/7404#issuecomment-1117231111 > (see subsequent comments for details) > > Any idea? > The commit you are missing, I believe, is: commit 4c1d9b0a57a349d9d3ae8c8af2519618c73c40b4 Author: Paul Durrant Date: Tue Apr 10 17:21:38 2018 +0100 Fix control/shutdown acknowledgement The code in FdoSuspend() currently acknowledges a suspend request by removing the control/shutdown node from xenstore. This is not correct. The documentation [1] states that a request should be acknowledged by writing the empty string. This patch makes the code behave correctly. [1] xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/misc/xenstore-paths.markdown;hb=HEAD#l413 Signed-off-by: Paul Durrant This is what git says: git tag --contains 4c1d9b0a57a349d9d3ae8c8af2519618c73c40b4 9.0.0-rc1 ... so it was not back-ported to 8.x. Paul From win-pv-devel-bounces@lists.xenproject.org Wed May 04 17:31:08 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 04 May 2022 17:31:08 +0000 Received: from list by lists.xenproject.org with outflank-mailman.320942.541927 (Exim 4.92) (envelope-from ) id 1nmIqB-0001zj-4a; Wed, 04 May 2022 17:31:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 320942.541927; Wed, 04 May 2022 17:31:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmIqB-0001zc-1g; Wed, 04 May 2022 17:31:07 +0000 Received: by outflank-mailman (input) for mailman id 320942; Wed, 04 May 2022 17:31:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmIq9-0001zW-VJ for win-pv-devel@lists.xenproject.org; Wed, 04 May 2022 17:31:06 +0000 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f678f096-cbcf-11ec-8fc4-03012f2f19d4; Wed, 04 May 2022 19:31:01 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3FCA632007CF; Wed, 4 May 2022 13:30:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 04 May 2022 13:30:58 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 May 2022 13:30:56 -0400 (EDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: f678f096-cbcf-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651685457; x= 1651771857; bh=KJWWNOfgp4kWop0ojZf3uhBLm4edP2YdGShA93OQvE4=; b=V GjRlH7Xqr2QL6pk+uCNMiWJZWR0I85H+TAcSsdnrDUvAcqk5kCSUmvjBSSd4PFHK WE1F8az/j/LixF3KIcr2vB2ib93XbF3zG1M0K2hC3SbQpc75jzb0xur/y8ZtFO2o ep8fgQPvdFz7NyMdrLrk2oekCy+iuKs2ab0GwneWw1yFpECQ9iv/qugJK5fbPkWs EAAlpv/69VnXoL87AujCkWuws8eVbA9F9Eo/fj8ot8jU6Cyxo7TNost+961W9wSJ Y/c5fBQnTo8vrGWOJp6rzEM9DcV96CbNbIraEYHtdkbiDfnKCV8Q1pxrwsgYEESq 4NqK13E72y/Vean4/3JVQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdelgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehgtd erredttdejnecuhfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgv tghkihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh hmqeenucggtffrrghtthgvrhhnpeduudefvdeiieetieevvdefleefvddugeevffelvdel geduieevffelieethfefjeenucffohhmrghinhepgigvnhdrohhrghdpghhithhhuhgsrd gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep mhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Date: Wed, 4 May 2022 19:30:52 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: paul@xen.org Cc: win-pv-devel@lists.xenproject.org Subject: Re: control/shutdown node removed on suspend? Message-ID: References: <2ca11218-b716-fb84-55d4-7d0aa0da8de8@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dhHsXTFLa28Zdxrm" Content-Disposition: inline In-Reply-To: <2ca11218-b716-fb84-55d4-7d0aa0da8de8@gmail.com> --dhHsXTFLa28Zdxrm Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Wed, 4 May 2022 19:30:52 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: paul@xen.org Cc: win-pv-devel@lists.xenproject.org Subject: Re: control/shutdown node removed on suspend? On Wed, May 04, 2022 at 05:42:51PM +0100, Durrant, Paul wrote: > On 04/05/2022 16:33, Marek Marczykowski-G=C3=B3recki wrote: > > Hi, > >=20 > > I've just got an interesting bug report - it seems Windows PV drivers (= or > > something else?) remove control/shutdown xenstore node on suspend, > > instead of just writing empty string there (to ack the request). > > This makes subsequent suspend to fail, because toolstack does not adjust > > permissions of that node when writing to it (assuming it was set > > correctly during domain construction), which means domU has no longer > > write access to it and cannot acknowledge the request. > >=20 > > TBH, I'm not sure where exactly this happens, could be also outside of > > PV drivers. But the issue doesn't apply for Linux VMs - that's why I > > think it is related to Windows PV drivers. > > https://xenbits.xen.org/gitweb/?p=3Dpvdrivers/win/xeniface.git;a=3Dblob= ;f=3Dsrc/xenagent/service.cpp;h=3D9bc5c20767454eaeae4760308d7655580a08e4cb;= hb=3D5c6adcaa423c465de279158c4cc42500627c20a0 > > seems to use StoreWrite("control/shutdown", ""), which sounds correct > > (if it really does what it suggests to do). But that's just cursory look > > at the code, I'm not sure if that's even the correct file. > >=20 > > The system is using official build of 8.2.2 drivers. > >=20 > > Original bug report can be found here: > > https://github.com/QubesOS/qubes-issues/issues/7404#issuecomment-111723= 1111 > > (see subsequent comments for details) > >=20 > > Any idea? > >=20 >=20 > The commit you are missing, I believe, is: >=20 > commit 4c1d9b0a57a349d9d3ae8c8af2519618c73c40b4 > Author: Paul Durrant > Date: Tue Apr 10 17:21:38 2018 +0100 >=20 > Fix control/shutdown acknowledgement >=20 > The code in FdoSuspend() currently acknowledges a suspend request by > removing the control/shutdown node from xenstore. This is not correct. >=20 > The documentation [1] states that a request should be acknowledged by > writing the empty string. This patch makes the code behave correctly. >=20 > [1] xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/xensto= re-paths.markdown;hb=3DHEAD#l413 >=20 > Signed-off-by: Paul Durrant >=20 > This is what git says: >=20 > git tag --contains 4c1d9b0a57a349d9d3ae8c8af2519618c73c40b4 > 9.0.0-rc1 >=20 > ... so it was not back-ported to 8.x. Looks like it, thanks! --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --dhHsXTFLa28Zdxrm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmJyuE0ACgkQ24/THMrX 1ywZ2Af+OwPcsBOezWZD8QNeFT/DYE6TPTzPaz16AKmQ5wUaGsc/tRS0Q87ST51Q J/he0+tM8Dz2o6RAgswbHfNGartCgxveBgeXRgyMHEshUAEveOrS8CIfRi2vjnJR NzqwEX3anzpclac/sHjlCKWRSh/WzuaErV1SHm73EpA+xYinsB1RvaN3RzkEd1dO p6xpf9pGo5N5QW+sNsnR8uAVeeWV28xc0RxR03IT0yAZNiXlYnNuBIuZBSSsRuUp kB5jVJLnWH1DhCJGk2vczguH3KJdwPeI4i76G6YVQRXuCsTQ9hSczRsXpK9nd7p4 17aLiuydpiIy9yMQV/v665nXNox++w== =2qKl -----END PGP SIGNATURE----- --dhHsXTFLa28Zdxrm-- From win-pv-devel-bounces@lists.xenproject.org Thu May 05 07:02:59 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 05 May 2022 07:02:59 +0000 Received: from list by lists.xenproject.org with outflank-mailman.321458.542462 (Exim 4.92) (envelope-from ) id 1nmVVq-0007ng-Ae; Thu, 05 May 2022 07:02:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 321458.542462; Thu, 05 May 2022 07:02:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVVq-0007nZ-7s; Thu, 05 May 2022 07:02:58 +0000 Received: by outflank-mailman (input) for mailman id 321458; Thu, 05 May 2022 07:02:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVVn-0007nR-VZ for win-pv-devel@lists.xenproject.org; Thu, 05 May 2022 07:02:56 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 60b6cfc6-cc41-11ec-a406-831a346695d4; Thu, 05 May 2022 09:02:54 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 60b6cfc6-cc41-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1651734174; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=09tyYo8XnAFr7idS6ePBpiLf+pmxS7KQeMd1ydGBGZE=; b=bH1CWO1FCvDdlKzFYNblreHSrvXP7QT11E+k/Wvq2E89XL+f0rU+wt0T Gqxn7kZvFu996PUNZZdm7kBvgf9k3ws/k5wIAXt8v1R0f1jmjCx34JjNm QdoGO42UyktOLwcfs4UMU834Kffn48CkenTMEYjZgmYWZOUooZ5PUVndI 0=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 71032793 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:rB9tX6lPW8+18MMu9s2nUcHo5gzXJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJLDG6Ebq7YZjOnctoiaN+zpxlVv8XTzYVlSANs/yhmHyMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EsLd9IR2NYy24DkW17V4 LsenuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYc1k3YYPvuP4kejIGQgVbIfBKoKHVPi3q2SCT5xWun3rExvxvCAc9PJEC+/YxCmZLn RAaAGlTNFbZ3bvwme/lDLk37iggBJCD0Ic3vW5ty3fCCPc6QbjIQrnQ5M8e1zA17ixLNamHP 5FDNms0BPjGSwwREQsHMpcnpc25tkXuWQ9etW+VjoNitgA/yyQuieOwYbI5YOeiWsRT216G4 27L4Wn9KhUbL8CEjyqI9Gq2ge3Clj+9X5gdfIBU7dYz3gfVnDZKTkRLCx3r+pFVl3JSRfpld VJL1AkOt5Eb3xL6avzhAhHgvmyb60t0t8VrL8U27wSEy6zx6gmfB3QZQjMpVOHKpPPaVhRxi AbXwoqB6ShH9eTMFCnDruv8QSaaY3B9EIMUWcMToeLpCfHHqZp7sB/AR80L/EWd3oysQmGYL 9xnQUEDa1QvYSwjiv3TEbPv2WvESn31oukdvF+/Y45dxlklDLNJnqTxgbQh0d5OLZyCUn6Kt 2Uels6V4YgmVM/QzXPVELVURu3wu55p1QEwZnY1RPEcG8mFoSb/Lei8HhkjTKuWDir0UWCwO xKC0e+gzJRSIGGrfcdKj3GZUKwXIVzbPY29DJj8N4MWCrAoLVPv1Hw+NCa4gjG2+GBxwP5XB HtuWZv1ZZrsIf88l2TeqiZ0+eJD+x3SMkuOG8Cml0j3jev2ibz8Ye5tDWZip9sRtMusyDg5O f4GXydW432ziNHDXxQ= IronPort-HdrOrdr: A9a23:8rzuiaCeU16zqJPlHemm55DYdb4zR+YMi2TC1yhKJiC9Ffbo8v xG/c5rsiMc5wxxZJhNo7290cq7MBHhHPxOgbX5VI3KNGKNhILBFvAH0WKI+VPd8kPFmtK1rZ 0QEJRDNA== X-IronPort-AV: E=Sophos;i="5.91,200,1647316800"; d="scan'208";a="71032793" From: Owen Smith To: CC: Owen Smith Subject: [PATCH][xenbus] Fix compiler options Date: Thu, 5 May 2022 08:02:45 +0100 Message-ID: <20220505070245.285-1-owen.smith@citrix.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker command lines These changes were prompted by binskim https://github.com/microsoft/binskim Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still reported for xenbus_coinst.dll and xenbus_monitor.exe Rule BA2007 (Error_WarningsDisabled) is still reported for all drivers Rule BA2018 (Error, SSE table is empty) is still reported for x86 xen.sys Signed-off-by: Owen Smith --- vs2019/xen/xen.vcxproj | 1 + vs2019/xenbus/xenbus.vcxproj | 8 +++++++- vs2019/xenbus_coinst/xenbus_coinst.vcxproj | 3 +++ vs2019/xenbus_monitor/xenbus_monitor.vcxproj | 3 +++ vs2019/xenfilt/xenfilt.vcxproj | 8 +++++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/vs2019/xen/xen.vcxproj b/vs2019/xen/xen.vcxproj index 6aaebf5..f0e1b98 100644 --- a/vs2019/xen/xen.vcxproj +++ b/vs2019/xen/xen.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) $(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) true diff --git a/vs2019/xenbus/xenbus.vcxproj b/vs2019/xenbus/xenbus.vcxproj index 00b39a9..d7b94bd 100644 --- a/vs2019/xenbus/xenbus.vcxproj +++ b/vs2019/xenbus/xenbus.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) true $(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common; @@ -30,7 +31,6 @@ ..\..\include;%(AdditionalIncludeDirectories) - false $(ProjectDir)..\$(ConfigurationName)\$(Platform)\xen.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/procgrp.lib;$(DDK_LIB_PATH)/rtlver.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -43,11 +43,17 @@ __i386__;%(PreprocessorDefinitions);_X86_ + + true + __x86_64__;%(PreprocessorDefinitions);_AMD64_ + + false + diff --git a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj b/vs2019/xenbus_coinst/xenbus_coinst.vcxproj index 2e7a6e7..b37e1a5 100644 --- a/vs2019/xenbus_coinst/xenbus_coinst.vcxproj +++ b/vs2019/xenbus_coinst/xenbus_coinst.vcxproj @@ -18,6 +18,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);%(PreprocessorDefinitions) EnableAllWarnings @@ -31,6 +33,7 @@ ../../src/coinst/xenbus_coinst.def setupapi.lib;%(AdditionalDependencies) false + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) diff --git a/vs2019/xenbus_monitor/xenbus_monitor.vcxproj b/vs2019/xenbus_monitor/xenbus_monitor.vcxproj index 8652ac4..54272ec 100644 --- a/vs2019/xenbus_monitor/xenbus_monitor.vcxproj +++ b/vs2019/xenbus_monitor/xenbus_monitor.vcxproj @@ -22,6 +22,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableAllWarnings @@ -33,6 +35,7 @@ wtsapi32.lib;cfgmgr32.lib;%(AdditionalDependencies) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) diff --git a/vs2019/xenfilt/xenfilt.vcxproj b/vs2019/xenfilt/xenfilt.vcxproj index ef53280..270d2e4 100644 --- a/vs2019/xenfilt/xenfilt.vcxproj +++ b/vs2019/xenfilt/xenfilt.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) true $(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;..\..\src\common; @@ -30,7 +31,6 @@ ..\..\include;%(AdditionalIncludeDirectories) - false $(ProjectDir)..\$(ConfigurationName)\$(Platform)\xen.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -43,11 +43,17 @@ __i386__;%(PreprocessorDefinitions);_X86_ + + true + __x86_64__;%(PreprocessorDefinitions);_AMD64_ + + false + -- 2.32.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Thu May 05 07:03:40 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 05 May 2022 07:03:40 +0000 Received: from list by lists.xenproject.org with outflank-mailman.321464.542467 (Exim 4.92) (envelope-from ) id 1nmVWW-0007rv-EE; Thu, 05 May 2022 07:03:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 321464.542467; Thu, 05 May 2022 07:03:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVWW-0007ro-BV; Thu, 05 May 2022 07:03:40 +0000 Received: by outflank-mailman (input) for mailman id 321464; Thu, 05 May 2022 07:03:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVWV-0007nR-Ni for win-pv-devel@lists.xenproject.org; Thu, 05 May 2022 07:03:39 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7bc3c501-cc41-11ec-a406-831a346695d4; Thu, 05 May 2022 09:03:38 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 7bc3c501-cc41-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1651734218; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DpRfjYQ3YkOI6+50jAXdVhfV+d4ycVzp8VDmniTksYQ=; b=QgD9ZsjQozG0Zmd4e4zTwxIvxiE7fGW8JvYXnketEXq+TtfQIIuyrrzv FVN9JF3CkWOE+ZIecf79aLU6gQ0vDgH74Zp9RVWNzMOiRxI/ncCMYDbXD jKg3KrKm1ZT3TdnjCvdENgMRT+h+aOMUB0mU8Cu3sIXx4eHOKQ+W6joF7 I=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 70498830 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:UjMZe6qGFY6FZslA6fzWKyiPOwheBmJJZRIvgKrLsJaIsI4StFCzt garIBnVPPfeMzOkL49+bom/9xwEsJ+DytMxTVE+qCw3E3kQ8ZuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvQ4 Y6q+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBLKf9p+gMYQJhLAJnIrwfo6KcfSb4vpnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVIyi7UC7A9RJHfQ43B5MNC3Sd2jcdLdRrbT 5VBNWs/PE+YC/FJEnZOC7sPnui4vHnQfx0b+FWqtKQ16kGGmWSd15CyaYGIK7RmX/59gUee4 3rYumj0HBweHNie0iaetGKhgPfVmiH2U55UE6e3nsOGm3XKmDZVUkdPEwLm/7/p0SZSRu6zN WQG8BsRobkA73WUbcDiTkTjvSXY4FkTDo84//IB1CmBza/d4gC8D2cCTyJcZNFOiPLaVQDGx XfSwYq3WGUHXKm9DCvEq+zK9W/a1T09dzdqWMMScecSDzAPSqkXhwmHcNtsGbXdYjbdSWCpm GDiQMTTatwuYS83O0eToAivb9GE/MGhousJCuL/BDjN0++BTNT5D7FEEHCChRq6EK6XT0Oao F8PkNWE4eYFAPmlzXLQGbpVTOHwvarcbFUwZGKD+LF7rFyQF4OLJ9gMsFmS2m80Wir7RdMZS BCK4l4AjHOiFHCrcbV2c+qM5zcClsDd+SDefqmMNLJmO8EpHCfepX0GTRPAjgjFzRl3+Ylia MjzTCpZJStDYUiR5GHtHLl1PH5C7n1W+F4/srimkUT6iebOOC/9pHVsGALmU93VJZis+G39m +uz/ePTlX2zjMWWjvHrzLMu IronPort-HdrOrdr: A9a23:zv0976+p6r9VFQs2fyFuk+DSI+orL9Y04lQ7vn2YSXRuHfBw8P re+cjztCWE7wr5N0tApTntAsS9qBDnhPxICOsqXYtKNTOO0ADDEGgL1/qH/9SKIUPDH4BmuZ uIC5IOa+HNMQ== X-IronPort-AV: E=Sophos;i="5.91,200,1647316800"; d="scan'208";a="70498830" From: Owen Smith To: CC: Owen Smith Subject: [PATCH][xeniface] Fix compiler options Date: Thu, 5 May 2022 08:03:27 +0100 Message-ID: <20220505070327.1080-1-owen.smith@citrix.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker command lines These changes were prompted by binskim https://github.com/microsoft/binskim Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still reported for xeniface_coinst.dll, xencontrol.dll and xenagent.exe Signed-off-by: Owen Smith --- vs2019/xenagent/xenagent.vcxproj | 3 +++ vs2019/xencontrol/xencontrol.vcxproj | 3 +++ vs2019/xeniface/xeniface.vcxproj | 8 +++++++- vs2019/xeniface_coinst/xeniface_coinst.vcxproj | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/vs2019/xenagent/xenagent.vcxproj b/vs2019/xenagent/xenagent.vcxproj index 1076c81..02b7b65 100644 --- a/vs2019/xenagent/xenagent.vcxproj +++ b/vs2019/xenagent/xenagent.vcxproj @@ -22,6 +22,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableAllWarnings @@ -33,6 +35,7 @@ powrprof.lib;%(AdditionalDependencies) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) diff --git a/vs2019/xencontrol/xencontrol.vcxproj b/vs2019/xencontrol/xencontrol.vcxproj index 36383d8..5474ceb 100644 --- a/vs2019/xencontrol/xencontrol.vcxproj +++ b/vs2019/xencontrol/xencontrol.vcxproj @@ -19,6 +19,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_USRDLL;XENCONTROL_EXPORTS;%(PreprocessorDefinitions) EnableAllWarnings @@ -32,6 +34,7 @@ setupapi.lib;ws2_32.lib;shlwapi.lib;wtsapi32.lib;userenv.lib;version.lib;ntdll.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;%(AdditionalDependencies) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) diff --git a/vs2019/xeniface/xeniface.vcxproj b/vs2019/xeniface/xeniface.vcxproj index 7e6b79d..b9756dd 100644 --- a/vs2019/xeniface/xeniface.vcxproj +++ b/vs2019/xeniface/xeniface.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) $(WindowsSdkDir)\include\km;..\..\include; PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) true @@ -30,7 +31,6 @@ ..\..\include;%(AdditionalIncludeDirectories) - false $(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\procgrp.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -43,11 +43,17 @@ __i386__;%(PreprocessorDefinitions) + + true + __x86_64__;%(PreprocessorDefinitions) + + false + diff --git a/vs2019/xeniface_coinst/xeniface_coinst.vcxproj b/vs2019/xeniface_coinst/xeniface_coinst.vcxproj index 77e6836..9035a14 100644 --- a/vs2019/xeniface_coinst/xeniface_coinst.vcxproj +++ b/vs2019/xeniface_coinst/xeniface_coinst.vcxproj @@ -18,6 +18,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);%(PreprocessorDefinitions) EnableAllWarnings @@ -30,6 +32,7 @@ ../../src/coinst/xeniface_coinst.def setupapi.lib;%(AdditionalDependencies) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) -- 2.32.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Thu May 05 07:04:18 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 05 May 2022 07:04:18 +0000 Received: from list by lists.xenproject.org with outflank-mailman.321470.542471 (Exim 4.92) (envelope-from ) id 1nmVX8-0007wt-Gv; Thu, 05 May 2022 07:04:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 321470.542471; Thu, 05 May 2022 07:04:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVX8-0007wm-EA; Thu, 05 May 2022 07:04:18 +0000 Received: by outflank-mailman (input) for mailman id 321470; Thu, 05 May 2022 07:04:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVX7-0007nR-5d for win-pv-devel@lists.xenproject.org; Thu, 05 May 2022 07:04:17 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 92995854-cc41-11ec-a406-831a346695d4; Thu, 05 May 2022 09:04:16 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 92995854-cc41-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1651734256; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JUK1mYE3kwIrzR3kYmZYsOjfL2rpHEVVuCPk6z/9JKg=; b=Nxsou5jLK19F2lVnXfW1jStnVkKJZyHH+3yqEgR2fYttLRsTdThlnGCs 8JFF8xNgDIUsM8YQA/FtAKhfXmjNZqxyU7FD6Dd3eqPSzurufTmaYmS52 EiUS9AbuxssDoIJjpRTUoPD4ysalgO4CyHPpeUPOjJCwHDEBa7kwffRd1 8=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 70498881 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:XbJz7aNC5bUbRT3vrR3zl8FynXyQoLVcMsEvi/4bfWQNrUojg2EOz GUYXWiGO/rbYmf2ftl+OYuwp0gP6MPUndRhQQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFYMpBsJ00o5wbZk2tMw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z1 8lf6cyAVh8TM/PFscIRcUV4SSxDFPgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALK9bmOsUEv3B8zRnSDOo8QICFSKLPjTNd9Gho2pEeTaaHD yYfQSUycwSQYwZSAUhUOp4igdyovjr9VyIN/Tp5ooJoujOOnWSdyoPFL9vTP8SUAMlYgEucj mbH5HjiRAEXMsSFzjiI+W7qgfXA9R4XQ6pLSuf+rKQzxgTOmCpDU3X6SGdXv9GmllziC+JAM 3YZpCMHi6QQqGzxQ+TUCkjQTGG/gjYQXN9ZEusf4Q6Ly7bJ7wvxOlXoXgKte/R96pZoGGVCO kuh2oqwWGcx6OH9pWe1rO/8kN+kBcQCwYbujwcgRBBN3dTsqZpbYvnnHoc6S/7dYjEY9FjNL 9G2QMoW2u17YS0jjfzTEbX7b9WE/MKhc+LNzl+LNl9JFysgDGJfW6Sm6ELA8dFLJ5uDQ1+Ks RAswpbDtb9WXcHUznDUHI3h+Y1FAN7fa1XhbaNHRcF9p1xBBVb+FWyv3N2ODBgwaZtVEdMYS ETSpRlQ9Pdu0IiCNsdKj3aKI51yl8DITI29PtiNN4YmSsUhJWevoXA1DWbNjj+FraTZufxmU XttWZ33Vihy5GUO5GfeetrxJpd2mHBjnT+DGcGTItbO+eP2WUN5gIwtaDOmBt3VJovdyOkJ2 76z7/e39ig= IronPort-HdrOrdr: A9a23:ZK8OQq6A2WqsnEuYZAPXwMTXdLJyesId70hD6qhwISY6TiX+rb HLoB17726TtN9/YhEdcLy7VJVoIkmskKKdg7NhXotKNTOO0ADDQb2KhbGSpAEIcBeeygcy78 hdmtBFeb/NMWQ= X-IronPort-AV: E=Sophos;i="5.91,200,1647316800"; d="scan'208";a="70498881" From: Owen Smith To: CC: Owen Smith Subject: [PATCH][xennet] Fix compiler options Date: Thu, 5 May 2022 08:04:09 +0100 Message-ID: <20220505070409.1376-1-owen.smith@citrix.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker command lines These changes were prompted by binskim https://github.com/microsoft/binskim Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still reported for xennet_coinst.dll Signed-off-by: Owen Smith --- vs2019/xennet/xennet.vcxproj | 9 ++++++++- vs2019/xennet_coinst/xennet_coinst.vcxproj | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/vs2019/xennet/xennet.vcxproj b/vs2019/xennet/xennet.vcxproj index cee1325..469ad09 100644 --- a/vs2019/xennet/xennet.vcxproj +++ b/vs2019/xennet/xennet.vcxproj @@ -21,6 +21,7 @@ + /ZH:SHA_256 %(AdditionalOptions) PROJECT=$(ProjectName);NDIS_MINIPORT_DRIVER;NDIS_WDM=1;NDIS630_MINIPORT=1;NDIS660_MINIPORT=1;NDIS685_MINIPORT=1;POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) true $(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen; @@ -32,7 +33,6 @@ ..\..\include;%(AdditionalIncludeDirectories) - false $(DDK_LIB_PATH)\ndis.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -45,11 +45,18 @@ __i386__;%(PreprocessorDefinitions) + + true + + __x86_64__;%(PreprocessorDefinitions) + + false + diff --git a/vs2019/xennet_coinst/xennet_coinst.vcxproj b/vs2019/xennet_coinst/xennet_coinst.vcxproj index d2c5d07..ea789f0 100644 --- a/vs2019/xennet_coinst/xennet_coinst.vcxproj +++ b/vs2019/xennet_coinst/xennet_coinst.vcxproj @@ -19,6 +19,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);%(PreprocessorDefinitions) EnableAllWarnings @@ -31,6 +33,7 @@ ../../src/coinst/xennet_coinst.def setupapi.lib;iphlpapi.lib;%(AdditionalDependencies) + true sha256 -- 2.32.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Thu May 05 07:05:02 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 05 May 2022 07:05:02 +0000 Received: from list by lists.xenproject.org with outflank-mailman.321479.542475 (Exim 4.92) (envelope-from ) id 1nmVXq-00081o-KV; Thu, 05 May 2022 07:05:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 321479.542475; Thu, 05 May 2022 07:05:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVXq-00081h-HY; Thu, 05 May 2022 07:05:02 +0000 Received: by outflank-mailman (input) for mailman id 321479; Thu, 05 May 2022 07:05:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVXp-00080a-K5 for win-pv-devel@lists.xenproject.org; Thu, 05 May 2022 07:05:01 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id accac57d-cc41-11ec-8fc4-03012f2f19d4; Thu, 05 May 2022 09:05:00 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: accac57d-cc41-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1651734300; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nraghz+zN2/p1UP/KFUGYpL2T6889URp68J7KlpY02o=; b=dD8qiliFkFe6AIIlAjCUkNTkPdzg+cVxmvj/I/RaVit0ZeSVGxDqtGRg eriL37kSW9uzdhrzBAjfm/ma23LiH5CjViSDrgoK2wjYrneFYBkRe+6GL 5GTjtEA16/39+SeBl/VLki0DnfI/4mRhmazjPaJ421iP6YGOypUBo2rwb g=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 70622564 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:vtlGE6hilDs6u34O+eeENeIvX161NhAKZh0ujC45NGQN5FlHY01je htvUWqAOPreZjfwc4oib9yw9B8DusCBz4djHARq+ygyEy0b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M68wIFqtQw24LhXlvQ4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YQYYDrTdqvktaEMCFghGOat33ZbgLlHq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bknZ/wDefFvMnXZDrSKTW/95Imjw3g6iiGN6BP 5RDM2cxMHwsZTVAAnFJCtFnht2loXj6bxtjo3iJiOkotj27IAtZj+G2bYu9lsaxbdpUmAOAu CfK8nr0BjkeNceD0nyV/3S0nOjNkCjnHoUIG9WFGuVC2QPJgDZJUVtPCAX98aLRZlOCt8x3K n0k4zscsJgJrhauZ+H5WSydiVmLl0tJMzZPKNES5AaIw6vSxg+WAGkYUzJMAOAbWN8KqS8Cj QHQwY6wbdB7mPjMEC/GqO/Ixd+nEXJNRVLucxPoWufsDzPLhIgoxizCQd94eEJepo2kQGqgq 9xmQcVXulnysSLp//jjlbwkq2j1znQscuLSzl+NNl9JFisjOOaYi3WAsDA3F8poIoeDVUWmt 3MZgcWY5+1mJcjTyXXSGLVdRev1vqrt3NjgbblHRcJJythQ0yT7IdA4DM9WeS+FzfroiRe2O RSO6Gu9FbdYPWewbL8fXm5CI59C8EQULvy8Dqq8RoMXOvBZLVbblAkzNR/49z28yyAEzPBgU ap3hO7xVB72/4w8l2HoLwrcuJd2rh0DKZT7GM6rkkz7gebPDJNXIJ9cWGazgikCxPvsiG3oH xx3bqNmFz03vDXCXxTq IronPort-HdrOrdr: A9a23:V5Uota7YKNcn14eyHgPXwMTXdLJyesId70hD6qhwISY6TiX+rb HLoB17726TtN9/YhEdcLy7VJVoIkmskKKdg7NhXotKNTOO0ADDQb2KhbGSpAEIcBeeygcy78 hdmtBFeb/NMWQ= X-IronPort-AV: E=Sophos;i="5.91,200,1647316800"; d="scan'208";a="70622564" From: Owen Smith To: CC: Owen Smith Subject: [PATCH][xenvbd] Fix compiler options Date: Thu, 5 May 2022 08:04:53 +0100 Message-ID: <20220505070453.383-1-owen.smith@citrix.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker command lines These changes were prompted by binskim https://github.com/microsoft/binskim Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still reported for xenvbd_coinst.dll and xencrsh.sys Rule BA2018 (Error, empty SEH table) is still reported for xencrsh.sys Signed-off-by: Owen Smith --- vs2019/xencrsh/xencrsh.vcxproj | 1 + vs2019/xendisk/xendisk.vcxproj | 10 +++++++--- vs2019/xenvbd/xenvbd.vcxproj | 8 +++++++- vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj | 3 +++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/vs2019/xencrsh/xencrsh.vcxproj b/vs2019/xencrsh/xencrsh.vcxproj index 9f80df3..d9c8bef 100644 --- a/vs2019/xencrsh/xencrsh.vcxproj +++ b/vs2019/xencrsh/xencrsh.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) $(WindowsSdkDir)\include\km;..\..\include;..\..\src\common;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);POOL_NX_OPTIN=1;%(PreprocessorDefinitions) true diff --git a/vs2019/xendisk/xendisk.vcxproj b/vs2019/xendisk/xendisk.vcxproj index c8370ff..9b4874a 100644 --- a/vs2019/xendisk/xendisk.vcxproj +++ b/vs2019/xendisk/xendisk.vcxproj @@ -19,8 +19,8 @@ + /ZH:SHA_256 %(AdditionalOptions) ..\..\include;..\..\src\common;%(AdditionalIncludeDirectories) - false PROJECT=$(ProjectName);POOL_NX_OPTIN=1;%(PreprocessorDefinitions) true EnableAllWarnings @@ -31,7 +31,6 @@ ..\..\include;..\..\src\common;%(AdditionalIncludeDirectories) - false %(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -44,11 +43,16 @@ __i386__;%(PreprocessorDefinitions) - + + true + __x86_64__;%(PreprocessorDefinitions) + + false + diff --git a/vs2019/xenvbd/xenvbd.vcxproj b/vs2019/xenvbd/xenvbd.vcxproj index 6f68f0c..7cae5f0 100644 --- a/vs2019/xenvbd/xenvbd.vcxproj +++ b/vs2019/xenvbd/xenvbd.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) $(WindowsSdkDir)\include\km;..\..\include;..\..\src\common;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);POOL_NX_OPTIN=1;%(PreprocessorDefinitions) true @@ -30,7 +31,6 @@ ..\..\include;..\..\src\common;%(AdditionalIncludeDirectories) - false $(ProjectDir)..\$(ConfigurationName)\$(Platform)\xencrsh.lib;$(DDK_LIB_PATH)/storport.lib;$(DDK_LIB_PATH)/libcntpr.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -43,11 +43,17 @@ __i386__;%(PreprocessorDefinitions) + + true + __x86_64__;%(PreprocessorDefinitions) + + false + diff --git a/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj b/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj index 9a66f45..5a0b918 100644 --- a/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj +++ b/vs2019/xenvbd_coinst/xenvbd_coinst.vcxproj @@ -18,6 +18,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);%(PreprocessorDefinitions) EnableAllWarnings @@ -30,6 +32,7 @@ ../../src/coinst/xenvbd_coinst.def setupapi.lib;%(AdditionalDependencies) + true $(SolutionDir)..\include;%(AdditionalIncludeDirectories) -- 2.32.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Thu May 05 07:05:40 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 05 May 2022 07:05:40 +0000 Received: from list by lists.xenproject.org with outflank-mailman.321486.542479 (Exim 4.92) (envelope-from ) id 1nmVYS-00086K-NQ; Thu, 05 May 2022 07:05:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 321486.542479; Thu, 05 May 2022 07:05:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVYS-00086D-KM; Thu, 05 May 2022 07:05:40 +0000 Received: by outflank-mailman (input) for mailman id 321486; Thu, 05 May 2022 07:05:39 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmVYR-00080a-G7 for win-pv-devel@lists.xenproject.org; Thu, 05 May 2022 07:05:39 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c37ec09d-cc41-11ec-8fc4-03012f2f19d4; Thu, 05 May 2022 09:05:38 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: c37ec09d-cc41-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1651734338; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FYjX0m34mek+dwH5ktyRWwyYp22SfX9h40jEbeoYdxc=; b=cD1yH/QjCDzhdPkDAa2sqbUsYuSe7cRiumIh2yjf6nU879MkBnChQx/e fk/7WjbBYJVRyRARLQTvjZaQlsdhgfdgfXMt5h8Qw1tciC5EcqoT6PMBM t12UlYzgjjKUMM5gOmbUVPybVzDt8XGq/ZdxfEf2YvZmyDt0jHO5/sUNc c=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 71033056 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:tX1idK2eBCemSd9BuvbD5YVxkn2cJEfYwER7XKvMYLTBsI5bpzJVz mJMXDvXPqzcZWOjeNEkOdu0pBtV6JHcmNJnTFM/pC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkjk7xdOCn9xGQ7InQLlbGILes1htZGEk1EU/NtTo5w7Rj2tMw3IDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1z9rnudgcRLJfFgekiUCZqGCZTAY1JreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHsI44Z/GplzC3ZJf0nXYrCU+PB4towMDIY2ZkWRq2GO pRxhTxHVTrtZSJpE1AtVdExx/26lHPaX2BTtwfAzUYwyzeKl1EguFT3C/LKe9rPXdsQkkuGq 2bu+2XiHgpcJNGZ0SCC8H+nmqnIhyyTZW4JPOTmrLgw2gTVnzFNTk1NPbemnRWnonD9foxgK 3QGwCM3oJcxy36gSfTBfxLt9RZooSUgc9ZXFuQ77iSExazV/xuVCwA4c9JRVDA1nJRoHGJ3j zdli/usXGUy6+PNFRpx45/O9VuP1T4pwXjujMPuZS8M+JHdrY46lXojpf4zQffu3rUZ9dwdq g1mTRTSZZ1O1abnNI3hpDgrZg5AQbCTFGYICv3/BD7N0++ATNfNi3aUwVba9+1cC42SU0OMu nMJ8+DHsr1XUsndxHXXHLxRdF1M2xpiGGeH6WOD4rF7r2j9k5JdVd04DM5CyLdBbZ9fJG6Bj L77sgJN/p5DVEZGnocsC79d//8ClPC6ffy8D6i8RoMXPvBZKV/WlAkzNBX49z28zyARfVQXZ M7znTCEVi1BV8yKDVOeGo8g7FPc7n1glT6LGcCnnnxKE9O2PRaodFvMC3PWBshR0U9OiFy9H wp3XydS9yhibQ== IronPort-HdrOrdr: A9a23:CSHICKgq9n2LPKCZIeNWxSiCRnBQXtAji2hC6mlwRA09TySZ// rAoB19726QtN9xYgBGpTnuAsi9qB/nmKKdgrNhX4tKPjOHhILAFugLhuHfKlXbaknDH4Vmu5 uIHZITNDSJNykYsfrH X-IronPort-AV: E=Sophos;i="5.91,200,1647316800"; d="scan'208";a="71033056" From: Owen Smith To: CC: Owen Smith Subject: [PATCH][xenvif] Fix compiler options Date: Thu, 5 May 2022 08:05:32 +0100 Message-ID: <20220505070532.164-1-owen.smith@citrix.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker command lines These changes were prompted by binskim https://github.com/microsoft/binskim Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still reported for xenvif_coinst.dll Signed-off-by: Owen Smith --- vs2019/xenvif/xenvif.vcxproj | 8 +++++++- vs2019/xenvif_coinst/xenvif_coinst.vcxproj | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxproj index 39427b7..52473b8 100644 --- a/vs2019/xenvif/xenvif.vcxproj +++ b/vs2019/xenvif/xenvif.vcxproj @@ -19,6 +19,7 @@ + /ZH:SHA_256 %(AdditionalOptions) $(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;%(AdditionalIncludeDirectories) PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) true @@ -30,7 +31,6 @@ ..\..\include;%(AdditionalIncludeDirectories) - false $(DDK_LIB_PATH)/Rtlver.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;$(DDK_LIB_PATH)/ksecdd.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies) UseLinkTimeCodeGeneration true @@ -43,11 +43,17 @@ __i386__;%(PreprocessorDefinitions) + + true + __x86_64__;%(PreprocessorDefinitions) + + false + diff --git a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj index ccf4135..ae187fc 100644 --- a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj +++ b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj @@ -22,6 +22,8 @@ + /ZH:SHA_256 %(AdditionalOptions) + true PROJECT=$(ProjectName);%(PreprocessorDefinitions) EnableAllWarnings 4127;4548;4711;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings) @@ -33,6 +35,7 @@ ../../src/coinst/xenvif_coinst.def setupapi.lib;%(AdditionalDependencies) + true sha256 -- 2.32.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Thu May 05 08:55:10 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 05 May 2022 08:55:10 +0000 Received: from list by lists.xenproject.org with outflank-mailman.321865.543011 (Exim 4.92) (envelope-from ) id 1nmXGQ-0005Sz-8Y; Thu, 05 May 2022 08:55:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 321865.543011; Thu, 05 May 2022 08:55:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmXGQ-0005Ss-5h; Thu, 05 May 2022 08:55:10 +0000 Received: by outflank-mailman (input) for mailman id 321865; Thu, 05 May 2022 08:55:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmXGP-0005Sm-5g for win-pv-devel@lists.xenproject.org; Thu, 05 May 2022 08:55:09 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0ef17294-cc51-11ec-a406-831a346695d4; Thu, 05 May 2022 10:55:07 +0200 (CEST) Received: from mail-bn8nam08lp2042.outbound.protection.outlook.com (HELO NAM04-BN8-obe.outbound.protection.outlook.com) ([104.47.74.42]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 May 2022 04:55:04 -0400 Received: from MW4PR03MB6347.namprd03.prod.outlook.com (2603:10b6:303:11e::22) by DM6PR03MB4315.namprd03.prod.outlook.com (2603:10b6:5:101::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.18; Thu, 5 May 2022 08:55:02 +0000 Received: from MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::1c1a:4522:6f0a:df7d]) by MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::1c1a:4522:6f0a:df7d%6]) with mapi id 15.20.5206.027; Thu, 5 May 2022 08:55:01 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 0ef17294-cc51-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1651740907; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tuAubkkEWFN1NWVLIVxvILEdvyiGJ/A5lZw1/M/fyYQ=; b=QmD9SBo7iwO+ut8N6Rr4INEXS1wUIT2TG4aP86Q40+w/CSXpunpFZV3F NoLNjZAaDCVqwtnHORD4wNNOo++fa7ljETYd9nGmKU9zK+Tacy02ztTTb hEgb7kI/HFHwBjP3UIFl/QdGPyDxv/bz/BOVtkODMZcJaCfnV7i462Djf 8=; X-IronPort-RemoteIP: 104.47.74.42 X-IronPort-MID: 73111989 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:AU0maqsvn/WfBQPbfCJUAwlDLOfnVDVfMUV32f8akzHdYApBsoF/q tZmKTzVOPaCYTb1Lo0kbYi2/UwEsMfdzN9qTQZurX02RiJB+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQywobVvqYy2YLjW17V5 IuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8lIqjvgOleCCN4TQQ5JL9a0Zb5fWmw5Jn7I03uKxMAwt1IJWRuYcgy3LYyBmtDs /sFNDoKcxaPwfqsx662QfVtgcJlK9T3OIQYuTdryjSx4fQOGMifBfmVo4AEmmtq7ixNNa+2i 84xbDN1cBXGJR1GIEkaGbo1nfuyh2m5eDpdwL6QjfVsujGKnVwguFTrGNbbWeeYG9QJp3+nu UXg02ryIksjFeXKnFJp9Vrp3IcjhxjTQIsPEJWo+/gsh0ecrkQMCRtTTUX+rfSnh0qWX9NEN 1dS6icotbI19kGgUp/6RRLQnZKflhsVWt4VGetq7giIkvrQ+1zBWjJCSSNdYts7ssNwXSYty lKCg9LuA3poraGRTnWesLyTqFteJBQoEIPLXgdcJSNt3jUpiNhbYs7nJjq7LJOIsw== IronPort-HdrOrdr: A9a23:Q+f226jGyrnf0ZWBnFJL/i9F6XBQX3h13DAbv31ZSRFFG/FwyP rCoB1L73XJYWgqM03IwerwQ5VpQRvnhP1ICPoqTM2ftW7dySeVxeBZnMbfKljbdxEWmdQtsp uIH5IeNDS0NykDsS+Y2nj2Lz9D+qjgzEnAv463oBlQpENRGthdBmxCe2Sm+zhNNW177O0CZf +hD6R8xwaISDAyVICWF3MFV+/Mq5ngj5T9eyMLABYh9U2nkS6owKSSKWnY4j4uFxd0hZsy+2 nMlAL0oo+5teug9xPa32jPq7xLhdrazMdZDsDksLlUFtyssHfqWG1SYczGgNkHmpDq1L/sqq iKn/4UBbUw15oWRBDynfKi4Xi47N9k0Q6e9bbRuwqenSW+fkN1NyMJv/MnTjLJr0Unp91yy6 RNwiaQsIdWFwrJmGDn68HPTAwCrDv9nZMOq59ks5Vka/pWVFaRl/1swGpFVJMbWC7q4oEuF+ djSMna+fZNaFufK3TUpHNmztCgVmk6Wk7ueDlJhuWFlzxN2HxpxUoRw8IS2n8G6ZImUpFBo+ DJKL5hmr1CRtIfKah9GOACS82qDXGle2OGDEuCZVD8UK0XMXPErJD6pL0z+eGxYZQNiIA/nZ zQOWkowlLbNynVeL6zNV1wg2TwqUmGLEXQI5tlluZEU5XHNcrWGDzGTkwymM29pPhaCtHHWp +ISedrP8M= X-IronPort-AV: E=Sophos;i="5.91,200,1647316800"; d="scan'208";a="73111989" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QH4WRRlQc9ZNRwJKCP4Y7GLSN+bYQJDZOQfv55JA9j3uj8tsx7wJfOECxYTTGt1d6W/nDZbx32P0ON5/oqb6BpzJ0DVvW7oO/5QQ4aDxBmoe1p/3njctksUTRukiLXL3GAOxHi4G/XQaeMZ0LeSfXQH3S6g0Qev2+7RRSH973yPt6p9kCqEoCJudSLF/y04yvISbaaL9XDXmIwAoHoPIyu43zi1UhydiyWKX2S0OeFI2lyMYJVPVZf8vGo1lJRlfXWVRPWc082SiHEDD5Goe21YikTctVCvw9ZMgeJXd2b5uG4tp+rY7lez0gxxRRFPbjNfMIJTjLiO17BSckUJ0AQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tuAubkkEWFN1NWVLIVxvILEdvyiGJ/A5lZw1/M/fyYQ=; b=YYfoztfi23qyigwglhh9Xz5nCpCedYAeElyog/kdtZtbshzBwhGnOq/TstAeGIcVvzdBOyPiLL6UbO9/NIeWDVxA6b7L4z7/wTI9aNjrNK2VFCB4kNJzbHm2PfkpUk4SgiZ8DNNpsdM9WQOoDpk2jEsTPJlyD4HJzgfytz0AZEy5f36hJOInO3FOJUfyiTZZyXWXkituXimdtPk9MxtH81oXjfM+z/Pk2uK1wl7DIla2wPqKI+YhEjmIVexAfrVF8IK6mn0O4xSgJWNdqi0gB1wAstvlI1zV6anUsj2Br3YbG9NhXWYFF5M4HajR2wW9vRiESrvDW59K1fZeGt5LjA== 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=tuAubkkEWFN1NWVLIVxvILEdvyiGJ/A5lZw1/M/fyYQ=; b=mg/PXGTO26IbprbntcZZB38TypwHnYWS9gJnmEZN/M2Oeq/BI725VpXbMLtzUKMzbGHgi91zTyhRQYxjDUkVlOMHjOX/WVb/9racJTOk/RVhL15fDyedAjH2Bi4UMtLyJOU23DWIzg8XPQgIxLnzAyKATwZq3B8+/QntTd7lO4k= From: Martin Harvey To: "paul@xen.org" , "win-pv-devel@lists.xenproject.org" CC: Owen Smith Subject: RE: RFC Add extra sync release step for late callbacks. Thread-Topic: RFC Add extra sync release step for late callbacks. Thread-Index: AdhbABZj/QTUWYFgSjmTyVfnJrSFdwAofwQAAArqpOAAAEu2AAEBkzCAACITu+A= Date: Thu, 5 May 2022 08:55:01 +0000 Message-ID: References: <356386bb-cb26-a1bf-57aa-dd0820b4275c@gmail.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4dc713ba-4acc-4cfb-86a1-08da2e74f0e1 x-ms-traffictypediagnostic: DM6PR03MB4315:EE_ x-ms-exchange-atpmessageproperties: SA|SL x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FfmoIfXVi8kvwkPrdW/4M1GuZhUhaQjviA0934h6PVs+YxXpfMdx6O4Hq0uV8l96SI4G0kyvbXQDocrX4Fi7qoPaVnq1dTVIsBpz6Uz0/srsrhA99EC9SCR9eTqmefSpKBm5Ha6Yz6nuF/skkgZCX7v052eib9PSEQXRAAS2blxmphimCV43gKJ14D23/8ok3HtTgddUqaBhwsOhlq0c4x6jwpy/axnv6e0Qu9y2QAstwxbQejjRpA7D/IG7u2WVOHI6Ns3d8LXo65ZAzfLy+aI+PpSYiuy+yRd5X/4cTC4sOELwNGh8CsNRslRDbqfLYaVuCOzYYYcUK2o7eP9CdvrID0Dt6Z86tB9op/lgEaUTuB9nFB8UsS9TktrNk4kGbQZ+HflfXdo0d/jWTsrvJbudU+KuOf3A8hk98EmNmpz6YkyWNDpyjp34P2rU/8kQ12ygB08GOvH/WbTGMCLucC1l8Pa4oV+rkLATy5p8sKrGh0qvi7qg9POqLHusq9LRLVr3PsVHnp4yZzWtckZROBOfCgBwCyMmIfBxgifHaNsMpy6RPsKvH6uS6/8vzU6P4OUSMNKHrTYoyqZgW7AJFOpXUcqYQZgs+JthtXI1uGPyKvb4PJ4/YTt41RcNN/KVCyh2xTpVg/HsefIlu2DJoAQsSI44RTsBhZ54IoA8Ua2L3Z0WrGrChu5x8a3xN7v7a6IuCCNbpFNuDmML2CFwmA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6347.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(122000001)(8936002)(4326008)(66476007)(66446008)(66946007)(64756008)(76116006)(55016003)(52536014)(66556008)(8676002)(33656002)(508600001)(9686003)(71200400001)(38100700002)(86362001)(4744005)(83380400001)(82960400001)(38070700005)(5660300002)(2906002)(316002)(53546011)(186003)(110136005)(6506007)(7696005)(26005)(107886003)(44832011);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?RjdKYnNaQjE5NFNHYUg5SFZGQitsUFJPbE1FSzd0OHplakQwZGlYNnJPbHUy?= =?utf-8?B?elJEaHZZR08vOGtvaDNJN0YwNUJVeGM1bUhzcGZVc0t5bUY1WEVrRVpGaHky?= =?utf-8?B?U1lHTVdvUENZSGJNOU5vUVlvcE1Wc1Z0U1lNbVFUKzk2M29OcGVYT2ZsVllp?= =?utf-8?B?SzZyR1NNQkY3TEpmOTFLL2N2VEdlczlXcWhPOVQ3L0trY1lScWxJbitlM29v?= =?utf-8?B?UldEZXM4UmRzTUdsaS82L3NWdVk4UzgrZExFUDRGVkgvVXJiRENsR1dKZ1Ji?= =?utf-8?B?NXh5T0szSkdoNjBEMHZEcm1OM0UzQ2NFV0EzakpydTdsL2RWMjVFT2FRd0xN?= =?utf-8?B?VGdzd0RPQXd0Y3hOVUhZY3dSdGpzN2tNd09jVDJRNHFQNDZrUTZqMG9TbWk4?= =?utf-8?B?YVhjTS9odU1iTUlQcmNYeHdNT0l4YzVEUWFVOTlXNGRKTTVENVFQbTFKcngx?= =?utf-8?B?TjVvSGtPcU9RbmdGYTZQdUNGR2pYa09LZEh6T3FLL2FzZFl6dk5QQWxtUDgr?= =?utf-8?B?SE5jTkFQN3lEN3pNMkNTYzFKeWt1Q3hwdC8xRUpYb0M1REh6ZUg4Nzk3YWo4?= =?utf-8?B?ckUrS0FBeW52RG9SQm12WGRBT3R5YW1YaUx3SkxpVkJuM3lhalc3VWZuaGJj?= =?utf-8?B?NWFad2tKa29HS2RWVFpXeTdYck1ZR2t0dnpBcjN3bFI2dG9ibjlLamdOY0dM?= =?utf-8?B?LzdhWVgrWldkUGdUZkhrTWo2RGU4K2hkWFRhaUdEZ2FLOUFrSnpLbU9tT2hM?= =?utf-8?B?SkhTOE1MVjlVb2dOUWcwSUVKeDBtdysxSUk4VVhhQUg1NjgrRFp2aFdId3I5?= =?utf-8?B?R3Y4QVd1ZzJTa1VpRmV1MkUrZnpqQUFMVTB2aDRwa3RqTkM4a0p5S0dtMnBB?= =?utf-8?B?L0hwcnM1S3RHa2syQStVemVWRDR6aE9uMHdnL28zZ3ZsOHVLcDhVNENUTGlT?= =?utf-8?B?aEhqbmFEVXc3LzkwbkdVa3JaRlZlcWZtK1VZRkRDMGlNRzFGK0xiNThkUEF5?= =?utf-8?B?OUluZEF5ZmVLRWFjKyt2UCs2c3daV1VCZ0RUWndjb09RNTczREhONnlOWEZv?= =?utf-8?B?RzRmdjAydFlmbC9laWtCRTVxR2ZuL2tRSXA2RXhJb3RLMjQyVjRtV3VQN096?= =?utf-8?B?a0xpL0Z1VzlWell4Qnp0QTFlbTNBbjUxdjlZK0E2d3V3R2NoU1dVMnVlMFhP?= =?utf-8?B?RXdrZXZCSXlSbmlnZ2RsM2RwNmZpTHhKNTlzRm16SXdURnhqZ0Vkb3h2Kzgx?= =?utf-8?B?SWlwYjZITjlML2xYQ05KL2pSeUVLOXRCWnlBUENoUTBTUE9tdmpOSnVSYWlN?= =?utf-8?B?ZEFyWmlZNUZBU1F5OTMxZUIxbzNFV1NPVW8rMzZnZlpnYWlINk5LNk1CblFD?= =?utf-8?B?NzhzMWd0UDJ0ZTFwQ2V2MXJqRWIzOFplZC9pS1NRZ3NhaW5YNTFIY3pPNE00?= =?utf-8?B?akE3SlRwUjZvVVF2akRuQldyMU5aME5VUXlSMlJLZ3RpMjlxSUdqcktJd3l4?= =?utf-8?B?ZWNkb3oyUGl1Vm9CRTRpVjJ6MUs0OE44TG5tUG4wRXpRZkk0UGF0cFlvaERo?= =?utf-8?B?RnlsR3VzNnJrVzg2VCtDd3h1dHdmMnE3clZrcHc0OHYwRkwwdy82NTNWZVhI?= =?utf-8?B?UWVxT1VvZHVzTnZmVXVTZUtheHlhejlVT1NGR2YvOGNvaEVnMHB3bUtCT1o5?= =?utf-8?B?SnMyMFlBb3N3cEdOMUlEQVc2T3NiK3I0Sks4b3pxTUNLaGZFSldZTmpwZjNh?= =?utf-8?B?WTBlQnZ1YjlUMVdLUGJPV1hhZDBzT2V6bUpFRUEvMVJEOWZ5eEUxTlMxODBL?= =?utf-8?B?SjIyTVZOSzBhVG84dmptc3ZMMTFZcFVZUndzNVNvTEhvengrZkVGM3lTV0dm?= =?utf-8?B?UHN3VmMyNzZsSUtsaEUzdU40ZTk2NzJLSFV2eGJUQ1AwTldyemg0ckNtY01R?= =?utf-8?B?eXVVcTF6c0xKdi9UMU4wRHJuYnZBeDFnSWo4T0VaY2tnY3BrclcwSkxwWWJw?= =?utf-8?B?KzI3UkRNcWxaa1g3Qi9nZzZtVFZtRWRkOTJaRUloYnorT2lVNzFWSHh2T2Z0?= =?utf-8?B?V2ZwZFNycnlsTmNtQ0IyYlF1d3VkMTZEQ1JTYWVRemx2N2lsU2VCdDlMZFF4?= =?utf-8?B?WDdHRzhKWXhOVG9SUUI3cytreEFwYUJXa01rUXZmWHlTUWdNNXNISzVoYTBW?= =?utf-8?B?YWU2cXNkQzBzTjhxQ0NlYVJ5V2hPZ0x3YUxPSFJiUklYanpXWXQrV0g0NEZk?= =?utf-8?B?ZzFWOEV5N2REU1BVYlVtdGl2S09IcjgzSld2V0tZUUNqbVp0M2Jnc1krMTFs?= =?utf-8?B?K05obHNoTWVjMU1WYWZIYWI1U3ViK1U0NUo3aTd5Yi9ZVUU4TW1HZz09?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6347.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4dc713ba-4acc-4cfb-86a1-08da2e74f0e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2022 08:55:01.8259 (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: drNBHTvWKKx6WLDIsHwe1+h81XilsFsMtChjrBdagrKBrDSfFXgNZSniFXSPbvKTsKKlYrSeN6S/3K5ILMNK+ty7HmUcl+4DxSDj9TQsprE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4315 DQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBEdXJyYW50LCBQYXVsIDx4YWRp bWduaWtAZ21haWwuY29tPiANClNlbnQ6IDA0IE1heSAyMDIyIDE3OjM3DQpUbzogTWFydGluIEhh cnZleSA8bWFydGluLmhhcnZleUBjaXRyaXguY29tPjsgcGF1bEB4ZW4ub3JnOyB3aW4tcHYtZGV2 ZWxAbGlzdHMueGVucHJvamVjdC5vcmcNCkNjOiBPd2VuIFNtaXRoIDxvd2VuLnNtaXRoQGNpdHJp eC5jb20+DQpTdWJqZWN0OiBSZTogUkZDIEFkZCBleHRyYSBzeW5jIHJlbGVhc2Ugc3RlcCBmb3Ig bGF0ZSBjYWxsYmFja3MuDQoNCj4gSSB3ZW50IHdpdGggcmVxdWVzdHMvY29tbWFuZHMgcmF0aGVy IHRoZW4gc3RhdGUgYW5kIEkgZG8gc2VlbSB0byBoYXZlIA0KPiBzb21ldGhpbmcgZnVuY3Rpb25h bCBub3cgYnV0IGFtIHNlZWluZyBzdGFsbHMgaW4gdGhlIHhlbnN0b3JlIGRhdGFwYXRoIA0KPiBh ZnRlciByZXN0b3JlIGZyb20gYSBzYXZlZCBpbWFnZS4gVGhlcmUncyBhbHNvIHF1aXRlIGEgYml0 IG9mIHRpZHlpbmcgdG8gZG8uDQo+IEFpbWluZyB0byBoYXZlIHNvbWV0aGluZyBieSB0aGUgZW5k IG9mIHRoZSB3ZWVrIChkYXktam9iIGFsbG93aW5nKS4NCg0KT0suIFdlJ3JlIHJ1bm5pbmcgd2l0 aCB0aGUgcGF0Y2ggSSBwcmVzZW50ZWQgaW4gdGhlIFJGQywgYW5kIHdpbGwgcHJvYmFibHkgcnVu IHdpdGggdGhhdCBpbiBtYXN0ZXIgdW50aWwgd2UgdXBkYXRlIG91ciB1cHN0cmVhbSByZWZzIC0g c28gd2UncmUgbm90IHVyZ2VudGx5IGluIG5lZWQgb2YgYW55IGZ1cnRoZXIgZml4aW5nLiBQZXJo YXBzIHJld29yayBhdCB5b3VyIGxlaXN1cmUsIGl0IHdvdWxkIGJlIGVtYmFycmFzc2luZyB0byBy ZS1pbnRyb2R1Y2UgYSBidWcgYXMgcGFydCBvZiB0aGUgcmUtd29yay4gUGVyaGFwcyBJIHNob3Vs ZCBzdWJtaXQgdGhlIFJGQyBhcyBhIHByb3BlciBbUEFUQ0hdPw0KDQpNSC4NCg== From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:49 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:49 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323186.544800 (Exim 4.92) (envelope-from ) id 1nmyZd-0002fK-1I; Fri, 06 May 2022 14:04:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323186.544800; Fri, 06 May 2022 14:04:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZc-0002fC-Ux; Fri, 06 May 2022 14:04:48 +0000 Received: by outflank-mailman (input) for mailman id 323186; Fri, 06 May 2022 14:04:48 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZb-0002df-Uu for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:47 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZb-00088x-To; Fri, 06 May 2022 14:04:47 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZb-0004N1-I6; Fri, 06 May 2022 14:04:47 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=FRlbXzX1YRpDjJim0IHG0JKmttBpGuYafADBVtiWKuU=; b=ak4wE1ikktgKDNyjZo7xXZsfp TACTgSM0MbHZmhL/GLkO/95IBNe0XS1bHzAKNEeh+pSug9f+Qwvi8h8P8bHyOxMn+fkO8fk6JFZ21 Nhr3/oD8DhSrYifm8EvQ29qrsjmZ1v8Vk3PnPi3oTwI4rHCeUG1YIuvLxsxRPyvB3mPmQ=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 01/11] Clear 'Success' in SUSPEND_CONTEXT after it has been used Date: Fri, 6 May 2022 15:04:33 +0100 Message-Id: <20220506140443.3674-2-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant Leaving it set to TRUE causes an ASSERTion failure in a checked build if it is disabled/unloaded after a resume-from-suspend. Signed-off-by: Paul Durrant --- src/xenbus/suspend.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c index f058a4f1edfc..471c0c4c1972 100644 --- a/src/xenbus/suspend.c +++ b/src/xenbus/suspend.c @@ -287,6 +287,8 @@ SuspendTrigger( SyncEnableInterrupts(); SyncRelease(); + Context->Success = FALSE; + LogPrintf(LOG_LEVEL_INFO, "SUSPEND: <====\n"); KeLowerIrql(Irql); -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:49 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:49 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323185.544797 (Exim 4.92) (envelope-from ) id 1nmyZc-0002dY-03; Fri, 06 May 2022 14:04:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323185.544797; Fri, 06 May 2022 14:04:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZb-0002dR-Tb; Fri, 06 May 2022 14:04:47 +0000 Received: by outflank-mailman (input) for mailman id 323185; Fri, 06 May 2022 14:04:47 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZb-0002dL-5x for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:47 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZb-00088s-1S; Fri, 06 May 2022 14:04:47 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZa-0004N1-NN; Fri, 06 May 2022 14:04:47 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=TZn/SKYMg86xJpmK9vgBRvkFPQPjzAGnCT1LOAmQnuA=; b=XRW/8eEbenmH4h2nFMGL/wKGvi N3hJDio49Nm9fkkoxnNSQJH0PKxpA2IO3uSFS13S6X2RX4oCXzGT70pznRDmCX4cmBY1e0etwHuxr hTZNEIjpgNMyiXL/xwsiA3CjkcfxXLSGJ+CO/G0O65NeaDlV4LCSQmwNcfs+EwFMeRHw=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 00/11] Synchronization API fixes Date: Fri, 6 May 2022 15:04:32 +0100 Message-Id: <20220506140443.3674-1-paul@xen.org> X-Mailer: git-send-email 2.17.1 From: Paul Durrant As discussed in the win-pv-devel thread culminating in: https://lists.xenproject.org/archives/html/win-pv-devel/2022-04/msg00031.html there is a problem in releasing CPUs before all 'late' callbacks have completed. This series fixes the problem and also does a lot of long- overdue code cleanup. Paul Durrant (11): Clear 'Success' in SUSPEND_CONTEXT after it has been used Remove 'Sequence' from SYNC_CONTEXT Remove unnecessary wait when enabling interrupts Reduce code duplication Replace the 'DisableInterrupts' and 'Exit' BOOLEANs in SYNC_PROCESSOR... Move 'Request' from SYNC_PROCESSOR to SYNC_CONTEXT Remove the SYNC_PROCESSOR structure Separate running the 'early' SYNC_CALLBACKs from the interrupt enable request Separate running the 'late' SYNC_CALLBACKs from exitting the DPC Replace if-else-if sequence in SyncWorker() with switch Remove the 'Success' field from SUSPEND_CONTEXT src/xenbus/suspend.c | 13 +- src/xenbus/sync.c | 387 +++++++++++++++++++++++-------------------- src/xenbus/sync.h | 14 ++ 3 files changed, 229 insertions(+), 185 deletions(-) -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:50 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:50 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323187.544804 (Exim 4.92) (envelope-from ) id 1nmyZe-0002hO-2k; Fri, 06 May 2022 14:04:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323187.544804; Fri, 06 May 2022 14:04:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZd-0002hH-WD; Fri, 06 May 2022 14:04:50 +0000 Received: by outflank-mailman (input) for mailman id 323187; Fri, 06 May 2022 14:04:48 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZc-0002f7-Q7 for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:48 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZc-000893-OM; Fri, 06 May 2022 14:04:48 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZc-0004N1-Cl; Fri, 06 May 2022 14:04:48 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=l6KS2xQ66VGcUf5d4i4yxGNnHs5zp8Pir1hXuN1q638=; b=2TmcCb6UhT9sichqX70BfLa2k pwWeNsQRv/o37EIbaTmuKL+ILIVhwF6UYrFrGEB515COLWv/ay5hkhG6UyDpwcIkf10O01vUr92/S x5wG3orreJEnoMoqwK3oFVAZRm6T63aP0Li3DdDv/yWzyUdQSyM/yQQP8x3JCtK4JbzNI=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 02/11] Remove 'Sequence' from SYNC_CONTEXT Date: Fri, 6 May 2022 15:04:34 +0100 Message-Id: <20220506140443.3674-3-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant It is not actually needed because enable/disable interrupt operations will always wait indefinitely. Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 615eca84c460..c2ef681501d1 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -89,7 +89,6 @@ typedef struct _SYNC_CONTEXT { PVOID Argument; SYNC_CALLBACK Early; SYNC_CALLBACK Late; - ULONG Sequence; LONG ProcessorCount; LONG CompletionCount; SYNC_PROCESSOR Processor[1]; @@ -160,8 +159,6 @@ SyncWorker( InterlockedIncrement(&Context->CompletionCount); for (;;) { - ULONG Sequence; - if (Processor->Exit) { if (Context->Late != NULL) Context->Late(Context->Argument, Index); @@ -176,8 +173,6 @@ SyncWorker( continue; } - Sequence = Context->Sequence; - if (Processor->DisableInterrupts) { ULONG Attempts; NTSTATUS status; @@ -188,8 +183,7 @@ SyncWorker( InterlockedIncrement(&Context->CompletionCount); Attempts = 0; - while (Context->Sequence == Sequence && - Context->CompletionCount < Context->ProcessorCount) { + while (Context->CompletionCount < Context->ProcessorCount) { _mm_pause(); KeMemoryBarrier(); @@ -233,8 +227,7 @@ SyncWorker( InterlockedIncrement(&Context->CompletionCount); - while (Context->Sequence == Sequence && - Context->CompletionCount < Context->ProcessorCount) { + while (Context->CompletionCount < Context->ProcessorCount) { _mm_pause(); KeMemoryBarrier(); } @@ -279,8 +272,8 @@ SyncCapture( Context->Early = Early; Context->Late = Late; - Context->Sequence++; Context->CompletionCount = 0; + KeMemoryBarrier(); Context->ProcessorCount = KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS); @@ -328,8 +321,8 @@ SyncDisableInterrupts( ASSERT(SyncOwner >= 0); - Context->Sequence++; Context->CompletionCount = 0; + KeMemoryBarrier(); for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; @@ -402,8 +395,8 @@ SyncEnableInterrupts( Irql = KeGetCurrentIrql(); ASSERT3U(Irql, ==, HIGH_LEVEL); - Context->Sequence++; Context->CompletionCount = 0; + KeMemoryBarrier(); for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; @@ -443,8 +436,8 @@ SyncRelease( if (Context->Late != NULL) Context->Late(Context->Argument, SyncOwner); - Context->Sequence++; Context->CompletionCount = 0; + KeMemoryBarrier(); for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:51 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:51 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323188.544809 (Exim 4.92) (envelope-from ) id 1nmyZf-0002jL-3v; Fri, 06 May 2022 14:04:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323188.544809; Fri, 06 May 2022 14:04:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZf-0002jG-1E; Fri, 06 May 2022 14:04:51 +0000 Received: by outflank-mailman (input) for mailman id 323188; Fri, 06 May 2022 14:04:49 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZd-0002h8-In for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:49 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZd-000898-Hv; Fri, 06 May 2022 14:04:49 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZd-0004N1-7S; Fri, 06 May 2022 14:04:49 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=b3jlO7uwx55gMpBprFZx5Wip3mTJuGUufeHAs1JJ4BM=; b=HMzXXleZ/GI55S/QDcO1kB2mm j/hezJ/TA1DjraHZ3EDLzS3r0oOWJZk7PJ0LkNCUo5TcPxX8KdvsCibsuIdeOFqRKn2d3YAUV44fD gZn3XXteI+xQZwZ38lGnf/2oUpVsPr1H5Iq1uVRvODqbPtcbtl718Ol5IigtCQTYVFriY=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 03/11] Remove unnecessary wait when enabling interrupts Date: Fri, 6 May 2022 15:04:35 +0100 Message-Id: <20220506140443.3674-4-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant There is no need for DPCs to wait: Only the main thread needs to do so. Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index c2ef681501d1..e3b55d1d257b 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -226,12 +226,6 @@ SyncWorker( KeLowerIrql(DISPATCH_LEVEL); InterlockedIncrement(&Context->CompletionCount); - - while (Context->CompletionCount < Context->ProcessorCount) { - _mm_pause(); - KeMemoryBarrier(); - } - } } -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:52 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:52 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323189.544812 (Exim 4.92) (envelope-from ) id 1nmyZg-0002le-5P; Fri, 06 May 2022 14:04:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323189.544812; Fri, 06 May 2022 14:04:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZg-0002lS-2Y; Fri, 06 May 2022 14:04:52 +0000 Received: by outflank-mailman (input) for mailman id 323189; Fri, 06 May 2022 14:04:50 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZe-0002j1-DZ for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:50 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZe-00089E-CO; Fri, 06 May 2022 14:04:50 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZe-0004N1-2F; Fri, 06 May 2022 14:04:50 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=C9q5QQzMTY89QUpfQkKOkIkQ0EAemK9obAG64xocr9Y=; b=Xq0+nK6ED90lGeQ++5prB/UWc JBZZm4f2/f/AIQfuF7MHyC16hTjcrqY1xtCxd4KDosAwGsUct1IUyT0qv3ePlzPxmh+ADflQ9fQQp fvyTehkHyt9YuXQ/x2AcdGdJd37OG1AhkzO5wZpbuufZKPkKWpz92scWcOwylZ0oibjqg=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 04/11] Reduce code duplication Date: Fri, 6 May 2022 15:04:36 +0100 Message-Id: <20220506140443.3674-5-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant Introduce helper functions for disabling/enabling interrupts and waiting for completion. The functions are then used in place of the current open-coding of these operations. NOTE: To avoid compiler/prefast noise, some warnings are disabled. The static analysis can't cope with the IRQL manipulation. Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 208 ++++++++++++++++++++++------------------------ 1 file changed, 100 insertions(+), 108 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index e3b55d1d257b..1b474c469e43 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -122,12 +122,93 @@ __SyncRelease( ASSERT3U(Old, ==, Index); } - KDEFERRED_ROUTINE SyncWorker; #pragma intrinsic(_enable) #pragma intrinsic(_disable) +#pragma warning(push) +#pragma warning(disable:28167) // Function changes IRQL and does not restore it before exit +#pragma warning(disable:28156) // Actual IRQL is inconsistent with required IRQL + +static FORCEINLINE NTSTATUS +__SyncProcessorDisableInterrupts( + VOID + ) +{ + PSYNC_CONTEXT Context = SyncContext; + ULONG Attempts; + LONG Old; + LONG New; + NTSTATUS status; + + (VOID) KfRaiseIrql(HIGH_LEVEL); + status = STATUS_SUCCESS; + + InterlockedIncrement(&Context->CompletionCount); + + Attempts = 0; + while (++Attempts <= 1000) { + KeMemoryBarrier(); + + if (Context->CompletionCount == Context->ProcessorCount) + break; + + _mm_pause(); + } + + do { + Old = Context->CompletionCount; + New = Old - 1; + + if (Old == Context->ProcessorCount) + break; + } while (InterlockedCompareExchange(&Context->CompletionCount, New, Old) != Old); + + if (Old < Context->ProcessorCount) { +#pragma prefast(suppress:28138) // Use constant rather than variable + KeLowerIrql(DISPATCH_LEVEL); + status = STATUS_UNSUCCESSFUL; + } + + if (NT_SUCCESS(status)) + _disable(); + + return status; +} + +static FORCEINLINE VOID +__SyncProcessorEnableInterrupts( + VOID + ) +{ + PSYNC_CONTEXT Context = SyncContext; + + _enable(); + +#pragma prefast(suppress:28138) // Use constant rather than variable + KeLowerIrql(DISPATCH_LEVEL); + + InterlockedIncrement(&Context->CompletionCount); +} + +static FORCEINLINE VOID +__SyncWait( + VOID + ) +{ + PSYNC_CONTEXT Context = SyncContext; + + for (;;) { + KeMemoryBarrier(); + + if (Context->CompletionCount == Context->ProcessorCount) + break; + + _mm_pause(); + } +} + VOID #pragma prefast(suppress:28166) // Function does not restore IRQL SyncWorker( @@ -174,45 +255,11 @@ SyncWorker( } if (Processor->DisableInterrupts) { - ULONG Attempts; - NTSTATUS status; - - (VOID) KfRaiseIrql(HIGH_LEVEL); - status = STATUS_SUCCESS; - - InterlockedIncrement(&Context->CompletionCount); - - Attempts = 0; - while (Context->CompletionCount < Context->ProcessorCount) { - _mm_pause(); - KeMemoryBarrier(); - - if (++Attempts > 1000) { - LONG Old; - LONG New; - - do { - Old = Context->CompletionCount; - New = Old - 1; - - if (Old == Context->ProcessorCount) - break; - } while (InterlockedCompareExchange(&Context->CompletionCount, New, Old) != Old); - - if (Old < Context->ProcessorCount) { -#pragma prefast(suppress:28138) // Use constant rather than variable - KeLowerIrql(DISPATCH_LEVEL); - status = STATUS_UNSUCCESSFUL; - break; - } - } - } + NTSTATUS status = __SyncProcessorDisableInterrupts(); if (!NT_SUCCESS(status)) continue; - _disable(); - InterruptsDisabled = TRUE; } else { InterruptsDisabled = FALSE; @@ -220,12 +267,7 @@ SyncWorker( if (Context->Early != NULL) Context->Early(Context->Argument, Index); - _enable(); - -#pragma prefast(suppress:28138) // Use constant rather than variable - KeLowerIrql(DISPATCH_LEVEL); - - InterlockedIncrement(&Context->CompletionCount); + __SyncProcessorEnableInterrupts(); } } @@ -289,12 +331,10 @@ SyncCapture( KeInsertQueueDpc(&Processor->Dpc, NULL, NULL); } - InterlockedIncrement(&Context->CompletionCount); + KeMemoryBarrier(); - while (Context->CompletionCount < Context->ProcessorCount) { - _mm_pause(); - KeMemoryBarrier(); - } + InterlockedIncrement(&Context->CompletionCount); + __SyncWait(); Trace("<==== (%u:%u)\n", Group, Number); } @@ -308,7 +348,6 @@ SyncDisableInterrupts( { PSYNC_CONTEXT Context = SyncContext; LONG Index; - ULONG Attempts; NTSTATUS status; Trace("====>\n"); @@ -326,47 +365,13 @@ SyncDisableInterrupts( KeMemoryBarrier(); -again: - (VOID) KfRaiseIrql(HIGH_LEVEL); - status = STATUS_SUCCESS; - - InterlockedIncrement(&Context->CompletionCount); - - Attempts = 0; - while (Context->CompletionCount < Context->ProcessorCount) { - _mm_pause(); - KeMemoryBarrier(); - - if (++Attempts > 1000) { - LONG Old; - LONG New; - - do { - Old = Context->CompletionCount; - New = Old - 1; - - if (Old == Context->ProcessorCount) - break; - } while (InterlockedCompareExchange(&Context->CompletionCount, New, Old) != Old); - - if (Old < Context->ProcessorCount) { - LogPrintf(LOG_LEVEL_WARNING, - "SYNC: %d < %d\n", - Old, - Context->ProcessorCount); + for (;;) { + status = __SyncProcessorDisableInterrupts(); + if (NT_SUCCESS(status)) + break; -#pragma prefast(suppress:28138) // Use constant rather than variable - KeLowerIrql(DISPATCH_LEVEL); - status = STATUS_UNSUCCESSFUL; - break; - } - } + LogPrintf(LOG_LEVEL_WARNING, "SYNC: RE-TRY\n"); } - - if (!NT_SUCCESS(status)) - goto again; - - _disable(); } __drv_requiresIRQL(HIGH_LEVEL) @@ -376,7 +381,6 @@ SyncEnableInterrupts( ) { PSYNC_CONTEXT Context = SyncContext; - KIRQL Irql; LONG Index; ASSERT(SyncOwner >= 0); @@ -384,14 +388,11 @@ SyncEnableInterrupts( if (Context->Early != NULL) Context->Early(Context->Argument, SyncOwner); - _enable(); - - Irql = KeGetCurrentIrql(); - ASSERT3U(Irql, ==, HIGH_LEVEL); - Context->CompletionCount = 0; KeMemoryBarrier(); + __SyncProcessorEnableInterrupts(); + for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; @@ -400,15 +401,7 @@ SyncEnableInterrupts( KeMemoryBarrier(); - InterlockedIncrement(&Context->CompletionCount); - - while (Context->CompletionCount < Context->ProcessorCount) { - _mm_pause(); - KeMemoryBarrier(); - } - -#pragma prefast(suppress:28138) // Use constant rather than variable - KeLowerIrql(DISPATCH_LEVEL); + __SyncWait(); Trace("<====\n"); } @@ -433,6 +426,8 @@ SyncRelease( Context->CompletionCount = 0; KeMemoryBarrier(); + InterlockedIncrement(&Context->CompletionCount); + for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; @@ -441,12 +436,7 @@ SyncRelease( KeMemoryBarrier(); - InterlockedIncrement(&Context->CompletionCount); - - while (Context->CompletionCount < Context->ProcessorCount) { - _mm_pause(); - KeMemoryBarrier(); - } + __SyncWait(); RtlZeroMemory(Context, PAGE_SIZE); @@ -454,3 +444,5 @@ SyncRelease( Trace("<====\n"); } + +#pragma warning(pop) -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:52 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:52 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323190.544818 (Exim 4.92) (envelope-from ) id 1nmyZg-0002ly-BT; Fri, 06 May 2022 14:04:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323190.544818; Fri, 06 May 2022 14:04:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZg-0002li-4A; Fri, 06 May 2022 14:04:52 +0000 Received: by outflank-mailman (input) for mailman id 323190; Fri, 06 May 2022 14:04:51 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZf-0002l4-7j for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:51 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZf-00089K-6x; Fri, 06 May 2022 14:04:51 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZe-0004N1-T9; Fri, 06 May 2022 14:04:51 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=6KiVj1a0ceduGVNFBieJ4M1UORfYirC+BojDC/EP19g=; b=NbcogNFxEEXxAtzDHgU94XKns w74ad4fJguYc2E4/FdhLKBXKmplpcrVTwViT7ntfbVqFQEu0dF9Wmheej7s3sdqIX35xoEeUzLlO7 DRvBMql/X+SpmdubfLKx280QoTR8J//WoDpEQGomdx3yOoltLx1ghFWohOSCBYblwV7Rs=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 05/11] Replace the 'DisableInterrupts' and 'Exit' BOOLEANs in SYNC_PROCESSOR... Date: Fri, 6 May 2022 15:04:37 +0100 Message-Id: <20220506140443.3674-6-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant ... with a single SYNC_REQUEST enumeration. NOTE: The consequential changes in SyncWorker() are deliberately naive to keep the patch concise. Subsequent patches will re-structure the code. Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 1b474c469e43..d3d217718f42 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -79,10 +79,16 @@ __declspec(allocate("sync")) static UCHAR __Section[PAGE_SIZE]; -typedef struct _SYNC_PROCESSOR { - KDPC Dpc; - BOOLEAN DisableInterrupts; - BOOLEAN Exit; +typedef enum _SYNC_REQUEST { + SYNC_REQUEST_NONE, + SYNC_REQUEST_DISABLE_INTERRUPTS, + SYNC_REQUEST_ENABLE_INTERRUPTS, + SYNC_REQUEST_EXIT, +} SYNC_REQUEST; + +typedef struct _SYNC_PROCESSOR { + KDPC Dpc; + SYNC_REQUEST Request; } SYNC_PROCESSOR, *PSYNC_PROCESSOR; typedef struct _SYNC_CONTEXT { @@ -219,7 +225,6 @@ SyncWorker( ) { PSYNC_CONTEXT Context = SyncContext; - BOOLEAN InterruptsDisabled; ULONG Index; PSYNC_PROCESSOR Processor; PROCESSOR_NUMBER ProcNumber; @@ -229,7 +234,6 @@ SyncWorker( UNREFERENCED_PARAMETER(Argument1); UNREFERENCED_PARAMETER(Argument2); - InterruptsDisabled = FALSE; Index = KeGetCurrentProcessorNumberEx(&ProcNumber); ASSERT(SyncOwner >= 0 && Index != (ULONG)SyncOwner); @@ -240,41 +244,37 @@ SyncWorker( InterlockedIncrement(&Context->CompletionCount); for (;;) { - if (Processor->Exit) { + KeMemoryBarrier(); + + if (Processor->Request == SYNC_REQUEST_EXIT) { if (Context->Late != NULL) Context->Late(Context->Argument, Index); break; } - if (Processor->DisableInterrupts == InterruptsDisabled) { + if (Processor->Request == SYNC_REQUEST_NONE) { _mm_pause(); - KeMemoryBarrier(); - continue; } - if (Processor->DisableInterrupts) { + if (Processor->Request == SYNC_REQUEST_DISABLE_INTERRUPTS) { NTSTATUS status = __SyncProcessorDisableInterrupts(); if (!NT_SUCCESS(status)) continue; - - InterruptsDisabled = TRUE; - } else { - InterruptsDisabled = FALSE; - + } else if (Processor->Request == SYNC_REQUEST_ENABLE_INTERRUPTS) { if (Context->Early != NULL) Context->Early(Context->Argument, Index); __SyncProcessorEnableInterrupts(); } + + Processor->Request = SYNC_REQUEST_NONE; } Trace("<==== (%u:%u)\n", ProcNumber.Group, ProcNumber.Number); InterlockedIncrement(&Context->CompletionCount); - - ASSERT(!InterruptsDisabled); } __drv_maxIRQL(DISPATCH_LEVEL) @@ -360,7 +360,7 @@ SyncDisableInterrupts( for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - Processor->DisableInterrupts = TRUE; + Processor->Request = SYNC_REQUEST_DISABLE_INTERRUPTS; } KeMemoryBarrier(); @@ -396,7 +396,7 @@ SyncEnableInterrupts( for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - Processor->DisableInterrupts = FALSE; + Processor->Request = SYNC_REQUEST_ENABLE_INTERRUPTS; } KeMemoryBarrier(); @@ -431,7 +431,7 @@ SyncRelease( for (Index = 0; Index < Context->ProcessorCount; Index++) { PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - Processor->Exit = TRUE; + Processor->Request = SYNC_REQUEST_EXIT; } KeMemoryBarrier(); -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:53 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:53 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323191.544821 (Exim 4.92) (envelope-from ) id 1nmyZh-0002pk-AP; Fri, 06 May 2022 14:04:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323191.544821; Fri, 06 May 2022 14:04:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZh-0002pd-7T; Fri, 06 May 2022 14:04:53 +0000 Received: by outflank-mailman (input) for mailman id 323191; Fri, 06 May 2022 14:04:52 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZg-0002lT-2Y for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:52 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZg-00089W-1f; Fri, 06 May 2022 14:04:52 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZf-0004N1-Ns; Fri, 06 May 2022 14:04:52 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=Id3/KtlcEqsG6a6J1Uac2fvAcyzHgttnAOAkKhhAq5c=; b=sEk+8ENITjm6KJvouni7OkUWS N/BinCb7gSdTuk8Mu4xib5ZnEq9YMvElqrWYvUOfPJYdM0gU+83n1NznJ+YzSpSPK7u8hKPY7IdxM 6LTIy3Dt3QTMTbjUvn+FMMtI9bN7YEeZPr1nfx/rLCnQ+yks4jfp3IfqC0Xdjpb+0h210=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 06/11] Move 'Request' from SYNC_PROCESSOR to SYNC_CONTEXT Date: Fri, 6 May 2022 15:04:38 +0100 Message-Id: <20220506140443.3674-7-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant By keeping a local 'Request' value on stack in SyncWorker() to track the last completed request, we can avoid the need to initiate operations using a per- processor value and simply use a global one. This means we no longer need the loops iterating over all SYNC_PROCESSORs in SyncDisableInterrupts(), SyncEnableInterrupts() and SyncRelease(). Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index d3d217718f42..17eed3c2fee7 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -88,7 +88,6 @@ typedef enum _SYNC_REQUEST { typedef struct _SYNC_PROCESSOR { KDPC Dpc; - SYNC_REQUEST Request; } SYNC_PROCESSOR, *PSYNC_PROCESSOR; typedef struct _SYNC_CONTEXT { @@ -96,6 +95,7 @@ typedef struct _SYNC_CONTEXT { SYNC_CALLBACK Early; SYNC_CALLBACK Late; LONG ProcessorCount; + SYNC_REQUEST Request; LONG CompletionCount; SYNC_PROCESSOR Processor[1]; } SYNC_CONTEXT, *PSYNC_CONTEXT; @@ -228,6 +228,7 @@ SyncWorker( ULONG Index; PSYNC_PROCESSOR Processor; PROCESSOR_NUMBER ProcNumber; + SYNC_REQUEST Request; UNREFERENCED_PARAMETER(Dpc); UNREFERENCED_PARAMETER(_Context); @@ -243,34 +244,35 @@ SyncWorker( Trace("====> (%u:%u)\n", ProcNumber.Group, ProcNumber.Number); InterlockedIncrement(&Context->CompletionCount); + Request = SYNC_REQUEST_NONE; for (;;) { KeMemoryBarrier(); - if (Processor->Request == SYNC_REQUEST_EXIT) { + if (Context->Request == SYNC_REQUEST_EXIT) { if (Context->Late != NULL) Context->Late(Context->Argument, Index); break; } - if (Processor->Request == SYNC_REQUEST_NONE) { + if (Context->Request == Request) { _mm_pause(); continue; } - if (Processor->Request == SYNC_REQUEST_DISABLE_INTERRUPTS) { + if (Context->Request == SYNC_REQUEST_DISABLE_INTERRUPTS) { NTSTATUS status = __SyncProcessorDisableInterrupts(); if (!NT_SUCCESS(status)) continue; - } else if (Processor->Request == SYNC_REQUEST_ENABLE_INTERRUPTS) { + } else if (Context->Request == SYNC_REQUEST_ENABLE_INTERRUPTS) { if (Context->Early != NULL) Context->Early(Context->Argument, Index); __SyncProcessorEnableInterrupts(); } - Processor->Request = SYNC_REQUEST_NONE; + Request = Context->Request; } Trace("<==== (%u:%u)\n", ProcNumber.Group, ProcNumber.Number); @@ -347,7 +349,6 @@ SyncDisableInterrupts( ) { PSYNC_CONTEXT Context = SyncContext; - LONG Index; NTSTATUS status; Trace("====>\n"); @@ -357,12 +358,7 @@ SyncDisableInterrupts( Context->CompletionCount = 0; KeMemoryBarrier(); - for (Index = 0; Index < Context->ProcessorCount; Index++) { - PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - - Processor->Request = SYNC_REQUEST_DISABLE_INTERRUPTS; - } - + Context->Request = SYNC_REQUEST_DISABLE_INTERRUPTS; KeMemoryBarrier(); for (;;) { @@ -381,7 +377,6 @@ SyncEnableInterrupts( ) { PSYNC_CONTEXT Context = SyncContext; - LONG Index; ASSERT(SyncOwner >= 0); @@ -393,12 +388,7 @@ SyncEnableInterrupts( __SyncProcessorEnableInterrupts(); - for (Index = 0; Index < Context->ProcessorCount; Index++) { - PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - - Processor->Request = SYNC_REQUEST_ENABLE_INTERRUPTS; - } - + Context->Request = SYNC_REQUEST_ENABLE_INTERRUPTS; KeMemoryBarrier(); __SyncWait(); @@ -414,7 +404,6 @@ SyncRelease( ) { PSYNC_CONTEXT Context = SyncContext; - LONG Index; Trace("====>\n"); @@ -428,12 +417,7 @@ SyncRelease( InterlockedIncrement(&Context->CompletionCount); - for (Index = 0; Index < Context->ProcessorCount; Index++) { - PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - - Processor->Request = SYNC_REQUEST_EXIT; - } - + Context->Request = SYNC_REQUEST_EXIT; KeMemoryBarrier(); __SyncWait(); -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:54 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:54 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323192.544825 (Exim 4.92) (envelope-from ) id 1nmyZi-0002s6-CU; Fri, 06 May 2022 14:04:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323192.544825; Fri, 06 May 2022 14:04:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZi-0002rx-8i; Fri, 06 May 2022 14:04:54 +0000 Received: by outflank-mailman (input) for mailman id 323192; Fri, 06 May 2022 14:04:52 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZg-0002pJ-TY for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:52 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZg-00089k-Si; Fri, 06 May 2022 14:04:52 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZg-0004N1-Ih; Fri, 06 May 2022 14:04:52 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=laYdAl9MtYr3NXvFG14+wEmPwoRJJcd7Ekgce3OfaU4=; b=30/wV+bEWrUlLDvIURb8SiL3R iBQnF/DZFtPgsKsU4e4NdXqwaTSDK1tB2bLpfnHQZ9BMLABICJ3OhOqFcAxEWI7l8m/xqkTV7MDYk W5jy9jMSj2zAlF9CSI+/tOMy/CuGLN9Zw7szmrxjq3Dq7gTR4XRiOhct9+7h06wh6hAyQ=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 07/11] Remove the SYNC_PROCESSOR structure Date: Fri, 6 May 2022 15:04:39 +0100 Message-Id: <20220506140443.3674-8-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant A previous commit left this structure with only a single remaining field: the KDPC structure. This patch simply replaces the SYNC_PROCESSOR array in SYNC_CONTEXT with a KDPC array. The now-unused 'Processor' pointer in SyncWorker() is also cleaned up. NOTE: There is a little re-formatting done in the definition of SYNC_CONEXT: The field names were excessively indented. Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 17eed3c2fee7..767a3c4a767e 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -86,18 +86,14 @@ typedef enum _SYNC_REQUEST { SYNC_REQUEST_EXIT, } SYNC_REQUEST; -typedef struct _SYNC_PROCESSOR { - KDPC Dpc; -} SYNC_PROCESSOR, *PSYNC_PROCESSOR; - typedef struct _SYNC_CONTEXT { - PVOID Argument; - SYNC_CALLBACK Early; - SYNC_CALLBACK Late; - LONG ProcessorCount; - SYNC_REQUEST Request; - LONG CompletionCount; - SYNC_PROCESSOR Processor[1]; + PVOID Argument; + SYNC_CALLBACK Early; + SYNC_CALLBACK Late; + LONG ProcessorCount; + SYNC_REQUEST Request; + LONG CompletionCount; + KDPC Dpc[1]; } SYNC_CONTEXT, *PSYNC_CONTEXT; static PSYNC_CONTEXT SyncContext = (PVOID)__Section; @@ -226,7 +222,6 @@ SyncWorker( { PSYNC_CONTEXT Context = SyncContext; ULONG Index; - PSYNC_PROCESSOR Processor; PROCESSOR_NUMBER ProcNumber; SYNC_REQUEST Request; @@ -239,8 +234,6 @@ SyncWorker( ASSERT(SyncOwner >= 0 && Index != (ULONG)SyncOwner); - Processor = &Context->Processor[Index]; - Trace("====> (%u:%u)\n", ProcNumber.Group, ProcNumber.Number); InterlockedIncrement(&Context->CompletionCount); @@ -316,10 +309,10 @@ SyncCapture( Context->ProcessorCount = KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS); for (Index = 0; Index < Context->ProcessorCount; Index++) { - PSYNC_PROCESSOR Processor = &Context->Processor[Index]; - NTSTATUS status; + PKDPC Dpc = &Context->Dpc[Index]; + NTSTATUS status; - ASSERT3U((ULONG_PTR)(Processor + 1), <, (ULONG_PTR)__Section + PAGE_SIZE); + ASSERT3U((ULONG_PTR)(Dpc + 1), <, (ULONG_PTR)__Section + PAGE_SIZE); status = KeGetProcessorNumberFromIndex(Index, &ProcNumber); ASSERT(NT_SUCCESS(status)); @@ -328,9 +321,9 @@ SyncCapture( ProcNumber.Number == Number) continue; - KeInitializeDpc(&Processor->Dpc, SyncWorker, NULL); - KeSetTargetProcessorDpcEx(&Processor->Dpc, &ProcNumber); - KeInsertQueueDpc(&Processor->Dpc, NULL, NULL); + KeInitializeDpc(Dpc, SyncWorker, NULL); + KeSetTargetProcessorDpcEx(Dpc, &ProcNumber); + KeInsertQueueDpc(Dpc, NULL, NULL); } KeMemoryBarrier(); -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:55 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:55 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323193.544829 (Exim 4.92) (envelope-from ) id 1nmyZj-0002ua-DQ; Fri, 06 May 2022 14:04:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323193.544829; Fri, 06 May 2022 14:04:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZj-0002uS-A7; Fri, 06 May 2022 14:04:55 +0000 Received: by outflank-mailman (input) for mailman id 323193; Fri, 06 May 2022 14:04:53 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZh-0002rZ-PV for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:53 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZh-00089r-ON; Fri, 06 May 2022 14:04:53 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZh-0004N1-DS; Fri, 06 May 2022 14:04:53 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=JOC2ehZC+4ZYKLPknO71GI2KH2bkDYNU/zPuWGEMslQ=; b=U0hquczTywuCARF3fQKvceMI/ Vm9i8/fs0yxArl0XvXKJla/fzuNn7lebhuENeDfktSnk4uAG7loZoQ9M5O73+xe+ZQcU4ig5znpeN 7Pj1qBVwHvUyk/MAmUq0dCoAGFDCf0RFI7zcleCqp+jSUoMmt+N3DUK1N6R3OzEU1Ozro=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 08/11] Separate running the 'early' SYNC_CALLBACKs from the interrupt enable request Date: Fri, 6 May 2022 15:04:40 +0100 Message-Id: <20220506140443.3674-9-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant This patch introduces a new dedicated request to ensure that *all* callbacks have been completed before *any* CPU re-enables interrupts. Signed-off-by: Paul Durrant --- src/xenbus/suspend.c | 1 + src/xenbus/sync.c | 42 ++++++++++++++++++++++++++++++++++++------ src/xenbus/sync.h | 7 +++++++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c index 471c0c4c1972..6a4a42ed0ab2 100644 --- a/src/xenbus/suspend.c +++ b/src/xenbus/suspend.c @@ -284,6 +284,7 @@ SuspendTrigger( Context->Success = NT_SUCCESS(status) ? TRUE : FALSE; + SyncRunEarly(); SyncEnableInterrupts(); SyncRelease(); diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 767a3c4a767e..07cc94d2f87b 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -82,6 +82,7 @@ static UCHAR __Section[PAGE_SIZE]; typedef enum _SYNC_REQUEST { SYNC_REQUEST_NONE, SYNC_REQUEST_DISABLE_INTERRUPTS, + SYNC_REQUEST_RUN_EARLY, SYNC_REQUEST_ENABLE_INTERRUPTS, SYNC_REQUEST_EXIT, } SYNC_REQUEST; @@ -179,6 +180,19 @@ __SyncProcessorDisableInterrupts( return status; } +static FORCEINLINE VOID +__SyncProcessorRunEarly( + IN ULONG Index + ) +{ + PSYNC_CONTEXT Context = SyncContext; + + if (Context->Early != NULL) + Context->Early(Context->Argument, Index); + + InterlockedIncrement(&Context->CompletionCount); +} + static FORCEINLINE VOID __SyncProcessorEnableInterrupts( VOID @@ -258,10 +272,9 @@ SyncWorker( if (!NT_SUCCESS(status)) continue; + } else if (Context->Request == SYNC_REQUEST_RUN_EARLY) { + __SyncProcessorRunEarly(Index); } else if (Context->Request == SYNC_REQUEST_ENABLE_INTERRUPTS) { - if (Context->Early != NULL) - Context->Early(Context->Argument, Index); - __SyncProcessorEnableInterrupts(); } @@ -363,6 +376,26 @@ SyncDisableInterrupts( } } +__drv_requiresIRQL(HIGH_LEVEL) +VOID +SyncRunEarly( + ) +{ + PSYNC_CONTEXT Context = SyncContext; + + ASSERT(SyncOwner >= 0); + + Context->CompletionCount = 0; + KeMemoryBarrier(); + + __SyncProcessorRunEarly(SyncOwner); + + Context->Request = SYNC_REQUEST_RUN_EARLY; + KeMemoryBarrier(); + + __SyncWait(); +} + __drv_requiresIRQL(HIGH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID @@ -373,9 +406,6 @@ SyncEnableInterrupts( ASSERT(SyncOwner >= 0); - if (Context->Early != NULL) - Context->Early(Context->Argument, SyncOwner); - Context->CompletionCount = 0; KeMemoryBarrier(); diff --git a/src/xenbus/sync.h b/src/xenbus/sync.h index c4b172107513..12ba406f662e 100644 --- a/src/xenbus/sync.h +++ b/src/xenbus/sync.h @@ -58,6 +58,13 @@ SyncDisableInterrupts( VOID ); +extern +__drv_requiresIRQL(HIGH_LEVEL) +VOID +SyncRunEarly( + VOID + ); + extern __drv_requiresIRQL(HIGH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:04:56 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:04:56 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323194.544832 (Exim 4.92) (envelope-from ) id 1nmyZk-0002x7-Ey; Fri, 06 May 2022 14:04:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323194.544832; Fri, 06 May 2022 14:04:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZk-0002x0-BY; Fri, 06 May 2022 14:04:56 +0000 Received: by outflank-mailman (input) for mailman id 323194; Fri, 06 May 2022 14:04:54 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZi-0002tv-Jf for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:04:54 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyZi-0008A2-It; Fri, 06 May 2022 14:04:54 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZi-0004N1-8q; Fri, 06 May 2022 14:04:54 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=lk35achJkA2Q11Ekeg2FsE+QhOPOIPEkCh+yrY4vqYE=; b=6C2NQ5PpFdbtS2fH9b7+yUwWN p2+pNXHV45o00mDxTEW1N4/hBjRA+kOB/iSO+jY4K72f5LfCwGaF/i2dGRpkN+JryEYJrZl8gb1l6 xs9WGouybMkByVqYzOBsR59qnmXestOFAV4xOBi6Co1mTafHn7CujfUPOO29KZH5TB/3c=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 09/11] Separate running the 'late' SYNC_CALLBACKs from exitting the DPC Date: Fri, 6 May 2022 15:04:41 +0100 Message-Id: <20220506140443.3674-10-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant This patch introduces a new dedicated request to ensure that *all* callbacks have been completed before *any* CPU exits the DPC, thereby allowing threads to be scheduled or other DPCs to run. Signed-off-by: Paul Durrant --- src/xenbus/suspend.c | 1 + src/xenbus/sync.c | 46 ++++++++++++++++++++++++++++++++++++-------- src/xenbus/sync.h | 7 +++++++ 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c index 6a4a42ed0ab2..3dca5d6fe11c 100644 --- a/src/xenbus/suspend.c +++ b/src/xenbus/suspend.c @@ -286,6 +286,7 @@ SuspendTrigger( SyncRunEarly(); SyncEnableInterrupts(); + SyncRunLate(); SyncRelease(); Context->Success = FALSE; diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index 07cc94d2f87b..b6665708a58e 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -84,6 +84,7 @@ typedef enum _SYNC_REQUEST { SYNC_REQUEST_DISABLE_INTERRUPTS, SYNC_REQUEST_RUN_EARLY, SYNC_REQUEST_ENABLE_INTERRUPTS, + SYNC_REQUEST_RUN_LATE, SYNC_REQUEST_EXIT, } SYNC_REQUEST; @@ -208,6 +209,19 @@ __SyncProcessorEnableInterrupts( InterlockedIncrement(&Context->CompletionCount); } +static FORCEINLINE VOID +__SyncProcessorRunLate( + IN ULONG Index + ) +{ + PSYNC_CONTEXT Context = SyncContext; + + if (Context->Late != NULL) + Context->Late(Context->Argument, Index); + + InterlockedIncrement(&Context->CompletionCount); +} + static FORCEINLINE VOID __SyncWait( VOID @@ -255,12 +269,8 @@ SyncWorker( for (;;) { KeMemoryBarrier(); - if (Context->Request == SYNC_REQUEST_EXIT) { - if (Context->Late != NULL) - Context->Late(Context->Argument, Index); - + if (Context->Request == SYNC_REQUEST_EXIT) break; - } if (Context->Request == Request) { _mm_pause(); @@ -276,6 +286,8 @@ SyncWorker( __SyncProcessorRunEarly(Index); } else if (Context->Request == SYNC_REQUEST_ENABLE_INTERRUPTS) { __SyncProcessorEnableInterrupts(); + } else if (Context->Request == SYNC_REQUEST_RUN_LATE) { + __SyncProcessorRunLate(Index); } Request = Context->Request; @@ -419,6 +431,27 @@ SyncEnableInterrupts( Trace("<====\n"); } +__drv_requiresIRQL(DISPATCH_LEVEL) +VOID +SyncRunLate( + ) +{ + PSYNC_CONTEXT Context = SyncContext; + + ASSERT(SyncOwner >= 0); + + Context->CompletionCount = 0; + KeMemoryBarrier(); + + __SyncProcessorRunLate(SyncOwner); + + Context->Request = SYNC_REQUEST_RUN_LATE; + KeMemoryBarrier(); + + __SyncWait(); +} + + __drv_requiresIRQL(DISPATCH_LEVEL) VOID #pragma prefast(suppress:28167) // Function changes IRQL @@ -432,9 +465,6 @@ SyncRelease( ASSERT(SyncOwner >= 0); - if (Context->Late != NULL) - Context->Late(Context->Argument, SyncOwner); - Context->CompletionCount = 0; KeMemoryBarrier(); diff --git a/src/xenbus/sync.h b/src/xenbus/sync.h index 12ba406f662e..e64d11431304 100644 --- a/src/xenbus/sync.h +++ b/src/xenbus/sync.h @@ -73,6 +73,13 @@ SyncEnableInterrupts( VOID ); +extern +__drv_requiresIRQL(DISPATCH_LEVEL) +VOID +SyncRunLate( + VOID + ); + extern __drv_requiresIRQL(DISPATCH_LEVEL) VOID -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:09:01 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:09:01 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323265.544838 (Exim 4.92) (envelope-from ) id 1nmydg-0003WQ-Pb; Fri, 06 May 2022 14:09:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323265.544838; Fri, 06 May 2022 14:09:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmydg-0003WJ-MC; Fri, 06 May 2022 14:09:00 +0000 Received: by outflank-mailman (input) for mailman id 323265; Fri, 06 May 2022 14:08:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyde-0003WD-TI for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:08:58 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 11a8f929-cd46-11ec-a406-831a346695d4; Fri, 06 May 2022 16:08:57 +0200 (CEST) Received: by mail-wr1-x434.google.com with SMTP id e2so10195344wrh.7 for ; Fri, 06 May 2022 07:08:57 -0700 (PDT) Received: from [10.7.237.9] (54-240-197-225.amazon.com. [54.240.197.225]) by smtp.gmail.com with ESMTPSA id d10-20020adffd8a000000b0020c5253d925sm3657216wrr.113.2022.05.06.07.08.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 May 2022 07:08:56 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 11a8f929-cd46-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=uBxtnqPawpfG2H6a8/T4si4FXrCgpwvLQjHYjnsbo10=; b=qv5UAkk2nazAAmj4//yF5YAyWllCtZDPViM8savJSnKvIGyqrCQzP3oDaWgz34y9jr +f0DpIqyz/Zfnq8DZPafRTOaEmb516jdARdFg+2TviTQvnkp3sWZc2bG23g3Hm1w7QAE fq+G2ebc23C1WoirijunOGzRIs2WYo5JXqEjeD+slKLtwSHo+9CCIdoJhLOkokY3a65k raxfMaQ0/wMBYdDsXplY8GWCnXWXx8wUm+NCzckUE5RxnkakGopK4dEfGGhzbxL5VRwk orAfnWsZOpzhOdLVuE3N97d0WcnHsFaB5tm+cSkf/3y5tXY8ZDOWwyU1wqhYVHdl2UrD wktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=uBxtnqPawpfG2H6a8/T4si4FXrCgpwvLQjHYjnsbo10=; b=YgbP37nj5im2dsVVXToUxm4fsSKNky1vzKS9VcDTP9Eos0EPxdVtmG+Wls017Lc4uO 5gAVR5AHFvl9gM4blYa9hsjQNEgNJ/ugJjXKTDpJQM2TR7VDEw48PF5XN5fnEdOjUGoW kTkByvqHltTn3t73+pSFsCg9WwfIAOmXz8EjMMHl3jnnx0YbzLqyEVanmvF+aGK0gBvd WFTOKO9yK+4z/qcc3zvstxJXfApZ+ieKPLi4IqJ36ymngcQXBX0Bsvt5vOrmwJvGk6+S b9tZWEifonvLuO+wL2z4SaYIQrAcrhKtRtSSQsztt3yI+KhjlqflJkSLEef8avGdvDxX X0BQ== X-Gm-Message-State: AOAM532JJvWLzsPmQACzzvb/U8yoJ6AkujbPbBw5KEzFcxcpctEj8E91 DCNB80snN7hrfOvJnDDdjYAQEpeL5weARw== X-Google-Smtp-Source: ABdhPJxXmJEdrbcnQK7Gu05I/fO5NYAdLPQ5x15kjbTLvmv8p/a3L6JqaHzyIjzVgrt94gHYcTPfHw== X-Received: by 2002:a5d:61c2:0:b0:20a:d92f:9056 with SMTP id q2-20020a5d61c2000000b0020ad92f9056mr2834956wrv.652.1651846136667; Fri, 06 May 2022 07:08:56 -0700 (PDT) Message-ID: Date: Fri, 6 May 2022 15:08:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Reply-To: paul@xen.org Subject: Re: [PATCH][xenvif] Fix compiler options Content-Language: en-US To: win-pv-devel@lists.xenproject.org References: <20220505070532.164-1-owen.smith@citrix.com> From: "Durrant, Paul" In-Reply-To: <20220505070532.164-1-owen.smith@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05/05/2022 08:05, Owen Smith wrote: > Adds '/ZH:SHA_256' '/CETCOMPAT' '/sdl' to compiler and '/SafeSEH' to x86 linker > command lines > These changes were prompted by binskim https://github.com/microsoft/binskim > > Note: Rule BA2004 (Warning_NativeWithInsecureStaticLibraryCompilands) is still > reported for xenvif_coinst.dll > > Signed-off-by: Owen Smith This and similar patches for the other drivers... Acked-by: Paul Durrant > --- > vs2019/xenvif/xenvif.vcxproj | 8 +++++++- > vs2019/xenvif_coinst/xenvif_coinst.vcxproj | 3 +++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/vs2019/xenvif/xenvif.vcxproj b/vs2019/xenvif/xenvif.vcxproj > index 39427b7..52473b8 100644 > --- a/vs2019/xenvif/xenvif.vcxproj > +++ b/vs2019/xenvif/xenvif.vcxproj > @@ -19,6 +19,7 @@ > > > > + /ZH:SHA_256 %(AdditionalOptions) > $(WindowsSdkDir)\include\km;..\..\include;..\..\include\xen;%(AdditionalIncludeDirectories) > PROJECT=$(ProjectName);POOL_NX_OPTIN=1;NT_PROCESSOR_GROUPS;%(PreprocessorDefinitions) > true > @@ -30,7 +31,6 @@ > ..\..\include;%(AdditionalIncludeDirectories) > > > - false > $(DDK_LIB_PATH)/Rtlver.lib;$(DDK_LIB_PATH)/libcntpr.lib;$(DDK_LIB_PATH)/aux_klib.lib;$(DDK_LIB_PATH)/ksecdd.lib;$(DDK_LIB_PATH)/procgrp.lib;%(AdditionalDependencies) > UseLinkTimeCodeGeneration > true > @@ -43,11 +43,17 @@ > > __i386__;%(PreprocessorDefinitions) > > + > + true > + > > > > __x86_64__;%(PreprocessorDefinitions) > > + > + false > + > > > > diff --git a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj > index ccf4135..ae187fc 100644 > --- a/vs2019/xenvif_coinst/xenvif_coinst.vcxproj > +++ b/vs2019/xenvif_coinst/xenvif_coinst.vcxproj > @@ -22,6 +22,8 @@ > > > > + /ZH:SHA_256 %(AdditionalOptions) > + true > PROJECT=$(ProjectName);%(PreprocessorDefinitions) > EnableAllWarnings > 4127;4548;4711;4820;4668;4255;5045;6001;6054;26052;28196;%(DisableSpecificWarnings) > @@ -33,6 +35,7 @@ > > ../../src/coinst/xenvif_coinst.def > setupapi.lib;%(AdditionalDependencies) > + true > > > sha256 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:30:29 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:30:29 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323305.544888 (Exim 4.92) (envelope-from ) id 1nmyyS-0000Jp-Hw; Fri, 06 May 2022 14:30:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323305.544888; Fri, 06 May 2022 14:30:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyyS-0000JZ-Ce; Fri, 06 May 2022 14:30:28 +0000 Received: by outflank-mailman (input) for mailman id 323305; Fri, 06 May 2022 14:30:26 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyyQ-0000JC-7H for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:30:26 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyyQ-0000C5-6G; Fri, 06 May 2022 14:30:26 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZj-0004N1-UZ; Fri, 06 May 2022 14:04:56 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=VqN98mlzuDlAGid3/d7JXGK+5uUWtaKR+WPN8wR3LkE=; b=HVVlvM56T5MskP9kpUKnDrtYq xLWIsW6TO9Hl7uNqcJrYIRF5EdaI8kFPkbV/g6BdxBgvP0RFl8wgYpZLZxvtRKAUuUFZSkIqwaZ0n drBlZZ3gJY6Dqj9M/4Dvd62K4GTz+NRs8NcdD6oe7Sf3x6HvW4OutwKXgHzKnh5BnT074=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 11/11] Remove the 'Success' field from SUSPEND_CONTEXT Date: Fri, 6 May 2022 15:04:43 +0100 Message-Id: <20220506140443.3674-12-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant Now that there are dedicated SyncRunEarly() and SyncRunLate() functions there is no need for this value; we can simply make the function invocations contingent on the success of the hypercall (which tells us whether we are doing fast-resume or not). Signed-off-by: Paul Durrant --- src/xenbus/suspend.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c index 3dca5d6fe11c..9294ff72f38e 100644 --- a/src/xenbus/suspend.c +++ b/src/xenbus/suspend.c @@ -51,7 +51,6 @@ struct _XENBUS_SUSPEND_CONTEXT { PXENBUS_FDO Fdo; KSPIN_LOCK Lock; LONG References; - BOOLEAN Success; ULONG Count; LIST_ENTRY EarlyList; LIST_ENTRY LateList; @@ -193,9 +192,6 @@ SuspendEarly( LogPrintf(LOG_LEVEL_INFO, "SUSPEND: EARLY (%u)\n", Cpu); - if (!Context->Success) - return; - // // No lock is required here as the VM is single-threaded with interrupts // disabled. @@ -236,7 +232,7 @@ SuspendLate( LogPrintf(LOG_LEVEL_INFO, "SUSPEND: LATE (%u)\n", Cpu); - if (!Context->Success || Cpu != 0) + if (Cpu != 0) return; // No lock is required here as the VM is single-threaded @@ -282,14 +278,15 @@ SuspendTrigger( __SuspendLogTimers("POST-SUSPEND"); - Context->Success = NT_SUCCESS(status) ? TRUE : FALSE; + if (NT_SUCCESS(status)) + SyncRunEarly(); - SyncRunEarly(); SyncEnableInterrupts(); - SyncRunLate(); - SyncRelease(); - Context->Success = FALSE; + if (NT_SUCCESS(status)) + SyncRunLate(); + + SyncRelease(); LogPrintf(LOG_LEVEL_INFO, "SUSPEND: <====\n"); -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 06 14:30:29 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 06 May 2022 14:30:29 +0000 Received: from list by lists.xenproject.org with outflank-mailman.323304.544886 (Exim 4.92) (envelope-from ) id 1nmyyS-0000Ja-Fr; Fri, 06 May 2022 14:30:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 323304.544886; Fri, 06 May 2022 14:30:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyyS-0000JN-BF; Fri, 06 May 2022 14:30:28 +0000 Received: by outflank-mailman (input) for mailman id 323304; Fri, 06 May 2022 14:30:26 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyyQ-0000JB-7J for win-pv-devel@lists.xenproject.org; Fri, 06 May 2022 14:30:26 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nmyyQ-0000C1-3v; Fri, 06 May 2022 14:30:26 +0000 Received: from 54-240-197-225.amazon.com ([54.240.197.225] helo=CBG-R90WXYV0.cbg12.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmyZj-0004N1-3f; Fri, 06 May 2022 14:04:55 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" 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=1CYvb/JYKBlfdY9qF9+WpIM6NFedVnpRbaeTuPfrA8Q=; b=GL2S0vl9V5u2FZD3GqErvhmTy KA/Ug4LhtpNmtOTpWDdCyYOWWFL4kNt05vYJbdJoPKoPRVaqFShlNZVmDrrJBQqBconja4mqRCVja ldGoqsxWocY1/XPL6KXpMhNcR+l4+uzDY5pIpBhHuiPMnZexeFO4Jzs0e8mI33Ro+oL94=; From: Paul Durrant To: win-pv-devel@lists.xenproject.org Cc: Paul Durrant Subject: [PATCH xenbus 10/11] Replace if-else-if sequence in SyncWorker() with switch Date: Fri, 6 May 2022 15:04:42 +0100 Message-Id: <20220506140443.3674-11-paul@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220506140443.3674-1-paul@xen.org> References: <20220506140443.3674-1-paul@xen.org> From: Paul Durrant Now that the set of requests and other re-factoring is complete, tidy up the code in SyncWorker(). Signed-off-by: Paul Durrant --- src/xenbus/sync.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/xenbus/sync.c b/src/xenbus/sync.c index b6665708a58e..5b2b76a47f58 100644 --- a/src/xenbus/sync.c +++ b/src/xenbus/sync.c @@ -267,6 +267,8 @@ SyncWorker( Request = SYNC_REQUEST_NONE; for (;;) { + NTSTATUS status; + KeMemoryBarrier(); if (Context->Request == SYNC_REQUEST_EXIT) @@ -277,20 +279,31 @@ SyncWorker( continue; } - if (Context->Request == SYNC_REQUEST_DISABLE_INTERRUPTS) { - NTSTATUS status = __SyncProcessorDisableInterrupts(); - - if (!NT_SUCCESS(status)) - continue; - } else if (Context->Request == SYNC_REQUEST_RUN_EARLY) { + status = STATUS_SUCCESS; + + switch (Context->Request) { + case SYNC_REQUEST_DISABLE_INTERRUPTS: + status = __SyncProcessorDisableInterrupts(); + break; + + case SYNC_REQUEST_RUN_EARLY: __SyncProcessorRunEarly(Index); - } else if (Context->Request == SYNC_REQUEST_ENABLE_INTERRUPTS) { + break; + + case SYNC_REQUEST_ENABLE_INTERRUPTS: __SyncProcessorEnableInterrupts(); - } else if (Context->Request == SYNC_REQUEST_RUN_LATE) { + break; + + case SYNC_REQUEST_RUN_LATE: __SyncProcessorRunLate(Index); + break; + + default: + break; } - Request = Context->Request; + if (NT_SUCCESS(status)) + Request = Context->Request; } Trace("<==== (%u:%u)\n", ProcNumber.Group, ProcNumber.Number); -- 2.17.1 From win-pv-devel-bounces@lists.xenproject.org Wed May 11 17:47:02 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 11 May 2022 17:47:02 +0000 Received: from list by lists.xenproject.org with outflank-mailman.327133.549870 (Exim 4.92) (envelope-from ) id 1noqQN-0002x6-Jm; Wed, 11 May 2022 17:46:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 327133.549870; Wed, 11 May 2022 17:46:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1noqQN-0002wz-GR; Wed, 11 May 2022 17:46:59 +0000 Received: by outflank-mailman (input) for mailman id 327133; Wed, 11 May 2022 17:46:58 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1noqQL-0002wt-Ut for win-pv-devel@lists.xenproject.org; Wed, 11 May 2022 17:46:58 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Wed, 11 May 2022 17:46:39 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <2143493.1.1652291200297.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENBUS-master - Build #231 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_5158680.1652291199578" X-Jenkins-Job: XENBUS-master X-Jenkins-Result: SUCCESS ------=_Part_0_5158680.1652291199578 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #231. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/231/console to view the results. ------=_Part_0_5158680.1652291199578-- From win-pv-devel-bounces@lists.xenproject.org Thu May 12 14:25:44 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 12 May 2022 14:25:44 +0000 Received: from list by lists.xenproject.org with outflank-mailman.327771.550655 (Exim 4.92) (envelope-from ) id 1np9l8-0006eC-RL; Thu, 12 May 2022 14:25:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 327771.550655; Thu, 12 May 2022 14:25:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1np9l8-0006e5-Oj; Thu, 12 May 2022 14:25:42 +0000 Received: by outflank-mailman (input) for mailman id 327771; Thu, 12 May 2022 14:25:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1np9l7-0006dz-NZ for win-pv-devel@lists.xenproject.org; Thu, 12 May 2022 14:25:41 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5df72c59-d1ff-11ec-8fc4-03012f2f19d4; Thu, 12 May 2022 16:25:29 +0200 (CEST) Received: from mail-mw2nam08lp2175.outbound.protection.outlook.com (HELO NAM04-MW2-obe.outbound.protection.outlook.com) ([104.47.73.175]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 May 2022 10:25:36 -0400 Received: from MW4PR03MB6347.namprd03.prod.outlook.com (2603:10b6:303:11e::22) by SN6PR03MB3775.namprd03.prod.outlook.com (2603:10b6:805:6a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Thu, 12 May 2022 14:25:33 +0000 Received: from MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::904e:6964:cca7:6e51]) by MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::904e:6964:cca7:6e51%6]) with mapi id 15.20.5227.023; Thu, 12 May 2022 14:25:33 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 5df72c59-d1ff-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652365540; h=from:to:subject:date:message-id:mime-version; bh=/cIkuSfAi4PWEAfaEkDT8C8GoR4JIbPd2+bEUVbJ6w8=; b=As1g2CSTETlABnJI9huEhCHYWLm9WEILcnpm5bm3AXKxkzkbKxL+Vznn 0BQT1NRWoLeqtVWEV4t99giMjUWmzIkNsTNCWHACfmCjwKFVXHP77YpRp iLZpEuNVSgvJMHPAFK3pEdbdXtSJ6rD/2ahKIbHrhXhxmNFvkByH82W5D M=; X-IronPort-RemoteIP: 104.47.73.175 X-IronPort-MID: 71163893 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:KC/iMaxMbGzeqd+HOHp6t+drxyrEfRIJ4+MujC+fZmUNrF6WrkUPy GMbX2HVO/6OYzGme9glOtiypEgG6J6Bn9QxT1FvrSAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnj/0bv656yMUOZigHtIQMsadUsxKbVIiGX5JZS5LwbZj2NY12ILhWWthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ NplkbuubCo0LpPwtvkZChBmPjteGat5weqSSZS/mZT7I0zuVVLJm6krKX5seIoS96BwHH1E8 uEeJHYVdBefiumqwbW9DO5xmsAkK8qtN4Qa0p1i5WiBUbB6HtacGOOTuoIwMDQY36iiGd7bb tAFaDwpbB3afRBeElwWFIg/jKGjgXyXnzhw9wvM+/FnsjO7IApZ1JzLCuPrSt2wWdhQj0XH/ knd00f1DURPXDCY4X/fmp62vcfQnCW+QJxXGLCm+/pChFyI2ndVGBAQTUG8o/Sylgi5Qd03F qAP0i8nrKx38VPxSND4B028uCTd4UNaXMdMGeon7g3L0rDT/wuSGmkDSHhGdcAis8g1Azct0 zdlgu/UONCmi5XNIVr1y1tehWra1fQ9RYPaWRI5cA== IronPort-HdrOrdr: A9a23:uDw47a6chD6ASqgJiQPXwUqBI+orL9Y04lQ7vn2ZFiY5TiXIra qTdaogviMc0AxhPk3I6urwQZVoIEmsvKKdhLN8AV7MZniDhILFFuBfBOjZsnXd8k/Fh4lgPM 5bGsAQZuEYZmIK7voSlTPIdurIt+P3kpxA692/815dCSVRL41w5QZwDQiWVmdsQhNdOJY/HJ 2AouJaujuJYx0sH46GL0hAe9KGi8zAlZrgbxJDLQUg8hOygTSh76O/OwSE3y0ZTyhEzd4ZgC X4ek3Cl+meWsOAu1HhPlzontVrcRzau5t+7fm3+4cow/PX+0WVjcpaKv+/VXsO0ZmSAR4R4a LxSlEbTo9OAjrqDxuIiAqo1A/63Dk07Xj+jVeenHv4uMT8ACk3EsxbmOtiA2/kAmcbzaNBOZ hwrhekXltsfG39tTW448KNWwBhl0Kyr3ZnmekPj2ZHWY9bbLNKt4QQ8E5cDZ9FRUvBmfYaOf grCNuZ6OddcFucYXyctm5zwMa0VnB2GhudWEANtsGczjATlnFkyEkTwtAZgx47heUAYogB4/ 6BPrVjlblIQMNTZaVhBP0ZSc/yEWDJSQKkChPgHb0mLtB2B5vgke+K3Fxu3pDWRHUh9upMpL 3RFFVFqGU1Z0XiTcWTwZwjyGG9fFmA X-IronPort-AV: E=Sophos;i="5.91,220,1647316800"; d="scan'208,217";a="71163893" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oGBdhWN3N4RLOu5xm3xUcxAXyNISQp2kWv9dz+Zoca/FtxtI2A1qiUswZac+NtzBkNRC+GGMhuM8o01N7Lsuj3WRsXRHvV9uXQqeVk7RFCHGqsBOsbPmdL8vrqvK0902KjTe4EJOWULh4vAT0qkbn+yL9zNd+EDRqBE41HA9Pk2Otl26WY8+kWdaOHMzJFL62Sr7m9cbN8gnANR/PZqwLNguYn48s/u2EVaSpKMGLEkFmH71IaZOUV38YjFB8KgLcklt48qPD/YNhQ5l4WRcf5oc8gENI0L2hYBekfcuOMhX4ZuHXpRrCojDnRXMSG779+1OezTuq1fwgUrp8D1Smw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tRb46uXAnWanVrz46Gxk1g35ur1vZB24ko9mPyFnOcI=; b=kROEmgLZdlOAIzhxf2NXZhUEMScVpkOWBsBv2yLYzErNggU8DKe4e+/bDqcmSgJy5UUSDxSn96JaWE+dbiZzSw0TV8u4SZ2pwQnTxEhVEKeseyFhVIuQMDOHko9FbyEPZNgnZ6ej+7T/8XfJf/YEeN9lBVqNTa9lJLOj8sgyM7Izg53/zx3NHZyBuA5BXmdm8xrwObduEKNeXU9wCg8+lx9dXgGR2FpmRvWWT3zXHdcWEaDphTQcmHH4IQh0mFYc/SE8JDdmjdlCh+bt0d+rZl/sqWajmmbHJk22B7MJzwXGW+43YqFZkl9eTg1GYcVPnHfPr3XGfLw7UfobpOD8Kg== 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=tRb46uXAnWanVrz46Gxk1g35ur1vZB24ko9mPyFnOcI=; b=fiyiI1of3jFzeoFtD+qhWmv6AyiaNTeVS2le8hHatMS9y+/WyE3MPcIKuuN2mWNastxysWUHU1ZdVPotB+/kWvX6FQgq2cxnuI6s7QRQpcZoiz3URDC0ffk18FlWYHxhMSqeFaznw8uIGGjczeH80+bc7d+kpDL84E+pXC6ONto= From: Martin Harvey To: "win-pv-devel@lists.xenproject.org" Subject: Varargs in AdapterVifCallbacks. Thread-Topic: Varargs in AdapterVifCallbacks. Thread-Index: AdhmC7aA17C99R2kT1uNNjmZQqMw8Q== Date: Thu, 12 May 2022 14:25:33 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9092ea9b-c91c-40e7-dab9-08da34234624 x-ms-traffictypediagnostic: SN6PR03MB3775:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VNvoxBiXRSn86PE3rU2a8TDnQzE3dlzA3epFvv0qVV57507uSo4MeNuWYoeG9c5rUwiQoXnUD13gNGqsden+cjhXNd/NoWn618/CMUF+wsYFfKKVuWYN/C1wyI6sxKakkeBveFuV94j83rcZl+NcVL0dAhXvWo+tTrD0Vumil09Tkn2auUZgh6ELecqUF8Je/UerXs06qcA+0Aa/h1PgCO0At3ANuj7/WSp9SYHfR/H6auXL0XhPtkZ2tozRtnIMeDYTs058G6T9nGKcNM4bJEf2bhT/jjIJzb/x7bitwhV2dRZ6WAj6CFyvduEFestu2wRd/U/6A5olzU2N8Jm6kKrDMoLwwN6M2IcXPAXdm283LEhWCgFkepmGyj3mBlfn/RMNAiAV9Qpj/oly/Ify6Np8vyOLtNHKiNreAYp6KMdOKDilOd32AkDH2mOkygomvMvRauAy+vrSgwDvkwTq2RMLHW3RaiPI6cEzuksEfm2wK8QRpMhw20FkmSd8U6yrs12eukqTE30yJdpw8PBPMIkgwtMiy/LRtMSOGrlngXJKtfMo3YuFUN+hIKElGfp4had5+DIyPEGe/uerC0HooZgJ0MmOtT9E5TjanZgiv0ouv7T8QKDQtGKE8sOhyOlrVFW05ouoCiSJLgBAhZMZll+qxyN0qR/sg07qXotvBAUTO4OFMLp1Q1S4FIzxLd8az6v8uSHz+50Fdbc7cLKubQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6347.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(7116003)(38100700002)(71200400001)(38070700005)(122000001)(86362001)(5660300002)(508600001)(82960400001)(8936002)(6506007)(9686003)(316002)(6916009)(66446008)(66946007)(66476007)(64756008)(66556008)(76116006)(52536014)(8676002)(7696005)(186003)(33656002)(55016003)(3480700007)(26005)(2906002)(44832011)(4744005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?H5VZ8xSLEZXlFCja+ZmWaFvKOqPOwTW0YVpjcEEx6o8mmaTDg6rQFfEBagZx?= =?us-ascii?Q?hzkVBxSny4n6bbOzrE6QSHPurKb7Af18bmmszYOIdDLqJhcKkITxNsHqn0f2?= =?us-ascii?Q?V119jFG8xaIjb6HBkONAF/Brs8aAESqAVTqPtElA15MnDYyCWD8oHOFKrsvs?= =?us-ascii?Q?l9lJW4b2y89p5Fbp/F+/wvvb4MyeUhKVmbxIBjyi+EpKcNhwkpShMFBOir1d?= =?us-ascii?Q?+B27kHOHHgktyeeHFWTLagVAutKtxMsqkK2sNxeJaTx/JveB0DbGoH9WxXZb?= =?us-ascii?Q?7gRuc/5trPOgLq0h6mlkciawK3jFkz2/5zWLBh/c3F/tWEYxBhLJfV2UNR6b?= =?us-ascii?Q?AREYvd6Uu8tQI5dZru1gZc/Mw/WSgSEovbh0DSb+psrlJ3+bW8MaJfq6Fcme?= =?us-ascii?Q?OAQ5+RosIXEOpBIOksJC5vLY31u3ujWW5N18zZbZ7ZXIc46YskH9relmA4Jz?= =?us-ascii?Q?M14i+TKcHLtJwii8PvzBdv712ZUr0LqaZWr78UsumxbNkycEjP/2eh4VoBPM?= =?us-ascii?Q?lrIH4LK8UDei/EEA/fy5xUd2Tppx1LSWwFv1tCnPbSJqURhFrYK4TqfFXziO?= =?us-ascii?Q?1i7kD1TnICSi5ffnK6Vsif/KnYE51bm2+2s8nnfQkXvFn4CIiwFkDlLcCSsY?= =?us-ascii?Q?phJsyjW7Lw2LZIfFMSDegYdtLAvHZi4+pGGZzPcMSblm4a+SACVU5gH8qDLE?= =?us-ascii?Q?EBal/AfRDphKwP9fo72zvkZ5TWMHVAvXtdyTlpbUdsyS938vAZfskZ14n7KE?= =?us-ascii?Q?A1Q+jfPBklSUktkiBCRRSb4wHGJ9/b8/HTG1VH76r6CAOSv2GOdxCkHqeGE5?= =?us-ascii?Q?Etri1aW4N2pL8KHUOvX+ThllpzYasGda67e6kXXk2TxNN2Rijnwopjh3aUWI?= =?us-ascii?Q?WDVZsXaAiPqK+NE9sVe+8bNG3BAoVRCbrZFpmelJe+qfrDNvBZN0erXs/a6b?= =?us-ascii?Q?d7o6ymtlHL6ZbZw49eaYuosRYTm3a5ZNTSG/QWMWFu9MVYt5dF5frShVG2h1?= =?us-ascii?Q?3uD1ZbjjD9mJ3LFc30U+mZ9nRXbh8Ug5oijzregDQ0MCg1sFGcNl0LCxdd0d?= =?us-ascii?Q?j8mgBldQcq/0U4BX6e7xSEgJg4raH4HvTZBv5Uu1ZGNxGnBDWMVzZ2acQ41A?= =?us-ascii?Q?y5yhyAmlh66iElMMhiBkn+TxsRjLVEYIhFx8W2W+u83JGZLaVsOpDmiGCF2w?= =?us-ascii?Q?uJ7P9T/pVeVGi/WIPDamQnSvCGUHwbbjrftkbVIoJJowcuBm97WsB8BMSDZF?= =?us-ascii?Q?Kx/FPU//wvZKBgleKHVTFt8hZjhJA3LAsxScGDVYRMXF7/kRrqEUhFR91ddt?= =?us-ascii?Q?wBgGhbhoqFM/D0Ha8d9uC6/UZC/mWftU6NeI6YdUb0idHQECJqYi8FosA7to?= =?us-ascii?Q?beJ+bMJSpLwR6SxMFIsV98Du/NCHYgbbBZPrHNNmXkHFNL83jepzcDfVH5ms?= =?us-ascii?Q?/nudSOVNR7m22wJqRK4txa5j2ZvRgxPYN6RijGsOh5HWbqgmGTtRpuhDbff7?= =?us-ascii?Q?9r9WNtPboDPAdwJMCsCm0FHsPalLqDzacgCYHkFRu8wxsQyteIrhIP2n/d3q?= =?us-ascii?Q?6VtDw+piSrv4tOpeeysGDJ76bNWTsgL8SxBeDfoHbjA6SUt9++Vm5iOwF8m2?= =?us-ascii?Q?CX2hJUk79Tq7dzDwpu1/SjH7w9wtXyYmiEaaP52uDLhoFgk0dMh5fOsbviXk?= =?us-ascii?Q?LnVpA4Cw81pUXaRhYvL+0ZXX7eHNUjvs6HKQ2mKXpy9ShpJk+25F87cB4vNo?= =?us-ascii?Q?zIJSK+tDhFR1+1W4FbNKaO5gt8kqM0s=3D?= Content-Type: multipart/alternative; boundary="_000_MW4PR03MB63474183AC6A05073AE99E0B9ACB9MW4PR03MB6347namp_" MIME-Version: 1.0 X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6347.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9092ea9b-c91c-40e7-dab9-08da34234624 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2022 14:25:33.1197 (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: vwQsM0FpgciB9KRlthJi2Bk5IZpkmV2bNCxwbk5HiKzD0UrmSjYFzolICcS/+PEuYh0H+DUtdj88eeN8TNuN3RUZlX4GJV/v8N38Ju2DcuM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3775 --_000_MW4PR03MB63474183AC6A05073AE99E0B9ACB9MW4PR03MB6347namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Some of the callback functions specified in the XENVIF_VIF interface rely o= n varargs callbacks. A little experimentation with the aforementioned makes= me believe that varargs is not as wonderful as it should be in a kernel co= ntext. Additionally, it's not used in windows kernel API's anywhere else, p= resumably for a reason. Any complaints if I remove varargs from upcoming v9 of XENVIF_VIF interfac= e? Speak now or forever ... MH. --_000_MW4PR03MB63474183AC6A05073AE99E0B9ACB9MW4PR03MB6347namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

Some of the callback functions specified in the XENV= IF_VIF interface rely on varargs callbacks. A little experimentation with t= he aforementioned makes me believe that varargs is not as wonderful as it s= hould be in a kernel context. Additionally, it’s not used in windows kernel API’s anywhere else, presumabl= y for a reason.

 

Any complaints if I remove varargs from upcoming v9&= nbsp; of XENVIF_VIF interface? Speak now or forever …

 

MH.

--_000_MW4PR03MB63474183AC6A05073AE99E0B9ACB9MW4PR03MB6347namp_-- From win-pv-devel-bounces@lists.xenproject.org Thu May 12 14:38:37 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 12 May 2022 14:38:37 +0000 Received: from list by lists.xenproject.org with outflank-mailman.327787.550670 (Exim 4.92) (envelope-from ) id 1np9xd-0008IQ-5a; Thu, 12 May 2022 14:38:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 327787.550670; Thu, 12 May 2022 14:38:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1np9xd-0008IJ-2l; Thu, 12 May 2022 14:38:37 +0000 Received: by outflank-mailman (input) for mailman id 327787; Thu, 12 May 2022 14:38:36 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1np9xc-0008IB-0z for win-pv-devel@lists.xenproject.org; Thu, 12 May 2022 14:38:36 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 332d53af-d201-11ec-a406-831a346695d4; Thu, 12 May 2022 16:38:35 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id a14-20020a7bc1ce000000b00393fb52a386so5292215wmj.1 for ; Thu, 12 May 2022 07:38:33 -0700 (PDT) Received: from [10.7.237.11] (54-240-197-227.amazon.com. [54.240.197.227]) by smtp.gmail.com with ESMTPSA id u21-20020a7bc055000000b00394586f696dsm2949389wmc.11.2022.05.12.07.38.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 07:38:33 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 332d53af-d201-11ec-a406-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=pZHMgzpMY0a4tM/APGAcKLfUr2dPrOdfUXfKoImrP/A=; b=HLhSM+qUotSVm2LFFKluHnFWOQWzPOUjviMBoxfSFDHLavkqXNeMMmVPM9gvdjZzNa YzSb6/r2A+c35L8oGYKq02sIidOTXbAs5PKdaEWqWjPjNdaKodxjVFCX3zmXWaILBqdP OGkWocasor6f8E9xNrxlk0qe80jzOGE/08GfFzhkfpR8W934cZknK5fgx2yvN3vYyXGD o8XHVmhlxFjOBqrLPRlRr3BJ4myVhBeHEGVDtS04qjKPP8mSJS79CuRwdkduQTNOxHHD FzPI7UQuEy9j1LwBej4sNjDq/Ig6FVMRtAp1R1Ts8Bn3FTLABiam1AMPYInH4L1/4ME0 OD7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=pZHMgzpMY0a4tM/APGAcKLfUr2dPrOdfUXfKoImrP/A=; b=QhQBkk2OdTG5bsMsyAF83GDfqbjXP3mK71VqaRFca7ULOHfadquW1Vw2GDXRaaG9jD WQQ+uwXvhFpPc4OadYvOuwg5JJxXpX5eaBqVSVALmCGTUnfRkWbf8liLQlPGQ49z5Lds 5qOPsEEukxs8sOKI5kHp4RsAKAFTu1DBWjrQoxSKuxOdp1jj4a3Rs1W9c4f5cs9Mc/6l 0t9CD5Th+W90RvZVD73d7qmQ9jxXa/1So1V9NaRmQ3M6Kq05moXrM/RNE4E3xk8t1ld+ YKO2+LeW1cdY2DwAprSeljo3Pzszb3Yux5IO+Tgk+cHWNJ+x1e/pFIESVnhrl7pt5peQ NifA== X-Gm-Message-State: AOAM533my39I4SFpLoEXZtL5pIxtYBhA+enbXAeLSAxTGEyYDzJES53/ J5NQbUzhDBJa8zInv6C/tgyPdjI3ic4zug== X-Google-Smtp-Source: ABdhPJyvJfNcOtOjfQt4JCedfq6FO62uXWe0byNWeFB6/Jagv2Ia2esnb4BZSUwMcl/LY2oDSb737A== X-Received: by 2002:a05:600c:214e:b0:394:31c6:b66b with SMTP id v14-20020a05600c214e00b0039431c6b66bmr10478100wml.31.1652366313417; Thu, 12 May 2022 07:38:33 -0700 (PDT) Message-ID: <640dbaa5-b3b6-a4ec-dc22-81c5b73d47f9@gmail.com> Date: Thu, 12 May 2022 15:38:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Reply-To: paul@xen.org Subject: Re: Varargs in AdapterVifCallbacks. Content-Language: en-US To: win-pv-devel@lists.xenproject.org References: From: "Durrant, Paul" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/05/2022 15:25, Martin Harvey wrote: > Some of the callback functions specified in the XENVIF_VIF interface > rely on varargs callbacks. A little experimentation with the > aforementioned makes me believe that varargs is not as wonderful as it > should be in a kernel context. Additionally, it’s not used in windows > kernel API’s anywhere else, presumably for a reason. Not necessarily. Can you elaborate on "not as wonderful as it should be"? > > Any complaints if I remove varargs from upcoming v9  of XENVIF_VIF > interface? Speak now or forever … > I could be persuaded that an argument struct is a suitable replacement but I'd like to understand what the exact nature of the problem is. Paul From win-pv-devel-bounces@lists.xenproject.org Thu May 12 15:42:36 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 12 May 2022 15:42:36 +0000 Received: from list by lists.xenproject.org with outflank-mailman.327842.550729 (Exim 4.92) (envelope-from ) id 1npAxX-0000cv-Ar; Thu, 12 May 2022 15:42:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 327842.550729; Thu, 12 May 2022 15:42:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npAxX-0000co-7v; Thu, 12 May 2022 15:42:35 +0000 Received: by outflank-mailman (input) for mailman id 327842; Thu, 12 May 2022 15:42:34 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npAxV-0000ci-R8 for win-pv-devel@lists.xenproject.org; Thu, 12 May 2022 15:42:34 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 21da4869-d20a-11ec-8fc4-03012f2f19d4; Thu, 12 May 2022 17:42:31 +0200 (CEST) Received: from mail-bn8nam11lp2175.outbound.protection.outlook.com (HELO NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.175]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 May 2022 11:42:29 -0400 Received: from MW4PR03MB6347.namprd03.prod.outlook.com (2603:10b6:303:11e::22) by MN2PR03MB5037.namprd03.prod.outlook.com (2603:10b6:208:1aa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Thu, 12 May 2022 15:42:26 +0000 Received: from MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::904e:6964:cca7:6e51]) by MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::904e:6964:cca7:6e51%6]) with mapi id 15.20.5227.023; Thu, 12 May 2022 15:42:26 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 21da4869-d20a-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652370151; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=M4aCqPsn2tjt4Sqk6gf9AxPgbRqX6aBiuSLnvobnxho=; b=Ea6QW/XNtgmbW7R4YZeWm/GiR0qCQ161RdAMqwIJoyJ5ofocuQol5q93 FJ/uVFwdvq/HeueD5QJHUdQ2ClFWFCwYLZ6BDokTBehp0aVyjooivoCsk 8/ZJby2yulViRrmhqPfJyLSOBmjWZoDSNzhkXhBXY7x712jy9pOeHA3Se Q=; X-IronPort-RemoteIP: 104.47.58.175 X-IronPort-MID: 71172403 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:G4vhjqoIhraLk4P4XYs/5Y3gPlNeBmJ6ZBIvgKrLsJaIsI4StFCzt garIBmPOf2KZmGmLYxwPInj/EhX75HRzN41QFE/qykwQXtA85uZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvQ4 Imq+aUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBIO7MtacnUCZhNQZcZocB/Y2bOkGwrpnGp6HGWyOEL/RGKmgTZNRd0MAnRGZE+ LofNSwHaQ2Fi6Su2rWnR+Jwh8Mlas72IIcYvXImxjbcZRokacmbH+OWupkFjHFp2Z0m8fX2P qL1bRJqZQ7cYhsJOl4NFp8vtOypmmP+Y3tTr1f9Sa8fvDGKk1YtiOOF3Nz9IOOlZoJerlShv kWcwnXcEwkjboSg1m/Qmp6rrqqV9c/hY6oKHaC83u5nhhuU3GN7IAIXUx6jv7y1h1CzX/pbK lcI4Ww+oK4q7kupQ9LhGRqirxa5UgU0XtNRF6gw7lGLw6+NugKBXDFbE3hGdcAss9IwSXoyz FiVktj1BDtp9rqIVXaa8bTSpjS3UcQIEVI/ieY/ZVNty7HeTEsb1Hojkv4L/HaJs+DI IronPort-HdrOrdr: A9a23:zvTCrKloEEgBe0ECDXJ/wnBSyGjpDfOZimdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcIi7SdK9qXO1z+8X3WBjB8bZYOCGghrkEGgG1+ffKlLbakrDH4JmtJ uINpIOcOEYbmIKwfoSgjPIderIqePvmM/HuQ6d9QYVcegAUdAD0+4NMHf+LqQAfngiOXNWLv qhz/sCgwDlVWUcb8y9CHVAdfPEvcf3mJXvZgNDLwI76SGV5AnYpoLSIly95FMzQjlPybAt/S zuiAri/JiutPm911v1y3LT1ZJLg9Hso+EzRfBky/JlagkEuDzYJriJaIfy+QzdZ9vfrGrCpe O84CvI+f4DrE85MFvF5ycFkDOQrQrGo0WStWNwx0GT7vARDQhKdPZplMZXdADU5FEnu8w52K VX33iBv54SFh/Ymj/hjuK4Hy2COXDE0kbKvNRj+UC3a7FuIYO5bLZvjn99AdMFBmb3+YonGO 5hAIXV4+tXa0qTazTcsnN0yNKhU3wvFlPeK3Jy8PC9wnxThjR03kEYzMsQkjMJ8488UYBN46 DBPr5znL9DQ8cKZeZ2BfsHQ8GwFmvRKCi8e166MBDiDuUKKnjNo5n47PE84/yrYoUByN8olJ HIQDpjxBkPkoLVeLmzNbFwg2HwqT+GLErQI+llluhEk6y5WbbtNiWFVTkV4r6dn8k= X-IronPort-AV: E=Sophos;i="5.91,220,1647316800"; d="scan'208";a="71172403" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=klmL9wntvOYm+jdC7+mD+vsIUlxU8QGV2Qc13r1b1hE9WL8Sj00t59A0wqH32tOQPb2QkG5EG+Bh3vQIO+CdtfMhTXLSyUHSLXYa/sbM4myBzoQnqIbd79X+m6rUyvSiczwLHQtJoDI7pyjNiViPp9emzLNB27bkKBNah4djlBB38uFm/mHQ5RiGyWdQIK/cENuEuLNzln1HIcSRJtAAwQ3alcFuUlX+JiJZ93s+D3IrQmm+ExAYSu+ZpyxB4OA/n99lQ6f0VfX7ZDKpsMj3ycugDOXxcDAZ33uLQnVBoO7R31qQGR4R6PUotMBt2bQ8X+yvkR8apo0LDCB9ZEoJdA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M4aCqPsn2tjt4Sqk6gf9AxPgbRqX6aBiuSLnvobnxho=; b=Hic6M5F2iV6TFvkgegpBMsjSoOHA/Ctgm7J/NNYKRBR1OOGauNBDjwsd1JrD5+QVwIFhjUGdvEOR5mxmERJgVnBdA8IwZvSuOqLDLLW8P+D6dwV9FGTVyYCMwImtnkJRGOHTmvDs8QFXXK3QHByZjdg7EMv7sT2qDU9lz5TfLmAvYKl/UoMEovbOnp/Vu+RlDgD2xWYYyUaFNtty2CnWevQCG/kFTaS77etaAIR80QPtZhs8ExFyc2IBmgwm76XU5ObVVc6oaNywB0sODEsHwC6r1L5ELHVRkKyrZdRStF0T9Ll2eocIjAk+yQwN5HH+Si63+rckKU18e75wzxhj9A== 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=M4aCqPsn2tjt4Sqk6gf9AxPgbRqX6aBiuSLnvobnxho=; b=wreRWtJLs+1tAqpQow6VT8CNbac4WDWJJ7tN/OOJ0YxYeyujcekV/RzhgBJbO0GIzLV6vnLk8L/umcIea0MFzZYUA8TREVSJm5+IJyCCekwn1Phr0xqTsYouFVF9HdDTS5uqNEGNKvAiY0pCTSCV0q/QT8xwYetthhizvSV1SBQ= From: Martin Harvey To: "paul@xen.org" , "win-pv-devel@lists.xenproject.org" CC: Owen Smith Subject: RE: Varargs in AdapterVifCallbacks. Thread-Topic: Varargs in AdapterVifCallbacks. Thread-Index: AdhmC7aA17C99R2kT1uNNjmZQqMw8QAAj1kAAAHXr2A= Date: Thu, 12 May 2022 15:42:26 +0000 Message-ID: References: <640dbaa5-b3b6-a4ec-dc22-81c5b73d47f9@gmail.com> In-Reply-To: <640dbaa5-b3b6-a4ec-dc22-81c5b73d47f9@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 367d53cd-3840-4b2e-02e0-08da342e040a x-ms-traffictypediagnostic: MN2PR03MB5037:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zfN1V1pTMjWnPbtnP7yP2yvXQiwX9HXCsCMzLeQ7t+wXzddiUfNk7G7uVr/5HV839up4YrjXPVXMxCGubtYDrujOX3GYhRXwN4C1tfA+g2PWzCJPTAHxFjtZ8Te+Zhkdc7+T72nZPhynI2utx9XrXGHBKxmqdJGMSVq2l35CfoO5PB9yJeeFHoRvLzkZarfTLkZubXbfTXOiPLGxAfufTeOhG6SQoIB1QFP3VJSq3jPe1QjcOOxwZQ3RkryMeYSHA5K/3xQouaeUC8Xgq0vgWrQDxrIIg5oQjgNmBzxGz/Ix2b4F3b4QxM8oyMTCNEv6C0Hg2NuGClKBP0WKXv+BDv8aPIIVAkFyMSOXkA0fAAlJf/IrkobkR9TBdc+BdoWDRHFFJoerp252WNdNjPNepVmi/eNMLS0owhWbb9LNRr5irdfI7/AZ6zr/RwosrE+hoF7VOY90A5hL1Y3XbUdPnuGwPVQY8gAB6I2YZZUjHXDmrXO9h9B7CN8ui3iffRM8AF72G9tY8HCRWBqFohje8PqABZJmY+dnC0Y/2FmwPgfiJ2hVTnBEHIcfZfA/LBb5+A+4HtkJAaIH9ZNIBmu1e0p6bXMJ45l0Kc2mNo7Nw685n3fS8t+WnU4kHIGPQowKXOOAmv3sxq3xzG81K2vwSot4+TgNSltdhSEPcK3gqxjiF3QwoO+MYsqV5WNuqWMT6SR4KzuFzISWcFgmUAUnlw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6347.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(82960400001)(86362001)(7696005)(52536014)(83380400001)(122000001)(186003)(44832011)(107886003)(8936002)(5660300002)(26005)(53546011)(9686003)(6506007)(33656002)(66476007)(64756008)(66446008)(3480700007)(55016003)(2906002)(38070700005)(7116003)(66946007)(4326008)(66556008)(76116006)(71200400001)(508600001)(8676002)(38100700002)(110136005)(316002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?alZhTjBETVo0eGt4VUE3azhQajI0MWFpaUo3SnpiNkpwV2ZpUFA3Y2lBMEdk?= =?utf-8?B?bnNya3lkL2FyVnpNZ20zSk9PSlpRSkpscUJmaU1ma0ZiQkhvTEd6V0JMTEZD?= =?utf-8?B?OS9LUzB4UWR2ZDdUd2owNGxOb1dRVkM3cHpmeGZPbm1vZnpKUnRocnhzZHV2?= =?utf-8?B?UUwwOVJ0TmczS01OODY5RnZwbjhjZWNWTlF2VGhSSVBHWjBwVG1DTCt3bXZX?= =?utf-8?B?VEZZWGI2a0c1QzNTb2ZaTzl2YW15UHlzZGNKVERsWjFjM0w3V0dJSzV4eGxj?= =?utf-8?B?MUVyeTBPeTFGVW1ldWJFa005NzQzdk1mZGUyQm90UDc5cXZjOGROc2VOaHVN?= =?utf-8?B?ZWZSNVo4ai9mZm5Eb3RJYzZYcnIwdlpmTTd6Y0ZNcWh5T2dWMXprWXZKOFZ5?= =?utf-8?B?U1cxcjRkQ2l6Vy9MT3I5V1AwMFc1Rkw1czRqVGFlc2IvZ2pXZGZMaHN4TFlu?= =?utf-8?B?dUlzUzFxbGJtUGFtdktDUzVjNGVHb0kveUpxU2Yxa25nc2k5SkNwS3VHNDIv?= =?utf-8?B?bEhQL3NhZCtFWFpodGIzVm5YNnhyTlBvTmt4WDVaS284N0QxTXh4Q0JmeVBa?= =?utf-8?B?dnNoT2lkUi90d0NMUElvTEtwYUZ2b0NPKzU1NHBMR0Jjby9PaFN6Y3A2QThP?= =?utf-8?B?M1k3aXQrZDRuc0tkRWJLTFBDKzVwS1VUUjFleUs2WGpYQ3I2dTlBYVFJRDgx?= =?utf-8?B?bCtmMjZ4QVVMbkxZbElRMzZVSEVlZVdYTWlkU3hvUmtKZ0w0UkxZaUU4aXBh?= =?utf-8?B?Q1BQQ0YzUzBpeTF1OGNBTk1ncUcwSDg4U1BuQnRVcXhISnJZM2pWZ1BTT0pT?= =?utf-8?B?VFpQNGptWWE0OEFDN1BCY1JLdG9tdjcranFDaHEyNmxNNnVvUksxOSt1T2FE?= =?utf-8?B?eUk2M3JFMWVTaDN4S05nUU13eHBTN1Y4NzAvS1VYWTQ3eHhJaWV5Z1dSK1di?= =?utf-8?B?LzNtN21jYmtWcWJLSWRyK1cxM0V0RUxMTE1rTStHZU1SdEg0VFo0SnhjZ0hY?= =?utf-8?B?QXJreW5xT0hheEgzcFFjU3NSM0EvL2Q3RDlONnFnWUo5VEJ3YnM3UXlPa1Zq?= =?utf-8?B?NE9QOFlUWjB3YmN3Ym9Kb0NseS90SUZxRnQ5QWsxS3lvZWxVdytzTGFKVFBW?= =?utf-8?B?N0NxODlIZUE3K2FGY1lwbTdGNjZuSkxzWmVDRGU0eUF6cXd4K01tYlZkSkhu?= =?utf-8?B?TURWSDRUU1hOSjFMbi9raGttaFlFL1h5VjdJTzNRWjlnYjMxblNkdzBGM2dz?= =?utf-8?B?OWpRS1NMUWl1eHQrLzlDQXN2dThkWUJxZXVPSUZHRlRzZU1qbzE1Q3BoQ0Zj?= =?utf-8?B?K0VwWUJZelNSdnFHU3VkUUVvaHRNSmdWdEhJdFE1YksrRk1MQVVVMm11eW91?= =?utf-8?B?eWp6MjdLU0U3TEg3Y2VhamppMzVTOXppREFCNHR0NGtJWERna09OcU4rSnZ3?= =?utf-8?B?NlNXNWJoR3hHdzJuNWZaR2lWM0M4ZG1tSXU3a0FjWTVRaHBaUk9yZGt0blQw?= =?utf-8?B?L0w5bkprRjBwTDZYblVBcW9wUVVyKy9yQkVDMTFDSWNxNDVjaVhKYkZEOTBa?= =?utf-8?B?enN6NUVYdGVVVVZMY215VEllRWMxeXRRZ0dTbHdOYkZCNmZ2aERIeW5ibEJY?= =?utf-8?B?a3NmZjU1YUplSFBHQUx3NC9rS1cxUlViaFphd0lteFBBelc0QWdRUjErYTZ4?= =?utf-8?B?N2VqQ1p6cld1WmVNYjAvUjZNMlJsOUpmR2V5U0tTUmExTGpkUXpJYUhlT01p?= =?utf-8?B?TG9wUDU0NzRUNTkzMnlqM3dZaGNmN2JPS1I3enNGMzlOY01NMVp6ZDdWeWk3?= =?utf-8?B?U2tWU0IyYWQyK2hUbTFPR1UwZXBucEVJRTB6RnNxcnN3dnEzOWpGMkRYS3dD?= =?utf-8?B?ejRjREI2Ty8xRCtNY1lFcWViM1h3L0phekJIQ2Q4dzJTcG1xZ2QrdGJSQzhp?= =?utf-8?B?Qm1pbURpSmg1N1N5QVpzaFFFZUxJenpvaTIxd3ZmVTVjYVNNUisyNUZQd2ky?= =?utf-8?B?NGsvcEEvdjFGcWlSb21tS0FkUXFZNlNHbEF5Z2FNQWthZDVUWWpTc3cwQTdn?= =?utf-8?B?dURVMllQdnBEUHFBTnV0TXpQZGcxbGV6TkRLdzIvNjJpQUN4V0l3L3lMcVpY?= =?utf-8?B?Q1hmbUYrQW0yNTdTWlVheGVPQ2VXVXNGSkVxYnlyRFlDd0VqQ2V4Tno5bEpI?= =?utf-8?B?OTJ4dG9LQW1xUHZMYU5ZRnQ2YytJWHZESW01amVoNEZ3Vm4zUVdkUDI4RjZx?= =?utf-8?B?Sk15ekI3eDJQMXkvcldacHF6QzRHZVpUVTVac2UvMzhiSldFbjhCQ3RHRFU4?= =?utf-8?B?Y1QvVTdqUzZzS0owNlRTejdQWTlnZzNYdDlNWm5YWjlpSmtHNS91bUp0Umcx?= =?utf-8?Q?7UgLWjl30JI1nQho=3D?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6347.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 367d53cd-3840-4b2e-02e0-08da342e040a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2022 15:42:26.6782 (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: XyB2UeH6DDl83E2KeBNK1ZxOYFycNZGzTI/wkPJR04tsOtEzpcfDoBMPqF9MPDax1tFRly5cdpB86ClQXi3d7jT+ckCClMg4Ueo2IFmdNV4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5037 DQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiB3aW4tcHYtZGV2ZWwgPHdpbi1w di1kZXZlbC1ib3VuY2VzQGxpc3RzLnhlbnByb2plY3Qub3JnPiBPbiBCZWhhbGYgT2YgRHVycmFu dCwgUGF1bA0KU2VudDogMTIgTWF5IDIwMjIgMTU6MzkNClRvOiB3aW4tcHYtZGV2ZWxAbGlzdHMu eGVucHJvamVjdC5vcmcNClN1YmplY3Q6IFJlOiBWYXJhcmdzIGluIEFkYXB0ZXJWaWZDYWxsYmFj a3MuDQoNCj4gTm90IG5lY2Vzc2FyaWx5LiBDYW4geW91IGVsYWJvcmF0ZSBvbiAibm90IGFzIHdv bmRlcmZ1bCBhcyBpdCBzaG91bGQgYmUiPw0KDQpUaGVyZSBpcyBzb21lIG5hc3RpbmVzcyB3aGVu IHlvdSBlbmQgdXAgd2l0aCBhIGxhcmdlIG51bWJlciBvZiBwYXJhbWV0ZXJzIG9yIHBvaW50ZXJz IHRvIGNlcnRhaW4gdHlwZXMgLSB1bmZvcnR1bmF0ZWx5IGl0J3MgYSBoZWlzZW5idWcsIGFuZCBr ZWVwcyBtb3ZpbmcgYXJvdW5kIGFzIEkgYWRkIC8gcmVtb3ZlIGRlYnVnZ2luZyBzdGF0ZW1lbnRz IC8gcGFyYW1zIHRvIHRoZSBjYWxsLiBIb3dldmVyLCBpdCdzIGZhaXJseSBjbGVhciB0aGUgc3Rh Y2sgZWF0cyBpdHNlbGYgZm9yIGx1bmNoLiBBbGwgSSBkaWQgd2FzIGFkZCBhIHNpbmdsZSBQQk9P TEVBTiB0byB0aGUgcGFyYW1ldGVyIGxpc3Qgb2Ygb25lIG9mIHRoZSBjYWxsYmFjayBwYXJhbWV0 ZXJzLCB1cHBlZCB0aGUgdmVyc2lvbiBudW1iZXIgb2YgdGhlIGludGVyZmFjZSwgYW5kIGl0IGFs bCB3ZW50IHZlcnkgYmFkbHkgd3JvbmcuIFRoZW4gSSB0aGVuICJmaXhlZCIgdGhlIHByb2JsZW0g YnkgYWRkaW5nIGEgY291cGxlIG1vcmUgVUxPTkcncyBwYWRkaW5nIHRvIHRoZSB2YXJhcmdzIGFu ZCBpdCBhbGwgd29ya3MgYWdhaW4uDQoNCkhvd2V2ZXIsIEkgZG8gbm90aWNlIHRoYXQgbm9uZSBv ZiB0aGUgd2luZG93cyBrZXJuZWwgaW50ZXJmYWNlcyB1c2UgdmFyYXJncywgSSdtIG5vdCBldmVu IHN1cmUgdGhleSBhcmUgIm9mZmljaWFsbHkiIHN1cHBvcnRlZCBmb3Iga2VybmVsIGRldmVsb3Bt ZW50LCBhbmQgSSB3b3VsZCBmYXIgcHJlZmVyIHRvIGRlY2xhcmUgYW5kIG1haW50YWluIGEgc3Ry dWN0L3VuaW9uIGZvciBwYXJhbWV0ZXJzLiBUaGF0IHdheSwgYWxsIHRoZSBkZXRhaWxzIGFyZSBp biBmYWN0IGtlcHQgaW4gdGhlIGludGVyZmFjZSwgYW5kIHRoZXJlIGlzIGdvb2QgZGVidWdnaW5n IHN5bWJvbGljIGluZm9ybWF0aW9uIGZvciBhbGwgb2YgdGhlbS4NCg0KPiBBbnkgY29tcGxhaW50 cyBpZiBJIHJlbW92ZSB2YXJhcmdzIGZyb20gdXBjb21pbmcgdjnCoCBvZiBYRU5WSUZfVklGIA0K PiBpbnRlcmZhY2U/IFNwZWFrIG5vdyBvciBmb3JldmVyIOKApg0KDQoNCj4gSSBjb3VsZCBiZSBw ZXJzdWFkZWQgdGhhdCBhbiBhcmd1bWVudCBzdHJ1Y3QgaXMgYSBzdWl0YWJsZSByZXBsYWNlbWVu dCBidXQgSSdkIGxpa2UgdG8gdW5kZXJzdGFuZCB3aGF0IHRoZSBleGFjdCBuYXR1cmUgb2YgdGhl IHByb2JsZW0gaXMuDQoNCk9LLiBJIGhvcGUgbXkgcGFydGlhbCBleHBsYW5hdGlvbiBhYm92ZSBp cyBhdCBsZWFzdCBhIGJpdCBvZiBhbiBleHBsYW5hdGlvbi4gVGhhdCBhbmQgdGhlIGZhY3QgdGhh dCB2YXJhcmdzIGFyZSBleHRyZW1lbHkgZGlmZmljdWx0IHRvIGRlYnVnIHdoZW4gdGhleSBnbyB3 cm9uZy4NCg0KT25lIGZpbmFsIHRoaW5nOiBXZSBtYXkgaGF2ZSB0aGluZ3MgYWZvb3QgaGVyZSB0 aGF0IEkgY2FuJ3QgdGFsayBhYm91dCBvbiB0aGUgbGlzdC4gTWlnaHQgdGhpcyBiZSBhIGdvb2Qg dGltZSBmb3IgbWUsIHlvdSBhbmQgb3dlbiB0byBtZWV0IGluIGEgcHViIHNvbWUgdGltZT8NCg0K TUguDQo= From win-pv-devel-bounces@lists.xenproject.org Fri May 13 10:24:41 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 13 May 2022 10:24:41 +0000 Received: from list by lists.xenproject.org with outflank-mailman.328352.551366 (Exim 4.92) (envelope-from ) id 1npSTR-0000wU-DA; Fri, 13 May 2022 10:24:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 328352.551366; Fri, 13 May 2022 10:24:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTR-0000wN-9z; Fri, 13 May 2022 10:24:41 +0000 Received: by outflank-mailman (input) for mailman id 328352; Fri, 13 May 2022 10:24:40 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTP-0000ud-Vx for win-pv-devel@lists.xenproject.org; Fri, 13 May 2022 10:24:39 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e2af8829-d2a6-11ec-aa76-f101dd46aeb6; Fri, 13 May 2022 12:24:37 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: e2af8829-d2a6-11ec-aa76-f101dd46aeb6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652437477; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bKyL3bMU9tfRcb+LDsic1IrFJJpJq3UBaSiDcm7c1ek=; b=Dq7owVFuHVkQmGMrMmlsoFCrAnm5czZQzsL0u7j1VJ4yxvDmDvDdUiKp TBGTTJd2jOkdczQB6WSrNDsXh7ZcbIX5MO4WUCmDt/lyWJCOLYbakwJ/B 02M67hBmPgXRxHEXa2M78iUTrRITL1sZIUZfGAOjJsoO5KA9akZNxAWPj Q=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 71109910 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:Xe/VJ6iJwIfVlVejA4jc0k7vX161NBAKZh0ujC45NGQN5FlHY01je htvXDuCOa7bY2GmL4oga9jkoEsG6JbUzN9hQFE/pS1kRisb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M68wIFqtQw24LhXlrW4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YSgzDIbnn/wzaDxBCBsgMvZt4q3jK0Hq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bknRp1y3YC7AmSIrdTrTi7t5ExjYgwMtJGJ4yY uJGMGM3PUWZO3WjPH86UrABvtWpgELbLR0JuFWTl5IZ0mL6mVkZPL/Fb4OOJ43iqd9utlmZo Cfe4SH1Dw8XMPSbyCGZ6TS8i+nXhyT5VYkOUrqi+ZZXbEa7nzJJTkdMDB3i/Kf/2hXWt89jx 1I81TAchoM17GKQa8DmZUO3+1WerDoWYo8FewEl0z2lxq3R6gefI2ELSD9dddAr3PMLqSwWO kyhxI2wW2E22FGBYTfEr+rP82vuUcQABTVaDRLoWzfp9DUKTGsbqhvUBuhuH6eu5jEeMWGhm mvaxMTSalh6sCLq60lZ1Q2f695PjsKQJuLQ2ukwdjj9hj6VnKb/O+SVBaHztJ6s1rqxQFibp 2QjkMOD9u0IBpzlvHXTHb9WTOn1uK7damW0bbtT834JrW7FxpJeVdoIvGEWyLlBbK7ohgMFk GeM4FgMtfe/zVOhbLNtYpLZNijZ5fOIKDgRbdiNNoAmSsEoLGevpXg+DWbNjjuFuBV9zskC1 WKzLJ/E4YAyUvw3klJbho41jNcW+8zJ7TmNGsqnn0/3gdJzphe9EN84DbdHVchhhIvsnekf2 4w32xeio/mHbNDDXw== IronPort-HdrOrdr: A9a23:Ur53q6zo72aqTX+Pm56mKrPwJr1zdoMgy1knxilNoRw8SKOlfq eV7ZEmPH7P+VEssR4b+OxoVJPsfZq+z+8W3WByB9eftWDd0QPCRr2KhbGSpwEIcBeRygcy78 tdmtBFeb7NMWQ= X-IronPort-AV: E=Sophos;i="5.91,221,1647316800"; d="scan'208";a="71109910" From: Martin Harvey To: CC: Martin Harvey , Martin Harvey Subject: [PATCH 1/2] Introduce per-dpc rate limits for XenVif / XeNet Rx path. Date: Fri, 13 May 2022 11:24:12 +0100 Message-ID: <20220513102413.1330-1-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain This patch allows XenNet to keep track of how many packets have been processed in a "batch" (per DPC), and to ask XenVif to stop the current batch once some predefined limit has been met. Signed-off-by: Martin Harvey --- include/vif_interface.h | 7 +++++-- src/xennet.inf | 6 +++--- src/xennet/adapter.c | 5 ++++- src/xennet/receiver.c | 12 ++++++++++-- src/xennet/receiver.h | 3 ++- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/include/vif_interface.h b/include/vif_interface.h index 20de314..c034657 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -928,7 +928,10 @@ struct _XENVIF_VIF_INTERFACE_V8 { XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; }; -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; +/* V9 is exactly the same as V8 */ +typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE_V9; + +typedef XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; /*! \def XENVIF_VIF \brief Macro at assist in method invocation @@ -939,6 +942,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER #endif // _WINDLL #define XENVIF_VIF_INTERFACE_VERSION_MIN 6 -#define XENVIF_VIF_INTERFACE_VERSION_MAX 8 +#define XENVIF_VIF_INTERFACE_VERSION_MAX 9 #endif // _XENVIF_INTERFACE_H diff --git a/src/xennet.inf b/src/xennet.inf index c44f4af..58ea5d7 100644 --- a/src/xennet.inf +++ b/src/xennet.inf @@ -61,9 +61,9 @@ xennet_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll ; DisplayName Section DeviceID ; ----------- ------- -------- -%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000001 -%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000001 -%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000001 +%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000002 +%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000002 +%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000002 [XenNet_Inst] Characteristics=0x84 diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c index 743cf35..a1bf9e8 100644 --- a/src/xennet/adapter.c +++ b/src/xennet/adapter.c @@ -234,6 +234,7 @@ AdapterVifCallback( PXENVIF_PACKET_HASH Hash; BOOLEAN More; PVOID Cookie; + PBOOLEAN NdisFinished; Index = va_arg(Arguments, ULONG); Mdl = va_arg(Arguments, PMDL); @@ -246,6 +247,7 @@ AdapterVifCallback( Hash = va_arg(Arguments, PXENVIF_PACKET_HASH); More = va_arg(Arguments, BOOLEAN); Cookie = va_arg(Arguments, PVOID); + NdisFinished = va_arg(Arguments, PBOOLEAN); ReceiverQueuePacket(Adapter->Receiver, Index, @@ -258,7 +260,8 @@ AdapterVifCallback( Info, Hash, More, - Cookie); + Cookie, + NdisFinished); break; } case XENVIF_MAC_STATE_CHANGE: { diff --git a/src/xennet/receiver.c b/src/xennet/receiver.c index 65527c5..d7a1e41 100644 --- a/src/xennet/receiver.c +++ b/src/xennet/receiver.c @@ -45,6 +45,7 @@ typedef struct _XENNET_RECEIVER_QUEUE { PNET_BUFFER_LIST Head; PNET_BUFFER_LIST Tail; ULONG Count; + ULONG SinceLastPush; } XENNET_RECEIVER_QUEUE, *PXENNET_RECEIVER_QUEUE; struct _XENNET_RECEIVER { @@ -544,7 +545,8 @@ ReceiverQueuePacket( IN PXENVIF_PACKET_INFO Info, IN PXENVIF_PACKET_HASH Hash, IN BOOLEAN More, - IN PVOID Cookie + IN PVOID Cookie, + OUT PBOOLEAN NdisFinished ) { PXENVIF_VIF_INTERFACE VifInterface; @@ -582,11 +584,17 @@ ReceiverQueuePacket( Queue->Tail = NetBufferList; } Queue->Count++; + Queue->SinceLastPush++; + + *NdisFinished = More && (Queue->SinceLastPush > IN_NDIS_MAX); + + if (!More || (*NdisFinished)) + Queue->SinceLastPush = 0; KeReleaseSpinLockFromDpcLevel(&Queue->Lock); done: - if (!More) + if (!More || (*NdisFinished)) __ReceiverPushPackets(Receiver, Index); } diff --git a/src/xennet/receiver.h b/src/xennet/receiver.h index 5fc9e66..6089fd4 100644 --- a/src/xennet/receiver.h +++ b/src/xennet/receiver.h @@ -68,7 +68,8 @@ ReceiverQueuePacket( IN PXENVIF_PACKET_INFO Info, IN PXENVIF_PACKET_HASH Hash, IN BOOLEAN More, - IN PVOID Cookie + IN PVOID Cookie, + OUT PBOOLEAN NdisFinished ); extern PXENVIF_VIF_OFFLOAD_OPTIONS -- 2.25.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 13 10:24:41 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 13 May 2022 10:24:41 +0000 Received: from list by lists.xenproject.org with outflank-mailman.328351.551362 (Exim 4.92) (envelope-from ) id 1npSTQ-0000uv-B2; Fri, 13 May 2022 10:24:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 328351.551362; Fri, 13 May 2022 10:24:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTQ-0000uo-8Q; Fri, 13 May 2022 10:24:40 +0000 Received: by outflank-mailman (input) for mailman id 328351; Fri, 13 May 2022 10:24:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTP-0000ud-Af for win-pv-devel@lists.xenproject.org; Fri, 13 May 2022 10:24:39 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e1fc6b50-d2a6-11ec-aa76-f101dd46aeb6; Fri, 13 May 2022 12:24:37 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: e1fc6b50-d2a6-11ec-aa76-f101dd46aeb6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652437477; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ynAGdGGCDyEl4VrRlQQtgy3tv/Z1JBr3arAcSsmpRW4=; b=WSm4lOsWLvfxzslSlxq9RxNp28GXNIrI9Guzit6q11niswrEg4QFe/1m BDge2U+uYf6W02OgeXpVO9vXFS6pQOqRcCvECQjZQnGQDQEYe39cYD3J+ mbNezDv5V9CrdBefSeWt8EqojVIRqevd9EW4L/YX0rkpC2mmtwfwaVYdu 0=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 71234579 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:KJOaMqr2iyOzme2ydRzYazpQX31eBmJMZRIvgKrLsJaIsI4StFCzt garIBmFbKuKM2X0L9tyO4Sxpk5SsMLUzNNjSVZsqXgwRC9BpJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvQ4 Iiq+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBZ67QyP0hbjRkKTBYOYNHwJHBA3eivpnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVIyDjDEfcgB5DKWbvH9PdT3Ssqh9AIFvHbD yYcQWU2Nk+cPkIeUrsRINVvtuaSrEntSRp/p3C7q4A7+HDo1SUkhdABN/KKI4fXFK25hH2wu WPAunznRx0XKtGb4T6E6W63wP/CmzvhX4AfH6H+8eRl6GB/3URKVkdQDwHi56Dk1AjuALqzN nD45AJ3rrRi7XCWY+XHTju8jn+8kBg+VMdfRrhSBB629oLY5AOQB24hRzFHacA7uMJeeQHGx mNljPuyW2Ux7eT9pWa1s+7N8GjsYXR9wXoqP3dscOcT3zX0TGjfZDrrR80rLqO6h8ad9drYk 2HT93hWa1n+YKc2O0SHEbLv3mrESnvhFFddCuDrsoWNtFsRWWJdT9b0gWU3FN4ZRGpjcnGPv WIfh++V5/0UAJeGmUSlGbtQRur5v6raaGWG2TaD+qXNEBz3oRaekX14umkidC+FzO5aEdMWX KMjkVwIv8ICVJdbRaR2f5iwG6wXIVvITrzYugTvRoMWOPBZLVbflAk3PB749z28yyAEzPBgU ap3hO7xVB72/4w8lGroLwrcuJd2rh0DKZT7H86klUj3iurODJNXIJ9cWGazgikCxPvsiG3oH xx3bqNmFz03vDXCXxTq IronPort-HdrOrdr: A9a23:BdHFKqwhyt3l9DQNPj6UKrPwFL1zdoMgy1knxilNoRw8SKKlfq eV7ZImPH7P+U4ssR4b+exoVJPtfZqYz+8R3WBzB8bEYOCFghrKEGgK1+KLqFeMJ8S9zJ846U 4JSdkGNDSaNzlHZKjBjzVQa+xQouW6zA== X-IronPort-AV: E=Sophos;i="5.91,221,1647316800"; d="scan'208";a="71234579" From: Martin Harvey To: CC: Martin Harvey , Martin Harvey Subject: [PATCH 2/2] Remove varargs from AdapterVifCallback. Date: Fri, 13 May 2022 11:24:13 +0100 Message-ID: <20220513102413.1330-2-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 In-Reply-To: <20220513102413.1330-1-Martin.Harvey@citrix.com> References: <20220513102413.1330-1-Martin.Harvey@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain VifEnable allows the client to pass in an adapter callback, which is called to push and return packets, and signal adapter state changes. The parameters for this callback were never fully specified (depending on varargs). This change formally specifies those params in the Vif interface. Signed-off-by: Martin Harvey --- include/vif_interface.h | 104 ++++++++++++++++++++++++++++++++++++---- src/xennet/adapter.c | 67 ++++++-------------------- 2 files changed, 110 insertions(+), 61 deletions(-) diff --git a/include/vif_interface.h b/include/vif_interface.h index c034657..c416f81 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -408,7 +408,7 @@ typedef VOID IN PINTERFACE Interface ); -/*! \typedef XENVIF_VIF_CALLBACK +/*! \typedef XENVIF_VIF_CALLBACK_VARARGS \brief Provider to subscriber callback function \param Argument An optional context argument passed to the callback @@ -436,13 +436,72 @@ typedef VOID No additional arguments */ typedef VOID -(*XENVIF_VIF_CALLBACK)( +(*XENVIF_VIF_CALLBACK_VARARGS)( IN PVOID Argument OPTIONAL, IN XENVIF_VIF_CALLBACK_TYPE Type, ... ); -/*! \typedef XENVIF_VIF_ENABLE +/*! \typedef XENVIF_VIF_ENABLE_VARARGS + \brief Enable the VIF interface + + All packets queued for transmit will be rejected and no packets will + be queued for receive until this method completes. + + \param Interface The interface header + \param Callback The subscriber's callback function + \param Argument An optional context argument passed to the callback +*/ +typedef NTSTATUS +(*XENVIF_VIF_ENABLE_VARARGS)( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK_VARARGS Callback, + IN PVOID Argument OPTIONAL + ); + + +typedef union _XENVIF_VIF_CALLBACK_PARAMS { + struct _XENVIF_VIF_CALLBACK_RETURN_PACKET_PARAMS { + PVOID Cookie; + PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; + } ReturnPacketParams; + struct _XENVIF_VIF_CALLBACK_QUEUE_PACKET_PARAMS { + ULONG Index; + PMDL Mdl; + ULONG Offset; + ULONG Length; + XENVIF_PACKET_CHECKSUM_FLAGS Flags; + USHORT MaximumSegmentSize; + USHORT TagControlInformation; + PXENVIF_PACKET_INFO Info; + PXENVIF_PACKET_HASH Hash; + BOOLEAN More; + PVOID Cookie; + PBOOLEAN NdisFinished; + } QueuePacketParams; + /* + struct _XENVIF_VIF_CALLBACK_STATE_CHANGE_PARAMS { + No parameters here + } StateChangeParams; + */ +} XENVIF_VIF_CALLBACK_PARAMS, *PXENVIF_VIF_CALLBACK_PARAMS; + +/*! \typedef XENVIF_VIF_CALLBACK + \brief Provider to subscriber callback function + + \param Argument An optional context argument passed to the callback + \param Type The callback type + \param Params Additional paramaters required by \a Type +*/ + +typedef VOID +(*XENVIF_VIF_CALLBACK)( + IN PVOID Argument OPTIONAL, + IN XENVIF_VIF_CALLBACK_TYPE Type, + IN PXENVIF_VIF_CALLBACK_PARAMS Params + ); + +/*! \typedef XENVIF_VIF_ENABLE_VARARGS \brief Enable the VIF interface All packets queued for transmit will be rejected and no packets will @@ -834,7 +893,7 @@ struct _XENVIF_VIF_INTERFACE_V6 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_VARARGS Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -868,7 +927,7 @@ struct _XENVIF_VIF_INTERFACE_V7 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_VARARGS Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -902,7 +961,7 @@ struct _XENVIF_VIF_INTERFACE_V8 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_VARARGS Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -928,10 +987,37 @@ struct _XENVIF_VIF_INTERFACE_V8 { XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; }; -/* V9 is exactly the same as V8 */ -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE_V9; +struct _XENVIF_VIF_INTERFACE_V9 { + INTERFACE Interface; + XENVIF_VIF_ACQUIRE Acquire; + XENVIF_VIF_RELEASE Release; + XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_DISABLE Disable; + XENVIF_VIF_QUERY_STATISTIC QueryStatistic; + XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; + XENVIF_VIF_UPDATE_HASH_MAPPING UpdateHashMapping; + XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; + XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; + XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; + XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; + XENVIF_VIF_RECEIVER_SET_HASH_ALGORITHM ReceiverSetHashAlgorithm; + XENVIF_VIF_RECEIVER_QUERY_HASH_CAPABILITIES ReceiverQueryHashCapabilities; + XENVIF_VIF_RECEIVER_UPDATE_HASH_PARAMETERS ReceiverUpdateHashParameters; + XENVIF_VIF_TRANSMITTER_QUEUE_PACKET TransmitterQueuePacket; + XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; + XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; + XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; + XENVIF_VIF_MAC_QUERY_STATE MacQueryState; + XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; + XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; + XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; + XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; + XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; + XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; + XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; +}; -typedef XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; +typedef struct _XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; /*! \def XENVIF_VIF \brief Macro at assist in method invocation diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c index a1bf9e8..9e8bebe 100644 --- a/src/xennet/adapter.c +++ b/src/xennet/adapter.c @@ -201,67 +201,32 @@ static VOID AdapterVifCallback( IN PVOID Context, IN XENVIF_VIF_CALLBACK_TYPE Type, - ... + IN PXENVIF_VIF_CALLBACK_PARAMS Params ) { PXENNET_ADAPTER Adapter = Context; - va_list Arguments; - - va_start(Arguments, Type); switch (Type) { case XENVIF_TRANSMITTER_RETURN_PACKET: { - PVOID Cookie; - PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; - - Cookie = va_arg(Arguments, PVOID); - Completion = va_arg(Arguments, PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO); - TransmitterReturnPacket(Adapter->Transmitter, - Cookie, - Completion); + Params->ReturnPacketParams.Cookie, + Params->ReturnPacketParams.Completion); break; } case XENVIF_RECEIVER_QUEUE_PACKET: { - ULONG Index; - PMDL Mdl; - ULONG Offset; - ULONG Length; - XENVIF_PACKET_CHECKSUM_FLAGS Flags; - USHORT MaximumSegmentSize; - USHORT TagControlInformation; - PXENVIF_PACKET_INFO Info; - PXENVIF_PACKET_HASH Hash; - BOOLEAN More; - PVOID Cookie; - PBOOLEAN NdisFinished; - - Index = va_arg(Arguments, ULONG); - Mdl = va_arg(Arguments, PMDL); - Offset = va_arg(Arguments, ULONG); - Length = va_arg(Arguments, ULONG); - Flags = va_arg(Arguments, XENVIF_PACKET_CHECKSUM_FLAGS); - MaximumSegmentSize = va_arg(Arguments, USHORT); - TagControlInformation = va_arg(Arguments, USHORT); - Info = va_arg(Arguments, PXENVIF_PACKET_INFO); - Hash = va_arg(Arguments, PXENVIF_PACKET_HASH); - More = va_arg(Arguments, BOOLEAN); - Cookie = va_arg(Arguments, PVOID); - NdisFinished = va_arg(Arguments, PBOOLEAN); - ReceiverQueuePacket(Adapter->Receiver, - Index, - Mdl, - Offset, - Length, - Flags, - MaximumSegmentSize, - TagControlInformation, - Info, - Hash, - More, - Cookie, - NdisFinished); + Params->QueuePacketParams.Index, + Params->QueuePacketParams.Mdl, + Params->QueuePacketParams.Offset, + Params->QueuePacketParams.Length, + Params->QueuePacketParams.Flags, + Params->QueuePacketParams.MaximumSegmentSize, + Params->QueuePacketParams.TagControlInformation, + Params->QueuePacketParams.Info, + Params->QueuePacketParams.Hash, + Params->QueuePacketParams.More, + Params->QueuePacketParams.Cookie, + Params->QueuePacketParams.NdisFinished); break; } case XENVIF_MAC_STATE_CHANGE: { @@ -269,8 +234,6 @@ AdapterVifCallback( break; } } - - va_end(Arguments); } static VOID -- 2.25.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 13 10:25:04 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 13 May 2022 10:25:04 +0000 Received: from list by lists.xenproject.org with outflank-mailman.328359.551370 (Exim 4.92) (envelope-from ) id 1npSTo-00012F-Fg; Fri, 13 May 2022 10:25:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 328359.551370; Fri, 13 May 2022 10:25:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTo-000127-CH; Fri, 13 May 2022 10:25:04 +0000 Received: by outflank-mailman (input) for mailman id 328359; Fri, 13 May 2022 10:25:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTn-0000zd-2q for win-pv-devel@lists.xenproject.org; Fri, 13 May 2022 10:25:03 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f0c23a91-d2a6-11ec-b8b8-f95467ff1ed0; Fri, 13 May 2022 12:25:01 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: f0c23a91-d2a6-11ec-b8b8-f95467ff1ed0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652437501; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Z2mmsLtbjL2JktL2XnCF3NPTDCXybXwC9gs7AUPH1FE=; b=KzDdU3hR7DkbNeaXbpeDUA/a1y3WrGtvadJjSk1jJtiB384d1F/M6Rmb szxOa+qv1aKxbzh+gqU7m7DuXicokGg6EGSPVi4Ld/WBZx7dAU8r6ZA3V BFts+/GxpeRC92oqe0WCDP8Q0Wte7LNu9c6lH5fqYTrB6kAP6OTF2lfAh M=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 71234598 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:fZrm9Kt71VPyi8pfvJ2wdR6Z/+fnVAJeMUV32f8akzHdYApBsoF/q tZmKWiCOPyNNzHzftpzPtnjpE8Hv5bVztBhHlM+/HowRXgS+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQywobVvqYy2YLjW17U4 ouryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8KHrPe3+FDFCBKUAxOMqJDybbqAkmG5Jn7I03uKxMAwt1rBUAye4YZ5vx2ESdF8 vlwxDIlN07ZwbjsmfTiF7cq1p9LwMrDZevzvlllxCvFDPBgQZnZXajbzdRZwC0xloZFGvO2i 88xNmM1N0idMk0n1lE/CpwFx+6Jo0fDfiBmlXuuiYd0z2Hx5VkkuFTqGIWMIYHbLSlPpW6Hp 2SD53q8DhwEOdi3zTue7mnqluLJhTn8Wo8ZCPu/7PECvbGI7jVNUltMDwL9+KTnzB7lMz5CF 6AK0gkOs7p18RLsd8u+ci23r3u1tzM/auMFRoXW9zqx4qbT5g+YAE0NQThAdMEquacKeNA66 rOat4i3XGIy6dV5XVrYr+7J9m3qZUD5OEdYPUc5oR05D84PSW3ZpjbGVZ5dHaG8lbUZ8hmgk mnR/EDSa1j+5PPnNplXH3ia21pARbCTF2bZAzk7uUr/tmtEiHaNPdDA1LQixa8owHylZleAp mMYvMOV8foDC5qA/ATUHrhXR+Hxu6ndaGeE6bKKI3XG3273k0NPgKgKuG0uTKuXGphslcDVj L/75loKuc470IqCZq5reYOhY/nGPoC7fekJosv8N4IUCrAoLVfv1Hg3NSa4gjG2+GBxwP5XB HtuWZv1ZZrsIf8/nGTeqiZ0+eJD+x3SMkuJG8+hk0T8ger2ibz8Ye5tDWZip9sRtMusyDg5O f4GXydW432ziNHDXxQ= IronPort-HdrOrdr: A9a23:9s1PBKjfbK4Xfm8G3HxTPRcNQXBQXtAji2hC6mlwRA09TySZ// rAoB19726QtN9xYgBGpTnuAsi9qB/nmKKdgrNhX4tKPjOHhILAFugLhuHfKlXbaknDH4Vmu5 uIHZITNDSJNykYsfrH X-IronPort-AV: E=Sophos;i="5.91,221,1647316800"; d="scan'208";a="71234598" From: Martin Harvey To: CC: Martin Harvey , Martin Harvey Subject: [PATCH 1/2] Introduce per-dpc rate limits for XenVif / XeNet Rx path. Date: Fri, 13 May 2022 11:24:44 +0100 Message-ID: <20220513102445.1413-1-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain This patch allows XenNet to keep track of how many packets have been processed in a "batch" (per DPC), and to ask XenVif to stop the current batch once some predefined limit has been met. Signed-off-by: Martin Harvey --- include/revision.h | 3 +- include/vif_interface.h | 7 ++- src/xenvif/receiver.c | 79 ++++++++++++++++++------- src/xenvif/vif.c | 124 ++++++++++++++++++++++++++++++++++------ src/xenvif/vif.h | 2 +- 5 files changed, 173 insertions(+), 42 deletions(-) diff --git a/include/revision.h b/include/revision.h index 39476b2..475700d 100644 --- a/include/revision.h +++ b/include/revision.h @@ -44,6 +44,7 @@ DEFINE_REVISION(0x0800000C, 1, 7, 2, 1), \ DEFINE_REVISION(0x0800000D, 1, 8, 2, 1), \ DEFINE_REVISION(0x09000000, 1, 8, 2, 1), \ - DEFINE_REVISION(0x09000001, 2, 8, 2, 1) + DEFINE_REVISION(0x09000001, 2, 8, 2, 1), \ + DEFINE_REVISION(0x09000002, 2, 9, 2, 1) #endif // _REVISION_H diff --git a/include/vif_interface.h b/include/vif_interface.h index 20de314..c034657 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -928,7 +928,10 @@ struct _XENVIF_VIF_INTERFACE_V8 { XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; }; -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; +/* V9 is exactly the same as V8 */ +typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE_V9; + +typedef XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; /*! \def XENVIF_VIF \brief Macro at assist in method invocation @@ -939,6 +942,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER #endif // _WINDLL #define XENVIF_VIF_INTERFACE_VERSION_MIN 6 -#define XENVIF_VIF_INTERFACE_VERSION_MAX 8 +#define XENVIF_VIF_INTERFACE_VERSION_MAX 9 #endif // _XENVIF_INTERFACE_H diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c index 505505e..0c1be81 100644 --- a/src/xenvif/receiver.c +++ b/src/xenvif/receiver.c @@ -99,6 +99,8 @@ typedef struct _XENVIF_RECEIVER_RING { BOOLEAN Connected; BOOLEAN Enabled; BOOLEAN Stopped; + BOOLEAN Backpressured; + BOOLEAN FinalFlush; XENVIF_VIF_OFFLOAD_OPTIONS OffloadOptions; ULONG BackfillSize; PXENBUS_DEBUG_CALLBACK DebugCallback; @@ -1338,43 +1340,53 @@ __ReceiverRingSwizzle( PXENVIF_VIF_CONTEXT Context; LIST_ENTRY List; PLIST_ENTRY ListEntry; + BOOLEAN AllFlushed; + BOOLEAN NdisFinishedBatch; Receiver = Ring->Receiver; Frontend = Receiver->Frontend; Context = PdoGetVifContext(FrontendGetPdo(Frontend)); + AllFlushed = TRUE; + NdisFinishedBatch = FALSE; InitializeListHead(&List); - ListEntry = InterlockedExchangePointer(&Ring->PacketQueue, NULL); + if (IsListEmpty(&Ring->PacketComplete) || Ring->FinalFlush) + { + ListEntry = InterlockedExchangePointer(&Ring->PacketQueue, NULL); - // Packets are held in the queue in reverse order so that the most - // recent is always head of the list. This is necessary to allow - // addition to the list to be done atomically. + // Packets are held in the queue in reverse order so that the most + // recent is always head of the list. This is necessary to allow + // addition to the list to be done atomically. - while (ListEntry != NULL) { - PLIST_ENTRY NextEntry; + while (ListEntry != NULL) { + PLIST_ENTRY NextEntry; - NextEntry = ListEntry->Blink; - ListEntry->Flink = ListEntry->Blink = ListEntry; + NextEntry = ListEntry->Blink; + ListEntry->Flink = ListEntry->Blink = ListEntry; - InsertHeadList(&List, ListEntry); + InsertHeadList(&List, ListEntry); - ListEntry = NextEntry; - } + ListEntry = NextEntry; + } - while (!IsListEmpty(&List)) { - PXENVIF_RECEIVER_PACKET Packet; + while (!IsListEmpty(&List)) { + PXENVIF_RECEIVER_PACKET Packet; - ListEntry = RemoveHeadList(&List); - ASSERT3P(ListEntry, !=, &List); + ListEntry = RemoveHeadList(&List); + ASSERT3P(ListEntry, !=, &List); - RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY)); + RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY)); - Packet = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_PACKET, ListEntry); - ReceiverRingProcessPacket(Ring, Packet); + Packet = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_PACKET, ListEntry); + ReceiverRingProcessPacket(Ring, Packet); + } + } else { + AllFlushed = FALSE; } - while (!IsListEmpty(&Ring->PacketComplete)) { + while (!IsListEmpty(&Ring->PacketComplete) && + (!NdisFinishedBatch || Ring->FinalFlush)) { PXENVIF_RECEIVER_PACKET Packet; PXENVIF_PACKET_INFO Info; PUCHAR BaseVa; @@ -1527,7 +1539,7 @@ __ReceiverRingSwizzle( (VOID) InterlockedIncrement(&Receiver->Loaned); - VifReceiverQueuePacket(Context, + NdisFinishedBatch = VifReceiverQueuePacket(Context, Ring->Index, &Packet->Mdl, Packet->Offset, @@ -1537,9 +1549,28 @@ __ReceiverRingSwizzle( Packet->TagControlInformation, &Packet->Info, &Packet->Hash, - !IsListEmpty(&Ring->PacketComplete) ? TRUE : FALSE, + !IsListEmpty(&Ring->PacketComplete), /* Keep this in - resets counts in xennet */ Packet); } + + if (!IsListEmpty(&Ring->PacketComplete)) + AllFlushed = FALSE; + + if (!AllFlushed) { + //Re-run remainder from back of DPC queue. + Ring->Backpressured = TRUE; + if (KeInsertQueueDpc(&Ring->QueueDpc, NULL, NULL)) + Ring->QueueDpcs++; + } else { + if ((Ring->Backpressured) && !Ring->FinalFlush) { + //Not any more - restart dataflow from initial ring poll. + Ring->Backpressured = FALSE; + + //PollDpc zeroed before final flush, don't queue it here. + if (KeInsertQueueDpc(&Ring->PollDpc, NULL, NULL)) + Ring->PollDpcs++; + } + } } static FORCEINLINE VOID @@ -1990,7 +2021,7 @@ ReceiverRingPoll( Count = 0; - if (!Ring->Enabled) + if (!Ring->Enabled || (Ring->Backpressured && !Ring->FinalFlush)) goto done; for (;;) { @@ -2963,8 +2994,12 @@ __ReceiverRingTeardown( Ring->BackfillSize = 0; Ring->OffloadOptions.Value = 0; + Ring->FinalFlush = TRUE; + KeInsertQueueDpc(&Ring->QueueDpc, NULL, NULL); KeFlushQueuedDpcs(); RtlZeroMemory(&Ring->QueueDpc, sizeof (KDPC)); + Ring->Backpressured = FALSE; + Ring->FinalFlush = FALSE; ThreadAlert(Ring->WatchdogThread); ThreadJoin(Ring->WatchdogThread); diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c index 69ced78..b026e5b 100644 --- a/src/xenvif/vif.c +++ b/src/xenvif/vif.c @@ -918,6 +918,36 @@ static struct _XENVIF_VIF_INTERFACE_V8 VifInterfaceVersion8 = { VifMacQueryFilterLevel }; +static XENVIF_VIF_INTERFACE_V9 VifInterfaceVersion9 = { + { sizeof (XENVIF_VIF_INTERFACE_V9), 9, NULL, NULL, NULL }, + VifAcquire, + VifRelease, + VifEnable, + VifDisable, + VifQueryStatistic, + VifQueryRingCount, + VifUpdateHashMapping, + VifReceiverReturnPacket, + VifReceiverSetOffloadOptions, + VifReceiverSetBackfillSize, + VifReceiverQueryRingSize, + VifReceiverSetHashAlgorithm, + VifReceiverQueryHashCapabilities, + VifReceiverUpdateHashParameters, + VifTransmitterQueuePacket, + VifTransmitterQueryOffloadOptions, + VifTransmitterQueryLargePacketSize, + VifTransmitterQueryRingSize, + VifMacQueryState, + VifMacQueryMaximumFrameSize, + VifMacQueryPermanentAddress, + VifMacQueryCurrentAddress, + VifMacQueryMulticastAddresses, + VifMacSetMulticastAddresses, + VifMacSetFilterLevel, + VifMacQueryFilterLevel +}; + NTSTATUS VifInitialize( IN PXENVIF_PDO Pdo, @@ -1033,6 +1063,23 @@ VifGetInterface( status = STATUS_SUCCESS; break; } + case 9: { + XENVIF_VIF_INTERFACE_V9 *VifInterface; + + VifInterface = (XENVIF_VIF_INTERFACE_V9 *)Interface; + + status = STATUS_BUFFER_OVERFLOW; + if (Size < sizeof (XENVIF_VIF_INTERFACE_V9)) + break; + + *VifInterface = VifInterfaceVersion9; + + ASSERT3U(Interface->Version, ==, Version); + Interface->Context = Context; + + status = STATUS_SUCCESS; + break; + } default: status = STATUS_NOT_SUPPORTED; break; @@ -1133,7 +1180,7 @@ __VifReceiverQueuePacketVersion7( } static FORCEINLINE VOID -__VifReceiverQueuePacket( +__VifReceiverQueuePacketVersion8( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, IN PMDL Mdl, @@ -1164,7 +1211,42 @@ __VifReceiverQueuePacket( } -VOID +static FORCEINLINE BOOLEAN +__VifReceiverQueuePacket( + IN PXENVIF_VIF_CONTEXT Context, + IN ULONG Index, + IN PMDL Mdl, + IN ULONG Offset, + IN ULONG Length, + IN XENVIF_PACKET_CHECKSUM_FLAGS Flags, + IN USHORT MaximumSegmentSize, + IN USHORT TagControlInformation, + IN PXENVIF_PACKET_INFO Info, + IN PXENVIF_PACKET_HASH Hash, + IN BOOLEAN More, + IN PVOID Cookie + ) +{ + BOOLEAN Finished = FALSE; + Context->Callback(Context->Argument, + XENVIF_RECEIVER_QUEUE_PACKET, + Index, + Mdl, + Offset, + Length, + Flags, + MaximumSegmentSize, + TagControlInformation, + Info, + Hash, + More, + Cookie, + &Finished); + return Finished; +} + + +BOOLEAN /* Returns NDIS finished batch for this DPC */ VifReceiverQueuePacket( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, @@ -1181,6 +1263,7 @@ VifReceiverQueuePacket( ) { KIRQL Irql; + BOOLEAN Finished = FALSE; KeRaiseIrql(DISPATCH_LEVEL, &Irql); @@ -1216,7 +1299,22 @@ VifReceiverQueuePacket( break; case 8: - __VifReceiverQueuePacket(Context, + __VifReceiverQueuePacketVersion8(Context, + Index, + Mdl, + Offset, + Length, + Flags, + MaximumSegmentSize, + TagControlInformation, + Info, + Hash, + More, + Cookie); + break; + + case 9: + Finished = __VifReceiverQueuePacket(Context, Index, Mdl, Offset, @@ -1236,6 +1334,8 @@ VifReceiverQueuePacket( } KeLowerIrql(Irql); + + return Finished; } VOID @@ -1245,20 +1345,12 @@ VifTransmitterReturnPacket( IN PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion ) { - switch (Context->Version) { - case 6: - case 7: - case 8: - Context->Callback(Context->Argument, - XENVIF_TRANSMITTER_RETURN_PACKET, - Cookie, - Completion); - break; + BUG_ON(Context->Version < 6); - default: - ASSERT(FALSE); - break; - } + Context->Callback(Context->Argument, + XENVIF_TRANSMITTER_RETURN_PACKET, + Cookie, + Completion); } PXENVIF_THREAD diff --git a/src/xenvif/vif.h b/src/xenvif/vif.h index b83a767..054cef1 100644 --- a/src/xenvif/vif.h +++ b/src/xenvif/vif.h @@ -62,7 +62,7 @@ VifTeardown( // CALLBACKS -extern VOID +extern BOOLEAN VifReceiverQueuePacket( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, -- 2.25.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 13 10:25:10 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 13 May 2022 10:25:10 +0000 Received: from list by lists.xenproject.org with outflank-mailman.328360.551375 (Exim 4.92) (envelope-from ) id 1npSTu-00014z-Im; Fri, 13 May 2022 10:25:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 328360.551375; Fri, 13 May 2022 10:25:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTu-00014s-F5; Fri, 13 May 2022 10:25:10 +0000 Received: by outflank-mailman (input) for mailman id 328360; Fri, 13 May 2022 10:25:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1npSTs-0000zd-JS for win-pv-devel@lists.xenproject.org; Fri, 13 May 2022 10:25:08 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f4d7ec7f-d2a6-11ec-b8b8-f95467ff1ed0; Fri, 13 May 2022 12:25:07 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: f4d7ec7f-d2a6-11ec-b8b8-f95467ff1ed0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652437506; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X0hDO6MJVA0ZrOy897n6VuPNaCvVWXQqjo0/AlVf1F4=; b=fuQr7qCyrF0HeS9ZmvECdpSUQkNt4CMi+UUBlHXEI+4HCAHKEBQp/V8n IREJ/kWMaZqrfu1EAToWErKHgBwLH19o3Nt5VnEaUa8a8/Hllfp5CPb8H gOJqKeov8mLBOt6XT4920tGSYjNO2cnJSRqPTGHcmkLXIPXjPr4/VARSx Y=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 73741140 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:l3pxFqBPkevaUBVW/33jw5YqxClBgxIJ4kV8jS/XYbTApGh03jEDm mQYCmmAa67bZjb1fNokYIu09kxTvMKAz9IyQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHGeIdA970Ug5w7Ng2dYx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPh0z /BEtrK8ETs5ZLXTpMUbXQNdVAxhaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwmJdP3PYVZunh60zzIJf0nXYrCU+PB4towMDIY2ZsRQa+HO 5JxhTxHSS3fPgB9AVErDrkCwfqion3EeAB8gQfAzUYwyzeKl1EguFT3C/LKe9rPXdsQkkuGq 2bu+2XiHgpcJNGZ0SCC8H+nmqnIhyyTZW4JPOTmrLgw2gTVnzFNTk1NPbemnRWnoku5fttcB UBMxjp0tbcO1UqlVNy6cgLt9RZooSUgc9ZXFuQ77iSExazV/xuVCwA4c9JRVDA1nJRoHGJ3j zdli/usXGUy6+PNFRpx45/O9VuP1T4pwXjujMPuZS8M+JHdrY46lXojpf4zQffu3rUZ9dwdq g1mTRTSZZ1O1abnNI3hpDgrZg5AQbCTFmYICv3/BD7N0++ATNfNi3aUwVba9+1cC42SU0OMu nMJ8+DHsr1UVsHVyHPVGL9VdF1M2xpiGGeG6WOD4rF7r2j9k5JdVd44DM5CyLdBbZ9fJG6Bj L77sgJN/p5DVEZGnocsC79d//8ClPC6ffy8D6i8RoMXMvBZKV7clAkzNBH44owYuBV1+U3JE czDIZjE4LdzIfkP8QdasM9Hj+BxmnBllTO7qFKS503P7IdyrUW9Ed8tWGZipMhghE9YiG05K +piCvY= IronPort-HdrOrdr: A9a23:WaySP6G6w5mdIGyQpLqE0MeALOsnbusQ8zAXP0AYc3Jom6uj5q aTdZUgpGfJYVkqOE3I9ertBEDEewK4yXcX2/h3AV7BZniEhILAFugLhuGO/9SjIVybygc079 YYT0EUMrzN5DZB4voSmDPIceod/A== X-IronPort-AV: E=Sophos;i="5.91,221,1647316800"; d="scan'208";a="73741140" From: Martin Harvey To: CC: Martin Harvey , Martin Harvey Subject: [PATCH 2/2] Remove varargs from AdapterVifCallback. Date: Fri, 13 May 2022 11:24:45 +0100 Message-ID: <20220513102445.1413-2-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 In-Reply-To: <20220513102445.1413-1-Martin.Harvey@citrix.com> References: <20220513102445.1413-1-Martin.Harvey@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain VifEnable allows the client to pass in an adapter callback, which is called to push and return packets, and signal adapter state changes. The parameters for this callback were never fully specified (depending on varargs). This change formally specifies those params in the Vif interface. Signed-off-by: Martin Harvey --- include/vif_interface.h | 104 +++++++++++++++++++++++++++--- src/xenvif/vif.c | 139 +++++++++++++++++++++++++++++----------- 2 files changed, 195 insertions(+), 48 deletions(-) diff --git a/include/vif_interface.h b/include/vif_interface.h index c034657..c416f81 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -408,7 +408,7 @@ typedef VOID IN PINTERFACE Interface ); -/*! \typedef XENVIF_VIF_CALLBACK +/*! \typedef XENVIF_VIF_CALLBACK_VARARGS \brief Provider to subscriber callback function \param Argument An optional context argument passed to the callback @@ -436,13 +436,72 @@ typedef VOID No additional arguments */ typedef VOID -(*XENVIF_VIF_CALLBACK)( +(*XENVIF_VIF_CALLBACK_VARARGS)( IN PVOID Argument OPTIONAL, IN XENVIF_VIF_CALLBACK_TYPE Type, ... ); -/*! \typedef XENVIF_VIF_ENABLE +/*! \typedef XENVIF_VIF_ENABLE_VARARGS + \brief Enable the VIF interface + + All packets queued for transmit will be rejected and no packets will + be queued for receive until this method completes. + + \param Interface The interface header + \param Callback The subscriber's callback function + \param Argument An optional context argument passed to the callback +*/ +typedef NTSTATUS +(*XENVIF_VIF_ENABLE_VARARGS)( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK_VARARGS Callback, + IN PVOID Argument OPTIONAL + ); + + +typedef union _XENVIF_VIF_CALLBACK_PARAMS { + struct _XENVIF_VIF_CALLBACK_RETURN_PACKET_PARAMS { + PVOID Cookie; + PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; + } ReturnPacketParams; + struct _XENVIF_VIF_CALLBACK_QUEUE_PACKET_PARAMS { + ULONG Index; + PMDL Mdl; + ULONG Offset; + ULONG Length; + XENVIF_PACKET_CHECKSUM_FLAGS Flags; + USHORT MaximumSegmentSize; + USHORT TagControlInformation; + PXENVIF_PACKET_INFO Info; + PXENVIF_PACKET_HASH Hash; + BOOLEAN More; + PVOID Cookie; + PBOOLEAN NdisFinished; + } QueuePacketParams; + /* + struct _XENVIF_VIF_CALLBACK_STATE_CHANGE_PARAMS { + No parameters here + } StateChangeParams; + */ +} XENVIF_VIF_CALLBACK_PARAMS, *PXENVIF_VIF_CALLBACK_PARAMS; + +/*! \typedef XENVIF_VIF_CALLBACK + \brief Provider to subscriber callback function + + \param Argument An optional context argument passed to the callback + \param Type The callback type + \param Params Additional paramaters required by \a Type +*/ + +typedef VOID +(*XENVIF_VIF_CALLBACK)( + IN PVOID Argument OPTIONAL, + IN XENVIF_VIF_CALLBACK_TYPE Type, + IN PXENVIF_VIF_CALLBACK_PARAMS Params + ); + +/*! \typedef XENVIF_VIF_ENABLE_VARARGS \brief Enable the VIF interface All packets queued for transmit will be rejected and no packets will @@ -834,7 +893,7 @@ struct _XENVIF_VIF_INTERFACE_V6 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_VARARGS Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -868,7 +927,7 @@ struct _XENVIF_VIF_INTERFACE_V7 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_VARARGS Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -902,7 +961,7 @@ struct _XENVIF_VIF_INTERFACE_V8 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_VARARGS Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -928,10 +987,37 @@ struct _XENVIF_VIF_INTERFACE_V8 { XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; }; -/* V9 is exactly the same as V8 */ -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE_V9; +struct _XENVIF_VIF_INTERFACE_V9 { + INTERFACE Interface; + XENVIF_VIF_ACQUIRE Acquire; + XENVIF_VIF_RELEASE Release; + XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_DISABLE Disable; + XENVIF_VIF_QUERY_STATISTIC QueryStatistic; + XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; + XENVIF_VIF_UPDATE_HASH_MAPPING UpdateHashMapping; + XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; + XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; + XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; + XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; + XENVIF_VIF_RECEIVER_SET_HASH_ALGORITHM ReceiverSetHashAlgorithm; + XENVIF_VIF_RECEIVER_QUERY_HASH_CAPABILITIES ReceiverQueryHashCapabilities; + XENVIF_VIF_RECEIVER_UPDATE_HASH_PARAMETERS ReceiverUpdateHashParameters; + XENVIF_VIF_TRANSMITTER_QUEUE_PACKET TransmitterQueuePacket; + XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; + XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; + XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; + XENVIF_VIF_MAC_QUERY_STATE MacQueryState; + XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; + XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; + XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; + XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; + XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; + XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; + XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; +}; -typedef XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; +typedef struct _XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; /*! \def XENVIF_VIF \brief Macro at assist in method invocation diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c index b026e5b..0c43e0c 100644 --- a/src/xenvif/vif.c +++ b/src/xenvif/vif.c @@ -51,7 +51,8 @@ struct _XENVIF_VIF_CONTEXT { PXENVIF_FRONTEND Frontend; BOOLEAN Enabled; ULONG Version; - XENVIF_VIF_CALLBACK Callback; + XENVIF_VIF_CALLBACK_VARARGS CallbackVarargs; + XENVIF_VIF_CALLBACK CallbackParams; PVOID Argument; PXENVIF_THREAD MacThread; KEVENT MacEvent; @@ -106,8 +107,19 @@ VifMac( break; if (Context->Enabled) - Context->Callback(Context->Argument, - XENVIF_MAC_STATE_CHANGE); + { + if (Context->Version < 9) { + Context->CallbackVarargs(Context->Argument, + XENVIF_MAC_STATE_CHANGE); + } else { + XENVIF_VIF_CALLBACK_PARAMS Params; + + RtlZeroMemory(&Params, sizeof(Params)); + Context->CallbackParams(Context->Argument, + XENVIF_MAC_STATE_CHANGE, + &Params); + } + } KeSetEvent(&Context->MacEvent, IO_NO_INCREMENT, FALSE); } @@ -138,10 +150,11 @@ VifSuspendCallbackLate( } static NTSTATUS -VifEnable( +VifEnableCommon( IN PINTERFACE Interface, - IN XENVIF_VIF_CALLBACK Callback, - IN PVOID Argument + IN PVOID Callback, + IN PVOID Argument, + IN BOOLEAN Varargs ) { PXENVIF_VIF_CONTEXT Context = Interface->Context; @@ -157,7 +170,13 @@ VifEnable( if (Context->Enabled) goto done; - Context->Callback = Callback; + if (Varargs) { + Context->CallbackVarargs = (XENVIF_VIF_CALLBACK_VARARGS) Callback; + Context->CallbackParams = NULL; + } else { + Context->CallbackVarargs = NULL; + Context->CallbackParams = (XENVIF_VIF_CALLBACK)Callback; + } Context->Argument = Argument; Context->Enabled = TRUE; @@ -226,7 +245,8 @@ fail1: KeMemoryBarrier(); Context->Argument = NULL; - Context->Callback = NULL; + Context->CallbackVarargs = NULL; + Context->CallbackParams = NULL; if (Exclusive) ReleaseMrswLockExclusive(&Context->Lock, Irql, FALSE); @@ -236,6 +256,28 @@ fail1: return status; } +static FORCEINLINE NTSTATUS +VifEnableVarargs( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK_VARARGS Callback, + IN PVOID Argument + ) { + BUG_ON(Interface->Version >= 9); + + return VifEnableCommon(Interface, (PVOID)Callback, Argument, TRUE); +} + +static FORCEINLINE NTSTATUS +VifEnableParams( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK Callback, + IN PVOID Argument + ) { + BUG_ON(Interface->Version < 9); + + return VifEnableCommon(Interface, (PVOID)Callback, Argument, FALSE); +} + static VOID VifDisable( IN PINTERFACE Interface @@ -285,7 +327,8 @@ VifDisable( XENBUS_SUSPEND(Release, &Context->SuspendInterface); Context->Argument = NULL; - Context->Callback = NULL; + Context->CallbackVarargs = NULL; + Context->CallbackParams = NULL; ReleaseMrswLockShared(&Context->Lock); @@ -832,7 +875,7 @@ static struct _XENVIF_VIF_INTERFACE_V6 VifInterfaceVersion6 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V6), 6, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableVarargs, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -862,7 +905,7 @@ static struct _XENVIF_VIF_INTERFACE_V7 VifInterfaceVersion7 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V7), 7, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableVarargs, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -892,7 +935,7 @@ static struct _XENVIF_VIF_INTERFACE_V8 VifInterfaceVersion8 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V8), 8, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableVarargs, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -918,11 +961,11 @@ static struct _XENVIF_VIF_INTERFACE_V8 VifInterfaceVersion8 = { VifMacQueryFilterLevel }; -static XENVIF_VIF_INTERFACE_V9 VifInterfaceVersion9 = { - { sizeof (XENVIF_VIF_INTERFACE_V9), 9, NULL, NULL, NULL }, +static struct _XENVIF_VIF_INTERFACE_V9 VifInterfaceVersion9 = { + { sizeof (struct _XENVIF_VIF_INTERFACE_V9), 9, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableParams, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -1064,12 +1107,12 @@ VifGetInterface( break; } case 9: { - XENVIF_VIF_INTERFACE_V9 *VifInterface; + struct _XENVIF_VIF_INTERFACE_V9 *VifInterface; - VifInterface = (XENVIF_VIF_INTERFACE_V9 *)Interface; + VifInterface = (struct _XENVIF_VIF_INTERFACE_V9 *)Interface; status = STATUS_BUFFER_OVERFLOW; - if (Size < sizeof (XENVIF_VIF_INTERFACE_V9)) + if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V9)) break; *VifInterface = VifInterfaceVersion9; @@ -1134,7 +1177,7 @@ __VifReceiverQueuePacketVersion6( UNREFERENCED_PARAMETER(Index); UNREFERENCED_PARAMETER(More); - Context->Callback(Context->Argument, + Context->CallbackVarargs(Context->Argument, XENVIF_RECEIVER_QUEUE_PACKET, Mdl, Offset, @@ -1165,7 +1208,7 @@ __VifReceiverQueuePacketVersion7( { UNREFERENCED_PARAMETER(Index); - Context->Callback(Context->Argument, + Context->CallbackVarargs(Context->Argument, XENVIF_RECEIVER_QUEUE_PACKET, Mdl, Offset, @@ -1195,7 +1238,7 @@ __VifReceiverQueuePacketVersion8( IN PVOID Cookie ) { - Context->Callback(Context->Argument, + Context->CallbackVarargs(Context->Argument, XENVIF_RECEIVER_QUEUE_PACKET, Index, Mdl, @@ -1227,21 +1270,27 @@ __VifReceiverQueuePacket( IN PVOID Cookie ) { + XENVIF_VIF_CALLBACK_PARAMS Params; BOOLEAN Finished = FALSE; - Context->Callback(Context->Argument, - XENVIF_RECEIVER_QUEUE_PACKET, - Index, - Mdl, - Offset, - Length, - Flags, - MaximumSegmentSize, - TagControlInformation, - Info, - Hash, - More, - Cookie, - &Finished); + + RtlZeroMemory(&Params, sizeof(Params)); + + Params.QueuePacketParams.Index = Index; + Params.QueuePacketParams.Mdl = Mdl; + Params.QueuePacketParams.Offset = Offset; + Params.QueuePacketParams.Length = Length; + Params.QueuePacketParams.Flags = Flags; + Params.QueuePacketParams.MaximumSegmentSize = MaximumSegmentSize; + Params.QueuePacketParams.TagControlInformation = TagControlInformation; + Params.QueuePacketParams.Info = Info; + Params.QueuePacketParams.Hash = Hash; + Params.QueuePacketParams.More = More; + Params.QueuePacketParams.Cookie = Cookie; + Params.QueuePacketParams.NdisFinished = &Finished; + + Context->CallbackParams(Context->Argument, + XENVIF_RECEIVER_QUEUE_PACKET, + &Params); return Finished; } @@ -1347,10 +1396,22 @@ VifTransmitterReturnPacket( { BUG_ON(Context->Version < 6); - Context->Callback(Context->Argument, - XENVIF_TRANSMITTER_RETURN_PACKET, - Cookie, - Completion); + if (Context->Version < 9) { + Context->CallbackVarargs(Context->Argument, + XENVIF_TRANSMITTER_RETURN_PACKET, + Cookie, + Completion); + } else { + XENVIF_VIF_CALLBACK_PARAMS Params; + + RtlZeroMemory(&Params, sizeof(Params)); + Params.ReturnPacketParams.Cookie = Cookie; + Params.ReturnPacketParams.Completion = Completion; + + Context->CallbackParams(Context->Argument, + XENVIF_TRANSMITTER_RETURN_PACKET, + &Params); + } } PXENVIF_THREAD -- 2.25.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Wed May 18 10:44:45 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 18 May 2022 10:44:45 +0000 Received: from list by lists.xenproject.org with outflank-mailman.331960.555599 (Exim 4.92) (envelope-from ) id 1nrHAa-000514-7D; Wed, 18 May 2022 10:44:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 331960.555599; Wed, 18 May 2022 10:44:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrHAa-00050x-4a; Wed, 18 May 2022 10:44:44 +0000 Received: by outflank-mailman (input) for mailman id 331960; Wed, 18 May 2022 10:44:42 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrHAY-00050R-I2 for win-pv-devel@lists.xenproject.org; Wed, 18 May 2022 10:44:42 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Wed, 18 May 2022 10:44:29 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <32534108.3.1652870670171.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENBUS-master - Build #232 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2_9632101.1652870669952" X-Jenkins-Job: XENBUS-master X-Jenkins-Result: SUCCESS ------=_Part_2_9632101.1652870669952 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #232. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/232/console to view the results. ------=_Part_2_9632101.1652870669952-- From win-pv-devel-bounces@lists.xenproject.org Wed May 18 11:09:35 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 18 May 2022 11:09:35 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332016.555658 (Exim 4.92) (envelope-from ) id 1nrHYd-0001pa-KR; Wed, 18 May 2022 11:09:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332016.555658; Wed, 18 May 2022 11:09:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrHYd-0001pS-HB; Wed, 18 May 2022 11:09:35 +0000 Received: by outflank-mailman (input) for mailman id 332016; Wed, 18 May 2022 11:09:34 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrHYc-0001pJ-Aa for win-pv-devel@lists.xenproject.org; Wed, 18 May 2022 11:09:34 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Wed, 18 May 2022 11:09:21 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <13588670.5.1652872161953.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENIFACE-master - Build #111 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_4_29881489.1652872161844" X-Jenkins-Job: XENIFACE-master X-Jenkins-Result: SUCCESS ------=_Part_4_29881489.1652872161844 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #111. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENIFACE-master/111/console to view the results. ------=_Part_4_29881489.1652872161844-- From win-pv-devel-bounces@lists.xenproject.org Wed May 18 12:01:13 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 18 May 2022 12:01:13 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332054.555694 (Exim 4.92) (envelope-from ) id 1nrIMa-00013h-D8; Wed, 18 May 2022 12:01:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332054.555694; Wed, 18 May 2022 12:01:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrIMa-00013a-AJ; Wed, 18 May 2022 12:01:12 +0000 Received: by outflank-mailman (input) for mailman id 332054; Wed, 18 May 2022 12:01:11 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrIMZ-00013U-LK for win-pv-devel@lists.xenproject.org; Wed, 18 May 2022 12:01:11 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Wed, 18 May 2022 12:00:59 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <32659845.7.1652875259314.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENNET-master - Build #119 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6_1826111.1652875259142" X-Jenkins-Job: XENNET-master X-Jenkins-Result: SUCCESS ------=_Part_6_1826111.1652875259142 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #119. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENNET-master/119/console to view the results. ------=_Part_6_1826111.1652875259142-- From win-pv-devel-bounces@lists.xenproject.org Wed May 18 12:21:09 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 18 May 2022 12:21:09 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332073.555709 (Exim 4.92) (envelope-from ) id 1nrIft-0003ft-8D; Wed, 18 May 2022 12:21:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332073.555709; Wed, 18 May 2022 12:21:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrIft-0003fm-5b; Wed, 18 May 2022 12:21:09 +0000 Received: by outflank-mailman (input) for mailman id 332073; Wed, 18 May 2022 12:21:08 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrIfr-0003fg-Vt for win-pv-devel@lists.xenproject.org; Wed, 18 May 2022 12:21:07 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Wed, 18 May 2022 12:20:55 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <23846080.9.1652876455659.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENVBD-master - Build #158 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_8_6154296.1652876455502" X-Jenkins-Job: XENVBD-master X-Jenkins-Result: SUCCESS ------=_Part_8_6154296.1652876455502 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #158. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVBD-master/158/console to view the results. ------=_Part_8_6154296.1652876455502-- From win-pv-devel-bounces@lists.xenproject.org Wed May 18 22:29:00 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Wed, 18 May 2022 22:29:00 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332498.556192 (Exim 4.92) (envelope-from ) id 1nrSA7-0004Zl-EW; Wed, 18 May 2022 22:28:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332498.556192; Wed, 18 May 2022 22:28:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrSA7-0004Ze-Bt; Wed, 18 May 2022 22:28:59 +0000 Received: by outflank-mailman (input) for mailman id 332498; Wed, 18 May 2022 22:28:58 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrSA6-0004ZY-3B for win-pv-devel@lists.xenproject.org; Wed, 18 May 2022 22:28:58 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Wed, 18 May 2022 22:28:45 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <9554935.11.1652912926099.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENVIF-master - Build #195 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_10_17859917.1652912925708" X-Jenkins-Job: XENVIF-master X-Jenkins-Result: SUCCESS ------=_Part_10_17859917.1652912925708 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #195. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENVIF-master/195/console to view the results. ------=_Part_10_17859917.1652912925708-- From win-pv-devel-bounces@lists.xenproject.org Thu May 19 10:17:54 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 19 May 2022 10:17:54 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332803.556568 (Exim 4.92) (envelope-from ) id 1nrdE9-0002y9-1o; Thu, 19 May 2022 10:17:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332803.556568; Thu, 19 May 2022 10:17:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrdE8-0002y2-VL; Thu, 19 May 2022 10:17:52 +0000 Received: by outflank-mailman (input) for mailman id 332803; Thu, 19 May 2022 10:17:52 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrdE8-0002xw-68 for win-pv-devel@lists.xenproject.org; Thu, 19 May 2022 10:17:52 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id edc5450c-d75c-11ec-bd2c-47488cf2e6aa; Thu, 19 May 2022 12:17:50 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: edc5450c-d75c-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652955470; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9wYtX2NRM4RliztVULpld0aMLNM97HVsDg2RuJOwyk8=; b=avFwMkaTKSFIvt6bi27p404kiyInZWvyto43IbDlNsPTzUaXifut6Dt/ MTLNU2Sq5DwupLNEW9N4ztDUZGwBRoIqRo0gYUpC+eGRrDO8A5fVsTM1g aEKAq6Y+W6wXHXfTEjikIg33Wc327sGJzVqwQ09SCIIcLqKP1nwUWwdzs g=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 72075805 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:4RbBxKo3T/HYMKXhpcviEmxX8GFeBmJJZRIvgKrLsJaIsI4StFCzt garIBnQO6yNYmHyKdEnOYuwoRkD7MWGz9ZgG1drqHhjEC5EopuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvQ4 IKq+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBIojKqdkebzdkTx5MAZdvwrj2fFeVmJnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVIyi7UC7A9RJHfQ43B5MNC3Sd2jcdLdRrbT 5VDMWUyPEydC/FJEhApIbEkouuMumTmQz5j9A+M9ZZquVGGmWSd15CyaYGIK7RmX/59gUee4 3rYumj0HBweHNie0iaetGKhgPfVmiH2U55UE6e3nsOGm3XKmDZVUkdPEwLm/7/p0SZSRu6zN WQI3ywfkKsO2nD3cevBZTSCp0/ZkTQ1Do84//IB1CmBza/d4gC8D2cCTyJcZNFOiPLaVQDGx XfSwYq3WGUHXKm9DCvEq+zK9W/a1T09dzdqWMMScecSDzAPSqkXhwmHcNtsGbXdYjbdSWCpm GDiQMTTatwuYS83O0eToAmvb9GE/MGhousJCuL/BzvN0++BTNT5D7FEEHCChRq6EK6XT0Oao F8PkNWE4eYFAPmlzXLQGrVURu30vqjeaFUwZGKD+LF4p1yQF4OLJ9gMsFmS2m83Wir7RdMZS BCK4l4AjHOiFHCrcbV2c+qM5zcClsDd+SDefqmMNLJmO8EpHCfepX0GTRPAjgjFzRl3+Ylia MjzTCpZJStDYUiR5GHtHLl1PH5C7n1W+F4/srigkUj2iefENSfMIVrHWXPXBt0EAGq/iF292 75i2wGikX2zjMWWjvHrzLMu IronPort-HdrOrdr: A9a23:8ZRtQKHpDSDF+1nNpLqE4seALOsnbusQ8zAXP0AYc3Nom6uj5q WTdZUgpHjJYVkqOU3I9ersBEDiewK/yXcW2+ks1N6ZNWGM0ldARLsSibcKqAePJ8SRzIJgPN 9bAstDNOE= X-IronPort-AV: E=Sophos;i="5.91,237,1647316800"; d="scan'208";a="72075805" From: Owen Smith To: CC: Owen Smith Subject: [PATCH] Fix error path cleanup Date: Thu, 19 May 2022 11:17:36 +0100 Message-ID: <20220519101736.366-1-owen.smith@citrix.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Signed-off-by: Owen Smith --- src/xenbus/fdo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c index 48d381a..d08c518 100644 --- a/src/xenbus/fdo.c +++ b/src/xenbus/fdo.c @@ -3389,7 +3389,10 @@ FdoCreateHole( fail3: Error("fail3\n"); - __FdoDestroyMemoryHole(Fdo); + if (Fdo->Mdl != NULL) + __FdoDestroyMemoryHole(Fdo); + else + __FdoDestroyPciHole(Fdo); fail2: Error("fail2\n"); -- 2.32.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Thu May 19 12:32:59 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 19 May 2022 12:32:59 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332921.556693 (Exim 4.92) (envelope-from ) id 1nrfKs-0005Op-0b; Thu, 19 May 2022 12:32:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332921.556693; Thu, 19 May 2022 12:32:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrfKr-0005Oi-U0; Thu, 19 May 2022 12:32:57 +0000 Received: by outflank-mailman (input) for mailman id 332921; Thu, 19 May 2022 12:32:57 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrfKr-0005Oc-1J for win-pv-devel@lists.xenproject.org; Thu, 19 May 2022 12:32:57 +0000 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [2a00:1450:4864:20::42d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cee69f51-d76f-11ec-bd2c-47488cf2e6aa; Thu, 19 May 2022 14:32:55 +0200 (CEST) Received: by mail-wr1-x42d.google.com with SMTP id e28so6369363wra.10 for ; Thu, 19 May 2022 05:32:56 -0700 (PDT) Received: from [10.7.237.9] (54-240-197-225.amazon.com. [54.240.197.225]) by smtp.gmail.com with ESMTPSA id e11-20020adfa44b000000b0020e608186a5sm4798829wra.48.2022.05.19.05.32.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 05:32:54 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: cee69f51-d76f-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=ow4E5eZlK2X70XbkW7gyAV01SJGKadqKKEpSwb2m2wg=; b=Dyll26Kmda3UsUlt/XNBRI/88j9/eUyxkvcNLRcys9Y28GvICNKm+imDSyFNW2Ecqs 67HblmGJXkgTqkLtOA4CO2nOA336Qo0cLDNp3p6dFhNCDdElNMBExiIBe+/8bsaSFu8A VuPMke7rTzZk4BDyVJ3siIp7R9Gzz0/YPKsQfuWxb1WmKe6RvBYiUvfEUqfh36JsNTEg p7784zkx29bdtIU3RFqPdH0cPjVpzRy7HOH3KnCBIIwlci6wmu2kIII2oUy7G7RXOf4c ro2kzHVrfR9LPU5GCCKUdmCmy6eFCu5zoQ3tCZ1H3LqysPOYT0w59HbhenCjDiBKMb8U +FUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=ow4E5eZlK2X70XbkW7gyAV01SJGKadqKKEpSwb2m2wg=; b=OmXavk1OZ5bunmu6lWUB36JAQRdn16Ey2HWTcWEsXRm9o9I6qwjeBjuH6u93xA8tOL 1zedwafikbApaUC3/tpnHhqwbM2BwhBc488DOlTp9GnB+blKO8OvznQsdfvyNkq0pMKR f4EvHc0i2aUDDrLEdWQ/BH815+jnnakIsb6CqJ/2QAMVMt4NfkVMtrJSqtOUoWExM+/+ KQcsTkbdxsNob8xo05+oPINXSAzkTL0K69Feyvam+6u5CbexjWQ2mYebvLS2JvvrnqbN Zz7NxNS+xethCzWJmjeGm/+RiHAR4C6la/xxRCzzrVEqabrH4hG2eK7ykD5gmZmBKK/U a+tA== X-Gm-Message-State: AOAM532KFdEGqVgoRegjoPjq+vOCffBocAmChGBkhBE8UCxbDZLaBYw2 QZYmM1XeiE+96pSg6nq8+FcOXLJxYng7TA== X-Google-Smtp-Source: ABdhPJybNMizeor6hAD8twy/VY2fjWKA+rqrB8Dled1DYrFuvpGrLd4wqEllTPS9oJrNWulFcY1zOg== X-Received: by 2002:adf:e3c6:0:b0:20e:6457:f2ba with SMTP id k6-20020adfe3c6000000b0020e6457f2bamr3840930wrm.74.1652963575585; Thu, 19 May 2022 05:32:55 -0700 (PDT) Message-ID: Date: Thu, 19 May 2022 13:32:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Reply-To: paul@xen.org Subject: Re: [PATCH] Fix error path cleanup Content-Language: en-US To: win-pv-devel@lists.xenproject.org References: <20220519101736.366-1-owen.smith@citrix.com> From: "Durrant, Paul" In-Reply-To: <20220519101736.366-1-owen.smith@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/05/2022 11:17, Owen Smith wrote: > Signed-off-by: Owen Smith Good catch. Acked-by: Paul Durrant > --- > src/xenbus/fdo.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c > index 48d381a..d08c518 100644 > --- a/src/xenbus/fdo.c > +++ b/src/xenbus/fdo.c > @@ -3389,7 +3389,10 @@ FdoCreateHole( > fail3: > Error("fail3\n"); > > - __FdoDestroyMemoryHole(Fdo); > + if (Fdo->Mdl != NULL) > + __FdoDestroyMemoryHole(Fdo); > + else > + __FdoDestroyPciHole(Fdo); > > fail2: > Error("fail2\n"); From win-pv-devel-bounces@lists.xenproject.org Thu May 19 12:54:30 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 19 May 2022 12:54:30 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332938.556709 (Exim 4.92) (envelope-from ) id 1nrffh-0007sv-QI; Thu, 19 May 2022 12:54:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332938.556709; Thu, 19 May 2022 12:54:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrffh-0007so-Mr; Thu, 19 May 2022 12:54:29 +0000 Received: by outflank-mailman (input) for mailman id 332938; Thu, 19 May 2022 12:54:28 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrffg-0007si-HL for win-pv-devel@lists.xenproject.org; Thu, 19 May 2022 12:54:28 +0000 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [2a00:1450:4864:20::42c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d0815cb8-d772-11ec-bd2c-47488cf2e6aa; Thu, 19 May 2022 14:54:26 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id j25so7028082wrc.9 for ; Thu, 19 May 2022 05:54:26 -0700 (PDT) Received: from [10.7.237.9] (54-240-197-225.amazon.com. [54.240.197.225]) by smtp.gmail.com with ESMTPSA id t12-20020adfba4c000000b0020c5253d91esm4794842wrg.106.2022.05.19.05.54.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 05:54:25 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: d0815cb8-d772-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=LfTu1Ye6Jg20Xn89veBu20TIhom95vzwh9dxlYLjzww=; b=MlOAPiIa0t44i4q2Cb8H84/EIR7RNj4fYqKT6lVuWvbU255kFsiYteUHXrgntBcvyU tr9tIVmCbcA2494fMUAuyiBu7ErehCXmmfgptWTjYn+5Ir2cCRzfHCREpD81PfW1/PmO WVd+aFQbHZcZBmua9mwMHaQY2I3z9zV/1DnFeqBW/PXYMJLa1j3K3Bfi5/gNOGmpirk2 KbROS9JL/WgrQM8gcwnzyqB+Ht/kTjsM0VopU2NVR96s1DX+mcHyR15K1fS0zdjInMFo 2+9jrCQ0F1UmUP4rHHLW9kneztq31sYJS7iXvtAFSGG7QeAPkFchFWUtpHr9xL1anBrD Rq6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=LfTu1Ye6Jg20Xn89veBu20TIhom95vzwh9dxlYLjzww=; b=mVRu5xT81g9feIgsjlPmd/BAGK+2cdLL/T8MYIDE7rYU08CWn5blue5ECCMgArT4V+ Zd4Vlurnbl/y7nU4sgfjM/Qj5T5/nEKgC1A526qark3krP7Q6aRW+rZFznRdDwxV8ILA O9KwMZKPnjNIToJPlU6p3BO2DRbV5BXnEm0E1mIskJm2iizk3IFgAAMte7UMFWqEx6PA oMUeOfSjbiA50/rzQ63DlegTFkwr8Bw0ks8ClLIbo2d7yiVwxs2V9ErGo+E5VqOHatoo h1KlgT+I9ZO/opTs4uLHt9TUqXn3C/pUaPDzCA9k2KXGPftSeXwmPX33M0+SwS9xPfM9 wUVg== X-Gm-Message-State: AOAM530teQf4aLSdozUk3GstnbSTPVRPWtnRpBLaa3Tca04HPpJjkUoF OseQORZqk5csfbHsdg0b+e5IUw834ViE5A== X-Google-Smtp-Source: ABdhPJzXGmVCGBkdzxNWTOJPlSt8f4yh/uGlGPJGxfgmFAQPMmciYt+6FVm9AN+ur1l3y/ibr8l73g== X-Received: by 2002:a5d:4744:0:b0:20a:ea5a:dc39 with SMTP id o4-20020a5d4744000000b0020aea5adc39mr4121499wrs.236.1652964866274; Thu, 19 May 2022 05:54:26 -0700 (PDT) Message-ID: <28286867-960b-e598-00ba-2ea1c90ce85f@gmail.com> Date: Thu, 19 May 2022 13:54:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Reply-To: paul@xen.org Subject: Re: [PATCH 2/2] Remove varargs from AdapterVifCallback. Content-Language: en-US To: win-pv-devel@lists.xenproject.org References: <20220513102445.1413-1-Martin.Harvey@citrix.com> <20220513102445.1413-2-Martin.Harvey@citrix.com> From: "Durrant, Paul" In-Reply-To: <20220513102445.1413-2-Martin.Harvey@citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13/05/2022 11:24, Martin Harvey wrote: > VifEnable allows the client to pass in an adapter callback, > which is called to push and return packets, and signal > adapter state changes. The parameters for this callback > were never fully specified (depending on varargs). > This change formally specifies those params in the Vif interface. > > Signed-off-by: Martin Harvey > --- > include/vif_interface.h | 104 +++++++++++++++++++++++++++--- > src/xenvif/vif.c | 139 +++++++++++++++++++++++++++++----------- > 2 files changed, 195 insertions(+), 48 deletions(-) > > diff --git a/include/vif_interface.h b/include/vif_interface.h > index c034657..c416f81 100644 > --- a/include/vif_interface.h > +++ b/include/vif_interface.h > @@ -408,7 +408,7 @@ typedef VOID > IN PINTERFACE Interface > ); > > -/*! \typedef XENVIF_VIF_CALLBACK > +/*! \typedef XENVIF_VIF_CALLBACK_VARARGS > \brief Provider to subscriber callback function > > \param Argument An optional context argument passed to the callback > @@ -436,13 +436,72 @@ typedef VOID > No additional arguments > */ > typedef VOID > -(*XENVIF_VIF_CALLBACK)( > +(*XENVIF_VIF_CALLBACK_VARARGS)( > IN PVOID Argument OPTIONAL, > IN XENVIF_VIF_CALLBACK_TYPE Type, > ... > ); > > -/*! \typedef XENVIF_VIF_ENABLE > +/*! \typedef XENVIF_VIF_ENABLE_VARARGS > + \brief Enable the VIF interface > + > + All packets queued for transmit will be rejected and no packets will > + be queued for receive until this method completes. > + > + \param Interface The interface header > + \param Callback The subscriber's callback function > + \param Argument An optional context argument passed to the callback > +*/ > +typedef NTSTATUS > +(*XENVIF_VIF_ENABLE_VARARGS)( > + IN PINTERFACE Interface, > + IN XENVIF_VIF_CALLBACK_VARARGS Callback, > + IN PVOID Argument OPTIONAL > + ); > + > + > +typedef union _XENVIF_VIF_CALLBACK_PARAMS { > + struct _XENVIF_VIF_CALLBACK_RETURN_PACKET_PARAMS { > + PVOID Cookie; > + PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; > + } ReturnPacketParams; > + struct _XENVIF_VIF_CALLBACK_QUEUE_PACKET_PARAMS { > + ULONG Index; > + PMDL Mdl; > + ULONG Offset; > + ULONG Length; > + XENVIF_PACKET_CHECKSUM_FLAGS Flags; > + USHORT MaximumSegmentSize; > + USHORT TagControlInformation; > + PXENVIF_PACKET_INFO Info; > + PXENVIF_PACKET_HASH Hash; > + BOOLEAN More; > + PVOID Cookie; > + PBOOLEAN NdisFinished; > + } QueuePacketParams; > + /* > + struct _XENVIF_VIF_CALLBACK_STATE_CHANGE_PARAMS { > + No parameters here > + } StateChangeParams; > + */ > +} XENVIF_VIF_CALLBACK_PARAMS, *PXENVIF_VIF_CALLBACK_PARAMS; > + > +/*! \typedef XENVIF_VIF_CALLBACK > + \brief Provider to subscriber callback function > + > + \param Argument An optional context argument passed to the callback > + \param Type The callback type > + \param Params Additional paramaters required by \a Type > +*/ > + > +typedef VOID > +(*XENVIF_VIF_CALLBACK)( > + IN PVOID Argument OPTIONAL, > + IN XENVIF_VIF_CALLBACK_TYPE Type, > + IN PXENVIF_VIF_CALLBACK_PARAMS Params > + ); > + > +/*! \typedef XENVIF_VIF_ENABLE_VARARGS > \brief Enable the VIF interface > > All packets queued for transmit will be rejected and no packets will > @@ -834,7 +893,7 @@ struct _XENVIF_VIF_INTERFACE_V6 { > INTERFACE Interface; > XENVIF_VIF_ACQUIRE Acquire; > XENVIF_VIF_RELEASE Release; > - XENVIF_VIF_ENABLE Enable; > + XENVIF_VIF_ENABLE_VARARGS Enable; > XENVIF_VIF_DISABLE Disable; > XENVIF_VIF_QUERY_STATISTIC QueryStatistic; > XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; > @@ -868,7 +927,7 @@ struct _XENVIF_VIF_INTERFACE_V7 { > INTERFACE Interface; > XENVIF_VIF_ACQUIRE Acquire; > XENVIF_VIF_RELEASE Release; > - XENVIF_VIF_ENABLE Enable; > + XENVIF_VIF_ENABLE_VARARGS Enable; > XENVIF_VIF_DISABLE Disable; > XENVIF_VIF_QUERY_STATISTIC QueryStatistic; > XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; > @@ -902,7 +961,7 @@ struct _XENVIF_VIF_INTERFACE_V8 { > INTERFACE Interface; > XENVIF_VIF_ACQUIRE Acquire; > XENVIF_VIF_RELEASE Release; > - XENVIF_VIF_ENABLE Enable; > + XENVIF_VIF_ENABLE_VARARGS Enable; > XENVIF_VIF_DISABLE Disable; > XENVIF_VIF_QUERY_STATISTIC QueryStatistic; > XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; > @@ -928,10 +987,37 @@ struct _XENVIF_VIF_INTERFACE_V8 { > XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; > }; > > -/* V9 is exactly the same as V8 */ > -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE_V9; No, you can't do that. The point of the versioning is that we make no incompatible change. You need to introduce v9 in its final form. Paul > +struct _XENVIF_VIF_INTERFACE_V9 { > + INTERFACE Interface; > + XENVIF_VIF_ACQUIRE Acquire; > + XENVIF_VIF_RELEASE Release; > + XENVIF_VIF_ENABLE Enable; > + XENVIF_VIF_DISABLE Disable; > + XENVIF_VIF_QUERY_STATISTIC QueryStatistic; > + XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; > + XENVIF_VIF_UPDATE_HASH_MAPPING UpdateHashMapping; > + XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; > + XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; > + XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; > + XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; > + XENVIF_VIF_RECEIVER_SET_HASH_ALGORITHM ReceiverSetHashAlgorithm; > + XENVIF_VIF_RECEIVER_QUERY_HASH_CAPABILITIES ReceiverQueryHashCapabilities; > + XENVIF_VIF_RECEIVER_UPDATE_HASH_PARAMETERS ReceiverUpdateHashParameters; > + XENVIF_VIF_TRANSMITTER_QUEUE_PACKET TransmitterQueuePacket; > + XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; > + XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; > + XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; > + XENVIF_VIF_MAC_QUERY_STATE MacQueryState; > + XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; > + XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; > + XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; > + XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; > + XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; > + XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; > + XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; > +}; > > -typedef XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; > +typedef struct _XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; > > /*! \def XENVIF_VIF > \brief Macro at assist in method invocation > diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c > index b026e5b..0c43e0c 100644 > --- a/src/xenvif/vif.c > +++ b/src/xenvif/vif.c > @@ -51,7 +51,8 @@ struct _XENVIF_VIF_CONTEXT { > PXENVIF_FRONTEND Frontend; > BOOLEAN Enabled; > ULONG Version; > - XENVIF_VIF_CALLBACK Callback; > + XENVIF_VIF_CALLBACK_VARARGS CallbackVarargs; > + XENVIF_VIF_CALLBACK CallbackParams; > PVOID Argument; > PXENVIF_THREAD MacThread; > KEVENT MacEvent; > @@ -106,8 +107,19 @@ VifMac( > break; > > if (Context->Enabled) > - Context->Callback(Context->Argument, > - XENVIF_MAC_STATE_CHANGE); > + { > + if (Context->Version < 9) { > + Context->CallbackVarargs(Context->Argument, > + XENVIF_MAC_STATE_CHANGE); > + } else { > + XENVIF_VIF_CALLBACK_PARAMS Params; > + > + RtlZeroMemory(&Params, sizeof(Params)); > + Context->CallbackParams(Context->Argument, > + XENVIF_MAC_STATE_CHANGE, > + &Params); > + } > + } > > KeSetEvent(&Context->MacEvent, IO_NO_INCREMENT, FALSE); > } > @@ -138,10 +150,11 @@ VifSuspendCallbackLate( > } > > static NTSTATUS > -VifEnable( > +VifEnableCommon( > IN PINTERFACE Interface, > - IN XENVIF_VIF_CALLBACK Callback, > - IN PVOID Argument > + IN PVOID Callback, > + IN PVOID Argument, > + IN BOOLEAN Varargs > ) > { > PXENVIF_VIF_CONTEXT Context = Interface->Context; > @@ -157,7 +170,13 @@ VifEnable( > if (Context->Enabled) > goto done; > > - Context->Callback = Callback; > + if (Varargs) { > + Context->CallbackVarargs = (XENVIF_VIF_CALLBACK_VARARGS) Callback; > + Context->CallbackParams = NULL; > + } else { > + Context->CallbackVarargs = NULL; > + Context->CallbackParams = (XENVIF_VIF_CALLBACK)Callback; > + } > Context->Argument = Argument; > > Context->Enabled = TRUE; > @@ -226,7 +245,8 @@ fail1: > KeMemoryBarrier(); > > Context->Argument = NULL; > - Context->Callback = NULL; > + Context->CallbackVarargs = NULL; > + Context->CallbackParams = NULL; > > if (Exclusive) > ReleaseMrswLockExclusive(&Context->Lock, Irql, FALSE); > @@ -236,6 +256,28 @@ fail1: > return status; > } > > +static FORCEINLINE NTSTATUS > +VifEnableVarargs( > + IN PINTERFACE Interface, > + IN XENVIF_VIF_CALLBACK_VARARGS Callback, > + IN PVOID Argument > + ) { > + BUG_ON(Interface->Version >= 9); > + > + return VifEnableCommon(Interface, (PVOID)Callback, Argument, TRUE); > +} > + > +static FORCEINLINE NTSTATUS > +VifEnableParams( > + IN PINTERFACE Interface, > + IN XENVIF_VIF_CALLBACK Callback, > + IN PVOID Argument > + ) { > + BUG_ON(Interface->Version < 9); > + > + return VifEnableCommon(Interface, (PVOID)Callback, Argument, FALSE); > +} > + > static VOID > VifDisable( > IN PINTERFACE Interface > @@ -285,7 +327,8 @@ VifDisable( > XENBUS_SUSPEND(Release, &Context->SuspendInterface); > > Context->Argument = NULL; > - Context->Callback = NULL; > + Context->CallbackVarargs = NULL; > + Context->CallbackParams = NULL; > > ReleaseMrswLockShared(&Context->Lock); > > @@ -832,7 +875,7 @@ static struct _XENVIF_VIF_INTERFACE_V6 VifInterfaceVersion6 = { > { sizeof (struct _XENVIF_VIF_INTERFACE_V6), 6, NULL, NULL, NULL }, > VifAcquire, > VifRelease, > - VifEnable, > + VifEnableVarargs, > VifDisable, > VifQueryStatistic, > VifQueryRingCount, > @@ -862,7 +905,7 @@ static struct _XENVIF_VIF_INTERFACE_V7 VifInterfaceVersion7 = { > { sizeof (struct _XENVIF_VIF_INTERFACE_V7), 7, NULL, NULL, NULL }, > VifAcquire, > VifRelease, > - VifEnable, > + VifEnableVarargs, > VifDisable, > VifQueryStatistic, > VifQueryRingCount, > @@ -892,7 +935,7 @@ static struct _XENVIF_VIF_INTERFACE_V8 VifInterfaceVersion8 = { > { sizeof (struct _XENVIF_VIF_INTERFACE_V8), 8, NULL, NULL, NULL }, > VifAcquire, > VifRelease, > - VifEnable, > + VifEnableVarargs, > VifDisable, > VifQueryStatistic, > VifQueryRingCount, > @@ -918,11 +961,11 @@ static struct _XENVIF_VIF_INTERFACE_V8 VifInterfaceVersion8 = { > VifMacQueryFilterLevel > }; > > -static XENVIF_VIF_INTERFACE_V9 VifInterfaceVersion9 = { > - { sizeof (XENVIF_VIF_INTERFACE_V9), 9, NULL, NULL, NULL }, > +static struct _XENVIF_VIF_INTERFACE_V9 VifInterfaceVersion9 = { > + { sizeof (struct _XENVIF_VIF_INTERFACE_V9), 9, NULL, NULL, NULL }, > VifAcquire, > VifRelease, > - VifEnable, > + VifEnableParams, > VifDisable, > VifQueryStatistic, > VifQueryRingCount, > @@ -1064,12 +1107,12 @@ VifGetInterface( > break; > } > case 9: { > - XENVIF_VIF_INTERFACE_V9 *VifInterface; > + struct _XENVIF_VIF_INTERFACE_V9 *VifInterface; > > - VifInterface = (XENVIF_VIF_INTERFACE_V9 *)Interface; > + VifInterface = (struct _XENVIF_VIF_INTERFACE_V9 *)Interface; > > status = STATUS_BUFFER_OVERFLOW; > - if (Size < sizeof (XENVIF_VIF_INTERFACE_V9)) > + if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V9)) > break; > > *VifInterface = VifInterfaceVersion9; > @@ -1134,7 +1177,7 @@ __VifReceiverQueuePacketVersion6( > UNREFERENCED_PARAMETER(Index); > UNREFERENCED_PARAMETER(More); > > - Context->Callback(Context->Argument, > + Context->CallbackVarargs(Context->Argument, > XENVIF_RECEIVER_QUEUE_PACKET, > Mdl, > Offset, > @@ -1165,7 +1208,7 @@ __VifReceiverQueuePacketVersion7( > { > UNREFERENCED_PARAMETER(Index); > > - Context->Callback(Context->Argument, > + Context->CallbackVarargs(Context->Argument, > XENVIF_RECEIVER_QUEUE_PACKET, > Mdl, > Offset, > @@ -1195,7 +1238,7 @@ __VifReceiverQueuePacketVersion8( > IN PVOID Cookie > ) > { > - Context->Callback(Context->Argument, > + Context->CallbackVarargs(Context->Argument, > XENVIF_RECEIVER_QUEUE_PACKET, > Index, > Mdl, > @@ -1227,21 +1270,27 @@ __VifReceiverQueuePacket( > IN PVOID Cookie > ) > { > + XENVIF_VIF_CALLBACK_PARAMS Params; > BOOLEAN Finished = FALSE; > - Context->Callback(Context->Argument, > - XENVIF_RECEIVER_QUEUE_PACKET, > - Index, > - Mdl, > - Offset, > - Length, > - Flags, > - MaximumSegmentSize, > - TagControlInformation, > - Info, > - Hash, > - More, > - Cookie, > - &Finished); > + > + RtlZeroMemory(&Params, sizeof(Params)); > + > + Params.QueuePacketParams.Index = Index; > + Params.QueuePacketParams.Mdl = Mdl; > + Params.QueuePacketParams.Offset = Offset; > + Params.QueuePacketParams.Length = Length; > + Params.QueuePacketParams.Flags = Flags; > + Params.QueuePacketParams.MaximumSegmentSize = MaximumSegmentSize; > + Params.QueuePacketParams.TagControlInformation = TagControlInformation; > + Params.QueuePacketParams.Info = Info; > + Params.QueuePacketParams.Hash = Hash; > + Params.QueuePacketParams.More = More; > + Params.QueuePacketParams.Cookie = Cookie; > + Params.QueuePacketParams.NdisFinished = &Finished; > + > + Context->CallbackParams(Context->Argument, > + XENVIF_RECEIVER_QUEUE_PACKET, > + &Params); > return Finished; > } > > @@ -1347,10 +1396,22 @@ VifTransmitterReturnPacket( > { > BUG_ON(Context->Version < 6); > > - Context->Callback(Context->Argument, > - XENVIF_TRANSMITTER_RETURN_PACKET, > - Cookie, > - Completion); > + if (Context->Version < 9) { > + Context->CallbackVarargs(Context->Argument, > + XENVIF_TRANSMITTER_RETURN_PACKET, > + Cookie, > + Completion); > + } else { > + XENVIF_VIF_CALLBACK_PARAMS Params; > + > + RtlZeroMemory(&Params, sizeof(Params)); > + Params.ReturnPacketParams.Cookie = Cookie; > + Params.ReturnPacketParams.Completion = Completion; > + > + Context->CallbackParams(Context->Argument, > + XENVIF_TRANSMITTER_RETURN_PACKET, > + &Params); > + } > } > > PXENVIF_THREAD From win-pv-devel-bounces@lists.xenproject.org Thu May 19 13:26:18 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 19 May 2022 13:26:18 +0000 Received: from list by lists.xenproject.org with outflank-mailman.332967.556735 (Exim 4.92) (envelope-from ) id 1nrgAT-0003Ri-L6; Thu, 19 May 2022 13:26:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 332967.556735; Thu, 19 May 2022 13:26:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrgAT-0003Rb-I9; Thu, 19 May 2022 13:26:17 +0000 Received: by outflank-mailman (input) for mailman id 332967; Thu, 19 May 2022 13:26:16 +0000 Received: from winpvdrvbuild.xenproject.org ([162.242.160.44]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrgAS-0003RV-7w for win-pv-devel@lists.xenproject.org; Thu, 19 May 2022 13:26:16 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" Date: Thu, 19 May 2022 13:26:04 +0000 (UTC) From: paul.durrant@xenproject.org To: win-pv-devel@lists.xenproject.org Message-ID: <18650932.13.1652966764752.JavaMail.WINPVDRVBUILD$@winpvdrvbuild> Subject: XENBUS-master - Build #233 - Successful MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12_19412550.1652966764580" X-Jenkins-Job: XENBUS-master X-Jenkins-Result: SUCCESS ------=_Part_12_19412550.1652966764580 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The build system has completed build #233. Check console output at https://winpvdrvbuild.xenproject.org:8080/job/XENBUS-master/233/console to view the results. ------=_Part_12_19412550.1652966764580-- From win-pv-devel-bounces@lists.xenproject.org Thu May 19 14:38:00 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 19 May 2022 14:38:00 +0000 Received: from list by lists.xenproject.org with outflank-mailman.333049.556838 (Exim 4.92) (envelope-from ) id 1nrhHr-0006gt-Da; Thu, 19 May 2022 14:37:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 333049.556838; Thu, 19 May 2022 14:37:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrhHr-0006gm-9z; Thu, 19 May 2022 14:37:59 +0000 Received: by outflank-mailman (input) for mailman id 333049; Thu, 19 May 2022 14:37:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrhHq-0006DW-0r for win-pv-devel@lists.xenproject.org; Thu, 19 May 2022 14:37:58 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 45152483-d781-11ec-bd2c-47488cf2e6aa; Thu, 19 May 2022 16:37:56 +0200 (CEST) Received: from mail-bn1nam07lp2043.outbound.protection.outlook.com (HELO NAM02-BN1-obe.outbound.protection.outlook.com) ([104.47.51.43]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 19 May 2022 10:37:51 -0400 Received: from MW4PR03MB6347.namprd03.prod.outlook.com (2603:10b6:303:11e::22) by BN3PR03MB2210.namprd03.prod.outlook.com (2a01:111:e400:7bb9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.15; Thu, 19 May 2022 14:37:49 +0000 Received: from MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::5587:5e20:5c2b:d94e]) by MW4PR03MB6347.namprd03.prod.outlook.com ([fe80::5587:5e20:5c2b:d94e%8]) with mapi id 15.20.5273.016; Thu, 19 May 2022 14:37:49 +0000 X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 45152483-d781-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652971076; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=fErMKVhcn10dIf35KEPRteTJZ0PRlLhyOAn86rSygZo=; b=WBJBFuu31YHWU3Nv0sdmbj676IKry5YHxgFMIspPz+7bc498pJTis2ME 27UaT7/a96I64qzhJBhqHX9rsYzqj29vknT9Qy9gsLGEbQsGSKNKIbaVn L5cBOmqPDO2+s6xHIUVYKLWiMv+iK8UGlvtMXoJJY77oiqUaU32BvUzv0 k=; X-IronPort-RemoteIP: 104.47.51.43 X-IronPort-MID: 71561477 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:bLIAvKvH46/hFKnGr3HFU/U7mefnVDVfMUV32f8akzHdYApBsoF/q tZmKW6PO/7ZZGT0edgiPYTi8EgGscSAydZrGgRoqy88EXgX+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQywobVvqYy2YLjW17U6 IuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8KL4Tmgu9GSSJ+KHtjAb1hxpSZDGWW5Jn7I03uKxMAwt1IJWRuZ8gy3L8yBmtDs /sFNDoKcxaPwfqsx662QfVtgcJlK9T3OIQYuTdryjSx4fQOGMifBfmVo4IBmmtr7ixNNa+2i 84xbDN1cBXGJR1GIEkaGbo1nfuyh2m5eDpdwL6QjfVuvjaKkFMuuFTrGObSa9GVRuhvp1i/l j2Z4V/XB04FHvXKnFJp9Vrp3IcjhxjTQIsPEJWo+/gsh0ecrkQMCRtTTUX+rfSnh0qWX9NEN 1dS6icotbI19kGgUp/6RRLQnZKflhsVWt4VGetj7giIkvXQ+1zBWjNCSSNdYts7ssNwXSYty lKCg9LuA3poraGRTnWesLyTqFteJBQoEIPLXgdcJSNt3jUpiNhbYs7nJjq7LJOIsw== IronPort-HdrOrdr: A9a23:Kvb/Pa2PqXzn1Wkr4UbxhwqjBQZyeYIsimQD101hICG9Lfb0qy n+pp4mPEHP4wr5AEtQ4exoS5PwOk80kqQFq7X5XI3SFzUO3VHFEGgM1/qH/9SNIUzDH6tmpN 5dmstFeZDN5DpB/KHHCWCDer5OruVvsprY49s2pE0dLj2CHpsQijuRfTzrcHGeKjMnObMJUL 6nouZXrTupfnoaKu6hAGMeYuTFr9rX0Lr7fB8vHXccmUazpALtzIS/PwmT3x8YXT8K66wl63 L5nwvw4bjmm+2nyyXby3TY4/1t6ZXcI5p4dY2xY/ouW3bRYzWTFcZcsnq5zXUISdSUmRYXeR /30lMd1opImjTslyqO0GHQMkHboUsTAjnZuBOlaDLY0LDEbSN/BMxbiY1DdBzFr0ImodFnya pOm3mUrpxNEHr77VLADvXzJmVXf3CP0A0feC8o/gxieJpbbKUUoZ0U/UtTHptFFCXm6Jo/GO 0rCM3H/v5ZfV6Tcnic5wBUsZSRd2V2Gg3DTlkJu8ST3TQTlHdlz1EAzMhamnsb7poyR5RN+u yBOKV1k7NFSNMQcMtGda48aNryDnaITQPHMWqUL1iiHKYbO2jVo5qy+7kx7PHCQu188HLzou WybLp1jx9NR6u1M7zw4HRiyGG9fEytGTLw18pZ+591/rXhWbuDC1zxdGwT X-IronPort-AV: E=Sophos;i="5.91,237,1647316800"; d="scan'208";a="71561477" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LD5jyccz9WquSu81AKIhdWGCMFvFM6KNNNDS/x07zcPorrQXCd2t0XtDdhJ2p54fM+Lmrx32Z1V/F33vX2nPRVQE08Z4YyIm35Q5JwhDZuaNHjz2bFKgve9nGGFO3MUoOvOQ2I9LwNLWj7+CWAtnbmPkip9HH4n4MkfPsD4HErdbRg+9Ku6Xj2tgrtlmouhRtwJk9kLBfmaG/tfZAAHZPEM2Dda18CwEOtJcxMhZgDFywNvOS/KrNwlvaFUulJQ+o4Kq/jh1zdC0nxUmbAmteS8KczKBNS5byIYt194JfjVlZ0fPB2HHev6GgzZFJSympPWTXKoiBtNYQaOkfe3HwA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fErMKVhcn10dIf35KEPRteTJZ0PRlLhyOAn86rSygZo=; b=GRt2oW0VzVG+vWpvCn9HorAKuZaw0saN2Hj5RCbhISfsPBMYd9IcyItvcmvqem9FwSlCK7eLZLsT4gHsGxsI3x/OR6lm+qcvkwE4C6r8w5RcfX8roPnvsQmokSaQq+h/eRuJHCdF2zeYc/bjkf9VaVcs+nm31qss3K0OZb/XxOKhNxc/WxknHHymM6ksgbLtoO2guzmwH3MPr9cTEF41C530MCUk9ckKpHMiOc9R90ZBIJ46K5GQDCJlng1iVhIn9kfChUZxCCGBIwNCimtnqvaV22ssYtQxCpyBkuLhonnROa+C9bAL0xtGWMipnSHq61IcUw+B6DUhuLAAnaS/xg== 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=fErMKVhcn10dIf35KEPRteTJZ0PRlLhyOAn86rSygZo=; b=Hfhnm+iL52QgifKklvV86DJDBYYkJX5IP8vVgxSBfnp0K3p8u/CIj/znH/CAKdyDkKZB59Bt93YL8d5L3znz9GZnaQpEVvkulaq4P/8+WghHjSDMGCgNH3ugo+mYe6bF4HwA15TQdjHWRFuoaeWtLRTkciXsKpFf5QcISLsOt1k= From: Martin Harvey To: "paul@xen.org" , "win-pv-devel@lists.xenproject.org" Subject: RE: [PATCH 2/2] Remove varargs from AdapterVifCallback. Thread-Topic: [PATCH 2/2] Remove varargs from AdapterVifCallback. Thread-Index: AQHYZrO57BEWPEzIEEyWwuNn09oQGq0mMbkAgAAZ31A= Date: Thu, 19 May 2022 14:37:49 +0000 Message-ID: References: <20220513102445.1413-1-Martin.Harvey@citrix.com> <20220513102445.1413-2-Martin.Harvey@citrix.com> <28286867-960b-e598-00ba-2ea1c90ce85f@gmail.com> In-Reply-To: <28286867-960b-e598-00ba-2ea1c90ce85f@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d5c11f9f-b74f-487d-1e52-08da39a525bb x-ms-traffictypediagnostic: BN3PR03MB2210:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F69WF07xmNuSY4rFJixJHHfiQcU7uGVB7pAtltmYLx3DfJ/ndTH3vSdA2Z0B2mE9Q4YbijTHvKTYaLnnYHDTQUPeiDS90TcGK6pZ3WT5aVH1Ox01D3JG7sJTtJvi9WjNZ9kGgJhvW4d6Z1cRY+E5TibszhA7BwCP/TwgSnOFPq4tHh1RV3CjjUp0MpIL/S+VvseKa+IS2risz5LaCF8quau3zav67AZRfpuJfYwv1ALhQZd1fWQID5ksZaPWF58zQNmYUKjb7mig/mdY4YfIU74cTRC+pt04RNWp0yk3zRfi+erOkgxMWYwEMu6JfWLXv6EATUDBJgvy8ltKxN/hrUXEZpqu9WK40n8oK0SEMV1KtCcEWyH45Wpu/5Z/a+hCJphRefnSibDg/VgKlENHakh960OsSLd4R5LBTeQ1OI1mDBnl53XS68II4fxeXY39okosng7y6O3I+39Hi2qLNjhluPpxx80oDWtyqSWH+g00e2ajBgMd5xQz/5mIzDFvjUjnkHpCVRq8Tw+loWM1idJ/0IGpB5Ya4hlYA0705p/fyCrB3P6ErMs3y/KIygghpLqzTo3RQrwDODzVsl09rvWunav+R3Ty/DkZqJy3BRfbYwWmeoTrI2xW7CENPQmrdZtI4xpPO0BE9T95BOsaH2PZK9Xvohv+tHnSUfGqSmE9a0IWUNHYWY+NwR+8vE0se3cboYzsfffcqsgmBdBXKw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR03MB6347.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(186003)(5660300002)(76116006)(66446008)(8936002)(52536014)(508600001)(44832011)(8676002)(66556008)(6506007)(66476007)(71200400001)(53546011)(64756008)(83380400001)(7696005)(2906002)(55016003)(38100700002)(38070700005)(316002)(9686003)(122000001)(66946007)(82960400001)(110136005)(33656002)(26005)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?L2NKUVMwbVh3OFFwNm1yRVdIOTQ1UlJrZUVJYU1iVm9hcTB1YVArU0xRNmor?= =?utf-8?B?bXZLeFZuRUg5Zk9mMnR5UWlXS1U0d3F2a2hCbFRjT25QcDl3Qks2V3ZHcnlV?= =?utf-8?B?UDlHbm1aUzlRaEVWUGxvbVUvZ2FuRnpFQ1RPUEFIRzNvMWZyQTVCSStTdVd5?= =?utf-8?B?SFhNR3IrVUdBQnd0QXZBRUVOUURNVGVCMm9lL0I4V1pPQWFvcmsvaTNNUTNz?= =?utf-8?B?dHlmMGJkNnBZUWl3U0lUYXh1VjFLK216MWVHM3RxQU9BREJmdlVwM3p2dmlj?= =?utf-8?B?Z0hrUXdaTlBRcFBLNkoyZUhSLzlTZWxpRDNsSUZUT1dTUHEwOFBTanNrREpp?= =?utf-8?B?S2NidDExWW5EZWZ5Tk5qZXpRem1uTit2bk1XV3BKOGFkUS9ob0x6dkdZWVNa?= =?utf-8?B?MXpwL3hzWXJKM2sva3FiaVQrSThtQ2hXTU5mQ1N4Y3kzblowaXRDR0dFQ2N5?= =?utf-8?B?eXZ1QXlCQUROZm1majRvMmZ5Q2txbkE4WjZCUTFzWS9BYjNkVXAvYVFWT2Fa?= =?utf-8?B?V1VBVlowMFYwZi9VV0VhNjl4N2kwd2U2N0FGWlBMZ3VCN1NoWXZKTmpNSG1s?= =?utf-8?B?cXY5UUpJclRra1BKcmE0b001L3lmUzN0cEJmS09jME4yM0RnSzRvM1BzNC9t?= =?utf-8?B?cW1MVlBNbW9vSG92NlZqYmxOWk9mTjRna2Y2SFdvNnFWZVRQM04rdGlET3c4?= =?utf-8?B?Wm0wMTZsdVd1SGNJdDBEMnFjMHVzTzNLNGVQN0txQ0hVMkVoYVF0K0N4R3FW?= =?utf-8?B?VHJId2hZRkNUZXhIQkpZZVBWR0tCZXRwdGdjYXc0dTR2N3pBQnh2ZzB0a0pI?= =?utf-8?B?M3lxT1NNbmI5TCs0R21qV0M4SnlZdjRYQkZCZUNyUG9ZcFUreVdHTTlGa0N5?= =?utf-8?B?UmtsMGdWaXZkRHVVL0xsS1VVVVA5VS9ZN3dIN3dUdjU4TVJwVEh6aTloZEJ1?= =?utf-8?B?Slgvall3NjdkdmxYcEt3VGhjS09qc3ZRWGRWcnBPaC9jNnZqSEI3NVk1WDhm?= =?utf-8?B?d0kwb1o2VEVjRHo2VmZJakFlZkNydGZaUnRKcHpLQUdqQk1FY3N0TlJkNmJX?= =?utf-8?B?b0JnbWx4blhZVW9ENXNidGJPSm1mZ256Qk84TDQxVVVHTFdzaUJvMGE0aTdX?= =?utf-8?B?d3psbWV2R1EzOEJQV2VvZXUxeGN0R3pEdmdpRzNjYnJnVjVpTmFvYzcrcTZy?= =?utf-8?B?ZlVtcVlaRDhRbi8yOVFRSWNoa3NCRzkxNEJiUFFVUUdnS21ld1RWTEFlWnBO?= =?utf-8?B?c0ZxVnZFODJmUEMyS0N1OS9Day9ncU9XSUQzcUdXQ3RHMlZTcjBIYmovaEZS?= =?utf-8?B?NmFFY1ZiRWtpMys0RTR5SXhBR0dLcWo0WUhhclBVVzlSYzBQUUwraTNLeHRK?= =?utf-8?B?eGVWZUxyaFhnOVNpaGZvQ3hUcTZuemlvbHFkNHk4ci95QXgzUGpHMUJxaGdW?= =?utf-8?B?UU5IVk1rOEhjMFY1eG4rWXhVMzhtQTE5N3NidHU2R09ZQy94Tzc0K2U1WTY1?= =?utf-8?B?L25YblI4aGRLKzZGOXlaOEM4VSt4VHAyMlptb29pR2tyU3JhcFh2cTVlZXBm?= =?utf-8?B?QzBFSitBNVVZaUZVRkJDSWVBb1kzN3daQW44dERrV3ZuZGFIQWRyYk1HT3d0?= =?utf-8?B?VWV2cXhSQW1GOVhqeUZUeThNUDVDa1dObWIvYkZEdHRqOFdZRGhHbXR2WmIz?= =?utf-8?B?eGRWM2tmQmpYamRhUTdOU0ZYRkdPQnRNTjNBcnVMM1lWaEJPM2lQNkNiWUlP?= =?utf-8?B?bTBGb2hsL25qeEwweXp6OXVGOGYxaFROR0tEY2JDYXJNL0pBL1U4cnJrd09l?= =?utf-8?B?VHEya29lRFUzMU1oRi9RRUNoT0RCaU55Rm03a25YaURQeVpYWWpnR2IyVmZa?= =?utf-8?B?VG1QdEFVWGVzYW41cG54MVI1SU5pbUQ4dWRpNEpFeGRteEF3YnFiMGlCVVRZ?= =?utf-8?B?TERFTVFCNDB0NktmZ2haRExsc2RCSk1zRURZTVp3dWxMdGRoUTRnMlpBeWZz?= =?utf-8?B?aTltY1hKNHg3c2ZXTjBwS29Sc3RqSWRkRTBPcXZCTVhNQVpXNElxTDFVdlRF?= =?utf-8?B?amtSaUc3bmM3dWFpRXFSTUZNNjFla01Ba1pLUTFIZVQ4WElScUVRTGk0TW56?= =?utf-8?B?RTg5eGVFbHAvUmlCNnFETFkrOXBMTnpNemIxMHlsZkkvZWhBMytMRTdHMnZM?= =?utf-8?B?U0hVQStvSkNmTXN2Q2p4UjBNZWxXMlExNUt3eTc2UTJ3UHFITHEwbncwS3VK?= =?utf-8?B?eHRmRnJLMEwwNGE1ZktVR1VvQW9DaHU1Ti81MTlHWUY5b2tnRXRLNHdoUElH?= =?utf-8?B?djZZZG9ZZEpKZ2Y0UENTdUJydEZlUGgyK1NrUHRHU21iUURGQk1OYkJDVHlG?= =?utf-8?Q?dWUSkg7OEnXMeB/A=3D?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR03MB6347.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5c11f9f-b74f-487d-1e52-08da39a525bb X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2022 14:37:49.1284 (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: g6F+V0sidFTuDiKUbPgYkudM90jeS8f3gi+dQOwKQjRiJggdT+d6wlNDr2RJWbSaFpN0kE8mIfkn7Q9FBtOG3S1GfmvNUzGWPKTn8kk7MDw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2210 DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogd2luLXB2LWRldmVsIDx3 aW4tcHYtZGV2ZWwtYm91bmNlc0BsaXN0cy54ZW5wcm9qZWN0Lm9yZz4gT24gQmVoYWxmIE9mIER1 cnJhbnQsIFBhdWwNCj4gU2VudDogMTkgTWF5IDIwMjIgMTM6NTQNCj4gVG86IHdpbi1wdi1kZXZl bEBsaXN0cy54ZW5wcm9qZWN0Lm9yZw0KPiBTdWJqZWN0OiBSZTogW1BBVENIIDIvMl0gUmVtb3Zl IHZhcmFyZ3MgZnJvbSBBZGFwdGVyVmlmQ2FsbGJhY2suDQo+DQo+ID4gLS8qIFY5IGlzIGV4YWN0 bHkgdGhlIHNhbWUgYXMgVjggKi8NCj4gPiAtdHlwZWRlZiBzdHJ1Y3QgX1hFTlZJRl9WSUZfSU5U RVJGQUNFX1Y4IFhFTlZJRl9WSUZfSU5URVJGQUNFX1Y5Ow0KDQo+IE5vLCB5b3UgY2FuJ3QgZG8g dGhhdC4gVGhlIHBvaW50IG9mIHRoZSB2ZXJzaW9uaW5nIGlzIHRoYXQgd2UgbWFrZSBubyBpbmNv bXBhdGlibGUgY2hhbmdlLiBZb3UgbmVlZCB0byBpbnRyb2R1Y2UgdjkgaW4gaXRzIGZpbmFsIGZv cm0uDQoNCk9LLiBJIGhhdmUgc3VibWl0dGVkIHR3byBwYXRjaGVzIGluIHRoZSBzZXJpZXMgaW4g b3JkZXIgdG8gZ2l2ZSB5b3UgYSBjaG9pY2UgLSBhcyBJIHdpbGwgZXhwbGFpbjoNCg0KMSkgSSBh c3N1bWUgeW91IGhhdmUgbm90ZWQgdGhlICItIiwgdG8gaW5kaWNhdGUgdGhhdCB0aGF0IHRoZXNl IGxpbmVzIGFyZSBwcmVzZW50IGFmdGVyIGFwcGx5aW5nIG9uZSBvZiB0aGUgdHdvIHBhdGNoZXMs IGJ1dCBub3QgYm90aC4NCg0KMikgV291bGQgeW91IGxpa2UgVjkgdG8gYmUganVzdCB0aGUgaW50 ZXJmYWNlIGFzIGl0IGlzIGFmdGVyIFsxLzJdIGhhcyBiZWVuIGFwcGxpZWQgdG8gYm90aCB4ZW52 aWYgYW5kIHhlbm5ldCAoa2VlcCB2YXJhcmdzKSwgb3IgYXMgaXQgaXMgYWZ0ZXIgYm90aCBwYXRj aGVzIGhhdmUgYmVlbiBhcHBsaWVkIHRvIGJvdGggeGVudmlmIGFuZCB4ZW5uZXQuDQoNCjMpIEkg dGFsa2VkIHRoaXMgdGhydSB3aXRoIG93ZW4gYW5kIHdlIGFncmVlIHRoYXQgdGhlIGludGVyZmFj ZSBjaGFuZ2VzIGFuZCB2ZXJzaW9uIGJ1bXAgZm9yIHRoZSBpbnRlcmZhY2UgYW5kIGFzc29jaWF0 ZWQgSUQncyBzaG91bGQgaGFwcGVuIGluIG9uZSBhdG9taWMgcGF0Y2ggLyBjaGFuZ2UgdG8gdGhl IGNvZGViYXNlLiBJbiB3aGljaCBjYXNlLCBJIHNob3VsZCBwcm9iYWJseSBqdXN0IGJlIHN1Ym1p dHRpbmcgb25lIHBhdGNoLiBIb3dldmVyLCBJIGhhdmUgc3VibWl0dGVkIGl0IGluIHR3byBoYWx2 ZXMgYmVjYXVzZSBJIGRvbid0IGtub3cgd2hldGhlciB5b3Ugd2FudCB0aGUgdmFyYXJncyBjaGFu Z2VzIG9yIG5vdC4NCg0KNCkgSWYgd2UgZG9uJ3QgcmVtb3ZlIHZhcmFyZ3MgKDEgb2YgMiBwYXRj aGVzIG9uIGJvdGgpLCBJICpoYXZlKiB0byB1cGRhdGUgdGhlIHZlcnNpb24gbnVtYmVyLCBiZWNh dXNlIHRoZSBpbnRlcmZhY2VzIGFyZSBub3QgYmluYXJ5IGNvbXBhdGlibGUuIEhvd2V2ZXIsIHRo ZSBmdW5jdGlvbiBwcm90b3R5cGVzIGZvciBhbGwgdGhlIGNhbGxzIGFyZSwgYmVjYXVzZSB0aGUg ZGlmZmVyZW5jZSBpcyBoaWRkZW4gYXdheSBpbiB2YXJhcmdzLCBoZW5jZSB0aGUgZGVmaW5pdGlv bi4NCg0KU28sIGdvaW5nIGJhY2sgdG8gcHJldmlvdXMgcG9pbnRzOg0KDQoxKSBXb3VsZCB5b3Ug bGlrZSBvbmUgb3IgYm90aD8NCjIpIElmIG9ubHkgb25lLCBkbyB5b3Ugd2FudCBtZSB0byBkZWNs YXJlIGEgdjkgaW50ZXJmYWNlIHdoaWNoIGhhcyBhbiBpZGVudGljYWwgc2V0IG9mIGZ1bmN0aW9u IGNhbGxzIChiZWNhdXNlIHRoZSBkaWZmZXJlbmNlIGlzIGhpZGRlbiBpbiB2YXJhcmdzIGltcGxl bWVudGF0aW9uKT8NCg0KTUguDQo= From win-pv-devel-bounces@lists.xenproject.org Thu May 19 15:10:32 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Thu, 19 May 2022 15:10:32 +0000 Received: from list by lists.xenproject.org with outflank-mailman.333121.556907 (Exim 4.92) (envelope-from ) id 1nrhnM-0005bK-NV; Thu, 19 May 2022 15:10:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 333121.556907; Thu, 19 May 2022 15:10:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrhnM-0005bD-Kl; Thu, 19 May 2022 15:10:32 +0000 Received: by outflank-mailman (input) for mailman id 333121; Thu, 19 May 2022 15:10:32 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nrhnL-0004Db-S0 for win-pv-devel@lists.xenproject.org; Thu, 19 May 2022 15:10:32 +0000 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [2a00:1450:4864:20::435]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d261ec32-d785-11ec-837e-e5687231ffcc; Thu, 19 May 2022 17:10:31 +0200 (CEST) Received: by mail-wr1-x435.google.com with SMTP id w4so7572699wrg.12 for ; Thu, 19 May 2022 08:10:30 -0700 (PDT) Received: from ?IPV6:2a00:23c5:5785:9a01:1d46:e89c:6dee:a0de? ([2a00:23c5:5785:9a01:1d46:e89c:6dee:a0de]) by smtp.gmail.com with ESMTPSA id v13-20020a5d4b0d000000b0020c5253d8e0sm5145526wrq.44.2022.05.19.08.10.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 08:10:29 -0700 (PDT) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: d261ec32-d785-11ec-837e-e5687231ffcc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Gu+YIuYMv1uFr00/I/+c09ANaQt1ec5jVl54QvtW/20=; b=ZDTJweSOvLB5Sprv2CIVa1aNw+LbZwg1uHWBStxQ5afTZYmC5dXFWAECS9tTRlTiV/ v9zvGqa7MunKH3ThpZjl5SADzd9Tk1lxt21tt2OYnZK/hvea+5E+ZUWLZaqIZ2JTj37h HIS08nahPJ6i2qwcttxDiSgiB5vouI9bx9cNE85IF2nL3XK6NqY3b2rjEqv3gkFPnwmo I5Ok2NQHOrFpNCMYQL1Lc3tDexwtbHK9Q8HFdsGwCm6wukHiJvMfRibg16aO1GOBwM6T j7ECc44LywVNvYJtoLOp6/QLC9wdpeR7N8no7J3W5RQRpmZF2jqShTPI4NqeMVHQZwSD KFtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Gu+YIuYMv1uFr00/I/+c09ANaQt1ec5jVl54QvtW/20=; b=wykUIkIKoKKHlofge/wkbUP39LTR+EHR9z6eP21SBr7+P//G6b/kZWPHtBAAZSZHDS 6mAM/NfdJYieLfKrPOCTu0HrWL2S+XavFColSoiVL8ur4619l0aFtPjqqkbQXjbHVSLK RdqLrHHCBuileDho2ZwWLaxS8C02I1kwB7HTv0d0ysJYrqnbSjTV0TUlDovON2UA/aIl lUuoa7KjvGPSXUXfUZ6JoP7P0VOI7I9EbXYEfhm+YNEv9Ikwl83yiSKax7h7sIH/wPBt RqDzc12+9rph4oYROL/S1DUXLbOWESFEUgfk4YZz+HEYK93LuSH0DKqau/caFwAD9eZV eBSA== X-Gm-Message-State: AOAM532ZB1aj1DXwApQuHi3nZ3ZBfp4OE7FVkgp2NnF0bTukvn/jLuNB +fJAEXF4A0DrmIF5bSxmu3WzfKB8R7HzrA== X-Google-Smtp-Source: ABdhPJylMcc3OEeZUywDSqIfblldeqPnas9Rn3c9x6TI8LeKVNAONiSw3asofcvqYgmVhrxCNS56yA== X-Received: by 2002:adf:ffd2:0:b0:20e:60ec:c37b with SMTP id x18-20020adfffd2000000b0020e60ecc37bmr4538052wrs.348.1652973029868; Thu, 19 May 2022 08:10:29 -0700 (PDT) Message-ID: Date: Thu, 19 May 2022 16:10:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Reply-To: paul@xen.org Subject: Re: [PATCH 2/2] Remove varargs from AdapterVifCallback. Content-Language: en-US To: win-pv-devel@lists.xenproject.org References: <20220513102445.1413-1-Martin.Harvey@citrix.com> <20220513102445.1413-2-Martin.Harvey@citrix.com> <28286867-960b-e598-00ba-2ea1c90ce85f@gmail.com> From: "Durrant, Paul" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/05/2022 15:37, Martin Harvey wrote: > > >> -----Original Message----- >> From: win-pv-devel On Behalf Of Durrant, Paul >> Sent: 19 May 2022 13:54 >> To: win-pv-devel@lists.xenproject.org >> Subject: Re: [PATCH 2/2] Remove varargs from AdapterVifCallback. >> >>> -/* V9 is exactly the same as V8 */ >>> -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE_V9; > >> No, you can't do that. The point of the versioning is that we make no incompatible change. You need to introduce v9 in its final form. > > OK. I have submitted two patches in the series in order to give you a choice - as I will explain: > > 1) I assume you have noted the "-", to indicate that that these lines are present after applying one of the two patches, but not both. > > 2) Would you like V9 to be just the interface as it is after [1/2] has been applied to both xenvif and xennet (keep varargs), or as it is after both patches have been applied to both xenvif and xennet. > > 3) I talked this thru with owen and we agree that the interface changes and version bump for the interface and associated ID's should happen in one atomic patch / change to the codebase. In which case, I should probably just be submitting one patch. However, I have submitted it in two halves because I don't know whether you want the varargs changes or not. > > 4) If we don't remove varargs (1 of 2 patches on both), I *have* to update the version number, because the interfaces are not binary compatible. However, the function prototypes for all the calls are, because the difference is hidden away in varargs, hence the definition. > > So, going back to previous points: > > 1) Would you like one or both? I think we can have both. Let's have the infrastructure for the back-pressure in XENVIF first, but keep the same VIF interface for now (hence meaning no functional chang for the moment), noting in the commit comment that the new functionality will be used in a subsequent patch. Then do the interface change. The general convention is to add a '_V' to the end of anything you are superseding where the number is the version number which first saw that variant. As we have retired vif interface versions older than 6, I think you should rename: XENVIF_VIF_CALLBACK -> XENVIF_VIF_CALLBACK_V6 XENVIF_VIF_ENABLE -> XENVIF_VIF_ENABLE_V6 (and have it reference XENVIF_VIF_CALLBACK_V6 rather than XENVIF_VIF_CALLBACK) and then adjust the v6, v7 and v8 interface structs accordingly. In the same patch define new versions of XENVIF_VIF_CALLBACK and XENVIF_VIF_ENABLE for your v9 interface, and also your XENVIF_VIF_CALLBACK_PARAMS union which the new XENVIF_VIF_CALLBACK will reference. Hence the option of backpressure is now available. These patches then need to be verified with an unmodified xennet still acquiring v8 of the interface. Then update XENNET by copying the new header across into the repo and make use of the back-pressure... that can be done in one commit I think. Paul > 2) If only one, do you want me to declare a v9 interface which has an identical set of function calls (because the difference is hidden in varargs implementation)? > > MH. From win-pv-devel-bounces@lists.xenproject.org Fri May 20 14:14:44 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 20 May 2022 14:14:44 +0000 Received: from list by lists.xenproject.org with outflank-mailman.334284.558296 (Exim 4.92) (envelope-from ) id 1ns3Ot-0000L9-5G; Fri, 20 May 2022 14:14:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 334284.558296; Fri, 20 May 2022 14:14:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns3Ot-0000L2-2C; Fri, 20 May 2022 14:14:43 +0000 Received: by outflank-mailman (input) for mailman id 334284; Fri, 20 May 2022 14:14:42 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns3Os-0000Ks-2p for win-pv-devel@lists.xenproject.org; Fri, 20 May 2022 14:14:42 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2ec34afd-d847-11ec-bd2c-47488cf2e6aa; Fri, 20 May 2022 16:14:40 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 2ec34afd-d847-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1653056080; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=29ElnPpE4O/I1SDvLIKFxIeqOag5fnq+DV3pmXJWKi0=; b=IrNeYL4m+dyLluaR9XHZsOCkThJYfeR4oDgBMeKUl17OWCucffnlGc8M caK5sok22/3vqhif4qqxIgRU6OaQ8R7c/eE/9n0zeRS677OdBcxkOSnUl 4Eom5MVcZK3Y8K9TARw3NcrAzlUCtuEL5oi0d1AkYMIW4Ig2+1lSo83Iv k=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 71653473 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:QYRWcKDCzkDFRxVW/27jw5YqxClBgxIJ4kV8jS/XYbTApD923zRWn WUbW2mFO/eKYzf1edp0O9++8RwEvMLVn9dlQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHGeIdA970Ug5w7Nj2tYx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPgtz o1RjMHgVTt2J4rntLoCEBJjOjlXaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwmJdP3PYVZunh60zzIJf0nXYrCU+PB4towMDIY2ZkQQK2CO JFxhTxHUxifbAVgJnUrBrECuaSrmCenURIIkQfAzUYwyzeKl1EguFT3C/LKe9rPXdsQkkuGq 2bu+2XiHgpcJNGZ0SCC8H+nmqnIhyyTZW4JPOTmrLgw2gTVnzFNTk1NPbemnRWnohK4A85md hwIxnU3ioMeqlPoReLURzTt9RZooSUgt8ps//wSsV/QkfKNu1jFWQDoXRYaNoV46ZZeqSgCk wbQwoi3XWEHXKi9Eyr1y1uCkd+l1cH5x0cmbDRMcwYK6sKLTGob3kOWFYYL/EJYY7TI9dDML 9Oi9nFWa00715Jj6klC1Qmvb8iQjpbIVBUpwQ7cQ3io6Ah0DKb8OdHyuQmLvagZd9jDJrVkg JTjs5HBhN3i8LnXzHDdKAnzNOzBCwm53M303gc0QshJG8WF8H+/Z4FAiAyS128wWvvojQTBO ReJ0SsIvcc7FCLzMcdfPtLgY+x3nPOIPYm0CZjpgi9mP8EZmPmvp3o1OyZ9HgnFzSARrE3IE czAIZr8UyxLVvgPIfjfb7517ILHDxsWnQv7La0XBTz9uVZCTBZ5kYs4DWY= IronPort-HdrOrdr: A9a23:elcP86rdyOOhYWiLPLrJ8a8aV5opeYIsimQD101hICG9JPbo8P xG78576faUslkssR4b9exoVJPrfZqYz+8X3WBzB9yftWvd2FdARbsKhbcKgQeQeREWndQtsZ uIBpIObeEYY2IWsS6yijPXL+od X-IronPort-AV: E=Sophos;i="5.91,239,1647316800"; d="scan'208";a="71653473" From: Martin Harvey To: CC: Martin Harvey , Martin Harvey Subject: [PATCH 2/2] Rate limit per DPC using both xenvif and xennet. Date: Fri, 20 May 2022 15:14:16 +0100 Message-ID: <20220520141416.833-2-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 In-Reply-To: <20220520141416.833-1-Martin.Harvey@citrix.com> References: <20220520141416.833-1-Martin.Harvey@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Further development of rate limiting code, whereby both xenvif and xennet co-operate across the VIF interface to decide how many packets to push up the stack. This allows for the situation where NDIS could provide information at upstream push time about how many more packets it is prepared to accept in this DPC. Signed-off-by: Martin Harvey --- include/revision.h | 3 +- include/vif_interface.h | 103 ++++++++++++++++++-- src/xenvif/receiver.c | 15 +-- src/xenvif/vif.c | 209 ++++++++++++++++++++++++++++++++++------ src/xenvif/vif.h | 2 +- 5 files changed, 285 insertions(+), 47 deletions(-) diff --git a/include/revision.h b/include/revision.h index 39476b2..475700d 100644 --- a/include/revision.h +++ b/include/revision.h @@ -44,6 +44,7 @@ DEFINE_REVISION(0x0800000C, 1, 7, 2, 1), \ DEFINE_REVISION(0x0800000D, 1, 8, 2, 1), \ DEFINE_REVISION(0x09000000, 1, 8, 2, 1), \ - DEFINE_REVISION(0x09000001, 2, 8, 2, 1) + DEFINE_REVISION(0x09000001, 2, 8, 2, 1), \ + DEFINE_REVISION(0x09000002, 2, 9, 2, 1) #endif // _REVISION_H diff --git a/include/vif_interface.h b/include/vif_interface.h index 20de314..7056783 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -408,7 +408,7 @@ typedef VOID IN PINTERFACE Interface ); -/*! \typedef XENVIF_VIF_CALLBACK +/*! \typedef XENVIF_VIF_CALLBACK_V6 \brief Provider to subscriber callback function \param Argument An optional context argument passed to the callback @@ -436,13 +436,72 @@ typedef VOID No additional arguments */ typedef VOID -(*XENVIF_VIF_CALLBACK)( +(*XENVIF_VIF_CALLBACK_V6)( IN PVOID Argument OPTIONAL, IN XENVIF_VIF_CALLBACK_TYPE Type, ... ); -/*! \typedef XENVIF_VIF_ENABLE +/*! \typedef XENVIF_VIF_ENABLE_V6 + \brief Enable the VIF interface + + All packets queued for transmit will be rejected and no packets will + be queued for receive until this method completes. + + \param Interface The interface header + \param Callback The subscriber's callback function + \param Argument An optional context argument passed to the callback +*/ +typedef NTSTATUS +(*XENVIF_VIF_ENABLE_V6)( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK_V6 Callback, + IN PVOID Argument OPTIONAL + ); + + +typedef union _XENVIF_VIF_CALLBACK_PARAMS { + struct _XENVIF_VIF_CALLBACK_RETURN_PACKET_PARAMS { + PVOID Cookie; + PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; + } ReturnPacketParams; + struct _XENVIF_VIF_CALLBACK_QUEUE_PACKET_PARAMS { + ULONG Index; + PMDL Mdl; + ULONG Offset; + ULONG Length; + XENVIF_PACKET_CHECKSUM_FLAGS Flags; + USHORT MaximumSegmentSize; + USHORT TagControlInformation; + PXENVIF_PACKET_INFO Info; + PXENVIF_PACKET_HASH Hash; + BOOLEAN More; + PVOID Cookie; + PBOOLEAN NdisFinished; + } QueuePacketParams; + /* + struct _XENVIF_VIF_CALLBACK_STATE_CHANGE_PARAMS { + No parameters here + } StateChangeParams; + */ +} XENVIF_VIF_CALLBACK_PARAMS, *PXENVIF_VIF_CALLBACK_PARAMS; + +/*! \typedef XENVIF_VIF_CALLBACK + \brief Provider to subscriber callback function + + \param Argument An optional context argument passed to the callback + \param Type The callback type + \param Params Additional paramaters required by \a Type +*/ + +typedef VOID +(*XENVIF_VIF_CALLBACK)( + IN PVOID Argument OPTIONAL, + IN XENVIF_VIF_CALLBACK_TYPE Type, + IN PXENVIF_VIF_CALLBACK_PARAMS Params + ); + +/*! \typedef XENVIF_VIF_ENABLE_V6 \brief Enable the VIF interface All packets queued for transmit will be rejected and no packets will @@ -834,7 +893,7 @@ struct _XENVIF_VIF_INTERFACE_V6 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_V6 Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -868,7 +927,7 @@ struct _XENVIF_VIF_INTERFACE_V7 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_V6 Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -899,6 +958,36 @@ struct _XENVIF_VIF_INTERFACE_V7 { \ingroup interfaces */ struct _XENVIF_VIF_INTERFACE_V8 { + INTERFACE Interface; + XENVIF_VIF_ACQUIRE Acquire; + XENVIF_VIF_RELEASE Release; + XENVIF_VIF_ENABLE_V6 Enable; + XENVIF_VIF_DISABLE Disable; + XENVIF_VIF_QUERY_STATISTIC QueryStatistic; + XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; + XENVIF_VIF_UPDATE_HASH_MAPPING UpdateHashMapping; + XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; + XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; + XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; + XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; + XENVIF_VIF_RECEIVER_SET_HASH_ALGORITHM ReceiverSetHashAlgorithm; + XENVIF_VIF_RECEIVER_QUERY_HASH_CAPABILITIES ReceiverQueryHashCapabilities; + XENVIF_VIF_RECEIVER_UPDATE_HASH_PARAMETERS ReceiverUpdateHashParameters; + XENVIF_VIF_TRANSMITTER_QUEUE_PACKET TransmitterQueuePacket; + XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; + XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; + XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; + XENVIF_VIF_MAC_QUERY_STATE MacQueryState; + XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; + XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; + XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; + XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; + XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; + XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; + XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; +}; + +struct _XENVIF_VIF_INTERFACE_V9 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; @@ -928,7 +1017,7 @@ struct _XENVIF_VIF_INTERFACE_V8 { XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; }; -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; +typedef struct _XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; /*! \def XENVIF_VIF \brief Macro at assist in method invocation @@ -939,6 +1028,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER #endif // _WINDLL #define XENVIF_VIF_INTERFACE_VERSION_MIN 6 -#define XENVIF_VIF_INTERFACE_VERSION_MAX 8 +#define XENVIF_VIF_INTERFACE_VERSION_MAX 9 #endif // _XENVIF_INTERFACE_H diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c index f8bfdd4..0c1be81 100644 --- a/src/xenvif/receiver.c +++ b/src/xenvif/receiver.c @@ -150,8 +150,6 @@ struct _XENVIF_RECEIVER { #define XENVIF_RECEIVER_TAG 'ECER' -#define RX_BUFFERING_MAX 2048 // X-ref XenNet IN_NDIS_MAX (half in NDIS half elsewhere) - static FORCEINLINE PVOID __ReceiverAllocate( IN ULONG Length @@ -1343,13 +1341,13 @@ __ReceiverRingSwizzle( LIST_ENTRY List; PLIST_ENTRY ListEntry; BOOLEAN AllFlushed; - ULONG PushedUpstream; + BOOLEAN NdisFinishedBatch; Receiver = Ring->Receiver; Frontend = Receiver->Frontend; Context = PdoGetVifContext(FrontendGetPdo(Frontend)); AllFlushed = TRUE; - PushedUpstream = 0; + NdisFinishedBatch = FALSE; InitializeListHead(&List); @@ -1388,7 +1386,7 @@ __ReceiverRingSwizzle( } while (!IsListEmpty(&Ring->PacketComplete) && - ((PushedUpstream < RX_BUFFERING_MAX) || Ring->FinalFlush)) { + (!NdisFinishedBatch || Ring->FinalFlush)) { PXENVIF_RECEIVER_PACKET Packet; PXENVIF_PACKET_INFO Info; PUCHAR BaseVa; @@ -1396,8 +1394,6 @@ __ReceiverRingSwizzle( PETHERNET_ADDRESS DestinationAddress; ETHERNET_ADDRESS_TYPE Type; - PushedUpstream++; - ListEntry = RemoveHeadList(&Ring->PacketComplete); ASSERT3P(ListEntry, !=, &Ring->PacketComplete); @@ -1543,7 +1539,7 @@ __ReceiverRingSwizzle( (VOID) InterlockedIncrement(&Receiver->Loaned); - VifReceiverQueuePacket(Context, + NdisFinishedBatch = VifReceiverQueuePacket(Context, Ring->Index, &Packet->Mdl, Packet->Offset, @@ -1553,8 +1549,7 @@ __ReceiverRingSwizzle( Packet->TagControlInformation, &Packet->Info, &Packet->Hash, - ((!IsListEmpty(&Ring->PacketComplete)) && - ((PushedUpstream < RX_BUFFERING_MAX) || Ring->FinalFlush)) ? TRUE : FALSE, + !IsListEmpty(&Ring->PacketComplete), /* Keep this in - resets counts in xennet */ Packet); } diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c index 69ced78..4aeb709 100644 --- a/src/xenvif/vif.c +++ b/src/xenvif/vif.c @@ -51,6 +51,7 @@ struct _XENVIF_VIF_CONTEXT { PXENVIF_FRONTEND Frontend; BOOLEAN Enabled; ULONG Version; + XENVIF_VIF_CALLBACK_V6 CallbackV6; XENVIF_VIF_CALLBACK Callback; PVOID Argument; PXENVIF_THREAD MacThread; @@ -106,8 +107,19 @@ VifMac( break; if (Context->Enabled) - Context->Callback(Context->Argument, - XENVIF_MAC_STATE_CHANGE); + { + if (Context->Version < 9) { + Context->CallbackV6(Context->Argument, + XENVIF_MAC_STATE_CHANGE); + } else { + XENVIF_VIF_CALLBACK_PARAMS Params; + + RtlZeroMemory(&Params, sizeof(Params)); + Context->Callback(Context->Argument, + XENVIF_MAC_STATE_CHANGE, + &Params); + } + } KeSetEvent(&Context->MacEvent, IO_NO_INCREMENT, FALSE); } @@ -138,10 +150,11 @@ VifSuspendCallbackLate( } static NTSTATUS -VifEnable( +VifEnableCommon( IN PINTERFACE Interface, - IN XENVIF_VIF_CALLBACK Callback, - IN PVOID Argument + IN PVOID Callback, + IN PVOID Argument, + IN BOOLEAN Varargs ) { PXENVIF_VIF_CONTEXT Context = Interface->Context; @@ -157,7 +170,13 @@ VifEnable( if (Context->Enabled) goto done; - Context->Callback = Callback; + if (Varargs) { + Context->CallbackV6 = (XENVIF_VIF_CALLBACK_V6) Callback; + Context->Callback = NULL; + } else { + Context->CallbackV6 = NULL; + Context->Callback = (XENVIF_VIF_CALLBACK)Callback; + } Context->Argument = Argument; Context->Enabled = TRUE; @@ -226,6 +245,7 @@ fail1: KeMemoryBarrier(); Context->Argument = NULL; + Context->CallbackV6 = NULL; Context->Callback = NULL; if (Exclusive) @@ -236,6 +256,28 @@ fail1: return status; } +static FORCEINLINE NTSTATUS +VifEnableVarargs( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK_V6 Callback, + IN PVOID Argument + ) { + BUG_ON(Interface->Version >= 9); + + return VifEnableCommon(Interface, (PVOID)Callback, Argument, TRUE); +} + +static FORCEINLINE NTSTATUS +VifEnableParams( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK Callback, + IN PVOID Argument + ) { + BUG_ON(Interface->Version < 9); + + return VifEnableCommon(Interface, (PVOID)Callback, Argument, FALSE); +} + static VOID VifDisable( IN PINTERFACE Interface @@ -285,6 +327,7 @@ VifDisable( XENBUS_SUSPEND(Release, &Context->SuspendInterface); Context->Argument = NULL; + Context->CallbackV6 = NULL; Context->Callback = NULL; ReleaseMrswLockShared(&Context->Lock); @@ -832,7 +875,7 @@ static struct _XENVIF_VIF_INTERFACE_V6 VifInterfaceVersion6 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V6), 6, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableVarargs, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -862,7 +905,7 @@ static struct _XENVIF_VIF_INTERFACE_V7 VifInterfaceVersion7 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V7), 7, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableVarargs, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -892,7 +935,37 @@ static struct _XENVIF_VIF_INTERFACE_V8 VifInterfaceVersion8 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V8), 8, NULL, NULL, NULL }, VifAcquire, VifRelease, - VifEnable, + VifEnableVarargs, + VifDisable, + VifQueryStatistic, + VifQueryRingCount, + VifUpdateHashMapping, + VifReceiverReturnPacket, + VifReceiverSetOffloadOptions, + VifReceiverSetBackfillSize, + VifReceiverQueryRingSize, + VifReceiverSetHashAlgorithm, + VifReceiverQueryHashCapabilities, + VifReceiverUpdateHashParameters, + VifTransmitterQueuePacket, + VifTransmitterQueryOffloadOptions, + VifTransmitterQueryLargePacketSize, + VifTransmitterQueryRingSize, + VifMacQueryState, + VifMacQueryMaximumFrameSize, + VifMacQueryPermanentAddress, + VifMacQueryCurrentAddress, + VifMacQueryMulticastAddresses, + VifMacSetMulticastAddresses, + VifMacSetFilterLevel, + VifMacQueryFilterLevel +}; + +static struct _XENVIF_VIF_INTERFACE_V9 VifInterfaceVersion9 = { + { sizeof (struct _XENVIF_VIF_INTERFACE_V9), 9, NULL, NULL, NULL }, + VifAcquire, + VifRelease, + VifEnableParams, VifDisable, VifQueryStatistic, VifQueryRingCount, @@ -1033,6 +1106,23 @@ VifGetInterface( status = STATUS_SUCCESS; break; } + case 9: { + struct _XENVIF_VIF_INTERFACE_V9 *VifInterface; + + VifInterface = (struct _XENVIF_VIF_INTERFACE_V9 *)Interface; + + status = STATUS_BUFFER_OVERFLOW; + if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V9)) + break; + + *VifInterface = VifInterfaceVersion9; + + ASSERT3U(Interface->Version, ==, Version); + Interface->Context = Context; + + status = STATUS_SUCCESS; + break; + } default: status = STATUS_NOT_SUPPORTED; break; @@ -1087,7 +1177,7 @@ __VifReceiverQueuePacketVersion6( UNREFERENCED_PARAMETER(Index); UNREFERENCED_PARAMETER(More); - Context->Callback(Context->Argument, + Context->CallbackV6(Context->Argument, XENVIF_RECEIVER_QUEUE_PACKET, Mdl, Offset, @@ -1118,7 +1208,7 @@ __VifReceiverQueuePacketVersion7( { UNREFERENCED_PARAMETER(Index); - Context->Callback(Context->Argument, + Context->CallbackV6(Context->Argument, XENVIF_RECEIVER_QUEUE_PACKET, Mdl, Offset, @@ -1133,7 +1223,7 @@ __VifReceiverQueuePacketVersion7( } static FORCEINLINE VOID -__VifReceiverQueuePacket( +__VifReceiverQueuePacketVersion8( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, IN PMDL Mdl, @@ -1148,7 +1238,7 @@ __VifReceiverQueuePacket( IN PVOID Cookie ) { - Context->Callback(Context->Argument, + Context->CallbackV6(Context->Argument, XENVIF_RECEIVER_QUEUE_PACKET, Index, Mdl, @@ -1164,7 +1254,48 @@ __VifReceiverQueuePacket( } -VOID +static FORCEINLINE BOOLEAN +__VifReceiverQueuePacket( + IN PXENVIF_VIF_CONTEXT Context, + IN ULONG Index, + IN PMDL Mdl, + IN ULONG Offset, + IN ULONG Length, + IN XENVIF_PACKET_CHECKSUM_FLAGS Flags, + IN USHORT MaximumSegmentSize, + IN USHORT TagControlInformation, + IN PXENVIF_PACKET_INFO Info, + IN PXENVIF_PACKET_HASH Hash, + IN BOOLEAN More, + IN PVOID Cookie + ) +{ + XENVIF_VIF_CALLBACK_PARAMS Params; + BOOLEAN Finished = FALSE; + + RtlZeroMemory(&Params, sizeof(Params)); + + Params.QueuePacketParams.Index = Index; + Params.QueuePacketParams.Mdl = Mdl; + Params.QueuePacketParams.Offset = Offset; + Params.QueuePacketParams.Length = Length; + Params.QueuePacketParams.Flags = Flags; + Params.QueuePacketParams.MaximumSegmentSize = MaximumSegmentSize; + Params.QueuePacketParams.TagControlInformation = TagControlInformation; + Params.QueuePacketParams.Info = Info; + Params.QueuePacketParams.Hash = Hash; + Params.QueuePacketParams.More = More; + Params.QueuePacketParams.Cookie = Cookie; + Params.QueuePacketParams.NdisFinished = &Finished; + + Context->Callback(Context->Argument, + XENVIF_RECEIVER_QUEUE_PACKET, + &Params); + return Finished; +} + + +BOOLEAN /* Returns NDIS finished batch for this DPC */ VifReceiverQueuePacket( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, @@ -1181,6 +1312,7 @@ VifReceiverQueuePacket( ) { KIRQL Irql; + BOOLEAN Finished = FALSE; KeRaiseIrql(DISPATCH_LEVEL, &Irql); @@ -1216,7 +1348,22 @@ VifReceiverQueuePacket( break; case 8: - __VifReceiverQueuePacket(Context, + __VifReceiverQueuePacketVersion8(Context, + Index, + Mdl, + Offset, + Length, + Flags, + MaximumSegmentSize, + TagControlInformation, + Info, + Hash, + More, + Cookie); + break; + + case 9: + Finished = __VifReceiverQueuePacket(Context, Index, Mdl, Offset, @@ -1236,6 +1383,8 @@ VifReceiverQueuePacket( } KeLowerIrql(Irql); + + return Finished; } VOID @@ -1245,20 +1394,24 @@ VifTransmitterReturnPacket( IN PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion ) { - switch (Context->Version) { - case 6: - case 7: - case 8: - Context->Callback(Context->Argument, - XENVIF_TRANSMITTER_RETURN_PACKET, - Cookie, - Completion); - break; + BUG_ON(Context->Version < 6); - default: - ASSERT(FALSE); - break; - } + if (Context->Version < 9) { + Context->CallbackV6(Context->Argument, + XENVIF_TRANSMITTER_RETURN_PACKET, + Cookie, + Completion); + } else { + XENVIF_VIF_CALLBACK_PARAMS Params; + + RtlZeroMemory(&Params, sizeof(Params)); + Params.ReturnPacketParams.Cookie = Cookie; + Params.ReturnPacketParams.Completion = Completion; + + Context->Callback(Context->Argument, + XENVIF_TRANSMITTER_RETURN_PACKET, + &Params); + } } PXENVIF_THREAD diff --git a/src/xenvif/vif.h b/src/xenvif/vif.h index b83a767..054cef1 100644 --- a/src/xenvif/vif.h +++ b/src/xenvif/vif.h @@ -62,7 +62,7 @@ VifTeardown( // CALLBACKS -extern VOID +extern BOOLEAN VifReceiverQueuePacket( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, -- 2.25.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 20 14:14:46 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 20 May 2022 14:14:46 +0000 Received: from list by lists.xenproject.org with outflank-mailman.334285.558300 (Exim 4.92) (envelope-from ) id 1ns3Ow-0000ND-6j; Fri, 20 May 2022 14:14:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 334285.558300; Fri, 20 May 2022 14:14:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns3Ow-0000N6-3z; Fri, 20 May 2022 14:14:46 +0000 Received: by outflank-mailman (input) for mailman id 334285; Fri, 20 May 2022 14:14:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns3Ov-0000Mw-HN for win-pv-devel@lists.xenproject.org; Fri, 20 May 2022 14:14:45 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 28cbd62f-d847-11ec-837e-e5687231ffcc; Fri, 20 May 2022 16:14:30 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 28cbd62f-d847-11ec-837e-e5687231ffcc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1653056083; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=R8x7O53tKcUl4AZE5xIHnBWhEU0gZF6aaV/pKKmHxYE=; b=KmLBC+A6abHG5K0iFto1bfgx7wQxgZRJD2eyzP1lUNJbBwuzm4mpMHQq 9iF2PVttEtVxn99HA/Fz2inQ+/0HbY2wbUv54iOV0dM5DJQmKHEMUe77I d1B0eDjBsBzZBiqY7q2cMC+BGsKq+RHJC8AK7klblJRp2hO9nh6WFGLlL o=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 74313182 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:cGRApa1/5aiUgr5JUvbD5ZRxkn2cJEfYwER7XKvMYLTBsI5bpzUAm GNJW27UOK6NYjCgeYh1ad7g/EoCvJbXmoJqTFFqpC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkjk7xdOCn9xGQ7InQLlbGILes1htZGEk1EU/NtTo5w7Rj2tMy2YDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1pvIfuWRoVZpSdhccCfj5oGHhAMpB/reqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHuNZkDu3cmzTjDE/s3aZvCX7/L9ZlT2zJYasVmQqqFP pFAOWAHgBLoMh5hIFw5BMIEx8iXilvbSBkIr1i/nP9ii4TU5FMoi+W8WDbPQfSVRMMQhljdq m/Y8mDRBhABKMfZ2TeD6mirhOLEgWX8Qo16KVGj3qc02hvJnDVVUUBIEwvgyRWktqKgc/ZWM BIE5xZ2lPkv11OGaen2BiO3nUfR63bwROFs//0GBBClk/SJuF7AXjZYEVate/R96pZoGGVCO kuh2oqwWGcx6OD9pWe1rO/8kN+kBcQCwYbujwcgRBBN3dTsqZpbYvnnHoc6S/7dYjEY9FjNL 9G2QMsW3ex7YTYjjfnTwLw+q2vESmL1ZgA0/B7LeWmu8xl0YoWoD6TxtwWBvacQfNjAFQfb1 JThpyR5xLlRZaxhaQTXGLlddF1Xz6vt3MLgba5HQMB6qmXFF4+LdoFM+jBuTHqFwe5dEQIFl HT74FsLjLcKZSPCRfYuP+qZVpR7pYC9RI+Nfq2FMbJzjm1ZKVbvENdGPhXLgQgAUSEEzMkCB HtsWZ33XSpKV/42k2beqiV0+eZD+x3SDFj7HfjTpylLG5LFDJJJYd/p6GezU90= IronPort-HdrOrdr: A9a23:3znjA6DqnTpzMLzlHemm55DYdb4zR+YMi2TC1yhKJiC9Ffbo8v xG/c5rsiMc5wxxZJhNo7290cq7MBHhHPxOgbX5VI3KNGKNhILBFvAH0WKI+VPd8kPFmtK1rZ 0QEJRDNA== X-IronPort-AV: E=Sophos;i="5.91,239,1647316800"; d="scan'208";a="74313182" From: Martin Harvey To: CC: Owen Smith , Martin Harvey Subject: [PATCH 1/2] Rate limit per DPC in Xenvif only. Date: Fri, 20 May 2022 15:14:15 +0100 Message-ID: <20220520141416.833-1-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain From: Owen Smith Change the receive algorithm, such that, for any particular receive DPC, only a fixed number of packets can be pushed up the stack. Under higher load conditions, another DPC is scheduled to process the remainder before any more packets are removed from the descriptor ring. This functionality currently local to xenvif. A more complete solution, where xennet determines when to finish a batch of packets will be included in a subsequent patch. Signed-off-by: Martin Harvey Ported-by: Owen Smith --- src/xenvif/receiver.c | 82 ++++++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 21 deletions(-) diff --git a/src/xenvif/receiver.c b/src/xenvif/receiver.c index 505505e..f8bfdd4 100644 --- a/src/xenvif/receiver.c +++ b/src/xenvif/receiver.c @@ -99,6 +99,8 @@ typedef struct _XENVIF_RECEIVER_RING { BOOLEAN Connected; BOOLEAN Enabled; BOOLEAN Stopped; + BOOLEAN Backpressured; + BOOLEAN FinalFlush; XENVIF_VIF_OFFLOAD_OPTIONS OffloadOptions; ULONG BackfillSize; PXENBUS_DEBUG_CALLBACK DebugCallback; @@ -148,6 +150,8 @@ struct _XENVIF_RECEIVER { #define XENVIF_RECEIVER_TAG 'ECER' +#define RX_BUFFERING_MAX 2048 // X-ref XenNet IN_NDIS_MAX (half in NDIS half elsewhere) + static FORCEINLINE PVOID __ReceiverAllocate( IN ULONG Length @@ -1338,43 +1342,53 @@ __ReceiverRingSwizzle( PXENVIF_VIF_CONTEXT Context; LIST_ENTRY List; PLIST_ENTRY ListEntry; + BOOLEAN AllFlushed; + ULONG PushedUpstream; Receiver = Ring->Receiver; Frontend = Receiver->Frontend; Context = PdoGetVifContext(FrontendGetPdo(Frontend)); + AllFlushed = TRUE; + PushedUpstream = 0; InitializeListHead(&List); - ListEntry = InterlockedExchangePointer(&Ring->PacketQueue, NULL); + if (IsListEmpty(&Ring->PacketComplete) || Ring->FinalFlush) + { + ListEntry = InterlockedExchangePointer(&Ring->PacketQueue, NULL); - // Packets are held in the queue in reverse order so that the most - // recent is always head of the list. This is necessary to allow - // addition to the list to be done atomically. + // Packets are held in the queue in reverse order so that the most + // recent is always head of the list. This is necessary to allow + // addition to the list to be done atomically. - while (ListEntry != NULL) { - PLIST_ENTRY NextEntry; + while (ListEntry != NULL) { + PLIST_ENTRY NextEntry; - NextEntry = ListEntry->Blink; - ListEntry->Flink = ListEntry->Blink = ListEntry; + NextEntry = ListEntry->Blink; + ListEntry->Flink = ListEntry->Blink = ListEntry; - InsertHeadList(&List, ListEntry); + InsertHeadList(&List, ListEntry); - ListEntry = NextEntry; - } + ListEntry = NextEntry; + } - while (!IsListEmpty(&List)) { - PXENVIF_RECEIVER_PACKET Packet; + while (!IsListEmpty(&List)) { + PXENVIF_RECEIVER_PACKET Packet; - ListEntry = RemoveHeadList(&List); - ASSERT3P(ListEntry, !=, &List); + ListEntry = RemoveHeadList(&List); + ASSERT3P(ListEntry, !=, &List); - RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY)); + RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY)); - Packet = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_PACKET, ListEntry); - ReceiverRingProcessPacket(Ring, Packet); + Packet = CONTAINING_RECORD(ListEntry, XENVIF_RECEIVER_PACKET, ListEntry); + ReceiverRingProcessPacket(Ring, Packet); + } + } else { + AllFlushed = FALSE; } - while (!IsListEmpty(&Ring->PacketComplete)) { + while (!IsListEmpty(&Ring->PacketComplete) && + ((PushedUpstream < RX_BUFFERING_MAX) || Ring->FinalFlush)) { PXENVIF_RECEIVER_PACKET Packet; PXENVIF_PACKET_INFO Info; PUCHAR BaseVa; @@ -1382,6 +1396,8 @@ __ReceiverRingSwizzle( PETHERNET_ADDRESS DestinationAddress; ETHERNET_ADDRESS_TYPE Type; + PushedUpstream++; + ListEntry = RemoveHeadList(&Ring->PacketComplete); ASSERT3P(ListEntry, !=, &Ring->PacketComplete); @@ -1537,9 +1553,29 @@ __ReceiverRingSwizzle( Packet->TagControlInformation, &Packet->Info, &Packet->Hash, - !IsListEmpty(&Ring->PacketComplete) ? TRUE : FALSE, + ((!IsListEmpty(&Ring->PacketComplete)) && + ((PushedUpstream < RX_BUFFERING_MAX) || Ring->FinalFlush)) ? TRUE : FALSE, Packet); } + + if (!IsListEmpty(&Ring->PacketComplete)) + AllFlushed = FALSE; + + if (!AllFlushed) { + //Re-run remainder from back of DPC queue. + Ring->Backpressured = TRUE; + if (KeInsertQueueDpc(&Ring->QueueDpc, NULL, NULL)) + Ring->QueueDpcs++; + } else { + if ((Ring->Backpressured) && !Ring->FinalFlush) { + //Not any more - restart dataflow from initial ring poll. + Ring->Backpressured = FALSE; + + //PollDpc zeroed before final flush, don't queue it here. + if (KeInsertQueueDpc(&Ring->PollDpc, NULL, NULL)) + Ring->PollDpcs++; + } + } } static FORCEINLINE VOID @@ -1990,7 +2026,7 @@ ReceiverRingPoll( Count = 0; - if (!Ring->Enabled) + if (!Ring->Enabled || (Ring->Backpressured && !Ring->FinalFlush)) goto done; for (;;) { @@ -2963,8 +2999,12 @@ __ReceiverRingTeardown( Ring->BackfillSize = 0; Ring->OffloadOptions.Value = 0; + Ring->FinalFlush = TRUE; + KeInsertQueueDpc(&Ring->QueueDpc, NULL, NULL); KeFlushQueuedDpcs(); RtlZeroMemory(&Ring->QueueDpc, sizeof (KDPC)); + Ring->Backpressured = FALSE; + Ring->FinalFlush = FALSE; ThreadAlert(Ring->WatchdogThread); ThreadJoin(Ring->WatchdogThread); -- 2.25.0.windows.1 From win-pv-devel-bounces@lists.xenproject.org Fri May 20 14:15:05 2022 Return-path: Envelope-to: archives@lists.xenproject.org Delivery-date: Fri, 20 May 2022 14:15:05 +0000 Received: from list by lists.xenproject.org with outflank-mailman.334293.558304 (Exim 4.92) (envelope-from ) id 1ns3PF-0000TI-AX; Fri, 20 May 2022 14:15:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 334293.558304; Fri, 20 May 2022 14:15:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns3PF-0000TB-6q; Fri, 20 May 2022 14:15:05 +0000 Received: by outflank-mailman (input) for mailman id 334293; Fri, 20 May 2022 14:15:04 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns3PD-0000Mw-WA for win-pv-devel@lists.xenproject.org; Fri, 20 May 2022 14:15:04 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 341eb90a-d847-11ec-837e-e5687231ffcc; Fri, 20 May 2022 16:14:48 +0200 (CEST) X-BeenThere: win-pv-devel@lists.xenproject.org List-Id: Developer list for the Windows PV Drivers subproject List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: win-pv-devel-bounces@lists.xenproject.org Precedence: list Sender: "win-pv-devel" X-Inumbo-ID: 341eb90a-d847-11ec-837e-e5687231ffcc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1653056102; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6PyKHy5R0z1duyhLyDPced950XPmfe8AlbyGo1QJhy8=; b=Bb9mgcTXL9MCMeMzqerP7mdig7SEV48rbFMJc02eFZ8Ssl7qziOE6RZV 7WFPpehSZCZxIC4grgk5nB6a5YDQ63YR4Pn7tYfuUJeLzSYFiyfepruY7 88braVsuapYmMxd9u7L+tZMLPW+wU7r/T2GSMY2+JDFxIPSGvTBFq3oC7 I=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 72193725 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:nYAQGKmV8CbCZKdDtgX8N0Xo5gzGJkRdPkR7XQ2eYbSJt1+Wr1Gzt xIaD2iAa/2KMzfweoh/aNjkpE4O7ZSGm9dkTAtp/no9QiMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EsLd9IR2NYy24DkWVvV4 LsenuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYUQkQOo3OlvgkcDphSghDLfMeqLzqPi3q2SCT5xWun3rExvxvCAc9PJEC+/YxCmZLn RAaAGlTNFbZ3bvwme/lDLk37iggBJCD0Ic3v3h60TDfS/YvW47OUo3B5MNC3Sd2jcdLdRrbT 5VDMGs0M06dC/FJElsqKpADl7qLuiDiKwxgtgzWirYR/FGGmWSd15CyaYGIK7RmX/59gUee4 3rYumj0HBweHNie0iaetGKhgPfVmiH2U55UE6e3nsOGm3XKmDZVUkdPEwLm/7/p0SZSRu6zN WQM9BMqjao86HWIbeCkdiCo/ibUvTMDDo84//IB1O2d9kbFy1/HWzNcF2YfNINOWNweHmJzi ALQ9z/9LXk26eDOFyrAnluBhWnqURX5O1PucsPtoeEtx9D46L8+gRvUJjqIOP7k14alcd0cL t3jkcTfu1nwpZRSv0lD1Qqb6w9AX7CQJuLP2i3ZX3i+8iRyb5O/aoqj5DDztKgddtbIHgnf5 SNawaByCdzi6rnUy0SwrBglRun1t55pzhWB6bKQI3XR32v0oCPyFWyhyDp/OF1oIq45lczBO SfuVfdqzMYLZhOCNPYvC6roUphC5fWwRLzNC6GPBvITM8cZSeNy1Hw3DaJm9zu2yxZEfGBWE crzTPtA+l5BUvQ7nGTsFrhBuVLprwhnrV7uqVnA50zP+dKjiLS9E9/p7HPmgjgF0Z65 IronPort-HdrOrdr: A9a23:f+Q62qhkScF2ML+fBRbfLy74DHBQXtYji2hC6mlwRA09TySZ// rBoB19726RtN9xYgBHpTnuAsm9qB/nmaKdgrNhWItKPjOW21dARbsKheCJrgEIcxeOkdK1vp 0AT0ERMrLN5CBB/KTH3DU= X-IronPort-AV: E=Sophos;i="5.91,239,1647316800"; d="scan'208";a="72193725" From: Martin Harvey To: CC: Martin Harvey , Martin Harvey Subject: [PATCH] Rate limit per DPC using both xenvif and xennet. Date: Fri, 20 May 2022 15:14:50 +0100 Message-ID: <20220520141450.121-1-Martin.Harvey@citrix.com> X-Mailer: git-send-email 2.25.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Further development of rate limiting code, whereby both xenvif and xennet co-operate across the VIF interface to decide how many packets to push up the stack. This allows for the situation where NDIS could provide information at upstream push time about how many more packets it is prepared to accept in this DPC. Signed-off-by: Martin Harvey --- include/vif_interface.h | 103 +++++++++++++++++++++++++++++++++++++--- src/xennet.inf | 6 +-- src/xennet/adapter.c | 64 ++++++------------------- src/xennet/receiver.c | 12 ++++- src/xennet/receiver.h | 3 +- 5 files changed, 126 insertions(+), 62 deletions(-) diff --git a/include/vif_interface.h b/include/vif_interface.h index 20de314..7056783 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -408,7 +408,7 @@ typedef VOID IN PINTERFACE Interface ); -/*! \typedef XENVIF_VIF_CALLBACK +/*! \typedef XENVIF_VIF_CALLBACK_V6 \brief Provider to subscriber callback function \param Argument An optional context argument passed to the callback @@ -436,13 +436,72 @@ typedef VOID No additional arguments */ typedef VOID -(*XENVIF_VIF_CALLBACK)( +(*XENVIF_VIF_CALLBACK_V6)( IN PVOID Argument OPTIONAL, IN XENVIF_VIF_CALLBACK_TYPE Type, ... ); -/*! \typedef XENVIF_VIF_ENABLE +/*! \typedef XENVIF_VIF_ENABLE_V6 + \brief Enable the VIF interface + + All packets queued for transmit will be rejected and no packets will + be queued for receive until this method completes. + + \param Interface The interface header + \param Callback The subscriber's callback function + \param Argument An optional context argument passed to the callback +*/ +typedef NTSTATUS +(*XENVIF_VIF_ENABLE_V6)( + IN PINTERFACE Interface, + IN XENVIF_VIF_CALLBACK_V6 Callback, + IN PVOID Argument OPTIONAL + ); + + +typedef union _XENVIF_VIF_CALLBACK_PARAMS { + struct _XENVIF_VIF_CALLBACK_RETURN_PACKET_PARAMS { + PVOID Cookie; + PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; + } ReturnPacketParams; + struct _XENVIF_VIF_CALLBACK_QUEUE_PACKET_PARAMS { + ULONG Index; + PMDL Mdl; + ULONG Offset; + ULONG Length; + XENVIF_PACKET_CHECKSUM_FLAGS Flags; + USHORT MaximumSegmentSize; + USHORT TagControlInformation; + PXENVIF_PACKET_INFO Info; + PXENVIF_PACKET_HASH Hash; + BOOLEAN More; + PVOID Cookie; + PBOOLEAN NdisFinished; + } QueuePacketParams; + /* + struct _XENVIF_VIF_CALLBACK_STATE_CHANGE_PARAMS { + No parameters here + } StateChangeParams; + */ +} XENVIF_VIF_CALLBACK_PARAMS, *PXENVIF_VIF_CALLBACK_PARAMS; + +/*! \typedef XENVIF_VIF_CALLBACK + \brief Provider to subscriber callback function + + \param Argument An optional context argument passed to the callback + \param Type The callback type + \param Params Additional paramaters required by \a Type +*/ + +typedef VOID +(*XENVIF_VIF_CALLBACK)( + IN PVOID Argument OPTIONAL, + IN XENVIF_VIF_CALLBACK_TYPE Type, + IN PXENVIF_VIF_CALLBACK_PARAMS Params + ); + +/*! \typedef XENVIF_VIF_ENABLE_V6 \brief Enable the VIF interface All packets queued for transmit will be rejected and no packets will @@ -834,7 +893,7 @@ struct _XENVIF_VIF_INTERFACE_V6 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_V6 Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -868,7 +927,7 @@ struct _XENVIF_VIF_INTERFACE_V7 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; + XENVIF_VIF_ENABLE_V6 Enable; XENVIF_VIF_DISABLE Disable; XENVIF_VIF_QUERY_STATISTIC QueryStatistic; XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; @@ -899,6 +958,36 @@ struct _XENVIF_VIF_INTERFACE_V7 { \ingroup interfaces */ struct _XENVIF_VIF_INTERFACE_V8 { + INTERFACE Interface; + XENVIF_VIF_ACQUIRE Acquire; + XENVIF_VIF_RELEASE Release; + XENVIF_VIF_ENABLE_V6 Enable; + XENVIF_VIF_DISABLE Disable; + XENVIF_VIF_QUERY_STATISTIC QueryStatistic; + XENVIF_VIF_QUERY_RING_COUNT QueryRingCount; + XENVIF_VIF_UPDATE_HASH_MAPPING UpdateHashMapping; + XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; + XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; + XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; + XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; + XENVIF_VIF_RECEIVER_SET_HASH_ALGORITHM ReceiverSetHashAlgorithm; + XENVIF_VIF_RECEIVER_QUERY_HASH_CAPABILITIES ReceiverQueryHashCapabilities; + XENVIF_VIF_RECEIVER_UPDATE_HASH_PARAMETERS ReceiverUpdateHashParameters; + XENVIF_VIF_TRANSMITTER_QUEUE_PACKET TransmitterQueuePacket; + XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; + XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; + XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; + XENVIF_VIF_MAC_QUERY_STATE MacQueryState; + XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; + XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; + XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; + XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; + XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; + XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; + XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; +}; + +struct _XENVIF_VIF_INTERFACE_V9 { INTERFACE Interface; XENVIF_VIF_ACQUIRE Acquire; XENVIF_VIF_RELEASE Release; @@ -928,7 +1017,7 @@ struct _XENVIF_VIF_INTERFACE_V8 { XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; }; -typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; +typedef struct _XENVIF_VIF_INTERFACE_V9 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTERFACE; /*! \def XENVIF_VIF \brief Macro at assist in method invocation @@ -939,6 +1028,6 @@ typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER #endif // _WINDLL #define XENVIF_VIF_INTERFACE_VERSION_MIN 6 -#define XENVIF_VIF_INTERFACE_VERSION_MAX 8 +#define XENVIF_VIF_INTERFACE_VERSION_MAX 9 #endif // _XENVIF_INTERFACE_H diff --git a/src/xennet.inf b/src/xennet.inf index c44f4af..58ea5d7 100644 --- a/src/xennet.inf +++ b/src/xennet.inf @@ -61,9 +61,9 @@ xennet_coinst_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dll ; DisplayName Section DeviceID ; ----------- ------- -------- -%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000001 -%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000001 -%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000001 +%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000002 +%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000002 +%XenNetName% =XenNet_Inst, XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000002 [XenNet_Inst] Characteristics=0x84 diff --git a/src/xennet/adapter.c b/src/xennet/adapter.c index 743cf35..9e8bebe 100644 --- a/src/xennet/adapter.c +++ b/src/xennet/adapter.c @@ -201,64 +201,32 @@ static VOID AdapterVifCallback( IN PVOID Context, IN XENVIF_VIF_CALLBACK_TYPE Type, - ... + IN PXENVIF_VIF_CALLBACK_PARAMS Params ) { PXENNET_ADAPTER Adapter = Context; - va_list Arguments; - - va_start(Arguments, Type); switch (Type) { case XENVIF_TRANSMITTER_RETURN_PACKET: { - PVOID Cookie; - PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; - - Cookie = va_arg(Arguments, PVOID); - Completion = va_arg(Arguments, PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO); - TransmitterReturnPacket(Adapter->Transmitter, - Cookie, - Completion); + Params->ReturnPacketParams.Cookie, + Params->ReturnPacketParams.Completion); break; } case XENVIF_RECEIVER_QUEUE_PACKET: { - ULONG Index; - PMDL Mdl; - ULONG Offset; - ULONG Length; - XENVIF_PACKET_CHECKSUM_FLAGS Flags; - USHORT MaximumSegmentSize; - USHORT TagControlInformation; - PXENVIF_PACKET_INFO Info; - PXENVIF_PACKET_HASH Hash; - BOOLEAN More; - PVOID Cookie; - - Index = va_arg(Arguments, ULONG); - Mdl = va_arg(Arguments, PMDL); - Offset = va_arg(Arguments, ULONG); - Length = va_arg(Arguments, ULONG); - Flags = va_arg(Arguments, XENVIF_PACKET_CHECKSUM_FLAGS); - MaximumSegmentSize = va_arg(Arguments, USHORT); - TagControlInformation = va_arg(Arguments, USHORT); - Info = va_arg(Arguments, PXENVIF_PACKET_INFO); - Hash = va_arg(Arguments, PXENVIF_PACKET_HASH); - More = va_arg(Arguments, BOOLEAN); - Cookie = va_arg(Arguments, PVOID); - ReceiverQueuePacket(Adapter->Receiver, - Index, - Mdl, - Offset, - Length, - Flags, - MaximumSegmentSize, - TagControlInformation, - Info, - Hash, - More, - Cookie); + Params->QueuePacketParams.Index, + Params->QueuePacketParams.Mdl, + Params->QueuePacketParams.Offset, + Params->QueuePacketParams.Length, + Params->QueuePacketParams.Flags, + Params->QueuePacketParams.MaximumSegmentSize, + Params->QueuePacketParams.TagControlInformation, + Params->QueuePacketParams.Info, + Params->QueuePacketParams.Hash, + Params->QueuePacketParams.More, + Params->QueuePacketParams.Cookie, + Params->QueuePacketParams.NdisFinished); break; } case XENVIF_MAC_STATE_CHANGE: { @@ -266,8 +234,6 @@ AdapterVifCallback( break; } } - - va_end(Arguments); } static VOID diff --git a/src/xennet/receiver.c b/src/xennet/receiver.c index 65527c5..d7a1e41 100644 --- a/src/xennet/receiver.c +++ b/src/xennet/receiver.c @@ -45,6 +45,7 @@ typedef struct _XENNET_RECEIVER_QUEUE { PNET_BUFFER_LIST Head; PNET_BUFFER_LIST Tail; ULONG Count; + ULONG SinceLastPush; } XENNET_RECEIVER_QUEUE, *PXENNET_RECEIVER_QUEUE; struct _XENNET_RECEIVER { @@ -544,7 +545,8 @@ ReceiverQueuePacket( IN PXENVIF_PACKET_INFO Info, IN PXENVIF_PACKET_HASH Hash, IN BOOLEAN More, - IN PVOID Cookie + IN PVOID Cookie, + OUT PBOOLEAN NdisFinished ) { PXENVIF_VIF_INTERFACE VifInterface; @@ -582,11 +584,17 @@ ReceiverQueuePacket( Queue->Tail = NetBufferList; } Queue->Count++; + Queue->SinceLastPush++; + + *NdisFinished = More && (Queue->SinceLastPush > IN_NDIS_MAX); + + if (!More || (*NdisFinished)) + Queue->SinceLastPush = 0; KeReleaseSpinLockFromDpcLevel(&Queue->Lock); done: - if (!More) + if (!More || (*NdisFinished)) __ReceiverPushPackets(Receiver, Index); } diff --git a/src/xennet/receiver.h b/src/xennet/receiver.h index 5fc9e66..6089fd4 100644 --- a/src/xennet/receiver.h +++ b/src/xennet/receiver.h @@ -68,7 +68,8 @@ ReceiverQueuePacket( IN PXENVIF_PACKET_INFO Info, IN PXENVIF_PACKET_HASH Hash, IN BOOLEAN More, - IN PVOID Cookie + IN PVOID Cookie, + OUT PBOOLEAN NdisFinished ); extern PXENVIF_VIF_OFFLOAD_OPTIONS -- 2.25.0.windows.1