From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1A30C54E49 for ; Fri, 8 May 2020 17:28:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B58B621775 for ; Fri, 8 May 2020 17:28:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="X3fKeXz0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B58B621775 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 494068E0005; Fri, 8 May 2020 13:28:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4446A8E0003; Fri, 8 May 2020 13:28:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 359DE8E0005; Fri, 8 May 2020 13:28:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 1DC3F8E0003 for ; Fri, 8 May 2020 13:28:30 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CE81D181AEF09 for ; Fri, 8 May 2020 17:28:29 +0000 (UTC) X-FDA: 76794235938.03.team95_84582ee486701 X-HE-Tag: team95_84582ee486701 X-Filterd-Recvd-Size: 4628 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 17:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=g4OHAWvJdqq6ZyHT3haATGWFoBehw1iX6Se1BPujZ5g=; b=X3fKeXz0aEWgnYZ/Wm4BaBo1tL moKbBLt4taCmsmtYyM2Yx6r+CjDsEWHxqyqVpRKoS5tKH/n/krHkdYmb2H1pnfFS6y4W64zDg/bBK rrndiu9vYtN7Vm4wsGustbbx77srZUdf41YupjbgdP3P4GNE8woSDcJzU2TE1KyHnPy8I4sVyHrk9 aZp2bg4CmY/ibFRkPoTOELO0MD1sp3SR7vq2xUXk7d7l1PfcpyVv6Zt+jy4G4Y7ndD7mwCMp6ohUh qdC2jo5Mzvnb84/90rUiS0cD4JnrjJPhKyup2/69WOMWtTRlSlMI40IkOBi7YDEemoeBhDcCLJwEY LXL5bvFw==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jX6nN-0002cH-NI; Fri, 08 May 2020 17:28:21 +0000 Subject: Re: mmotm 2020-05-05-15-28 uploaded (objtool warning) To: Peter Zijlstra Cc: akpm@linux-foundation.org, broonie@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-next@vger.kernel.org, mhocko@suse.cz, mm-commits@vger.kernel.org, sfr@canb.auug.org.au, Josh Poimboeuf References: <20200505222922.jajHT3b4j%akpm@linux-foundation.org> <36dc367a-f647-4ee8-a327-d1c3457a7940@infradead.org> <20200508103830.GZ5298@hirez.programming.kicks-ass.net> From: Randy Dunlap Message-ID: <73dd7a8c-87a4-695d-6f3b-ddde337c0747@infradead.org> Date: Fri, 8 May 2020 10:28:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200508103830.GZ5298@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/8/20 3:38 AM, Peter Zijlstra wrote: > On Tue, May 05, 2020 at 10:40:43PM -0700, Randy Dunlap wrote: >> On 5/5/20 3:29 PM, akpm@linux-foundation.org wrote: >>> The mm-of-the-moment snapshot 2020-05-05-15-28 has been uploaded to >>> >>> http://www.ozlabs.org/~akpm/mmotm/ >>> >>> mmotm-readme.txt says >>> >>> README for mm-of-the-moment: >>> >>> http://www.ozlabs.org/~akpm/mmotm/ >>> >>> This is a snapshot of my -mm patch queue. Uploaded at random hopefully >>> more than once a week. >>> >> >> >> on x86_64: >> >> arch/x86/hyperv/hv_apic.o: warning: objtool: hv_apic_write()+0x25: alternative modifies stack > > Wheee... this seems to have cured it for me. > > --- > Subject: objtool: Allow no-op CFI ops in alternatives > From: Peter Zijlstra > Date: Fri May 8 12:34:33 CEST 2020 > > Randy reported a false-positive: "alternative modifies stack". > > What happens is that: > > alternative_io("movl %0, %P1", "xchgl %0, %P1", X86_BUG_11AP, > 13d: 89 9d 00 d0 7f ff mov %ebx,-0x803000(%rbp) > > decodes to an instruction with CFI-ops because it modifies RBP. > However, due to this being a !frame-pointer build, that should not in > fact change the CFI state. > > So instead of dis-allowing any CFI-op, verify the op would've actually > changed the CFI state. > > Fixes: 7117f16bf460 ("objtool: Fix ORC vs alternatives") > Reported-by: Randy Dunlap > Signed-off-by: Peter Zijlstra (Intel) Acked-by: Randy Dunlap Tested-by: Randy Dunlap Thanks. > --- > tools/objtool/check.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -2078,17 +2078,18 @@ static int handle_insn_ops(struct instru > struct stack_op *op; > > list_for_each_entry(op, &insn->stack_ops, list) { > + struct cfi_state old_cfi = state->cfi; > int res; > > - if (insn->alt_group) { > - WARN_FUNC("alternative modifies stack", insn->sec, insn->offset); > - return -1; > - } > - > res = update_cfi_state(insn, &state->cfi, op); > if (res) > return res; > > + if (insn->alt_group && memcmp(&state->cfi, &old_cfi, sizeof(struct cfi_state))) { > + WARN_FUNC("alternative modifies stack", insn->sec, insn->offset); > + return -1; > + } > + > if (op->dest.type == OP_DEST_PUSHF) { > if (!state->uaccess_stack) { > state->uaccess_stack = 1; > -- ~Randy