Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1510848imc; Mon, 11 Mar 2019 15:49:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtn9nkSedGArrgqtRiS1ZQM9PF21PDGpBr5q6RxAHNHeMXUKS3UAPOEB7GF4/1bC5TGlj3 X-Received: by 2002:a17:902:aa0c:: with SMTP id be12mr375879plb.63.1552344560292; Mon, 11 Mar 2019 15:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552344560; cv=none; d=google.com; s=arc-20160816; b=YT8Vgy3kd7Q4gQnmQwhmwv1DgPTI/Pb/+5tQSZ04nRWP7gkJHghNHpTnXZQiz16HbU tc44YhOJz+39ivyZNcEH7En1DML2tVJv7dXLnRPAt6FZ5ZTyBzOm6gIUgqstn69oSJCH fnX4JMqNYffRNiuVk+HBx6yha1d5+C0soJBHVZyC8bvuu83lrXn8XyPb2X+swcwbxfvX YZnyaCz5Rs5Jl9lCTCsmKYFU8stoDYB9kmGgGgxZ43lLF+zJeKYnCWJH86vwLWx7pLe+ DQzxnp4xLKeKaNXiCRHBsX9h+/WVNhTpwLNpbHaCj6Z/whoXT+PsBvgdr+V0bK12MB2I ad7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iEuZdxgzte31neQOpOPXZlUry2kFG1HOtg5QpfyzwNw=; b=W2NBwguO/sDAErzHsljmtVonX8ahXAp1/Vy/9vxVAtJbPGxWMLvrn302E2Tv/v09v8 Xu61MMaxQ+kvcQpRESTJ6IBvXw9i2wNXetSsh1Ge2SYzApPxGo3MkU2rRSHWf3JijFsi oNbab34ArW6bLUPM+5zBb5PcIoyfKBiGdXScqU6+1mrnCytCDMlnM0arZuaSS1Yd1b5T HDAdw9HEI2Bon5tg9nJm83BF/h/uQTD5ozzGC/lr0gU/pt8N1uafINKoNwvld6yo8jMe tgFr3j8ezZSieTWNujpyyZ89xBdJdMymjzpT2bSZaIY0Oa9EGpil8kVePB0uYZ5mf3oY Meyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94si6250699plc.298.2019.03.11.15.49.05; Mon, 11 Mar 2019 15:49:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbfCKWs2 (ORCPT + 99 others); Mon, 11 Mar 2019 18:48:28 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33992 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbfCKWsZ (ORCPT ); Mon, 11 Mar 2019 18:48:25 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ADD9B1688; Mon, 11 Mar 2019 15:48:24 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 330173F59C; Mon, 11 Mar 2019 15:48:23 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org Subject: [PATCH 13/14] x86/entry: Remove unneeded need_resched() loop Date: Mon, 11 Mar 2019 22:47:51 +0000 Message-Id: <20190311224752.8337-14-valentin.schneider@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311224752.8337-1-valentin.schneider@arm.com> References: <20190311224752.8337-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the enabling and disabling of IRQs within preempt_schedule_irq() is contained in a need_resched() loop, we don't need the outer arch code loop. Signed-off-by: Valentin Schneider Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: x86@kernel.org --- arch/x86/entry/entry_32.S | 3 +-- arch/x86/entry/entry_64.S | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index d309f30cf7af..b1856fe9decf 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -766,13 +766,12 @@ END(ret_from_exception) #ifdef CONFIG_PREEMPT ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) -.Lneed_resched: cmpl $0, PER_CPU_VAR(__preempt_count) jnz restore_all_kernel testl $X86_EFLAGS_IF, PT_EFLAGS(%esp) # interrupts off (exception path) ? jz restore_all_kernel call preempt_schedule_irq - jmp .Lneed_resched + jmp restore_all_kernel END(resume_kernel) #endif diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 1f0efdb7b629..e7e270603fe7 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -645,10 +645,9 @@ retint_kernel: /* Check if we need preemption */ btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f -0: cmpl $0, PER_CPU_VAR(__preempt_count) + cmpl $0, PER_CPU_VAR(__preempt_count) jnz 1f call preempt_schedule_irq - jmp 0b 1: #endif /* -- 2.20.1