Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp838442iob; Thu, 12 May 2022 05:52:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyimOa53oNfZBYb1MJFnZql13lzzx7Yx7/opd8oxSlxCe9soM6CGTaZ00ddh5u7lr9NXh9 X-Received: by 2002:a17:907:761c:b0:6d6:e553:7bd1 with SMTP id jx28-20020a170907761c00b006d6e5537bd1mr28843337ejc.5.1652359948980; Thu, 12 May 2022 05:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652359948; cv=none; d=google.com; s=arc-20160816; b=UJWCaT+vpKqs3YfJ4DbvpWB+bBkoRczk8D9BOLZWcB+3pCkjv/qIIaBo4JDFUUIT57 VXsSNSvn3mUlkuB8nvpBOW2Nwmh0CqHedB9n91z0CLYLOOZypxL1lQ6WpJMI6CQlXKwk nK2wrDmEkoOSA4vw0rpYeynWnR+cgjXL+0AkkomSXnYcuRc6G5PrwZ2NwJisf9wdGpqI gheSMoNJuSS9NWxxSMxLuxeVfZjV4U+JMfdDm4WnCf99Ha0g72CcKNiQrCkiSPXJ+XGc GrzdBqYZBtT6P+49/ZUMKaPib9MpYQyqPf8yT895x8KPjgK/KDvX8PHBkOleWnvKZMmU ndbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=N7APsdlpxz6u79WorIWwR5LZd+w3+vL9fRK/HNG4EQU=; b=EyxoG+gd3nObXHrsYwqO1KWPq9LRUvKfn+btP62l4+I6SP6s4OuOrGfhfLKmBJEU1o 5AMXvAwZJ3+JaEqVbG0a9hDgiJRbNgpdLJFwfoJ4uIa9+2BXGFTtI/iQ+9+V9H0uiSqQ /RBg/Gjcvx/Xc4xpJmBUI79RopoGeB/lIQbHUxJe8n6H76tgiOu2a2W5YgwGfohhATLT h7do4klFCj64OkdM4Vj4OVB7O9z6KSC94DMpR3XEiHeBp9Ic4FnxJdAeKRSjheWOPWMp 24kt/Q1sNrn7Jc3ConnBT+kb2Kx98xVYMS7e5CAPqJOR8TciF8T/knZKH1VsYRt0DGUI bFgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Sj9Q8flT; 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=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa6-20020a1709076d0600b006f4e29e6785si6559295ejc.364.2022.05.12.05.52.03; Thu, 12 May 2022 05:52:28 -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=@quicinc.com header.s=qcdkim header.b=Sj9Q8flT; 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=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245034AbiEKOr3 (ORCPT + 99 others); Wed, 11 May 2022 10:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244750AbiEKOr1 (ORCPT ); Wed, 11 May 2022 10:47:27 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18DBF13F1E; Wed, 11 May 2022 07:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652280446; x=1683816446; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=N7APsdlpxz6u79WorIWwR5LZd+w3+vL9fRK/HNG4EQU=; b=Sj9Q8flTXilnYFMR5m9urM3Xi1x4FYM5pLP57cfZwlxX4IE30iJzvsYQ +OdANbqjx2JoDbWmf27lRjC12XEZUZRYhr+uwqyjXIEXhMkI6r7xza9cL dRGmLFsifUSidTBSpslVMszrCl1peGoiCpW9+hfH4T170M1M1gdHD/P0T I=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 May 2022 07:47:25 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2022 07:47:25 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 07:47:24 -0700 Received: from [10.226.59.182] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 07:47:24 -0700 Message-ID: Date: Wed, 11 May 2022 08:47:23 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH 0/2] hyperv compose_msi_msg fixups Content-Language: en-US To: Wei Liu CC: , , , , , , , , , , , , References: <1652132902-27109-1-git-send-email-quic_jhugo@quicinc.com> <20220511144124.rj7inq6zy6bgbii4@liuwe-devbox-debian-v2> From: Jeffrey Hugo In-Reply-To: <20220511144124.rj7inq6zy6bgbii4@liuwe-devbox-debian-v2> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 5/11/2022 8:41 AM, Wei Liu wrote: > On Mon, May 09, 2022 at 03:48:20PM -0600, Jeffrey Hugo wrote: >> While multi-MSI appears to work with pci-hyperv.c, there was a concern about >> how linux was doing the ITRE allocations. Patch 2 addresses the concern. >> >> However, patch 2 exposed an issue with how compose_msi_msg() was freeing a >> previous allocation when called for the Nth time. Imagine a driver using >> pci_alloc_irq_vectors() to request 32 MSIs. This would cause compose_msi_msg() >> to be called 32 times, once for each MSI. With patch 2, MSI0 would allocate >> the ITREs needed, and MSI1-31 would use the cached information. Then the driver >> uses request_irq() on MSI1-17. This would call compose_msi_msg() again on those >> MSIs, which would again use the cached information. Then unmask() would be >> called to retarget the MSIs to the right VCPU vectors. Finally, the driver >> calls request_irq() on MSI0. This would call conpose_msi_msg(), which would >> free the block of 32 MSIs, and allocate a new block. This would undo the >> retarget of MSI1-17, and likely leave those MSIs targeting invalid VCPU vectors. >> This is addressed by patch 1, which is introduced first to prevent a regression. >> >> Jeffrey Hugo (2): >> PCI: hv: Reuse existing ITRE allocation in compose_msi_msg() >> PCI: hv: Fix interrupt mapping for multi-MSI >> > > Applied to hyperv-next. Thanks. Huh? I thought you wanted a V2. I was intending on sending that out today. -Jeff