Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7760551rwb; Tue, 15 Nov 2022 17:41:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf7n2K9wDX37FvsH1qUIFYWRLep48UtUMuMvafpGxSVKn1ZTmKQ9CIXaSz/+EmEogExog2nP X-Received: by 2002:a17:902:b195:b0:187:3fcb:121e with SMTP id s21-20020a170902b19500b001873fcb121emr6786847plr.100.1668562878266; Tue, 15 Nov 2022 17:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668562878; cv=none; d=google.com; s=arc-20160816; b=FkajkxMTq+oWHKpjE3W6bQAVsJkSv2Gp2UUxnYtTyzx6hr2V1GVjlFZvf2yCytPW3B 8C60o12pVI+aK9SEi/ebtnp2Thra2RPy/p2+p+DErzetkDeebCtmvCjD5g8ylk7e0gRy UGVjNpsCYYoPykQ81QPHHXyHW4BINNJeAVKoH3BYIRXjreTkOa8nGzPWP3ER9mWRK5/R qwi6L+DDhlf92/vBY8ZNcyzg9XBTpeyCST1GpusQ22SYkmvYNhkKViCQbmfCCwM6cLiy XBJ+5DKS4NUUfGgillhJce4+AQoPDY/Z5IB+qoKqyPG5aY+P8HZR4KWFmqvRhdqmI+xK D1Gw== 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:dkim-filter; bh=VDLo8zbPXioYWN/SStu6qUVWfBLk1lWDQR3U6RnVois=; b=z9fwcWoxeRMN/+VIDbpO+RbbvPx0BY2dMLtL3EZ5CJFedfCaOwsIIsaeIbcUfuDfCZ SL4rj7ZtjDuutmS7RHqVzeOHvNmXQ5yxuz2e2Es9lHt2d8iEHki0u3GMDFuiql0W1TEx 9A3hJyCkFmmrRjp2pw/Jw0plbPsRatpWEhuAuWA4pVieffvKnGXtO9mwFm9Ogkeu/9Qx UaKtb2ttgRag7ll5ijGaxblotTlRrcJjbhTqtJwfKylNj62l7gstxpLEuBd3zM26Xpe6 m8CeraZZQCQYxaJw5eUBUysVn5LGde1JvTFNnhSyloVCUtABSLzHgzE+fYogn76Mri3g SHnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=s+7UOMAf; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a17090322ca00b00186989178b0si15299512plg.132.2022.11.15.17.41.06; Tue, 15 Nov 2022 17:41:18 -0800 (PST) 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=@linux.microsoft.com header.s=default header.b=s+7UOMAf; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230450AbiKPBZj (ORCPT + 91 others); Tue, 15 Nov 2022 20:25:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbiKPBZg (ORCPT ); Tue, 15 Nov 2022 20:25:36 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45F212611B; Tue, 15 Nov 2022 17:25:30 -0800 (PST) Received: from [192.168.0.5] (71-212-113-106.tukw.qwest.net [71.212.113.106]) by linux.microsoft.com (Postfix) with ESMTPSA id 8260320B717A; Tue, 15 Nov 2022 17:25:29 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8260320B717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1668561929; bh=VDLo8zbPXioYWN/SStu6qUVWfBLk1lWDQR3U6RnVois=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=s+7UOMAfiepeCPyCHW5IlDj7xGLqR8CdM/K1zb4urLoy7cQQhxHbuXZze2NgODi9W Ul1J73OByj210UGEbHSpMYLdM6tA3QazVQFWgQ1Q0G2r1pqXXMBH4XlXJaLlOYvrHh wnfpKdRAuNO4m3mRoR3vjATUIb9veVLlwg0+K1Zw= Message-ID: Date: Tue, 15 Nov 2022 17:25:29 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] iommu/hyper-v: Allow hyperv irq remapping without x2apic Content-Language: en-US To: "Michael Kelley (LINUX)" , Wei Liu Cc: Tianyu Lan , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux.dev" , Sunil Muthuswamy , KY Srinivasan , Haiyang Zhang , Dexuan Cui , "dwmw2@infradead.org" , "joro@8bytes.org" , "will@kernel.org" References: <1668020853-23950-1-git-send-email-nunodasneves@linux.microsoft.com> <2f721208-d169-2baa-fa1f-b8450e80ddd7@linux.microsoft.com> From: Nuno Das Neves In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 11/14/2022 11:09 AM, Michael Kelley (LINUX) wrote: > From: Wei Liu Sent: Monday, November 14, 2022 5:59 AM >> >> On Fri, Nov 11, 2022 at 02:53:59PM -0800, Nuno Das Neves wrote: >>> On 11/11/2022 9:58 AM, Michael Kelley (LINUX) wrote: >>>> From: Wei Liu Sent: Friday, November 11, 2022 9:27 AM >> [...] >>> >>> I've tested this patch on these Azure SKUs: >>> - Standard_D2S_v2 (intel xapic) >>> - Standard_D4ds_v4 (intel xapic) >>> - Standard_D4ds_v5 (intel x2apic) >>> - Standard_D4ads_v5 (amd xapic) >>> >>> I've tested with linux Dom0 (nested hyperv root partition) and as a >>> regular L1 guest. >>> >> >> Okay. I think your tests are good. >> >> Michael, do you have any further concern? >> > > If ms_hyperv_msi_ext_dest_id() returns "true", then > hyperv_prepare_irq_remapping() will still return -ENODEV and you > won't get interrupt remapping because it isn't needed, at least not > for guest VMs. Is that what we want for the root partition? Or does > ms_hyperv_msi_ext_dest_id() only return true in a guest partition, > and not in the root partition? See commit d981059e13ff. > I did some digging, and I *think* this function will always return "false" in the root partition. The cpuids (HYPERV_CPUID_VIRT_STACK_*) that determine the result of ms_hyperv_msi_ext_dest_id() are implemented by the virtualization stack in Azure, so for L1 guests it depends on that. But, for nested root, the nested hypervisor controls which cpuids the root partition sees, and VIRTUALIZATION_STACK_CPUID_INTERFACE is not in that list. I tested this too; if I boot the kernel with an L1 guest, I can see that the HYPERV_CPUID_VIRT_STACK_INTERFACE contains the "VS#1" signature. If I boot as L2 Root, the signature is not present. I'm reasonably certain, but if I'm wrong we'll see the same breakage for the same reason and we can fix it I guess.