From owner-svn-src-all@freebsd.org Thu Sep 22 12:54:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78CA2BE529F for ; Thu, 22 Sep 2016 12:54:46 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x236.google.com (mail-yb0-x236.google.com [IPv6:2607:f8b0:4002:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38D5FD25 for ; Thu, 22 Sep 2016 12:54:46 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x236.google.com with SMTP id x93so53347637ybh.1 for ; Thu, 22 Sep 2016 05:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aVPUbzXfqoC71fCgTZsteV/axYxhSJXMBmA6CV9YK+k=; b=Dl8JFci3dkCFQiaGwd8MOWNt7zrTGJzTsN5f0DYiIu1xbOMqgm1+gEZNP1F/+TNHa6 g0slRU3/e3fBHY3D7couMhkiD5/SnHabqypU2pnN+kpnYblNfOc3w82IY1Ye791bn5g+ 8acNsNcDAvYpX9MiOXqkv29MGJFWFnBVEzGYH/LFjXB5kMB/JJpRw796aYCL5sikSWG1 N74gBUCTRPwphRi1W6MeN6a8WDRr6Zuw2wJu+YkXYPN1wn7Px3qyeam45Q/pSEmL0Dlb XPIPJR+YxYMoJILQXkks4LSdGv/fjla3Q5/AVUEPEfFR5Vv1SoBMwFA5azRoRRJ77h+i ElWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aVPUbzXfqoC71fCgTZsteV/axYxhSJXMBmA6CV9YK+k=; b=MQdpBYhK5oHHh/kdnzfmdU8/jU/YqEqJAxckl3PX1xRpcsKpXF7HBE1wZExEjZRRWq 0SMsSSB9B6EEJs/VxCa+AAuLoimoA+hbZYEcxy4RZSby6YrxZpPU9tjle2vL6gYveYoh xnq7FvVYKDHkPuxSIWoxiW33psBIktENxYf9ZxNjIVdbbqBup53rrrdIjV04OnDGzvu2 Odn3ORyBWMvVg5aUbPFHq7YlRUopU0DhhJMbdwn5DT0ky+2BFVAnwfiCmjvEA3bOL1Bz k6FGLHA7EJoETpJiRt438J/Zy/FqqFAIdwLqc6bOHBq2tTC7rt54z8PB5MeNxtVRy8Wr Jlrw== X-Gm-Message-State: AE9vXwOHg+WVW2X7vA4HjQPAdmGo3rtmu61eU4VfvW3mXwbemIxqYgx1NoSwWlOpGp6YrtGKkLR43M+2bb/mZA== X-Received: by 10.37.201.1 with SMTP id z1mr1269673ybf.70.1474548885399; Thu, 22 Sep 2016 05:54:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 22 Sep 2016 05:54:44 -0700 (PDT) In-Reply-To: <20160922092808.GR38409@kib.kiev.ua> References: <201609220815.u8M8F0Lo096297@repo.freebsd.org> <20160922092808.GR38409@kib.kiev.ua> From: Ed Schouten Date: Thu, 22 Sep 2016 14:54:44 +0200 Message-ID: Subject: Re: svn commit: r306162 - in head/sys/arm: arm include To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 12:54:46 -0000 Hi Kostik, 2016-09-22 11:28 GMT+02:00 Konstantin Belousov : > What do you mean about 'possibility to switch between TLS areas in > usermode' ? On x86, kernel switches %fs/%gs bases on the context > switches. There is, indeed, a way to turn off this functionality, but it > is somewhat unobvious, I have to admit. On x86 I've solved this by not letting apps have ownership over %fs/%gs. Instead, they simply assume that they point to some valid piece of memory. They can only use %fs:0. That way we now effectively have the ability to adjust TLS from userspace on all architectures freely. This feature is already used extensively by the userspace emulator, where you can run CloudABI executables on unmodified operating systems. You can even run an emulator inside of an emulator inside of an emulator. Not useful, but a good demonstration/test. Another thing this could be useful for is that it allows us to implement something like a simple truss(1) that doesn't depend on kernel-level tracing facilities, but merely captures system call invocations inside the process itself. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717