Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1166126yba; Thu, 9 May 2019 11:50:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjou1l23xuYg0+BQN4fu0jP2F5vKRswOKAMZJ6SnCuvqVFDTFr4XQrJBUu5g+zKKiX7yqS X-Received: by 2002:aa7:9577:: with SMTP id x23mr7597973pfq.164.1557427854439; Thu, 09 May 2019 11:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557427854; cv=none; d=google.com; s=arc-20160816; b=drcHQTaZM/3bZ0eNFI88OErH8Don5aW92ANSCV7o+TwIaphwx0exRTjj5Cj1bYpMJa 4JKmYG8PsTNn7kpxR+HYeEGXNeW4KlweICfJTpzL2JsfQF5TiZqynnG6mKzrY+2TgUF8 /qZoZJ0cZwtX/2YAO0lGemXtuQNzvCcqHlKrAjDb1PnZNH6GR1kfec3GUem0lk5Ujzdi iGirDGuyOhywKPm/UE71PgGGrPDU7QCMjiRKN6/itUciuKNCc9bqGSD6tAQNQtGAdBKA 8hSz3ouMFxJmpQSXIUj1UUJm3Hyr7ZnVd4e23PgkxwFRFAOxlyTKGBT+AUb+4LskLZ3S /kXg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IVX6pwx4rYVwVghl332T09U7VMsNILSr+gWki8fR1yk=; b=HRMN6kcCllSJszGJBNmWw2yb9bCq0Hd1+EMZI6c+YZHsmitDkh27FKGgadwBioCRr+ HQodX3e1CvFnqrlFSckF/LILtyGMYZ6KWGm8FwZ0Ak7wd2q/gfr8fIkGbABjjPBwyoBg ENZ73TRZV65n5gQwchRwcTJHIC/5xq46xtb+4aFCaW/vtf/DB309EpSI62sNk7qSQuA+ gq+8wTYos8wFai6NcaYpO+CZaUqYiju1DlvTkuHWOGpJIh0GXf3+iZ2u0TBHme9GnBtm lqPgQnS+MKTpWJLAm505JhPVbthGd8zxMNO7dpvtGXdf5u33IyFYOd6F6WqOed7jZ8r6 dBng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uStNVL/v"; 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 z1si4188252plb.48.2019.05.09.11.50.38; Thu, 09 May 2019 11:50:54 -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; dkim=pass header.i=@kernel.org header.s=default header.b="uStNVL/v"; 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 S1727965AbfEISsK (ORCPT + 99 others); Thu, 9 May 2019 14:48:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:40998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbfEISsI (ORCPT ); Thu, 9 May 2019 14:48:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A89D12184D; Thu, 9 May 2019 18:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557427688; bh=BUDnrf/w8DJeoUExIXvy5ZlhV8zEWHorSEFZJt2WU+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uStNVL/vnQsyBVkO7QgOvmEPuc7AQl+hQPhUiyq/dwrXJ5YhYQoa00W2krm4Gn73v c4KMfC6eLCcqsCmB2nZF/YAauYjoGgsnXFZl4hdZbuxAgpIbKn5mS7fyN8YRqHl7Rc tb7YBuw65gw+9OgGA59AZxhpsZD+Ctg9wgSzl+Nw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov , Sasha Levin Subject: [PATCH 4.19 32/66] xtensa: fix initialization of pt_regs::syscall in start_thread Date: Thu, 9 May 2019 20:42:07 +0200 Message-Id: <20190509181305.327667203@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190509181301.719249738@linuxfoundation.org> References: <20190509181301.719249738@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2663147dc7465cb29040a05cc4286fdd839978b5 ] New pt_regs should indicate that there's no syscall, not that there's syscall #0. While at it wrap macro body in do/while and parenthesize macro arguments. Signed-off-by: Max Filippov Signed-off-by: Sasha Levin --- arch/xtensa/include/asm/processor.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 677bc76c1d707..6e709fb562831 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -194,15 +194,18 @@ struct thread_struct { /* Clearing a0 terminates the backtrace. */ #define start_thread(regs, new_pc, new_sp) \ - memset(regs, 0, sizeof(*regs)); \ - regs->pc = new_pc; \ - regs->ps = USER_PS_VALUE; \ - regs->areg[1] = new_sp; \ - regs->areg[0] = 0; \ - regs->wmask = 1; \ - regs->depc = 0; \ - regs->windowbase = 0; \ - regs->windowstart = 1; + do { \ + memset((regs), 0, sizeof(*(regs))); \ + (regs)->pc = (new_pc); \ + (regs)->ps = USER_PS_VALUE; \ + (regs)->areg[1] = (new_sp); \ + (regs)->areg[0] = 0; \ + (regs)->wmask = 1; \ + (regs)->depc = 0; \ + (regs)->windowbase = 0; \ + (regs)->windowstart = 1; \ + (regs)->syscall = NO_SYSCALL; \ + } while (0) /* Forward declaration */ struct task_struct; -- 2.20.1