forked from mirrors/linux
		
	s390/irqflags: optimize irq restore
The ssm instruction takes longer that stnsm/stosm as it is often used to modify DAT and PER. We know that irqsave/irqrestore only deals with external and I/O interrupts and we know that irqrestore can transition only from disabled->disabled or disabled->enabled, so we can use the faster stosm. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
		
							parent
							
								
									a9d7ab9781
								
							
						
					
					
						commit
						204ee2c564
					
				
					 2 changed files with 8 additions and 3 deletions
				
			
		|  | @ -8,6 +8,8 @@ | ||||||
| 
 | 
 | ||||||
| #include <linux/types.h> | #include <linux/types.h> | ||||||
| 
 | 
 | ||||||
|  | #define ARCH_IRQ_ENABLED	(3UL << (BITS_PER_LONG - 8)) | ||||||
|  | 
 | ||||||
| /* store then OR system mask. */ | /* store then OR system mask. */ | ||||||
| #define __arch_local_irq_stosm(__or)					\ | #define __arch_local_irq_stosm(__or)					\ | ||||||
| ({									\ | ({									\ | ||||||
|  | @ -54,14 +56,17 @@ static inline notrace void arch_local_irq_enable(void) | ||||||
| 	__arch_local_irq_stosm(0x03); | 	__arch_local_irq_stosm(0x03); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /* This only restores external and I/O interrupt state */ | ||||||
| static inline notrace void arch_local_irq_restore(unsigned long flags) | static inline notrace void arch_local_irq_restore(unsigned long flags) | ||||||
| { | { | ||||||
| 	__arch_local_irq_ssm(flags); | 	/* only disabled->disabled and disabled->enabled is valid */ | ||||||
|  | 	if (flags & ARCH_IRQ_ENABLED) | ||||||
|  | 		arch_local_irq_enable(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static inline notrace bool arch_irqs_disabled_flags(unsigned long flags) | static inline notrace bool arch_irqs_disabled_flags(unsigned long flags) | ||||||
| { | { | ||||||
| 	return !(flags & (3UL << (BITS_PER_LONG - 8))); | 	return !(flags & ARCH_IRQ_ENABLED); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static inline notrace bool arch_irqs_disabled(void) | static inline notrace bool arch_irqs_disabled(void) | ||||||
|  |  | ||||||
|  | @ -98,7 +98,7 @@ void __init paging_init(void) | ||||||
| 	__ctl_load(S390_lowcore.kernel_asce, 1, 1); | 	__ctl_load(S390_lowcore.kernel_asce, 1, 1); | ||||||
| 	__ctl_load(S390_lowcore.kernel_asce, 7, 7); | 	__ctl_load(S390_lowcore.kernel_asce, 7, 7); | ||||||
| 	__ctl_load(S390_lowcore.kernel_asce, 13, 13); | 	__ctl_load(S390_lowcore.kernel_asce, 13, 13); | ||||||
| 	arch_local_irq_restore(4UL << (BITS_PER_LONG - 8)); | 	__arch_local_irq_stosm(0x04); | ||||||
| 
 | 
 | ||||||
| 	sparse_memory_present_with_active_regions(MAX_NUMNODES); | 	sparse_memory_present_with_active_regions(MAX_NUMNODES); | ||||||
| 	sparse_init(); | 	sparse_init(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Christian Borntraeger
						Christian Borntraeger