Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp484958pxb; Wed, 29 Sep 2021 03:42:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzitjI5QPqox8rLLHKFQcGyIS9BAzdJRjOp5LJ/bkpm2hGqCCAjEbsuhtZLwpyC6MB4husR X-Received: by 2002:a62:31c5:0:b0:447:b30c:9a79 with SMTP id x188-20020a6231c5000000b00447b30c9a79mr10042119pfx.67.1632912131337; Wed, 29 Sep 2021 03:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632912131; cv=none; d=google.com; s=arc-20160816; b=LUpUAKou+nPF5sgoFMqqYc/a0exAi+gKSIxkZPhsZ4QQ+yDVrTOAAb79ccss6Gms3E lWqDX+bwJB6Dv5HuSKxL+kguW5XLfX4YuHxfHaDypPw+bKeebYChr/WHv2yvepRyW+v5 ZWfYhKEvKPumln5Kf1li/shIzNVqMwAURiBaR3Dk8J398+0S6ClA6Y9oyP7ToqgFzoxU EV2G3FdeQAZLVCjOem7CvoG92LdCoz98nYfz6uLLw3KzJXjbj34y+H520Wp/GNFv4S5p +Qp8/MvvAL9jHOLHhRSDMZQU54W+MnTR/Quj+lZ1yv36fGrrx4pPzstVi1g24fOZBMWd vgWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SWfsDGnM1C3CzjYVVIpW+X+APIBjSBls1Qn80oZJaMM=; b=JTHGC1LLyAG1AgWJ4GuPi4ib6hO8JRuqMCQoy55nyprdXT+cp8uMjANwSHsZngOQRV b9bI7qC0wGMF74IlgLHiTezDtGc67Vft2YIh/ki441Krc5vOK80jxjlf4ZMIgut09Udx +pBsBthSkrAgMZPGZDXwOdRsbgDjyf4gSgZnq2xvZJT476Eao0LW7l0aNgRKMfFAmFO+ oqoA3TZKr+aIJKeTuApt5EsWuq5TRVKvbc+Jr62ogmBWwK74AgL1Vpl4lgLaMZlUnjGl iKq5AI8RCDLxtl5Zna054IkK8MCCkqrj9ZDQijjspzaJVrxvS3hpS2NV6fGcFPyF/91Z /2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=QSZWAFYB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si2332821pfr.60.2021.09.29.03.41.58; Wed, 29 Sep 2021 03:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=QSZWAFYB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244847AbhI2IrR (ORCPT + 99 others); Wed, 29 Sep 2021 04:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244764AbhI2IrR (ORCPT ); Wed, 29 Sep 2021 04:47:17 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82DBCC06161C for ; Wed, 29 Sep 2021 01:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=SWfsDGnM1C3CzjYVVIpW+X+APIBjSBls1Qn80oZJaMM=; b=QSZWAFYBMsPqV9bOwtNhxNqYoh RiRM38zOzxy6+13pI+shgTZsyCL1ZpiOEG8lRkAnJkceKel7RGnafEkwAD+Og9/MF3yvFnay823ek MgIu8pgHnMW9J5aAqRV5jT2dHYO7gc6nqKYqpKiKFN9oQn28Wn4Z4QKRJJvkNA7inusA+3yMhXZIt hPu8z8ha3d8jx7O2cEXNnlyGXDhiM/jeby8+DqRoVXLuOCHp1by1EIWzmE5SCpjvDeKntN7boI30f vr9IKAv3dzpTkQ0DD+jGamaGdUEUUIHY3TdpNPOCAiS2uhhv9ipeK7F0Zw0cBvnzWzdiVBVoiAlqb 8zqlnszg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVVDL-006fxP-6E; Wed, 29 Sep 2021 08:45:19 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 19283300056; Wed, 29 Sep 2021 10:45:18 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E8DF32DC92D13; Wed, 29 Sep 2021 10:45:17 +0200 (CEST) Date: Wed, 29 Sep 2021 10:45:17 +0200 From: Peter Zijlstra To: Brian Gerst Cc: Lai Jiangshan , Linux Kernel Mailing List , Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , "H. Peter Anvin" , Youquan Song , Tony Luck Subject: Re: [PATCH V2 16/41] x86/entry: Implement the whole error_entry() as C code Message-ID: References: <20210926150838.197719-1-jiangshanlai@gmail.com> <20210926150838.197719-17-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 05:34:02PM -0400, Brian Gerst wrote: > On Sun, Sep 26, 2021 at 11:13 AM Lai Jiangshan wrote: > > +asmlinkage __visible __entry_text > > +struct pt_regs *error_entry(struct pt_regs *eregs) > > +{ > > + unsigned long iret_ip = (unsigned long)native_irq_return_iret; > > + > > + asm volatile ("cld"); > > The C ABI states that the direction flag must be clear on function > entry and exit, so the CLD instruction needs to remain in the asm > code. Right, also, one of my pet peeves with out entry code is that CLD and CLAC are not next to one another.