From owner-freebsd-i386@FreeBSD.ORG Sun Sep 2 17:56:31 2007 Return-Path: Delivered-To: i386@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5783A16A41A; Sun, 2 Sep 2007 17:56:31 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2A513C467; Sun, 2 Sep 2007 17:56:31 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id EA01B8C2507; Sun, 2 Sep 2007 19:39:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TaC65SUfYp00; Sun, 2 Sep 2007 19:39:54 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 710B18C24E9; Sun, 2 Sep 2007 19:39:54 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l82HdssN052719; Sun, 2 Sep 2007 19:39:54 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 2 Sep 2007 19:39:54 +0200 From: Roman Divacky To: arch@freebsd.org Message-ID: <20070902173953.GA52566@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: i386@freebsd.org Subject: PSL_RF inclusion in PSL_USERCHANGE for i386 X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2007 17:56:31 -0000 hi in i386/i386/machdep.c the set_regs() function sets i386 registers (called by ptrace for example). it checks what eflags are being changed and compares that with a mask of allowed flags to be changed. the mask is defined in psl.h like this: #define PSL_USERCHANGE (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_T \ | PSL_D | PSL_V | PSL_NT | PSL_AC | PSL_ID) PSL_RF (Flag to ensure single-step only happens once per instruction.). Can someone tell me why this is omitted? I think its because of having in-kernel debugger. User-mode Linux requires this to be allowed. So I wonder why this is disabled in FreeBSD. (Linux itself does not check the eflags in any way). thanks for answer, and/or pointer to answer Roman Divacky