From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D719A0599; Fri, 10 Apr 2020 04:50:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CB381D44E; Fri, 10 Apr 2020 04:50:14 +0200 (CEST) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 9493B1D449 for ; Fri, 10 Apr 2020 04:50:12 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id n17so635256lji.8 for ; Thu, 09 Apr 2020 19:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3OGEFbVNbibhxMADGqLTM3mcO1qWu87tN2A5WCvZy+E=; b=ny8Fk2gEbfBVsznrStUtn3GOCuwX62fWCvclmQ1rAtg0/L12b0lED/QlQbTgNJXWwN LnL2fRl4N0+IA4Dz8Q/22+hn9jWysPUnFZdICyQW4Lv1TBbusy3XKaKrwxoxbNuvB0TR 9V0oNy6yzM6SbL5AR/uXQyRsb4cyyYuMqQb81jTGjWzvYDRwXMRHYfIwhv5asJzEa5O1 8ksU7oZ0CVzw0Ed6zElNqIntekEo15KQNOsuQCIxKWhoqUBaQV1ktiHvGml5dLQCt6jv 97MqKGZewo3kutZNhPGID4sJL3HLhzGFcGKVfdXoSAfMVGmJoYpKMuSTMl/eShELFnkK Nx9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3OGEFbVNbibhxMADGqLTM3mcO1qWu87tN2A5WCvZy+E=; b=pUoXRulcpEw+dP1kNTMk0Xzvu8ECz8DwvSDvH9kRimd09i3MoNB6JwSPJuFaZjSI5j WUXCI5KjWEzptCUEZjIgA1PhL6JeYXthyOkS9xYm+PRtgudOXMUb/0Aph+L5lngm8DPW 4b9mg48QovtaGwzY3XJ7/zDRURoPhl0xMTURws88FPaxmhEwPxyXCndP/ZqCbrsl2SA5 baTUDSwAlm1xByRcnC4csoXYeiQc8Oxee+VqqA+xLRV68kwtuNNOSteSttNcISRS5XLS a8GQi0apAt3g2SWv7L05t4kgM5ak2hDa6TrwfRMvx/xadkuY+g0+9yLbFrg0SOXIvdC5 0LFQ== X-Gm-Message-State: AGi0PuYzDdGSkZgAkUqGKs12f3/JkEVmGI1FK/ohl7dfRG3OcuGPuDoY VCXN6d5ibUEK9Fgn9f6oVpE= X-Google-Smtp-Source: APiQypLtQlsYrarMADF3ydf6uqkbWkjMZHUHJGkJSYiE/zcEE/XjMY+bGDyV32pEvkRgzU6sp6DlxQ== X-Received: by 2002:a2e:985a:: with SMTP id e26mr1676121ljj.17.1586487011982; Thu, 09 Apr 2020 19:50:11 -0700 (PDT) Received: from Sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id h21sm451805lfp.1.2020.04.09.19.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 19:50:11 -0700 (PDT) Date: Fri, 10 Apr 2020 05:50:10 +0300 From: Dmitry Kozlyuk To: Ranjit Menon Cc: dev@dpdk.org, "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile Message-ID: <20200410055010.6d2b5592@Sovereign> In-Reply-To: References: <20200330041026.784624-1-dmitry.kozliuk@gmail.com> <20200330041026.784624-2-dmitry.kozliuk@gmail.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/1] virt2phys: virtual to physical address translator for Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > + > > +_Use_decl_annotations_ > > +VOID > > +virt2phys_device_EvtIoInCallerContext( > > + IN WDFDEVICE device, IN WDFREQUEST request) > > +{ > > + WDF_REQUEST_PARAMETERS params; > > + ULONG code; > > + PVOID *virt; > > Should this be PVOID virt; (instead of PVOID *virt)? > If so, changes will be required to parameters passed in to > WdfRequestRetrieveInputBuffer() call. This should be PVOID *virt (pointer to an untyped pointer). User-mode passes a virtual address as a PVOID value, WdfRequestRetrieveInputBuffer() fills virt with the address of that parameter, so that *virt is the virtual address user-mode wants to translate into a physical one. > > > + PHYSICAL_ADDRESS *phys; > > + size_t size; > > + NTSTATUS status; > > + [snip] > > + > > + status = WdfRequestRetrieveOutputBuffer( > > + request, sizeof(*phys), &phys, &size); > > Better to put a (PVOID *)typecast for &phys here: > status = WdfRequestRetrieveOutputBuffer( > request, sizeof(*phys), (PVOID *)&phys, &size); What do you mean? Without a typecast the built-in static analyzer emits a warning (and all warnings are treated as errors for a driver): virt2phys.c(108,46): error C2220: the following warning is treated as an error virt2phys.c(108,46): warning C4047: 'function': 'PVOID *' differs in levels of indirection from 'PVOID **' virt2phys.c(108,46): warning C4022: 'WdfRequestRetrieveInputBuffer': pointer mismatch for actual parameter 3 > > + if (!NT_SUCCESS(status)) { > > + KdPrint(("WdfRequestRetrieveOutputBuffer() failed, " > > + "status=%08x\n", status)); > > + WdfRequestComplete(request, status); > > + return; > > + } > > + > > + *phys = MmGetPhysicalAddress(*virt); > > + > > + WdfRequestCompleteWithInformation( > > + request, STATUS_SUCCESS, sizeof(*phys)); > > +} > > > > Co-installers are no longer required (and discouraged) as per Microsoft. > So you can remove the lines indicated below from the .inf file. Thanks, will remove in v2. They were generated by WDK solution template. -- Dmitry Kozlyuk