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:	Mon, 21 Jul 2014 14:18:28 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Nadav Amit <namit@...technion.ac.il>
CC:	tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
	x86@...nel.org, gleb@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/7] KVM: x86: Function for determining exception type

Il 21/07/2014 13:37, Nadav Amit ha scritto:
> +int kvm_exception_type(unsigned int nr)

The manual calls this the exception class.

Please open code this as an if like this

	int mask;

	/* This should never happen, right? */
	if (WARN_ON(nr > 31))
		return EXCPT_INTERRUPT;

	mask = 1 << nr;
	if (mask &
	    ((1 << DB_VECTOR) | (1 << BP_VECTOR) |
	     (1 << OF_VECTOR)))
		return EXCPT_TRAP;

	...

	/*
	 * If it is reserved, assume it is a fault and
	 * set RF.
	 */
	return EXCPT_FAULT;

> +	case VE_VECTOR:
> +		return EXCPT_FAULT;
> +	case DB_VECTOR:
> +		return EXCPT_FAULT_OR_TRAP;

It is only a fault for instruction fetch breakpoints.  You can modify
kvm_vcpu_check_breakpoint to set RF, add a comment here that fault
handling is done elsewhere, and return EXCPT_TRAP.

Paolo
--
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