From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id p9M2HyoTBGYYORgAWB0awg (envelope-from ) for ; Wed, 27 Mar 2024 08:38:02 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=JEJq4RhU; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6BD341E0C0; Wed, 27 Mar 2024 08:38:02 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1EB7C1E030 for ; Wed, 27 Mar 2024 08:38:00 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 710393864810 for ; Wed, 27 Mar 2024 12:37:59 +0000 (GMT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A794E385DC06 for ; Wed, 27 Mar 2024 12:37:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A794E385DC06 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A794E385DC06 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711543061; cv=none; b=bIJ8WWCcJBIStcstbefrp1jQS3SfY6I/+oUpm3FlaFHILpVP99cr60fVYCbno2abTrp01b/H8P1WJnrAZztG5be9OJjEY/E6fukibAqPijBzOMZOuyxvurvZ+3RjW+y47JixJNQuufBMcqYae4xkJoO17xY5Yqt1e+b9qlcVp5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711543061; c=relaxed/simple; bh=Du26QLNd1aRmAB7N5bOGl4PbdWkiJYtDRQ7UnaFooLo=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=Y0pkFqWoQw/Qh8ahnbRbvSWepmvKhPT2khUGXQ1nBIvVm4ZGbTiw2nzTOC6nCbNa/nVRbA8VWqE/Mu4l9ch93NVapY+g3OT62onvKseA6bxA4RuXrVHaBjRuspffoOrdiCVvL54z1x4kRnef/QnFninUwrjrxu7MxDPMr6vl9/4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpSX9-0001ft-I2; Wed, 27 Mar 2024 08:37:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nLFBG2US/W22ywxiCUKi3eD0OF2yKU+SFUzG4bt5CXs=; b=JEJq4RhUIJJo QKx/Ggd1N7Ey+k71/gZEbBuiPIQBGW/EotNj2eVVchrzGxEQbBseF2U6yyBRb8e0bQOBYejxnYyzs jlJq0LW3+i2dpTCpZCEqwb5/hpkAaBDf0M34Jc7x8t5c0Sm641mMpDuqtR9xl++fOhnpd9Fq6H6vJ M9zYVdl1aF0aqIMc4hXfIzrMXthfsw1OP1ZFN9gNpIWa/zwOqNJWU8Wqwn5X9O7dk9IgvBWoH6Asw wBetSbWIj1by9ACU877XXcNMc1GGcYUmloKTI82mbiI/nbtjqJsH+DmyMX6INzyFAUKpFqEFCr5iw ieF+nyTmnZcJqLmxxHc4zA==; Date: Wed, 27 Mar 2024 14:37:30 +0200 Message-Id: <86h6grj1f9.fsf@gnu.org> From: Eli Zaretskii To: "Schimpe, Christina" Cc: gdb-patches@sourceware.org In-Reply-To: <20240327074739.2969623-3-christina.schimpe@intel.com> Subject: Re: [PATCH 2/3] LAM: Enable tagged pointer support for watchpoints. References: <20240327074739.2969623-1-christina.schimpe@intel.com> <20240327074739.2969623-3-christina.schimpe@intel.com> X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org > From: "Schimpe, Christina" > Cc: christina.schimpe@intel.com > Date: Wed, 27 Mar 2024 07:47:38 +0000 > > From: Christina Schimpe > > The Intel (R) linear address masking (LAM) feature modifies the checking > applied to 64-bit linear addresses. With this so-called "modified > canonicality check" the processor masks the metadata bits in a pointer > before using it as a linear address. LAM supports two different modes that > differ regarding which pointer bits are masked and can be used for > metadata: LAM 48 resulting in a LAM width of 15 and LAM 57 resulting in a > LAM width of 6. > > This patch adjusts watchpoint addresses based on the currently enabled > LAM mode using the untag mask provided in the /proc//status file. > As LAM can be enabled at runtime or as the configuration may change > when entering an enclave, GDB checks enablement state each time a watchpoint > is updated. > > In contrast to the patch implemented for ARM's Top Byte Ignore "Clear > non-significant bits of address on memory access", it is not necessary to > adjust addresses before they are passed to the target layer cache, as > for LAM tagged pointers are supported by the system call to read memory. > Additionally, LAM applies only to addresses used for data accesses. > Thus, it is sufficient to mask addresses used for watchpoints. > > The following examples are based on a LAM57 enabled program. > Before this patch tagged pointers were not supported for watchpoints: > ~~~ > (gdb) print pi_tagged > $2 = (int *) 0x10007ffffffffe004 > (gdb) watch *pi_tagged > Hardware watchpoint 2: *pi_tagged > (gdb) c > Continuing. > Couldn't write debug register: Invalid argument. > ~~~~ > > Once LAM 48 or LAM 57 is enabled for the current program, GDB can now > specify watchpoints for tagged addresses with LAM width 15 or 6, > respectively. > --- > gdb/NEWS | 2 + > gdb/amd64-linux-tdep.c | 67 ++++++++++++++++++++++++++++ > gdb/testsuite/gdb.arch/amd64-lam.c | 49 ++++++++++++++++++++ > gdb/testsuite/gdb.arch/amd64-lam.exp | 45 +++++++++++++++++++ > gdb/testsuite/lib/gdb.exp | 62 +++++++++++++++++++++++++ > 5 files changed, 225 insertions(+) > create mode 100755 gdb/testsuite/gdb.arch/amd64-lam.c > create mode 100644 gdb/testsuite/gdb.arch/amd64-lam.exp Thanks, the NEWS part is approved. Reviewed-By: Eli Zaretskii