From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74692 invoked by alias); 8 Feb 2017 16:31:59 -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 74654 invoked by uid 89); 8 Feb 2017 16:31:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Lastly, H*RU:HELO, Hx-spam-relays-external:HELO, H*MI:sk:9851a15 X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Feb 2017 16:31:44 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 08 Feb 2017 08:31:43 -0800 X-ExtLoop1: 1 Received: from ullv-win8-gdb-jenkins.wtedesch-mobl (HELO [172.28.205.157]) ([172.28.205.157]) by fmsmga002.fm.intel.com with ESMTP; 08 Feb 2017 08:31:41 -0800 Subject: Re: [PATCH V7] amd64-mpx: initialize bnd register before performing inferior calls. To: Pedro Alves , qiyaoltc@gmail.com, brobecker@adacore.com References: <1485875613-31975-1-git-send-email-walfred.tedeschi@intel.com> <53d42bb6-3b83-6213-4087-6d30e7d837de@redhat.com> <217a8c13-b7d0-7fe6-56b5-85ff53ce097a@intel.com> <88c7180f-8843-a148-425a-2adf56c6d0bf@redhat.com> <9851a15e-b03a-7e5b-8415-87260120df9a@redhat.com> Cc: gdb-patches@sourceware.org From: "Tedeschi, Walfred" Message-ID: Date: Wed, 08 Feb 2017 16:31:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <9851a15e-b03a-7e5b-8415-87260120df9a@redhat.com> Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00192.txt.bz2 Am 2/8/2017 um 4:21 PM schrieb Pedro Alves: > I just occurred to me that I think it's important that > we test what happens to the BND registers _after_ the > infcall finishes: > > #1 - by normal completion > > #2 - when it is interrupted midway, e.g., because the > called function trips on a breakpoint. > > I didn't find this in the current test. > > I expect that in case #1, the BND registers are restored to > what they were before the infcall. The test should exercise > this, by continuing execution after the infcall returns, and > checking that a bounds violation / lack of bounds violation, > is still detected / not detected as if the infcall didn't > happen. BND registers should be restored to the values they had previous to the=20 inferior call. AFAIR that is the behaviour. I will change the test to reflect more what you are proposing. Nice=20 ideas have to be integrated! Thanks a lot! :) > Similarly, for #2, once gdb "silently stops" after being > resumed from the breakpoint hit, I think all registers are > restored, so the same testing would apply then. Yes, will add the test! > You may also think about testing what should happen > to bounds checks done by the function that had the > breakpoint that interrupted the infcall, if you say, step > over some code inside that interrupted function. > > Comprehensive testing like that would make it clearer how > the feature is meant to behave, and ensure it continues > working like that going forward. Agreed! I was considering that was default GDB functionality before. But it is indeed interesting to test those cases. Being sure that also=20 in this context those functionalities are not broken. Thanks again! > Lastly, shouldn't the manual say something about all this? I think so, explaing what is expected for inferior calls in presence of=20 MPX in general. The entry should explain the case that you have pointed out above, right? > Thanks, > Pedro Alves > Thanks a lot for the valuable contribution, /Fred Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928