Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp881112ybt; Fri, 26 Jun 2020 13:58:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb13wiid0W9AAf5UE4OhILZe2aO7zKsLz+ctqN66yjbIwBfvgJWIWirvci2RXQclaX5kdy X-Received: by 2002:a17:906:2bd8:: with SMTP id n24mr4547611ejg.83.1593205116908; Fri, 26 Jun 2020 13:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593205116; cv=none; d=google.com; s=arc-20160816; b=UNi4PR0kMPGU/k/MgmwG8+azwclSk/IqW0kvI0+UTWAoIu53Gzsh559KkLLVQjkv1D pUWfZp6LzQkh4+JAnapPCA1A1v4eiRX6A8sK9G/8bh+a6Jiqm1u5//rrI7yAlvjAnFDt SxeKQ5r6F9CBZkSh8+Q2KXr8GquF9zvn5ls6ryInvkU+XeK1q+aJNDbB3osOTGaZ+sfJ Ma8TGcRjetlYK5ZuT0qp2OzHccQ87/O+EgWPTDosrYBdQXIVqX46AKwIkh+hGlPbZlQ7 Uqid27N2yFt6Fj80WULxfIoIWoz6HOwO5kFEamTDWScXuwycBluKFVfqYkN4Wu0u3lHD At5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UEtSMorzUsNwgUS6/uoC1DFelzsLLNjhA0ODxeYGQZk=; b=YlOWqN6WAW00b7VYh6rYXSxmrDA3B6kYtYIgFkGjDostnFm8suVZ2936MGLxtGb/1W f3Rggvts7QkN4Ce02ueNCjBrqcRewUBJs3M8IrbdnGvn8M4BdMMQDgU14owh5nF5O7up g9h8PPeayEDRDVZOwXBkre+IJcmJJ9M8FaXx6SFMGcb8HUn3vRoQoJlD16zvtrllnuuv 0eC9+Vx/wBF/Dwd60vTkkKlSd0T0exL74C138F3aKLQz3dU6GPKFgrQt2sX9mRSlg1lc 53yAeoWiWervpaKZXNNw8MqBptUlKalCItEu2DiCJYKmgp+D5LwDIUHfvAu3Sxf1p01Q mChQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi8si20018360edb.602.2020.06.26.13.58.14; Fri, 26 Jun 2020 13:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbgFZU5b (ORCPT + 99 others); Fri, 26 Jun 2020 16:57:31 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:32989 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbgFZU5a (ORCPT ); Fri, 26 Jun 2020 16:57:30 -0400 Received: by mail-wr1-f65.google.com with SMTP id f18so2653267wrs.0; Fri, 26 Jun 2020 13:57:28 -0700 (PDT) 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UEtSMorzUsNwgUS6/uoC1DFelzsLLNjhA0ODxeYGQZk=; b=OZchDIXGo6iu9X5b8iFXhS8rb4s9itnPmLav8LKS6K+d359xFI1TaN+uCZ8xoQ3fc5 Xrhullnd59DchWEDJBV2UUpS+Z/r6f4Dje7+caXHhr/XraN3SqIh6/8dzbDbkabaFqL7 v4YsyR+4baHNYxzNYo0SFnVcJfuYntG187KBFcswGXBpbD3vI41kJOFDcI2fhhsZFnjz +gbnNdGpOkzNAtiPK8USyvXq3lVTFSNAuzWnHWRqjxoNz4FUXsLZnF21fLgItdn40nsm MzAHRjgbDrUulmhTdseHZ7xKB9cl9bLS6ktN+sX55yZW7Vxm7iVdb/7Hp5sIDjAJueOH mNHg== X-Gm-Message-State: AOAM531yYjrp5KxpQQ3scPn7KFIlaXqBvaOhErjOe3QSx0VG8PIu61vH k8ISLaMvRIDTw1SJUtmeOK2sq8ZC X-Received: by 2002:a5d:42c8:: with SMTP id t8mr5326836wrr.23.1593205048041; Fri, 26 Jun 2020 13:57:28 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id b184sm12903093wmc.20.2020.06.26.13.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 13:57:27 -0700 (PDT) Date: Fri, 26 Jun 2020 20:57:26 +0000 From: Wei Liu To: Andrea Parri Cc: Wei Liu , Andres Beltran , kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, mikelley@microsoft.com, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , "David S. Miller" , Jakub Kicinski Subject: Re: [PATCH 0/3] Drivers: hv: vmbus: vmbus_requestor data structure Message-ID: <20200626205726.nx54ztdtmo3fxbxm@liuwe-devbox-debian-v2> References: <20200625153723.8428-1-lkmlabelt@gmail.com> <20200626134227.ka4aghqjpktdupnu@liuwe-devbox-debian-v2> <20200626144817.GA1023610@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200626144817.GA1023610@andrea> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 04:48:17PM +0200, Andrea Parri wrote: > On Fri, Jun 26, 2020 at 01:42:27PM +0000, Wei Liu wrote: > > On Thu, Jun 25, 2020 at 11:37:20AM -0400, Andres Beltran wrote: > > > From: Andres Beltran (Microsoft) > > > > > > Currently, VMbus drivers use pointers into guest memory as request IDs > > > for interactions with Hyper-V. To be more robust in the face of errors > > > or malicious behavior from a compromised Hyper-V, avoid exposing > > > guest memory addresses to Hyper-V. Also avoid Hyper-V giving back a > > > bad request ID that is then treated as the address of a guest data > > > structure with no validation. Instead, encapsulate these memory > > > addresses and provide small integers as request IDs. > > > > > > The first patch creates the definitions for the data structure, provides > > > helper methods to generate new IDs and retrieve data, and > > > allocates/frees the memory needed for vmbus_requestor. > > > > > > The second and third patches make use of vmbus_requestor to send request > > > IDs to Hyper-V in storvsc and netvsc respectively. > > > > > > > Per my understanding, this new data structure is per-channel, so it > > won't introduce contention on the lock in multi-queue scenario. Have you > > done any testing to confirm there is no severe performance regression? > > I did run some performance tests using our dev pipeline (storage and > network workloads). I did not find regressions w.r.t. baseline. Thanks, that's good to hear. Wei. > > Andrea