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]
Message-ID: <46BAB9DD.5030400@goop.org>
Date:	Wed, 08 Aug 2007 23:53:17 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Andi Kleen <ak@...e.de>
CC:	Glauber de Oliveira Costa <gcosta@...hat.com>,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	rusty@...tcorp.com.au, mingo@...e.hu, chrisw@...s-sol.org,
	avi@...ranet.com, anthony@...emonkey.ws,
	virtualization@...ts.linux-foundation.org, lguest@...abs.org,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 25/25] [PATCH] add paravirtualization support for x86_64

Andi Kleen wrote:
>> +	if (opfunc == NULL)
>> +		/* If there's no function, patch it with a ud2a (BUG) */
>> +		ret = paravirt_patch_insns(site, len, start_ud2a, end_ud2a);
>>     
>
> This will actually give corrupted BUGs because you don't supply
> the full inline BUG header. Perhaps another trap would be better.
>   

The BUG handler will still report it as a normal illegal instruction. 
It should never happen; the main thing is that it clearly points out
where the problem is (as opposed to jumping to a NULL pointer and
getting the unhelpful "oh, eip is zero" symptom).

>> +EXPORT_SYMBOL(paravirt_ops);
>>     
>
> Definitely _GPL at least.
>   

No, for the same reason as i386.

>> +extern struct paravirt_ops paravirt_ops;
>>     
>
> Should be native_paravirt_ops I guess
>
>   

No, because its the current set of pv_ops.  It starts all native, but it
is either completely or partially overwritten by hypervisor-specific ops.

>> +
>> + * This generates an indirect call based on the operation type number.
>>     
>
> The macros here don't
>   

Yes, PARAVIRT_CALL does: "call *(paravirt_ops+%c[paravirt_typenum]*8);"


>> +			     : "=a"(f)
>> +			     : paravirt_type(save_fl),
>> +			       paravirt_clobber(CLBR_RAX)
>> +			     : "memory", "cc");
>> +	return f;
>> +}
>> +
>> +static inline void raw_local_irq_restore(unsigned long f)
>> +{
>> +	__asm__ __volatile__(paravirt_alt(PARAVIRT_CALL)
>> +			     :
>> +			     : "D" (f),
>>     
>
> Have you investigated if a different input register generates better/smaller 
> code? I would assume rdi to be usually used already for the caller's 
> arguments so it will produce spilling
>
> Similar for the rax return in the other functions.
>   

This has to match the normal C calling convention though, doesn't it?

    J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ