From owner-svn-soc-all@FreeBSD.ORG Wed Jul 23 13:07:02 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EBA048B for ; Wed, 23 Jul 2014 13:07:02 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50EAD28E8 for ; Wed, 23 Jul 2014 13:07:02 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ND72QY068520 for ; Wed, 23 Jul 2014 13:07:02 GMT (envelope-from op@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s6ND713a068473 for svn-soc-all@FreeBSD.org; Wed, 23 Jul 2014 13:07:01 GMT (envelope-from op@FreeBSD.org) Date: Wed, 23 Jul 2014 13:07:01 GMT Message-Id: <201407231307.s6ND713a068473@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to op@FreeBSD.org using -f From: op@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r271274 - in soc2014/op/freebsd-base/sys: kern x86/include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2014 13:07:02 -0000 Author: op Date: Wed Jul 23 13:07:01 2014 New Revision: 271274 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271274 Log: KSP: fix xsaveopt NOTE: the cpuid_count part must be refactor, probably place into idencpu.c Signed-off-by: Oliver Pinter git: https://github.com/opntr/opBSD/tree/op/gsoc2014/kpatch Modified: soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h Modified: soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c ============================================================================== --- soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c Wed Jul 23 13:06:51 2014 (r271273) +++ soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c Wed Jul 23 13:07:01 2014 (r271274) @@ -100,6 +100,15 @@ if ((via_feature_xcrypt & p->feature) != 0) return (true); break; + case KSP_CPUID_EXTSTATE : + { + u_int cp[4]; + + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & p->feature) != 0) + return (true); + } + break; case KSP_SELFTEST: if ((p->feature & KSP_FEATURE_SELFTEST) != 0) return (true); Modified: soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h ============================================================================== --- soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h Wed Jul 23 13:06:51 2014 (r271273) +++ soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h Wed Jul 23 13:07:01 2014 (r271274) @@ -37,6 +37,7 @@ #define KSP_CPUID_STDEXT 5 #define KSP_VIA_CPUID 6 #define KSP_VIA_CRYPT_CWLO 7 +#define KSP_CPUID_EXTSTATE 8 /* * Intel Instruction Set Reference M-Z @@ -76,8 +77,8 @@ .quad 0725b ; \ .int 0724b-0723b ; \ .int 0726b-0725b ; \ - .int KSP_CPUID2 ; \ - .int CPUID2_OSXSAVE ; \ + .int KSP_CPUID_EXTSTATE ; \ + .int CPUID_EXTSTATE_XSAVEOPT ; \ .quad 0 ; \ .popsection ;