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 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8351BC433EF for ; Wed, 16 Mar 2022 01:28:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.291007.493723 (Exim 4.92) (envelope-from ) id 1nUISL-0005QM-6B; Wed, 16 Mar 2022 01:28:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 291007.493723; Wed, 16 Mar 2022 01:28:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nUISL-0005QF-2K; Wed, 16 Mar 2022 01:28:05 +0000 Received: by outflank-mailman (input) for mailman id 291007; Wed, 16 Mar 2022 01:28:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nUISJ-0005Q9-2b for xen-devel@lists.xenproject.org; Wed, 16 Mar 2022 01:28:03 +0000 Received: from sonic308-8.consmr.mail.gq1.yahoo.com (sonic308-8.consmr.mail.gq1.yahoo.com [98.137.68.32]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 506d0f73-a4c8-11ec-853b-5f4723681683; Wed, 16 Mar 2022 02:28:00 +0100 (CET) Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Wed, 16 Mar 2022 01:27:58 +0000 Received: by kubenode521.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 7cb405e66a15f40978b8915c0788dcd7; Wed, 16 Mar 2022 01:27:55 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 506d0f73-a4c8-11ec-853b-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1647394078; bh=i74NpBZTlnJtZy5cWd/xbyKRu8h0jzVV3zJBMfLtQgM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=ooWS9h4yYOK/rqq6SCm/mQa8Mbo+wMsyzPhB1czDfoxk/07n0Uy5oS6BWlTG6xu+1MkBnYS1QqVvB59MnaqElD3Nnx6CA+KDMVx15+eZ867gh49WmDmn5GY0g2kEQ35vJyJ6z448VPF663N2NDgWYuW+BNoprzHEhhLpcw3t8kfdf1PzCGutZSO/+e897VXBfOWjtYvPBVQf4PDIT56IJkjOhJPf1mY8Rm1lDLQUS3MOwUBzwZuTd0bVNGe51TqBu15qaH+X4JJdOtufWBSRLPt2RBWvEZ8zo3gT+SbTOonowjFwLtvLota4kmXlZEgGXPiP5FnPLMCXtxprbOWfMg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1647394078; bh=rTv3Zj1YkWRRzqqTDJyFXpSBpytOJiFz6EDNIiGrTtB=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=bcrkbK2rnzSnP6IlYA3RQU+kDns7qrO2AfN7lg2No+x7La79AT4XTAqofixJXvhSH+xFpGM5N3CShTlzbBB+iuN8Zu0FDWz+xWyWfQYUOdqDGBlPVAyzH0+3/7FIRcjxkSK1y8nYU3nWUQJyz9CyVWG1jqzgoToQWUbgq5cUO/eokCp8RTjpE+gCcNNvVPsSuCVgEmngHtXorPobajzc9ojAL824ATZ9wRL/u65SL2UZLQWN5Vdr2a97EAEUz8EYECugb8uru025XIEHq9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t w9Qz7MfFeLshHyhhjY4j6yyHMWlBVM0iILcxWxzoZtQIPC9YUNSilYmiVnfejTAaE1johd4U7UQd 2jCU7qBXZvi9RNbswV3TzjwTtGpA29JiF3OF9Cmt_l5Xemi2u0ZBKlVIhsIy_VvmCqSTaVpK_HVQ JD9ooO55FEkIp20GMfEXfCXIkGuxdAJFY7HfW58XDJ7Q0x8o5P2HId4OJGN3MRN0z_KeZUuOnRCr 7Sur2f5g5 X-Sonic-MF: Message-ID: Date: Tue, 15 Mar 2022 21:27:54 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [XEN PATCH] tools/libs/light/libxl_pci.c: explicitly grant access to Intel IGD opregion Content-Language: en-US To: Jan Beulich Cc: Wei Liu , Anthony PERARD , Juergen Gross , xen-devel@lists.xenproject.org References: <23f5afb4-c712-f872-acee-7f18b98b73e6@suse.com> From: Chuck Zmudzinski In-Reply-To: <23f5afb4-c712-f872-acee-7f18b98b73e6@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.19878 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol On 3/15/22 7:38 AM, Jan Beulich wrote: > On 14.03.2022 04:41, Chuck Zmudzinski wrote: > >> @@ -610,6 +612,45 @@ out: >> return ret; >> } >> >> +static uint32_t sysfs_dev_get_igd_opregion(libxl__gc *gc, >> + libxl_device_pci *pci) >> +{ >> + char *pci_device_config_path = >> + GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/config", >> + pci->domain, pci->bus, pci->dev, pci->func); >> + size_t read_items; >> + uint32_t igd_opregion; >> + uint32_t error = 0xffffffff; > I think this constant wants to gain a #define, to be able to correlate > the use sites. I'm also not sure of the value - in principle the > register can hold this value, but of course then it won't be 3 pages. > I have one more comment to add here. I am not intending to define igd_opregion as a data structure 3 pages (12k) long, much less as a pointer to such a structure. However, it would be nice to have access to the actual data structure in libxl, because we could use it to validate its contents. I looked in the code for the i915 Linux kernel module, and the IGD opregion does have a signature that we could check if we have access to it. That would mitigate my concerns expressed in my first version of the patch about a false positive when identifying an Intel IGD. Hvmloader should probably also do this check before it maps the Intel IGD into guest memory if that is possible. However, I expect that it is not a memory that libxl has access to. It is probably a structure in kernel space, but it might be possible for libxl to ask the hypervisor for access to it. Perhaps the libxl maintainers can shed some light on that possibility. If this is possible, I will include such a check for the validity of the contents in the IGD in version 2 of the patch. Regards, Chuck