Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp536811pxw; Fri, 8 Apr 2022 14:10:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqCj2KJhJ/4MEX0pzrojmF+ZWvxH/42ZsE3PciQFFMnM4ShOxB+1Khb626RV8i6WlB8Mo5 X-Received: by 2002:a05:6a00:b95:b0:4fa:ec15:7eb7 with SMTP id g21-20020a056a000b9500b004faec157eb7mr21691221pfj.74.1649452229610; Fri, 08 Apr 2022 14:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649452229; cv=none; d=google.com; s=arc-20160816; b=OV+RYjLKxk4kdyiAR/oCbxoZEdlSZV7QyiW3LscLDBxZf0jWX4ijMkZTcIvMt1Fgi6 JP6++bMXQDqrhARJfR2bO7DDat6FM/2al63TUrLo/YTfP+OK/ot3RRLOMPzikZNz8vWR eQjN/0DCNp9VxfxgIl0Svf7leRafBRuErTwVvJmr/0yWkOehp4oj8Pnd1W+v9il5vuR6 Ug5ZDZicDQcaIHbjPRHjGx2A3apc7buyys2liCrkrjar/mjGrAj/znjzWgvzOJPrG/Vc x8+e7GBwLT84S5W7vZvpzX20a80KBrnpLHEYtV9qEdjvS6jvCXIXWWKsCjtj8oSgfNSp NMDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=poKLZdLjyeVK1eiFPw1FYejqrhv7pft5yH4/kZaOek0=; b=WqOpMZhXMMA6uZ6UBi0Hfx0bkEpJ6GDFoqLloBmN2JzpYApU7FMT0HkbfX3DA8OhF4 5GjWlAmN1oS9ISUbrTNb+2bSlx2DbYcdR9u2MvSGC36TfAHRQjmYAg+pbjHEtkP54CX6 ee8arwuY3oIswZW915W/FxdDha8IBqolqnW5mzmy6K0B8xZSZJ8XqKpchl1XjrrqzNDk qUNuG/IPEZ6EkKKOWTjaypTfKIyysRFWmRRKF2+ZT6CpXUTF6dsZ7AktMAxlGmLDNQvs tEe82tWXquLipGVBfDHYgbZJch9FNM1+gVFACSDc1H1fdVbpV2StOH8vAUg8BgELW1Fo Apqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BSyQ3rrk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m1-20020a056a00080100b005056fd7c13fsi2380188pfk.174.2022.04.08.14.10.14; Fri, 08 Apr 2022 14:10:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BSyQ3rrk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232502AbiDHQg2 (ORCPT + 99 others); Fri, 8 Apr 2022 12:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232479AbiDHQg1 (ORCPT ); Fri, 8 Apr 2022 12:36:27 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C86F10E55E; Fri, 8 Apr 2022 09:34:22 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id x24so5698581edl.2; Fri, 08 Apr 2022 09:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=poKLZdLjyeVK1eiFPw1FYejqrhv7pft5yH4/kZaOek0=; b=BSyQ3rrkoLXhiF1cWehL6RkJ+44AWoRmS0X58u2EnISwJ9ArpoYtI8ZJSvhYlIHne/ YfYD24VX6I2WbFgLJdjSRN0HfhTvVJ3JXifT61rUMf6wRBzldhPhsnT7gUFnUM5i9dAt R9hqUoQmgiCujTCJZAR4ffg8WDLqlfSo5fpAZaUuI3dRljzEtMwBhBDy+xQcXYF/y/B3 yHyDD/wbvRBWNLf3pq5sTcTGTP0iviaOp5gwUkzzkRFJHViPcDjmpTmcBQWwrQWpJ7NA Dy6mzb4x4NzprlEWOYmqL17XeC0EdG1jx445V7NG30LflidIbH3TyLAzPJ/gkXCNGUmR OGVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=poKLZdLjyeVK1eiFPw1FYejqrhv7pft5yH4/kZaOek0=; b=7fenFMYeVQdLscSC8/oHvE1XqtijvAZ87dwYIfIaAYtkMcucEON2Y5b3mEs/ZZh+Eq iRmwRtS12KwtpfBxu+vNfUcGiHw9FhTd4YSMpNZEgsEE//+pn0/7jOHSpiUAhb2lgEGA QV2cMGvEeXN9FdnLoVqoPVykkM+CZAURSKbu6/1uYvSv/VJ05Z2dyzU+LF+vSHfMcY+W NHBQb2M7aGXf6YbdP1TwLmxCwu41oFY51qpUX6/jqrDq28tzRvn+6Uochv6LrKmlls5M MpKXBzZ6KBFMHTrr/cr6GUOi+O5G/mPv6BhNt52n4+lpgfg5brKpJzf3EC1bQJvAYqFu 5RDA== X-Gm-Message-State: AOAM533LNbD5uhUdl324kNVl3L7EBb8LsLdbYC+HOUPGx8Hsg0/YfCb8 sTdBaj5Z6iAQMJzfMFpbVSo= X-Received: by 2002:a50:cd8d:0:b0:416:63d7:9326 with SMTP id p13-20020a50cd8d000000b0041663d79326mr20297238edi.233.1649435660944; Fri, 08 Apr 2022 09:34:20 -0700 (PDT) Received: from anparri (host-87-11-75-174.retail.telecomitalia.it. [87.11.75.174]) by smtp.gmail.com with ESMTPSA id n13-20020a170906724d00b006cedd6d7e24sm8891181ejk.119.2022.04.08.09.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:34:19 -0700 (PDT) Date: Fri, 8 Apr 2022 18:34:11 +0200 From: Andrea Parri To: "Michael Kelley (LINUX)" Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Wei Hu , Lorenzo Pieralisi , Rob Herring , Krzysztof Wilczynski , Bjorn Helgaas , "linux-hyperv@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/6] PCI: hv: Use vmbus_requestor to generate transaction IDs for VMbus hardening Message-ID: <20220408163411.GA206695@anparri> References: <20220407043028.379534-1-parri.andrea@gmail.com> <20220407043028.379534-3-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > @@ -2743,11 +2751,14 @@ static void hv_pci_onchannelcallback(void *context) > > switch (desc->type) { > > case VM_PKT_COMP: > > > > - /* > > - * The host is trusted, and thus it's safe to interpret > > - * this transaction ID as a pointer. > > - */ > > - comp_packet = (struct pci_packet *)req_id; > > + req_addr = chan->request_addr_callback(chan, req_id); > > + if (req_addr == VMBUS_RQST_ERROR) { > > + dev_warn_ratelimited(&hbus->hdev->device, > > + "Invalid transaction ID %llx\n", > > + req_id); > > This handling of a bad requestID error is a bit different from storvsc > and netvsc. They both use dev_err(). Earlier in the storvsc and netvsc > cases, I remember some discussion about whether to rate limit these errors, > and evidently we decided not to. I think we should be consistent unless > there's a specific reason not to. Well, this 'error' is hardcoded in hv_compose_msi_msg() (as described in patch #6). But no strong opinion really: let me replace with dev_err(). Thanks, Andrea