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=-3.5 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 autolearn=no 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 769E4C38A2A for ; Fri, 8 May 2020 10:38:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 37E70206D5 for ; Fri, 8 May 2020 10:38:36 +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="hqBpaCsS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37E70206D5 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 D8E4B8E0005; Fri, 8 May 2020 06:38:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D400D8E0003; Fri, 8 May 2020 06:38:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C85048E0005; Fri, 8 May 2020 06:38:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id AC30C8E0003 for ; Fri, 8 May 2020 06:38:35 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4ACDF181AEF07 for ; Fri, 8 May 2020 10:38:35 +0000 (UTC) X-FDA: 76793202990.08.slave74_2dd2e39a9c22a X-HE-Tag: slave74_2dd2e39a9c22a X-Filterd-Recvd-Size: 4685 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 May 2020 10:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oXjqqQJLus+/+zgHpN+/AuMXduVDDwIK2LOdHmK15tc=; b=hqBpaCsScr1CBw9qTMDCEPKHYk Vzdocnr2sYswbK6FaReKGV273kCCaSBnYJ+goewpl5f86l5zKc3ELxwcXXHOcPXNT+1IhWLMOQAan 3Fyzbz0rOBuZ4FhxMAwZxDJu5NQ0iAOouBLlfBAzuPPZL72A6YsAsbo9jK8anny1OlP3rvUR3U8SO JZujHiFU4Q/zpdBS2xlIGP7QT4Jw65SrcKR7+LBeAB65219EQGZSnNx9r4BPyKPhutUkjbHrr8oTR EwyIim5iqIrhMYjNXHeGlpqnQ85coMC7RIundnsYavLbxvmRURsitC4WOX+lwFcELfo1VaGEg2A1v vJhfma6w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jX0On-00020w-8t; Fri, 08 May 2020 10:38:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D77F43010C8; Fri, 8 May 2020 12:38:30 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6D361201C228D; Fri, 8 May 2020 12:38:30 +0200 (CEST) Date: Fri, 8 May 2020 12:38:30 +0200 From: Peter Zijlstra To: Randy Dunlap 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 Subject: Re: mmotm 2020-05-05-15-28 uploaded (objtool warning) Message-ID: <20200508103830.GZ5298@hirez.programming.kicks-ass.net> References: <20200505222922.jajHT3b4j%akpm@linux-foundation.org> <36dc367a-f647-4ee8-a327-d1c3457a7940@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36dc367a-f647-4ee8-a327-d1c3457a7940@infradead.org> 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 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) --- 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;