mbox series

[0/8] limit passing around of cpu_user_regs

Message ID 1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com (mailing list archive)
Headers show
Series limit passing around of cpu_user_regs | expand

Message

Jan Beulich Jan. 11, 2024, 7:31 a.m. UTC
Unlike (synchronous) exception handlers, interrupt handlers don't normally
have a need to know the outer context's register state. Similarly, the vast
majority of key handlers has no need for such.

1: keyhandler: don't pass cpu_user_regs around
2: IRQ: generalize [gs]et_irq_regs()
3: serial: drop serial_rx_fn's regs parameter
4: PV-shim: drop pv_console_rx()'s regs parameter
5: serial: drop serial_[rt]x_interrupt()'s regs parameter
6: IRQ: drop regs parameter from handler functions
7: x86/vPMU: drop regs parameter from interrupt functions
8: x86/APIC: drop regs parameter from direct vector handler functions

Jan

Comments

Michal Orzel Jan. 11, 2024, 9:52 a.m. UTC | #1
On 11/01/2024 08:31, Jan Beulich wrote:
> 
> 
> Unlike (synchronous) exception handlers, interrupt handlers don't normally
> have a need to know the outer context's register state. Similarly, the vast
> majority of key handlers has no need for such.
> 
> 1: keyhandler: don't pass cpu_user_regs around
> 2: IRQ: generalize [gs]et_irq_regs()
> 3: serial: drop serial_rx_fn's regs parameter
> 4: PV-shim: drop pv_console_rx()'s regs parameter
> 5: serial: drop serial_[rt]x_interrupt()'s regs parameter
> 6: IRQ: drop regs parameter from handler functions
FYI, I did a build test on Arm and there were 2 build errors. Fix below:

diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index b5c84c51a20a..da011413c5c0 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -642,7 +642,7 @@ static void ipmmu_domain_irq(struct ipmmu_vmsa_domain *domain)
                         domain->d, status, iova);
 }
 
-static void ipmmu_irq(int irq, void *dev, struct cpu_user_regs *regs)
+static void ipmmu_irq(int irq, void *dev)
 {
     struct ipmmu_vmsa_device *mmu = dev;
     unsigned int i;
diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c
index f820c5500e08..c3ac6d17d1c8 100644
--- a/xen/drivers/passthrough/arm/smmu-v3.c
+++ b/xen/drivers/passthrough/arm/smmu-v3.c
@@ -929,7 +929,7 @@ static void arm_smmu_combined_irq_handler(int irq, void *dev)
 {
 	struct arm_smmu_device *smmu = dev;
 
-	arm_smmu_gerror_handler(irq, dev, regs);
+	arm_smmu_gerror_handler(irq, dev);
 
 	tasklet_schedule(&(smmu->combined_irq_tasklet));
 }


> 7: x86/vPMU: drop regs parameter from interrupt functions
> 8: x86/APIC: drop regs parameter from direct vector handler functions
> 
> Jan
> 

~Michal
Jan Beulich Jan. 11, 2024, 9:55 a.m. UTC | #2
On 11.01.2024 10:52, Michal Orzel wrote:
> On 11/01/2024 08:31, Jan Beulich wrote:
>> Unlike (synchronous) exception handlers, interrupt handlers don't normally
>> have a need to know the outer context's register state. Similarly, the vast
>> majority of key handlers has no need for such.
>>
>> 1: keyhandler: don't pass cpu_user_regs around
>> 2: IRQ: generalize [gs]et_irq_regs()
>> 3: serial: drop serial_rx_fn's regs parameter
>> 4: PV-shim: drop pv_console_rx()'s regs parameter
>> 5: serial: drop serial_[rt]x_interrupt()'s regs parameter
>> 6: IRQ: drop regs parameter from handler functions
> FYI, I did a build test on Arm and there were 2 build errors. Fix below:

Thanks for spotting. First of all I'll want to figure out why I didn't
notice these; I certainly did do several Arm text builds.

Jan

> diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> index b5c84c51a20a..da011413c5c0 100644
> --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
> @@ -642,7 +642,7 @@ static void ipmmu_domain_irq(struct ipmmu_vmsa_domain *domain)
>                          domain->d, status, iova);
>  }
>  
> -static void ipmmu_irq(int irq, void *dev, struct cpu_user_regs *regs)
> +static void ipmmu_irq(int irq, void *dev)
>  {
>      struct ipmmu_vmsa_device *mmu = dev;
>      unsigned int i;
> diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c
> index f820c5500e08..c3ac6d17d1c8 100644
> --- a/xen/drivers/passthrough/arm/smmu-v3.c
> +++ b/xen/drivers/passthrough/arm/smmu-v3.c
> @@ -929,7 +929,7 @@ static void arm_smmu_combined_irq_handler(int irq, void *dev)
>  {
>  	struct arm_smmu_device *smmu = dev;
>  
> -	arm_smmu_gerror_handler(irq, dev, regs);
> +	arm_smmu_gerror_handler(irq, dev);
>  
>  	tasklet_schedule(&(smmu->combined_irq_tasklet));
>  }
> 
> 
>> 7: x86/vPMU: drop regs parameter from interrupt functions
>> 8: x86/APIC: drop regs parameter from direct vector handler functions
>>
>> Jan
>>
> 
> ~Michal