Re: [PATCH v3 3/8] x86/psp: Register PSP platform device when ASP table is present
From: Jeremi Piotrowski
Date: Tue Mar 21 2023 - 10:16:32 EST
On 20/03/2023 22:03, Borislav Petkov wrote:
> On Mon, Mar 20, 2023 at 09:18:19PM +0100, Jeremi Piotrowski wrote:
>> I agree with you here. The irq config of this thing requires specifying
>> passing a CPU vector, this follows the hardware spec which I linked in the
>> first 2 commits, pages 13-15 here:
>
> You mean the interrupt vector in table 19?
>
Yes - this thing wants to receive an interrupt vector and APIC id which it will
then use to target its interrupt at.
>> https://www.amd.com/system/files/TechDocs/58028_1.00-PUB.pdf
>>
>> The only way I found to get this to work was going through x86_vector_domain
>> or statically defining a system vector (the latter felt worse).
>
> Hmm. Why is that thing special and can't use devm_request_irq() like the
> rest of the drivers out there?
>
Because the device is not exposed through AML (with ACPI managed irq routing)
and needs to be discovered manually and the interrupt programmed by hand.
I don't know the reasoning behind it being specified this way.
But essentially I am doing all this nasty stuff so that I get a simple irq number.
This is then passed to the actual driver that binds to the platform_device
(drivers/crypto/ccp/sp-platform.c) which uses it with devm_request_irq.