From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19693 invoked by alias); 9 Oct 2013 02:24:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 19684 invoked by uid 89); 9 Oct 2013 02:24:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f176.google.com Received: from mail-vc0-f176.google.com (HELO mail-vc0-f176.google.com) (209.85.220.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 09 Oct 2013 02:24:20 +0000 Received: by mail-vc0-f176.google.com with SMTP id lf11so98771vcb.21 for ; Tue, 08 Oct 2013 19:24:18 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=yr9BTasUocosjVxi0mjeciCs5J1HSHGrIgZzexN5qAc=; b=magIyLae5qDG4XbE1pkVVc//FrTw/KUTskQ7fqnhNBjCxkfyCUE1XYCv5bC5e9CwYx VP1FtYX7w8GfEfBuNVh/wliGk3mJXExVT1iu8CZ68rqd+/yB9vC1GzD7E/azY7sGQJYZ R7lzMAlPQg/3IKsLeyFxKp4dMWHPrZz4vsrFw/QeCfsTmRq4VNbXz7vPSMjPdG+XzrtK YWMKYKqM6bfTg1GpIhzJ1ykGoVTNJ2hASFZMIQyanJAGEC2nGiCnmZn96atP2jh+Z84o ULvPuG1rhXcHnosx9u40gb22ivUqSJSBeQN7k3g/9W9AEuLlFUmVRKM9X29IEp4vvb4r +TGg== X-Gm-Message-State: ALoCoQl3UOOFeThyAOTFB3fgNrn3S0NFmtEXxp/laHy2yiQu1HNxvvd9UTw9kqrgLXnGyw+acIcQIYHPRIPWeqMImQfkKb72ONePiniqAHevVR8FgCjplqQuaqqiorF9kuD0oDWilgJKiQRmyeXK+gElA4iYgmhR8owjxufDsTpsigBaEOYxT5BK/zznXFHSEMFOW/y63kjYhFfeaeq+0QNHnClXxlkcPw== MIME-Version: 1.0 X-Received: by 10.220.11.7 with SMTP id r7mr3594301vcr.12.1381285458256; Tue, 08 Oct 2013 19:24:18 -0700 (PDT) Received: by 10.52.37.138 with HTTP; Tue, 8 Oct 2013 19:24:18 -0700 (PDT) In-Reply-To: <5249B9F9.4030901@redhat.com> References: <1378432920-7731-1-git-send-email-yao@codesourcery.com> <1378641807-24256-1-git-send-email-yao@codesourcery.com> <201309091916.r89JGbpf009986@glazunov.sibelius.xs4all.nl> <522E9A8A.7040509@codesourcery.com> <52317B66.3020602@codesourcery.com> <201309120949.r8C9nFsJ016506@glazunov.sibelius.xs4all.nl> <5232C9EC.2040707@codesourcery.com> <5249B9F9.4030901@redhat.com> Date: Wed, 09 Oct 2013 02:24:00 -0000 Message-ID: Subject: Re: [PATCH 0/7 V2] Trust readonly sections if target has memory protection From: Doug Evans To: Pedro Alves Cc: Yao Qi , Mark Kettenis , gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00247.txt.bz2 On Mon, Sep 30, 2013 at 10:50 AM, Pedro Alves wrote: > [...] > We have similar infrastructure already, in dcache.c -- we use > it for stack memory nowadays, and if the memory region is marked as > cacheable. We used to support caching more than just stack, but > that was never enabled by default because it may not be safe to > read memory outside of the range the caller is specifying, because of > things like memory mapped registers, etc. (In the case of stack, we assume > stack is allocated in page chunks, so that dcache never steps on memory is > should not). But in cases like disassembly, we're being driven by debug > info or user input. As GDB knows upfront the whole range of memory it'll > be fetching, accessing a bigger chunk upfront, as long as it doesn't > step out of the range we read piecemeal anyway, should have no effect > on correctness. For reference sake, ISTR prologue parsing being another place where we saw pain (not often, but painful when it happens). We also saw paradoxical slowdowns from using trust-readonly. The culprit was target_section_by_addr. Should be fixable of course, but heads up.