From owner-svn-src-head@freebsd.org Mon Mar 12 07:52:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E58FF51D89; Mon, 12 Mar 2018 07:52:31 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (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 AC7316D67B; Mon, 12 Mar 2018 07:52:30 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f52.google.com with SMTP id m69-v6so21677108lfe.8; Mon, 12 Mar 2018 00:52:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7of32cH8T5wV8VHhWnZwiudGCTnmDRWymdmdnxklSAc=; b=PvkWKksUB6oRMtxX3PtXnpc4em4Zc6lwBvSvOUEqBA+RhKeAFHYRtLQTSfhUA04Zij cuDfXpi2xMCe+ETwzXkxDQZz82OAw6yxwYcgibKdgeyie5kPJB+Hb42kFp4By5rxHx4e CLxRbjji1kR7mkhQwz2o2oHmjo/yUlbmaFdJrIaQmH/HXSZ1/cq1i5boKG8PS+ELXi5E RXGCxjNo3ES3igWVO8aueKjDbJOJOFlkF4DFfnxHFySBU+AjiIBbBkCsFpzw5QdJZvNo 78+EBLfjAPh6bz+eXGZbUEAG4O+KUg05dbBAXajdKDwiy/drnIoF0RbcaCR+ZXKTh9CS ATfg== X-Gm-Message-State: AElRT7FwTI5QyHpKNWliC8NghCAbRVxsq9ARU0pzJLWClGKzytL3dw3i kg/sB9PtYzmmpqvwiYtGkk7oRcYT X-Google-Smtp-Source: AG47ELvGiIyW8mY4nhspcvRpR4hJ9ht6IZzcyNSoDUZ/yKK+haAdFPGmUyiUywAG703UZt8pqwIzHw== X-Received: by 10.46.54.1 with SMTP id d1mr4669749lja.84.1520841142809; Mon, 12 Mar 2018 00:52:22 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id r13sm1538279ljd.60.2018.03.12.00.52.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 00:52:22 -0700 (PDT) Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803031510.w23FAbeC065867@repo.freebsd.org> <2557369.6nFzd3kAUm@ralph.baldwin.cx> From: Andriy Gapon Message-ID: Date: Mon, 12 Mar 2018 09:52:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <2557369.6nFzd3kAUm@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 07:52:31 -0000 On 09/03/2018 21:22, John Baldwin wrote: > On Saturday, March 03, 2018 03:10:37 PM Andriy Gapon wrote: >> Author: avg >> Date: Sat Mar 3 15:10:37 2018 >> New Revision: 330338 >> URL: https://svnweb.freebsd.org/changeset/base/330338 >> >> Log: >> db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common >> >> Since that change the system call stack traces look like this: >> ... >> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 >> amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 >> So, db_nextframe() stopped recognizing the system call frame. >> This commit should fix that. >> >> Reviewed by: kib >> MFC after: 4 days >> >> Modified: >> head/sys/amd64/amd64/db_trace.c >> >> Modified: head/sys/amd64/amd64/db_trace.c >> ============================================================================== >> --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) >> +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) >> @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s >> strcmp(name, "Xcpususpend") == 0 || >> strcmp(name, "Xrendezvous") == 0) >> frame_type = INTERRUPT; >> - else if (strcmp(name, "Xfast_syscall") == 0) >> + else if (strcmp(name, "Xfast_syscall") == 0 || >> + strcmp(name, "Xfast_syscall_pti") == 0 || >> + strcmp(name, "fast_syscall_common") == 0) >> frame_type = SYSCALL; > > I think you actually just want to replace Xfast_syscall with > fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any > functions before jumping to the common label, so when unwinding from a system > call you should always get the common label. (That is, I think we should > remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that > happens to find those symbols during unwinding won't have a valid SYSCALL > frame to unwind.) > I kept / added those to, sort of, decouple db_nextframe from the current implementation details. I hope that the extra code does not create too much overhead. -- Andriy Gapon