Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1619025ybp; Fri, 11 Oct 2019 17:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzplYD4GIp6hd5xUDlqbm70rx7VlUfB3q4yaGN5fZvOIRNjlvSb5ysydSps/tvZlTVsvppY X-Received: by 2002:a05:6402:1b8a:: with SMTP id cc10mr16452713edb.202.1570840922864; Fri, 11 Oct 2019 17:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570840922; cv=none; d=google.com; s=arc-20160816; b=HH34U4QeOkuk0goikOi4g8ny0ul9xDhNDr9cnJmrZ26C0DRN0Xcjz7N3pQMTusyxfg 7s8OhuGIMZ2ok0bTofK8fn4jBG5OofyxguI92izdwHXNx80Cg3qcqIQSbjcoTr2mZI8c caMsfwgipULWTR18e+t3L4xlc/Kp+aejfv2RTMh/4A6FzqQrjn6slX2YYfhT2OMVGUTa Ese7q10gFR+mQ0J6CbkPL9DnZjvH3UErEKCwWAWBzEp01we5Pzl+Sc+zrBvZbs2IAOLN 9OAclqeTa2+v5+o+XaOdkmgS5dX7dF1Nbmmla3OjYo1sV/0SYCOVlai6w5V5FavLZIZ2 JvbA== 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 :dkim-signature; bh=54LRcAZD00eVKPK3FNvqhw23ruw7tf3kBIi8BnJjoS0=; b=I/B/O0tRjI6smKrgB6flExXqlvOW1sKc60nHfnEJoGZ0IRU9pAV/ygEWeRsOpsn4k2 TfRUkFYIpgZAPduEh06I1t6jKwg2/NNH6U8+dPEcopp21XIOMbje3yGWdZ2lxsQ5k81I rDIgW0b8WOO2jM1hiSZQy/vNlaEY1+5r3spCY6Q9hvMsomqtdM/22GeDbkzVHu62RSWM HDsK4sqdy+2a5b3V5lSCgLo+5o9VeosBkhhtkP0koFHQcBNKgwmthR/14Mr65S7omTns BZmJ9116C/06TWW+rQUjCzqNm7SWt/swDpEoL8hM2pw9G/rSeQqASv6kiXatNWwt+YzA 1DsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uPOussVD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b25si6608023ejb.49.2019.10.11.17.41.39; Fri, 11 Oct 2019 17:42:02 -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=@gmail.com header.s=20161025 header.b=uPOussVD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728285AbfJLAhk (ORCPT + 99 others); Fri, 11 Oct 2019 20:37:40 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:40489 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbfJLAhj (ORCPT ); Fri, 11 Oct 2019 20:37:39 -0400 Received: by mail-lj1-f196.google.com with SMTP id 7so11436131ljw.7 for ; Fri, 11 Oct 2019 17:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=54LRcAZD00eVKPK3FNvqhw23ruw7tf3kBIi8BnJjoS0=; b=uPOussVDx72S+iDIooeNqsmbtrl7it6MbxgKtymlvx2TNLPMvf8vvRvlMzTvEba84v wvzMXMASiBtbhasQZVqhQCC4QC8X657wNp3wxbRSIFZ5SjONATAoHk4ATDB/AuzrGR85 8lLOdZtC0Bd0A9tMSlM/QRPVzPZ+QQ/YX+ESPA6zDMHUajQtOUxVvfqb2nvMkM1nt9Yx eS1wDxICqSE0Z/FVMlkJ1sqBHx35V294Uoz8sAk0UEDd4iTFl+vN4shsomAoTcYOfpj4 p9fXKnxoFeotcFLADwxbNWoezyWiTYmkOQDXlfQlsVLQRLEIvJMV4fS7uFRPwSbk4MlN MR5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=54LRcAZD00eVKPK3FNvqhw23ruw7tf3kBIi8BnJjoS0=; b=FRBQai4aWjIUn1Bg+8JEfMtSYNWDASgxIN/W7gWR5x36DSX16O5Eg3oxOe5ynOHoL0 9H6Mr3V9QVUFY6RM5qXkaG+ogKzFjEOMsdkeMIrDfMWD1hmDxJg/tdhDMLM3WFEEer2V oBbfV+7iu8139aTU9EafARjke7eAvbwq16ofr5AhpZ2mD//Whzrv32KFWio/JmpfZTUY EoxJbUrjkWAuuoDj9bFwCuT8lrmwWVXRIbvY+2jqDANs5d5Ef8Bjp3lqsKeRBNIDUsaE hcCH4CDmCpQ0eoXvNmdJqWRjHWehIuEXSaAYwrWpS4MjdcTMJVq6qqNVc6Qdb/UDUlRV 9Rwg== X-Gm-Message-State: APjAAAWCbGGqA6NOTNlMzXQOam30bH594hvDIUOkshWk8UN3ZShToVE6 cXDuOjRWIKOcC7cpCqaAhNc= X-Received: by 2002:a2e:3c05:: with SMTP id j5mr11098180lja.24.1570840657244; Fri, 11 Oct 2019 17:37:37 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id f22sm2346620lfa.41.2019.10.11.17.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 17:37:36 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org, Al Viro Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov Subject: [PATCH v2 4/4] xtensa: initialize result in __get_user_asm for unaligned access Date: Fri, 11 Oct 2019 17:37:08 -0700 Message-Id: <20191012003708.22182-5-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191012003708.22182-1-jcmvbkbc@gmail.com> References: <20191012003708.22182-1-jcmvbkbc@gmail.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 __get_user_asm macro leaves result register uninitialized when alignment check fails. Add 'insn' parameter to __check_align_{1,2,4} and pass an instruction that initializes result register from __get_user_asm. Signed-off-by: Max Filippov --- arch/xtensa/include/asm/uaccess.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 43e923678dfb..d8cff972f3cf 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h @@ -129,17 +129,19 @@ do { \ * sync. */ -#define __check_align_1 "" +#define __check_align_1(insn) "" -#define __check_align_2 \ +#define __check_align_2(insn) \ " _bbci.l %[addr], 0, 1f \n" \ " movi %[err], %[efault] \n" \ + " "insn" \n" \ " _j 2f \n" -#define __check_align_4 \ +#define __check_align_4(insn) \ " _bbsi.l %[addr], 0, 0f \n" \ " _bbci.l %[addr], 1, 1f \n" \ "0: movi %[err], %[efault] \n" \ + " "insn" \n" \ " _j 2f \n" @@ -153,7 +155,7 @@ do { \ */ #define __put_user_asm(x_, addr_, err_, align, insn, cb)\ __asm__ __volatile__( \ - __check_align_##align \ + __check_align_##align("") \ "1: "insn" %[x], %[addr], 0 \n" \ "2: \n" \ " .section .fixup,\"ax\" \n" \ @@ -221,7 +223,7 @@ do { \ do { \ u32 __x; \ __asm__ __volatile__( \ - __check_align_##align \ + __check_align_##align("movi %[x], 0") \ "1: "insn" %[x], %[addr], 0 \n" \ "2: \n" \ " .section .fixup,\"ax\" \n" \ -- 2.20.1