From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121071 invoked by alias); 11 Apr 2018 11:13:34 -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 121056 invoked by uid 89); 11 Apr 2018 11:13:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:alternative X-HELO: mail-qt0-f181.google.com Received: from mail-qt0-f181.google.com (HELO mail-qt0-f181.google.com) (209.85.216.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Apr 2018 11:13:31 +0000 Received: by mail-qt0-f181.google.com with SMTP id w12so1416298qti.4 for ; Wed, 11 Apr 2018 04:13:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=emnictEKALQWKkVkfXePG8jWIVdqFkznmRq3+AXxne4=; b=cKqkIbHU4+Cz8Vh3+RbFnrkOPaDq52swb2LGxv4/cOdTkYNdjVSumodUshd8RFNui6 6RBNormfCivvGKzn9Or8ORPZQObWvixLFec0V3rYvJVp2cD6u088S2YfyIufDXLD+23M MCX2Wq710apRHz1dtufFrmmwTuopdQF33Y5JZSsDnHv23qh9rQOyGgI/W9IzkP7QLhYf XCEKH1BXZ6g0PfoKc/foW3WTodkRhXNpHZc5xsEPoFGFNNcaAZ7lK8JZTrnAsBa5rq/e +cUrWDGqH+uvDhccNKnQ6dzzxB5yJhRHXlJ+89JjwL5FFXl9tz6uZCXQhsVcASO0wpPt 66ig== X-Gm-Message-State: ALQs6tAh10w26YPlccQBF8kQFEBv7VrbC8dn2C9eKXYGXeDyh/EiMaws UkD+Bu/i0FMaciidbNju9Hr6hg3EXLzcCR12s3Teqg== X-Google-Smtp-Source: AIpwx48LDGXgFEjBFwZB6JbNTmFXcp+ZEGTCNPOri439KrrldAYOqmhbFhb86gGOI59FTPRU8z3Bz/y+xn1l74DP3/o= X-Received: by 10.237.61.213 with SMTP id j21mr6438517qtf.251.1523445209893; Wed, 11 Apr 2018 04:13:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.60.210 with HTTP; Wed, 11 Apr 2018 04:12:59 -0700 (PDT) In-Reply-To: <5429b7f0-ee91-67f4-3b15-f5de9aa06389@redhat.com> References: <1512727471-30745-1-git-send-email-yao.qi@linaro.org> <5429b7f0-ee91-67f4-3b15-f5de9aa06389@redhat.com> From: Omair Javaid Date: Wed, 11 Apr 2018 11:13:00 -0000 Message-ID: Subject: Re: [PATCH 0/3 v3] [AArch64] Support tagged pointer To: Pedro Alves Cc: Yao Qi , GDB Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00212.txt.bz2 On 11 April 2018 at 15:13, Pedro Alves wrote: > On 04/11/2018 01:15 AM, Omair Javaid wrote: > > > This patch has broken kernel debugging using kgdb and openOCD. > > OOC, can you qualify this a bit more, please? > > Does the kernel use the high bits for something? > We can safely assume that top byte is 0 in case of user address space on linux because it enables tagging support but not for kernel address space. According to linux memory layout of AArch64 given here: https://www.kernel.org/doc/Documentation/arm64/memory.txt "User addresses have bits 63:48 set to 0 while the kernel addresses have the same bits set to 1. TTBRx selection is given by bit 63 of the virtual address." According to kernel document on tagged pointer support in AArch64 given here: https://www.kernel.org/doc/Documentation/arm64/tagged-pointers.txt The kernel configures the translation tables so that translations made via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of the virtual address ignored by the translation hardware. This frees up this byte for application use. With set_gdbarch_significant_addr_bit applied to aarch64-tdep following happens when gdb tries reading kernel address space memory: query the 0xffffffc000092698 memory data, GDB sent "m00ffffc000092698,4" instead of "mffffffc000092698,4" > Thanks, > Pedro Alves >