From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVzQx-0007cc-JM for qemu-devel@nongnu.org; Wed, 17 Feb 2016 05:34:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVzQs-0001tg-J9 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 05:34:11 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:37328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVzQs-0001tD-Bv for qemu-devel@nongnu.org; Wed, 17 Feb 2016 05:34:06 -0500 Received: by mail-wm0-x232.google.com with SMTP id g62so21434740wme.0 for ; Wed, 17 Feb 2016 02:34:05 -0800 (PST) Sender: Paolo Bonzini References: <1455037993-25461-1-git-send-email-pbonzini@redhat.com> <1455037993-25461-6-git-send-email-pbonzini@redhat.com> <56BA2C59.5040900@twiddle.net> From: Paolo Bonzini Message-ID: <56C44C92.7070104@redhat.com> Date: Wed, 17 Feb 2016 11:33:54 +0100 MIME-Version: 1.0 In-Reply-To: <56BA2C59.5040900@twiddle.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 5/5] target-i386: implement PKE for TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org On 09/02/2016 19:13, Richard Henderson wrote: >> >> +{ >> + if ((env->cr[4] & CR4_PKE_MASK) == 0) { >> + raise_exception_err_ra(env, EXCP06_ILLOP, 0, GETPC()); >> + return; >> + } > > The document I have says #GP for this case, not #UD. The text says #GP, the "Protected Mode Exceptions" section says #UD. :( I think #UD is more likely, as it's similar to XSAVE. > If you make the change to return a 64-bit value, this would look like > > gen_helper_rdpkru(cpu_tmp1_i64, cpu_env); > tcg_gen_extr_i64_tl(cpu_regs[REG_EAX], cpu_regs[REG_EDX], cpu_tmp1_i64); Yup, I can steal all that's needed from xgetbv and xsetbv. Paolo