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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 0FDC9C4361B for ; Tue, 15 Dec 2020 16:28:51 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 9D1FB207E8 for ; Tue, 15 Dec 2020 16:28:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D1FB207E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.54474.94656 (Exim 4.92) (envelope-from ) id 1kpDBr-00042k-Mb; Tue, 15 Dec 2020 16:28:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 54474.94656; Tue, 15 Dec 2020 16:28:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpDBr-00042d-Hm; Tue, 15 Dec 2020 16:28:43 +0000 Received: by outflank-mailman (input) for mailman id 54474; Tue, 15 Dec 2020 16:28:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpDBq-00042O-GB for xen-devel@lists.xenproject.org; Tue, 15 Dec 2020 16:28:42 +0000 Received: from mail-wm1-f67.google.com (unknown [209.85.128.67]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c445b198-3528-46e9-9a1c-f6ac4e3b9408; Tue, 15 Dec 2020 16:28:41 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id k10so17433170wmi.3 for ; Tue, 15 Dec 2020 08:28:41 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id 94sm39531260wrq.22.2020.12.15.08.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 08:28:40 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c445b198-3528-46e9-9a1c-f6ac4e3b9408 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=j4tyz0KYb1+m9dRi4JRX79o8d/DzBmaeKPiouZzpfiw=; b=AymfjRnC//EHiu7Vefi0Onerqg91k03TRLX2YXA+GrVZI70L6l081fFn6znm0HDZ+E /5j7/pKSN9/dhGweT0Q74NjJAj3YjHW3sSA2PDFmSrzHy4aYsPAO6qDY18nJvfSHfYks rUpayxobe/0HI53Xrcjb9YXWV+8G23VZNj/hSGW4K1vL1W4RbRiu1bkodVLr1zqHdAqr zeJo4ve6MSFQgatxOOeajPlml8fF2Ieg7JdO+I9l2rOAcEjKryxXO4XkM/PH98PwSJ2K y8OBgXBHb0pK5BHrRdYqsF9p793dw5MwuDNIMqTREyi57WnuEawxYIk1tEz51rW5wFbM eXSw== X-Gm-Message-State: AOAM533/I/j+4JRG1Ys62Ibq2aJy5HN56LOUfSm63Qv1rMYFt7uVX4lU lUAuKUJTBhz9iJedCiQuDO4= X-Google-Smtp-Source: ABdhPJyl+EIpqtc0c0xoqNXI313POITbese7sP6R6Su0lWEELf4cv8amYqeyVPZBhw6Y32FV+pqPRA== X-Received: by 2002:a1c:770d:: with SMTP id t13mr34839387wmi.153.1608049721060; Tue, 15 Dec 2020 08:28:41 -0800 (PST) Date: Tue, 15 Dec 2020 16:28:39 +0000 From: Wei Liu To: Jan Beulich Cc: "xen-devel@lists.xenproject.org" , Roger Pau =?utf-8?B?TW9ubsOp?= , Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu Subject: Re: [PATCH v2 1/4] x86: verify function type (and maybe attribute) in switch_stack_and_jump() Message-ID: <20201215162838.o7ihaoj2tirqjg5s@liuwe-devbox-debian-v2> References: <792c442d-c05a-7a00-c807-b94a54bca94f@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <792c442d-c05a-7a00-c807-b94a54bca94f@suse.com> User-Agent: NeoMutt/20180716 On Tue, Dec 15, 2020 at 05:11:41PM +0100, Jan Beulich wrote: > It is imperative that the functions passed here are taking no arguments, > return no values, and don't return in the first place. While the type > can be checked uniformly, the attribute check is limited to gcc 9 and > newer (no clang support for this so far afaict). > > Note that I didn't want to have the "true" fallback "implementation" of > __builtin_has_attribute(..., __noreturn__) generally available, as > "true" may not be a suitable fallback in other cases. > > Note further that the noreturn addition to startup_cpu_idle_loop()'s > declaration requires adding unreachable() to Arm's > switch_stack_and_jump(), or else the build would break. I suppose this > should have been there already. > > For vmx_asm_do_vmentry() along with adding the attribute, also restrict > its scope. > > Signed-off-by: Jan Beulich > Reviewed-by: Juergen Gross Reviewed-by: Wei Liu