lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Nov 2023 09:28:46 +0100
From:   Juergen Gross <jgross@...e.com>
To:     Oleksandr Tyshchenko <Oleksandr_Tyshchenko@...m.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc:     Stefano Stabellini <sstabellini@...nel.org>,
        "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>
Subject: Re: [PATCH 4/7] xen/events: remove some simple helpers from
 events_base.c

On 13.11.23 18:35, Oleksandr Tyshchenko wrote:
> 
> 
> On 16.10.23 09:28, Juergen Gross wrote:
> 
> 
> Hello Juergen.
> 
> 
>> The helper functions type_from_irq() and cpu_from_irq() are just one
>> line functions used only internally.
>>
>> Open code them where needed. At the same time modify and rename
>> get_evtchn_to_irq() to return a struct irq_info instead of the IRQ
>> number.
>>
>> Signed-off-by: Juergen Gross <jgross@...e.com>
> 
> 
> 
> [snip]
> 
> 
> 
>>
>> @@ -1181,15 +1172,16 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
>>    {
>>    	int irq;
>>    	int ret;
>> +	struct irq_info *info;
>>    
>>    	if (evtchn >= xen_evtchn_max_channels())
>>    		return -ENOMEM;
> 
> 
> I assume this check is called here (*before* holding a lock) by
> intention, as evtchn_to_info() below contains the same check.

Yes.

> 
>>    
>>    	mutex_lock(&irq_mapping_update_lock);
>>    
>> -	irq = get_evtchn_to_irq(evtchn);
>> +	info = evtchn_to_info(evtchn) >
>> -	if (irq == -1) {
>> +	if (!info) {
>>    		irq = xen_allocate_irq_dynamic();
>>    		if (irq < 0)
>>    			goto out;
>> @@ -1212,8 +1204,8 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
>>    		 */
>>    		bind_evtchn_to_cpu(evtchn, 0, false);
>>    	} else {
>> -		struct irq_info *info = info_for_irq(irq);
>> -		WARN_ON(info == NULL || info->type != IRQT_EVTCHN);
>> +		WARN_ON(info->type != IRQT_EVTCHN);
>> +		irq = info->irq;
>>    	}
> 
> 
> This hunk doesn't apply clearly to the latest state, because of
> "9e90e58c11b7 xen: evtchn: Allow shared registration of IRQ handers"
> went in. Please rebase.
> 
> 
> With that:
> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>

Thanks,


Juergen


Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)

Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ