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

Re: [PATCH] x86/ioapic: sanitize IO-APIC pins before enabling the local APIC


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jul 2023 14:18:29 +0200
  • 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=Gcd8J65i8vMfqwXzXSD63zpDSYFUuSaQAzs5IcQb68w=; b=B3xGPic6ovIMqXGwlLWeyYD2KhIogFsp7dkP7GTu6UER+gCezTN/yq0AyJ9DqqmfKFw7WjtceZvBy9ExlRkx+1AchCvZoGxet8E3NdtIZkfkxCSiu56Ymcsu7fmJfzDTL4bxFFa0r9QmE7lvN0Ibi1HTHEaBMzLN95QoFq5Z2JtZjUDr4tOJSmRE4+BeSMKg1AzGjXB+X2IBYO8I0IdRgI5UXQQ8e7IDo+DyySYGcN+EgxzkKWhh0ILPdZ5ucSTVOWNOGV2Ctt4ZtOQZw8f8BXiMryHRkR1WRSb583F3G8i7mH2DCtU4eSqLBJiq2iOOyk1KrHYlT/corC99t6mqow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DYppZfI4X0XgRSPc0jd8y/nIcbixj9LZq+H8yZsU9vckOei5qSlk1bUE0CVW/Q2hU4wtjB5Kep6zUHznwY5JQ4XNzsKM/x1le8PD1/6qZkIqOU+70o2THlmmn9bsFrBjBU3iaHiH3bL/tQCn7gAqaSWareDX2eLPzTVZVVfOTG3gudeeTXssjeTPNvz4mTc9WavJBScB4/jpn/wl5zGk86vFqB8ib1xf7zx75KSqjqlkNKRyrx7JqraeZ0M1ivJZkRsCIg066ClL5l/9fvUqAfJclnudxXxhNTxbFTkLTK/4KUNo78NZTeWbEqujlazlZ+5cp+C0vusccjf+zrhN2Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 13 Jul 2023 12:18:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.07.2023 13:29, Roger Pau Monné wrote:
> On Thu, Jul 13, 2023 at 09:49:14AM +0200, Jan Beulich wrote:
>> One other thing I finally figured was confusing me in the
>> description of the patch; re-quoting that paragraph here:
>>
>> "Fix this by moving the masking of IO-APIC pins ahead of the enabling
>>  of the local APIC.  Note that before doing such masking Xen attempts
>>  to detect the pin where the legacy i8259 is connected, and that logic
>>  relies on the pin being unmasked, hence the logic is also moved ahead
>>  of enabling the local APIC."
>>
>> The last sentence saying "also" is kind of odd with the first one
>> already stating this very movement. To me it's therefore unclear what
>> exactly the second sentence is intended to be telling me. I guess you
>> want to express that together with the making the detection logic is
>> also moved (i.e. the entire function is called earlier), but I'm
>> afraid this isn't the only way to read that second sentence.
> 
> Yes, you are reading it as I was intending.  It's merely a logic that
> the i8259 detection is also done slightly earlier, as it relies on the
> RTE masking not being tampered with.
> 
> What about:
> 
> "Fix this by moving the masking of IO-APIC pins ahead of the enabling
>  of the local APIC.  Note that before doing such masking Xen attempts
>  to detect the pin where the legacy i8259 is connected, and that logic
>  relies on the pin being unmasked, hence the logic is also moved ahead
>  of enabling the local APIC."
> 
> "Move the masking of the IO-APIC pins ahead of the setup of the local
>  APIC.  This has the side effect of also moving the detection of the
>  pin where the i8259 is connected, as it must be done before masking
>  any pins."
> 
> Is the aboce any better?

It is, thanks.

>  Would you rather prefer me to drop any
> mention of the i8259 detection being moved? (as it's just a side
> effect of moving the masking).

No, better mention this aspect.

> So to recap, I think we are in agreement that calling enable_IO_APIC()
> just ahead of the call to setup_local_APIC() is the preferred
> solution?

Well, yes and no. My preferred course of action for the issue at hand
would be to convert RTE 0 to ExtInt (under the mentioned set of
conditions). I agree though that we also want to move the masking of
RTEs, and for that I further agree with the placement mentioned above.

That said, you're the contributor, so it's still up to you what you
submit in what order (you could still decide to leave out the RTE
conversion change). The two of us not reaching agreement merely makes
a little more difficult to decide which of the changes to backport
then.

Jan



 


Rackspace

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