Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1596714pxb; Tue, 26 Oct 2021 11:58:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk9ywBn3ErSBKKNJtC6XnmxWBX+vwWEAq8Lia6KuTDk3sJ3Ms+zOalMvN7w7uM/9C4tJGz X-Received: by 2002:a62:ab14:0:b0:47b:e126:ea50 with SMTP id p20-20020a62ab14000000b0047be126ea50mr21516062pff.58.1635274719857; Tue, 26 Oct 2021 11:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635274719; cv=none; d=google.com; s=arc-20160816; b=gr23aFb0YhkSnZwDp34qihzkxaf0UtuJdzz+c7Pd5h8cjRlRiZYgMQoqp/G/IPyeZN IA7pg0MbQjK9MoYfvsboVAI9GG3kw78B5dXykAqv8phbA/tuT7sLSI0E/cYJwDa+C7gn 9NS/gCGH1az2+f21+brnzs8xg4QCRHaBfALsteKsjEGSJvFcBEGrdkChjzph8QcOTjxX QW9y3Ptsv0A79XZI3IByRdwCT4e0foSb4uZL4V8GQWoEqdg+9m06hfVK7ga6D7oYlgJJ mB5UYyPXmBs2+aByFFVO/AxgQP8YxF4XZ9fFClWeOeJwMIrdJgETIVl6B149K/fkWf5t YfkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Iv2xBEWgdsLbsGrbI1Ynj++RbyVyoOiqc5Pz0aTXiaA=; b=tx8sDME1TydTNXN2wwX5AlwgmEr4toFWsenA0obrqjETWos1oSx8GNqIvdG8E+3aXf g2marrtZb8aM3xc9KTwXV11SscpG5ulwz8NIi2176kXVNs+f8OMiT8TOE3xKIP3C2J9j xYTcJXP1JJK18l7HyR5Sn0RLpbmUaaZZ1zFww6EVrAwugEtebuXqMGUOqs3XLvN6Lv0s ufrH8JXo6MYoROlJ9HtOZzha4CYI+68D9McDNZkWgt80iH9xlsvBcGq83Ie1WcclBmI1 lcoobMIdMmz8E/+3u+kBCpSXZ+dtvzzMKIQfuiHk3TuUjpBp5vZjG8E8g6MZ068L3HXH GYQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OtSYCdaD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fy12si1758241pjb.87.2021.10.26.11.58.23; Tue, 26 Oct 2021 11:58:39 -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=@gmail.com header.s=20210112 header.b=OtSYCdaD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236808AbhJZOj2 (ORCPT + 99 others); Tue, 26 Oct 2021 10:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbhJZOjU (ORCPT ); Tue, 26 Oct 2021 10:39:20 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77170C061348 for ; Tue, 26 Oct 2021 07:36:56 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id u6-20020a17090a3fc600b001a00250584aso2433521pjm.4 for ; Tue, 26 Oct 2021 07:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Iv2xBEWgdsLbsGrbI1Ynj++RbyVyoOiqc5Pz0aTXiaA=; b=OtSYCdaDTSbq4RKOJJ+AV/w5/fCS7qcvuM7T4FnexJaftpDiOLW42FOvSqcTJEfDRj Z+PU8lmDZ7LaBN97jI1c+75rlktP2+Li7N9G8szacry90dBx3KOY5yWuFO/OBxp+mtdB nNCQ4Gkpj6te84rhEbE6ReDX8Ywhq9fN0ZaepJ62lnI46ycCWMkCv6vU8CC1wtqK6crd +cwZNPm++5ZCJFHeEZjm+KpFZ2KpZ3qJnVZAP9kTO4Pfq0s7tM0fUSnhTtwBrFCAx31r sVXuwxp6TWn5IZxnkOQx59mjI8tQ4uJst5e3J9a/rRZfbXSCXpzqXVETUoaD2FF1TPZt gzGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iv2xBEWgdsLbsGrbI1Ynj++RbyVyoOiqc5Pz0aTXiaA=; b=0xrcWqF3+CWRlmEN544sWOfmS4Wa8C4FHkmiCgVQ/dFlLy33T4piBWTgarkdWR5QNU N1JPI/iK8iJ2QQUcmMYUxb4ZWoeYcS6Qnuwfs8r2iXM8zgwZgEL837V3Esl3ZFhhE3T+ lZe9RA5X4Rrx3Ii0XFPZeuE0riKv45ljuxcQH9EFymRKV4MKdJc2xpxrcrP9qcW8Fk79 RBdz3AS7C74A03EcXPB7kewgIbtwqSx+klELqUb2j0cm/LvHbmkN705CQ5zfNj6BlxMI gc1CCyvtXTBDADGlcLnPWAm8dhn8J/MjoiJrSkyKOgkLPkm3tBfvhA1ZEtkmLS2BPcQw 3r3g== X-Gm-Message-State: AOAM530sLru0pyOQ0ft6c1MHKG0g52haaUGmygotPUiSZudjm9mxjyis 73aNGpCvWW9bSBMUQRiNsTVAis5jma0= X-Received: by 2002:a17:90b:4a07:: with SMTP id kk7mr29054707pjb.37.1635259015801; Tue, 26 Oct 2021 07:36:55 -0700 (PDT) Received: from localhost ([47.88.5.130]) by smtp.gmail.com with ESMTPSA id p23sm12616547pfw.61.2021.10.26.07.36.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 07:36:55 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Juergen Gross , "Peter Zijlstra (Intel)" , Joerg Roedel Subject: [PATCH V4 44/50] x86/doublefault: Use C entry code Date: Tue, 26 Oct 2021 22:34:30 +0800 Message-Id: <20211026143436.19071-19-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20211026141420.17138-1-jiangshanlai@gmail.com> References: <20211026141420.17138-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lai Jiangshan Use DEFINE_IDTENTRY_IST_ETNRY_ERRORCODE to emit C entry function and use the function directly in entry_64.S. Signed-off-by: Lai Jiangshan --- arch/x86/entry/entry_64.S | 12 ++---------- arch/x86/include/asm/idtentry.h | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 0a1a55c8207e..57559d810785 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -575,16 +575,8 @@ SYM_CODE_START(\asmsym) PUSH_AND_CLEAR_REGS ENCODE_FRAME_POINTER - /* paranoid_entry returns GS information for paranoid_exit in EBX. */ - call paranoid_entry - UNWIND_HINT_REGS - - movq %rsp, %rdi /* pt_regs pointer into first argument */ - movq ORIG_RAX(%rsp), %rsi /* get error code into 2nd argument*/ - movq $-1, ORIG_RAX(%rsp) /* no syscall to restart */ - call \cfunc - - call paranoid_exit + movq %rsp, %rdi /* pt_regs pointer */ + call ist_\cfunc jmp restore_regs_and_return_to_kernel _ASM_NOKPROBE(\asmsym) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h index c57606948433..931b689f464c 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -415,6 +415,7 @@ __visible __entry_text void ist_##func(struct pt_regs *regs) \ * Maps to DEFINE_IDTENTRY_RAW_ERRORCODE */ #define DEFINE_IDTENTRY_DF(func) \ + DEFINE_IDTENTRY_IST_ETNRY_ERRORCODE(func) \ DEFINE_IDTENTRY_RAW_ERRORCODE(func) /** -- 2.19.1.6.gb485710b