[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] x86/msi: Allow writes to registers on the same page as MSI-X table


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 18 Nov 2022 14:07:49 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Wj+wN79UIU++EZEPDK8h9OnzJpEAaIWwPp7bth08jRw=; b=U1INVGbgBcMTVyLRasD07llkkZCNVpZIt41X37OZ29tgRNaD6upEgxwFznwd6nB9B6ZfpsIwAmOjBYBMQVX6oZ77lBduWNfi0749+wNU0ycrnKbq65vIZo4E/qn7yKjH3mFRS1siDWNwwV+sSrYf6oxvKPFt1yr1GQvuRMl1iYMAoiTFqxcfjwhbIyd2DGYjtrsEqv+9cn6IhtnOfq5ruzPxHhgrq8iY0W1mtlRKDVT1uehtipbr+bURNU7ZrsZS9mrW4ou/1/6w+2+LDYNxHW/YiQeQtgmWO+ISMpvY/1i+ZLHJmHuFLzZFTgWG8/91YrlHGolurzIiB3z3ui1Fxg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g8PUtd35oirKymh9ERMG6KexNqDPGaMz8tVODYcpKy5F2uPIFF5ikearzrxpKwEErdneRm5PhHAB/HOdYiU4ZuuIRPU9y6sp4r94hStuSwf2EYmNrRtBX4popTpLDPytnpqVa4qyMFrxpJ5e/PoffpwEeKlTSzRDLwjqBwMX3wWG908sQiH0fPVi5bDbhSxCxL5bfYL8yj0Y7xHfVeIsPGjGPOqA4Va3Cp6hSOkuB4o4qQd6ePb6P+RkMLzyw8/rjKCKgdG52moL4GoH4YwpMpMyawDqahgV2L5nSyZHSGo2ub6N8uab3bbi+D+aESigLyt64//IHEuvlP5GGZekJg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 18 Nov 2022 13:07:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.11.2022 14:00, Marek Marczykowski-Górecki wrote:
> On Fri, Nov 18, 2022 at 01:33:39PM +0100, Jan Beulich wrote:
>> On 18.11.2022 13:19, Marek Marczykowski-Górecki wrote:
>>> On Fri, Nov 18, 2022 at 08:20:14AM +0100, Jan Beulich wrote:
>>>> On 17.11.2022 18:31, Marek Marczykowski-Górecki wrote:
>>>>> On Thu, Nov 17, 2022 at 05:34:36PM +0100, Jan Beulich wrote:
>>>>>> Which in turn raises the question: Do you need to handle reads
>>>>>> in the new code in the first place?
>>>>>
>>>>> The page not being mapped is also the reason why I do need to handle
>>>>> reads too.
>>>>
>>>> Just for my own clarity: You mean "not mapped to qemu" here?
>>>
>>> No, to the HVM domain (in p2m). Xen (outside of MSI-X specific code for
>>> HVM) doesn't know where those reads should be from.
>>
>> Hmm, I was expecting them to be mapped r/o to the guest, but perhaps I'm
>> misremembering. Clearly both ept_p2m_type_to_flags() and
>> p2m_type_to_flags() take mmio_ro_ranges into consideration, which is
>> what I was basing my understanding on (without having looked at other
>> places in detail).
> 
> Qemu doesn't map the page (using xc_domain_memory_mapping()) where MSI-X
> table lives. I tried to modify this part, but it resulted in EPT
> violation on write attempt (and my emulation code wasn't called at all).

Well, yes - that leads to the other path I pointed you at, which is
used for both HVM and PV (and which, as per what you say, then looks
to be relevant for PVH only right now).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.