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:	Sun, 16 Sep 2007 11:08:24 +0200
From:	Avi Kivity <avi@...ranet.com>
To:	Anthony Liguori <aliguori@...ibm.com>
CC:	kvm-devel@...ts.sourceforge.net, Ingo Molnar <mingo@...e.hu>,
	Dor Laor <dor.laor@...ranet.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	linux-kernel@...r.kernel.org, Zachary Amsden <zach@...are.com>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Muli Ben-Yehuda <muli@...ibm.com>
Subject: Re: [PATCH] Refactor hypercall infrastructure (v2)

Anthony Liguori wrote:
> This patch refactors the current hypercall infrastructure to better support live
> migration and SMP.  It eliminates the hypercall page by trapping the UD
> exception that would occur if you used the wrong hypercall instruction for the
> underlying architecture and replacing it with the right one lazily.
>
> It also introduces the infrastructure to probe for hypercall available via
> CPUID leaves 0x40001000.  CPUID leaf 0x40001001 should be filled out by
> userspace.
>
> A fall-out of this patch is that the unhandled hypercalls no longer trap to
> userspace.  There is very little reason though to use a hypercall to communicate
> with userspace as PIO or MMIO can be used.  There is no code in tree that uses
> userspace hypercalls.
>
> Since the last patchset, I've changed the CPUID leaves to better avoid Xen's
> CPUID range and fixed a bug spotted by Muli in masking off hypercall arguments.
>
> Signed-off-by: Anthony Liguori <aliguori@...ibm.com>
>
> @@ -1721,6 +1657,18 @@ void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
>  	vcpu->regs[VCPU_REGS_RBX] = 0;
>  	vcpu->regs[VCPU_REGS_RCX] = 0;
>  	vcpu->regs[VCPU_REGS_RDX] = 0;
> +
> +	if (function == KVM_CPUID_SIGNATURE) {
> +		u32 signature[3];
> +
> +		memcpy(signature, "LinuxPVLinux", 12);
> +		vcpu->regs[VCPU_REGS_RAX] = 0;
> +		vcpu->regs[VCPU_REGS_RBX] = signature[0];
> +		vcpu->regs[VCPU_REGS_RCX] = signature[1];
> +		vcpu->regs[VCPU_REGS_RDX] = signature[2];
> +		goto out;
> +	}
> +
>   

This needs to be done from userspace, so that kvm can pretend not to 
have this leaf.

(I have no objection to our userspace doing it unconditionally; but I 
don't want to force it on others)

Also, the signature string is too generic.

> diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
> index 18c2b2c..1362082 100644
> --- a/drivers/kvm/x86_emulate.c
> +++ b/drivers/kvm/x86_emulate.c
>   


Please split out the emulator changes.

> - *
> - * 64-bit parameters 1-6 are in the standard gcc x86_64 calling convention
> - * order: RDI, RSI, RDX, RCX, R8, R9.
> - *
> - * 32-bit index is EBX, parameters are: EAX, ECX, EDX, ESI, EDI, EBP.
> - * (the first 3 are according to the gcc regparm calling convention)
>   

Please document the new ABI.

-- 
error compiling committee.c: too many arguments to function

-
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