Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4097903pxb; Wed, 13 Oct 2021 20:59:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUvOWbvt2VmEbSjWtjkx+7A43r6u5Rt1w/iNFWbC5rmLfHt/dx1EUVnN1oy4Ks0S65UZzg X-Received: by 2002:a17:902:f281:b0:13f:3be8:b160 with SMTP id k1-20020a170902f28100b0013f3be8b160mr3008469plc.32.1634183986007; Wed, 13 Oct 2021 20:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634183986; cv=none; d=google.com; s=arc-20160816; b=i8SoDdxjtgl7EqT9TqdKG04I8qj76hBqQ3eBY9pmDLcoKilUTl1NO5OzhW0kWtJyJu //BqDEmWZizZrEWfOV1AClW2afRF4R5ML6cCJPGBQ2thjRXhc75bNgfhs0GiFFysAyLb lfrv4cBnONM1N98KroBtXbNg/wfVyBIho84o5mWALtke1V9M+P9qVZalPl3RNHVjmG50 8QEW2CKHsYrCURX60cVfDQ8nmUoMMOPwLdBXe5ZZFh7rw2X4IsqoG4Cb0SC3gN0RFl77 +ujI+02RvNqQl7tP2FSBSZdeUGCnfQJFSHSpyK+mzROaDNB1bx4696SwY0FJNJ8SH+rz 13QA== 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=Z9yr61w8pfAYnN0xIN6ksp0DVvzCyRWue2DNkNi8WYOkotP1jKjbruZD1lo1HHHP3Z 2mnst5lnt+fQcq89wli8g19UOIcs9nLEavdB0q/ZgDFtTrZ/XTo/2bAjhef31uM9K31s 8qhlE6nFYel6ugS2zuHqHbKp1YV9OycHs1zldLCP7e+FVe266cVUkpzsG3qVrS+tyPxy 1jlEPsvYRQObwguNlPMn3LQ9BKe1mp1nG/uDgfWjXmfwRPWsYiRVI47fNItKZZxzPcHp Byw328Kkh7RHZIS+Ug3zkvFzepp4hZZj2oUS8jeQc2JSCAeZ6umx8qWhYqX9t/vfs9et x41A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WnqduEVB; 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 r34si2090560pgl.489.2021.10.13.20.59.32; Wed, 13 Oct 2021 20:59:45 -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=WnqduEVB; 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 S229473AbhJNEAi (ORCPT + 99 others); Thu, 14 Oct 2021 00:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbhJNEAi (ORCPT ); Thu, 14 Oct 2021 00:00:38 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A378C061570 for ; Wed, 13 Oct 2021 20:58:34 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id oa4so3799357pjb.2 for ; Wed, 13 Oct 2021 20:58:34 -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=WnqduEVBGy81TydMP0Z6/4eCjE1cq/ydzIyEBn9jMSV41ydgOTj6edr+wN5c22DQGM I+vbmXyfwsztWVvd/2kbprQkCbuRsg767yG0gIKMMmMdmCKXAnuzd4QFQypgUOv+Jxbz lXpKVHLIaiN5X5JCqs8xkkY5lXE9O0XKjLwv5h35fZF/F//SxIsLfRg5CddDML9CHHUH t0nmLDxJ44vJuaPBAUDpESqHKoVlLHUn7juwAcdl2Q5m5ewIdimYmN6DCmKdaFGCo+QA 03m4IHkgn6ekbkVvEgyQSbM0yN6I+RuJNFqNGlZXCwijsCCFqbIG9j2zNLB3Bezt/G6e pLzg== 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=SeqNwkukoDICGTooOTTdKIX6Gi6dux3LQCkkPvcV00rbTmQWKX8XHJgEbOe9Q7knFa PFSBNdoBR2icshYoyUvLITetnYFgHZ4K9hTLSBKBjx8Mwd/dR6wphFAiJpxCDgQvh+VY GGNWNuRkNsfvLqlRl5cNJkXusYdlsAvUnkJFlPQRfvFzvBPK5vlkCqNjV+Xex4tTKp9v Qe7EtHJhfCR+0LCV89QRijjXZ4lwNMZc2d4dvXsVSckJKtmChOpAZAzK/ANyXrxD4jbm KUnNFPoe5NqFkpZNhbqGhzvzNQmpo4z4uLlHiZXXlHJcp/Iym0dVyg0qD/Ze4afoSkhG jdHw== X-Gm-Message-State: AOAM5335OvwaKLE/+1fgOXXrJayNOBhLKWzEQWo0ENowXw266zo637KM aXW/fW9d2JJomqXSJsznFdOlcFaJsNk= X-Received: by 2002:a17:90b:1e4f:: with SMTP id pi15mr3681619pjb.231.1634183913427; Wed, 13 Oct 2021 20:58:33 -0700 (PDT) Received: from localhost ([198.11.176.14]) by smtp.gmail.com with ESMTPSA id c64sm937355pga.40.2021.10.13.20.58.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Oct 2021 20:58:33 -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 , "H. Peter Anvin" , Juergen Gross , "Peter Zijlstra (Intel)" , Joerg Roedel Subject: [PATCH V3 43/49] x86/doublefault: Use C entry code Date: Thu, 14 Oct 2021 11:58:29 +0800 Message-Id: <20211014035836.18401-1-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20211014031413.14471-1-jiangshanlai@gmail.com> References: <20211014031413.14471-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