From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF5FFC197BF for ; Sun, 6 Dec 2020 21:34:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AAB4230FA for ; Sun, 6 Dec 2020 21:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728144AbgLFVd6 (ORCPT ); Sun, 6 Dec 2020 16:33:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbgLFVd5 (ORCPT ); Sun, 6 Dec 2020 16:33:57 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E41DC0613D2; Sun, 6 Dec 2020 13:33:17 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id c198so9933458wmd.0; Sun, 06 Dec 2020 13:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=H2ihWmj1xz3YUTUg4hm8Uz+Y+1WdQit3Ko6/J96mYYM=; b=ZgOmGcHNvldEzL+8MdfX12VyB0IA1DpU5tTi1qCHjMB+ef3w2sYJDTVXEW5VTdMx6E yDWW0xtiP0FkJJMnjiKhsbBpMycG5NcGCnNIYY4Fd8UrPKKerd4e0z4XxlueSdh10zSf 1XbQRz61a6fvHwPi/oTi+Aqk2HZvjwMfW8rKbESLziMUz1Aj4A1Fkzxuet2jiKXat6Eg Vm6W41q4IvToEvcsR5mDVa26gYmceHatpmI1AL1KQ0Cs5nVhpQC5xqHf/agze1QTvFVs ma6bjLXRiUmmqWK/6tan3GJC2bQiqXg0swT5mvIE0kGUYktFuPWb8gdyoISQJ115GKr8 QzgQ== 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; bh=H2ihWmj1xz3YUTUg4hm8Uz+Y+1WdQit3Ko6/J96mYYM=; b=jHuZ+J2Qc2wqoDOuh4FHvUGoWmLAWriR+smUkmcCY3GsdYqyZJ/BhcQy3Z55qD/+Sr AW6+1w6ASDOfa/Ru7QKigCLlPG6geerOA2Xgbui5ymynuIkCiTjuBY0Z0XEc6mWwrFu+ Fe+jn2wSBL2+7z7/ljN/if8lgUMrKs4Nnsw7JxcaZyIBn/ipsTtqrASKXMCRseAneMDa Jj19xCerfp11cXhS2CLRN9KCUecwmrWEdSto9CPczgbm3eKjW6XjRw/sVInZacY1Ze4K mnS1kwk2ouM5Wj0s/PfaOF3TArr9LMq1lENnqQ2t7FVr8fvDsHLkGMFVkCA/AAukRCRE zzEw== X-Gm-Message-State: AOAM5321kvvKZD2CMz145soFA5DJMYREWiLaKKZ38eYHgLCVBKsk9zXW 0nnfdOqPVORdqndLsGWoFMg= X-Google-Smtp-Source: ABdhPJzGoFoCFZnWM7Z1vjJyt3zJQrJPa+VXNvx7lOngn7QhOuU5SWboVcziZl3fzVJfPmC44+N6Wg== X-Received: by 2002:a1c:c90b:: with SMTP id f11mr15159982wmb.47.1607290396050; Sun, 06 Dec 2020 13:33:16 -0800 (PST) Received: from andrea (host-95-239-64-30.retail.telecomitalia.it. [95.239.64.30]) by smtp.gmail.com with ESMTPSA id c4sm13438187wrw.72.2020.12.06.13.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2020 13:33:15 -0800 (PST) Date: Sun, 6 Dec 2020 22:33:08 +0100 From: Andrea Parri To: Michael Kelley Cc: "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Juan Vazquez , Saruhan Karademir Subject: Re: [PATCH v2 4/7] Drivers: hv: vmbus: Copy the hv_message object in vmbus_on_msg_dpc() Message-ID: <20201206213308.GA11423@andrea> References: <20201202092214.13520-1-parri.andrea@gmail.com> <20201202092214.13520-5-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 06, 2020 at 06:39:39PM +0000, Michael Kelley wrote: > From: Andrea Parri (Microsoft) Sent: Wednesday, December 2, 2020 1:22 AM > > > > The hv_message object is in memory shared with the host. To prevent > > an erroneous or a malicious host from 'corrupting' such object, copy > > the object into private memory. [...] > But if we're going to just make a copy at the start and use the copy for > everything, then the motivation for the changes in Patches 2 and 3 goes > away. The double-fetch problem is solved entirely by Patch 4. The > changes in Patches 2 and 3 *are* nice for simplifying the code, but > that's all. The code simplification is still useful as prep to reduce the > number of references to "msg" that have to be changed to "msg_copy", > but the commit message should be changed to reflect that, rather than > to eliminate double fetches. I'm okay with this: I will revisit the commit messages of 2/3, maybe squash those 'simplifications' into a single patch, and then 'solve' /guard against the double fetch problem with 4. Thanks, Andrea