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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 8AA39C55ABD for ; Fri, 13 Nov 2020 23:32:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E0A022256 for ; Fri, 13 Nov 2020 23:32:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D8S/aHtP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="jSNVZO0K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E0A022256 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ykZKNrThDJpCY4VfHai9R5PiHTMvopuQf9Hi7eFi8/g=; b=D8S/aHtPgOhpYWF8dd3YkNRs2 /OCCYMUgqrF1lJbfwIjdpeoT4X04TkzfwE5YHWFMsFhpDbpJ9T4ZrGEwg46aCYXKlL8k1cCGurto2 5eNSRmGW5cVw1/xAYSi3HAgDi3Wdz6mJ/Lqo+ApoGeqUbbz7ju5J2ndEtgT6WHvyFFotSbeuXjils gIqkNY2OLBno+Vx3Ky0TpekTXFgZzF2yukDp04kqOaAmkbwoHrugN720VCxP+A/gCnUQnFNFnczLr X2bsUs5tkYgVSKm0deOLLxdjKSvZ0EESzu8FRs0d+1TDpJpRIOE9rT9VLTjzbHp368jx2Ib41DALN fVLbjdCbw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdiXn-0001Mn-FQ; Fri, 13 Nov 2020 23:31:51 +0000 Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdiXk-0001Lb-Fe for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 23:31:49 +0000 Received: by mail-vs1-xe42.google.com with SMTP id z123so6108496vsb.0 for ; Fri, 13 Nov 2020 15:31:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AJStHOY5Qh2DGFTroegyQhWYQ1MmCmTEUHWIJvas+7M=; b=jSNVZO0K7wzWNgivPRsTS23unTlL5xu3JAtfH6tP3wTtqKXHTFxKLDpXglVNKVogCS 6GN3EBqfM/ZUBQPh9/KXRac8yN3VH0HlBG3quWK6QtaxtiL1rK8O5VK7VVHqo6J7Rt/X pLPxkZTYuxt9e7KMQUlSjLI7JuuwGE0+gzwfrHa+KQQiFj8lluSMbarMau3hHsSH1/Ly I1ayeKXU+HZyBmmdWsN2DNObwSk0A53WftOV1KjCprrJHCY1GRvxqs5hu+HPHBc4Mr91 nRjSltnInqcTuCWkLRcwZA5Rf8Mmi9P0lK2FChkaNPICHq6O3gumsgzJMmBvO66F5HQu PNWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AJStHOY5Qh2DGFTroegyQhWYQ1MmCmTEUHWIJvas+7M=; b=AkgKdIqN88MCuToXFZYHPpUUft/GnEVPz8v+dd/VO810FSw+rGSTdzYO9XbSaXm7jI j+eU8HjkhJlRiLyNBjzPKRmq7PsCMVH5R9S07yCjX5vMAvosW9pWX/i8J/4Xgypk1dvk 10CySkjmN4yVGfz9lI1H3IB7HPvASk3sJ0Zeuun+xHKV5PVdOfEPOrFZW2o0i1frzOB+ 63uLFS+cp0siijOgOtHxb/e3xEMNj+upqtfpxPHWHP1Axn7uB7FbzFwzoVUvkqQKXbup l8nUyeskWp6JpDDrtc82kqAKu9OC4UPD+Gm0llaMSa2FI3rZusMbv5rc+Uv4BUryc67s MWfg== X-Gm-Message-State: AOAM532OKXmIyqmBvvnCIpp4aAoLc8PuxaImJx4nC7trx0f4LPSNRMeo SfNi26fimxgOIzwmg+RIDAzEAclewrxrn19/GXoo/g== X-Google-Smtp-Source: ABdhPJxSW9RODWqSRFIxVh02sljFGIxaFmVwff0K0MDsmxDUSocAvDQCNoKIe2vb8EcMsPSHfR3I4Mur2BV/pt3dnso= X-Received: by 2002:a67:ee93:: with SMTP id n19mr3267175vsp.36.1605310306224; Fri, 13 Nov 2020 15:31:46 -0800 (PST) MIME-Version: 1.0 References: <20201021085606.GZ2628@hirez.programming.kicks-ass.net> <20201023173617.GA3021099@google.com> <20201110022924.tekltjo25wtrao7z@treble> <20201110174606.mp5m33lgqksks4mt@treble> <20201113195408.atbpjizijnhuinzy@treble> <20201113223412.inono2ekrs7ky7rm@treble> In-Reply-To: <20201113223412.inono2ekrs7ky7rm@treble> From: Sami Tolvanen Date: Fri, 13 Nov 2020 15:31:34 -0800 Message-ID: Subject: Re: [PATCH v6 22/25] x86/asm: annotate indirect jumps To: Josh Poimboeuf X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_183148_626848_FB81AC1B X-CRM114-Status: GOOD ( 27.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch , Kees Cook , "Paul E. McKenney" , Jann Horn , Peter Zijlstra , Greg Kroah-Hartman , Masahiro Yamada , the arch/x86 maintainers , Nick Desaulniers , kernel list , Steven Rostedt , linux-kbuild , clang-built-linux , linux-pci@vger.kernel.org, Kernel Hardening , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Nov 13, 2020 at 2:34 PM Josh Poimboeuf wrote: > > On Fri, Nov 13, 2020 at 12:24:32PM -0800, Sami Tolvanen wrote: > > > I still don't see this warning for some reason. > > > > Do you have CONFIG_XEN enabled? I can reproduce this on ToT master as follows: > > > > $ git rev-parse HEAD > > 585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba > > $ make defconfig && \ > > ./scripts/config -e HYPERVISOR_GUEST -e PARAVIRT -e XEN && \ > > make olddefconfig && \ > > make -j110 > > ... > > $ ./tools/objtool/objtool check -arfld vmlinux.o 2>&1 | grep secondary > > vmlinux.o: warning: objtool: __startup_secondary_64()+0x2: return with > > modified stack frame > > > > > Is it fixed by adding cpu_bringup_and_idle() to global_noreturns[] in > > > tools/objtool/check.c? > > > > No, that didn't fix the warning. Here's what I tested: > > I think this fixes it: > > From: Josh Poimboeuf > Subject: [PATCH] x86/xen: Fix objtool vmlinux.o validation of xen hypercalls > > Objtool vmlinux.o validation is showing warnings like the following: > > # tools/objtool/objtool check -barfld vmlinux.o > vmlinux.o: warning: objtool: __startup_secondary_64()+0x2: return with modified stack frame > vmlinux.o: warning: objtool: xen_hypercall_set_trap_table()+0x0: <=== (sym) > > Objtool falls through all the empty hypercall text and gets confused > when it encounters the first real function afterwards. The empty unwind > hints in the hypercalls aren't working for some reason. Replace them > with a more straightforward use of STACK_FRAME_NON_STANDARD. > > Reported-by: Sami Tolvanen > Signed-off-by: Josh Poimboeuf > --- > arch/x86/xen/xen-head.S | 9 ++++----- > include/linux/objtool.h | 8 ++++++++ > 2 files changed, 12 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S > index 2d7c8f34f56c..3c538b1ff4a6 100644 > --- a/arch/x86/xen/xen-head.S > +++ b/arch/x86/xen/xen-head.S > @@ -6,6 +6,7 @@ > > #include > #include > +#include > > #include > #include > @@ -67,14 +68,12 @@ SYM_CODE_END(asm_cpu_bringup_and_idle) > .pushsection .text > .balign PAGE_SIZE > SYM_CODE_START(hypercall_page) > - .rept (PAGE_SIZE / 32) > - UNWIND_HINT_EMPTY > - .skip 32 > - .endr > + .skip PAGE_SIZE > > #define HYPERCALL(n) \ > .equ xen_hypercall_##n, hypercall_page + __HYPERVISOR_##n * 32; \ > - .type xen_hypercall_##n, @function; .size xen_hypercall_##n, 32 > + .type xen_hypercall_##n, @function; .size xen_hypercall_##n, 32; \ > + STACK_FRAME_NON_STANDARD xen_hypercall_##n > #include > #undef HYPERCALL > SYM_CODE_END(hypercall_page) > diff --git a/include/linux/objtool.h b/include/linux/objtool.h > index 577f51436cf9..746617265236 100644 > --- a/include/linux/objtool.h > +++ b/include/linux/objtool.h > @@ -109,6 +109,12 @@ struct unwind_hint { > .popsection > .endm > > +.macro STACK_FRAME_NON_STANDARD func:req > + .pushsection .discard.func_stack_frame_non_standard > + .long \func - . > + .popsection > +.endm > + > #endif /* __ASSEMBLY__ */ > > #else /* !CONFIG_STACK_VALIDATION */ > @@ -123,6 +129,8 @@ struct unwind_hint { > .macro UNWIND_HINT sp_reg:req sp_offset=0 type:req end=0 > .endm > #endif > +.macro STACK_FRAME_NON_STANDARD func:req > +.endm This macro needs to be before the #endif, so it's defined only for assembly code. This breaks my arm64 builds even though x86 curiously worked just fine. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel