From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52A5CC43461 for ; Mon, 7 Sep 2020 13:33:26 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id B9DCA216C4 for ; Mon, 7 Sep 2020 13:33:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fvgALk8s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9DCA216C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 14FDB4B4A4; Mon, 7 Sep 2020 09:33:25 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ys6XYBh8Juw3; Mon, 7 Sep 2020 09:33:23 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 74AD14B461; Mon, 7 Sep 2020 09:33:23 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3197A4B443 for ; Mon, 7 Sep 2020 09:33:22 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15j2XmDxXXoe for ; Mon, 7 Sep 2020 09:33:21 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 278434B233 for ; Mon, 7 Sep 2020 09:33:21 -0400 (EDT) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 D5CCE207DE; Mon, 7 Sep 2020 13:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599485600; bh=hL47qDYxMDTVqevWnCXsSynbDvNsZ02kwtxd7Latxhs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fvgALk8ss2QOkJYpLJjiyYCZMa7pxqdDJc1c/FaRHbYUzBQBUc93wZ4V0B6+t0vM0 gxRZhV/5k6TKoazd4ug9LPb+q0OW89KUVqRKfa0bpSiOIoU7eXmFLi5DXtg5mQNdl5 l+zPu1G4omNWjGl/P8NK7gHg5yzapZFvWLqTCqvc= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFHGo-009m1C-3o; Mon, 07 Sep 2020 14:33:18 +0100 Date: Mon, 07 Sep 2020 14:33:17 +0100 Message-ID: <87r1rdlnj6.wl-maz@kernel.org> From: Marc Zyngier To: Andrew Scull Subject: Re: [PATCH v3 14/18] smccc: Cast arguments to unsigned long In-Reply-To: <20200903135307.251331-15-ascull@google.com> References: <20200903135307.251331-1-ascull@google.com> <20200903135307.251331-15-ascull@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: ascull@google.com, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, suzuki.poulose@arm.com, julien.thierry.kdev@gmail.com, will@kernel.org, catalin.marinas@arm.com, kernel-team@android.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: kernel-team@android.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, Sudeep Holla , will@kernel.org, kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thu, 03 Sep 2020 14:53:03 +0100, Andrew Scull wrote: > > To avoid warning about implicit casting, make the casting explicit. This > allows, for example, pointers to be used as arguments as are used in the > KVM hyp interface. > > Cc: Sudeep Holla > Signed-off-by: Andrew Scull > --- > include/linux/arm-smccc.h | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index 15c706fb0a37..3bb109a35554 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -260,7 +260,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, > typeof(a1) __a1 = a1; \ > struct arm_smccc_res *___res = res; \ > register unsigned long r0 asm("r0") = (u32)a0; \ > - register unsigned long r1 asm("r1") = __a1; \ > + register unsigned long r1 asm("r1") = (unsigned long)__a1; \ Given the pain we go through to extract the type of each argument, it seems odd to end-up with casts everywhere. I'd rather keep the type system alive by having: register typeof(a1) r1 asm("r1") = __a1; Is there any reason why this doesn't work? Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F3D3C43461 for ; Mon, 7 Sep 2020 13:34:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5C4E207DE for ; Mon, 7 Sep 2020 13:34:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LIU7DsmQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fvgALk8s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5C4E207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A4jN21esnHRQHTxo40mbT2b3q2blW8IPIHHQrxcle/Y=; b=LIU7DsmQXJdBn+EnMP6DYWeJR wFcIAf2EJmUkFYJTGGbqpyjk2n0DIEd2/OTTHL6QaBRURGvRed/mNLtty3MC7gF9+7tUrRPuP+31q WSJjA37KGp1RAbB805NpuLr4cnrT4YYmpxAQtxk2OLewxi5mMMs9M7YOfWmQ1tNl35kV2DnKkHlS1 noQrAIgm+doCw839LM5NTKkb1C7HCOE5gGWwnmpgbQAJOY6ouWMCrl8QwPF6+kM4CiFveZb8NxB3y RbyC4wTrgfLQSJyhHS9TkYVJqI7UxcFZKrszMI5CrTuiysjBj9EdM1SaB6aNSV+BZKWXb37Fzf+pw VG6UItOEQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFHGu-0002jd-0d; Mon, 07 Sep 2020 13:33:24 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFHGq-0002jA-Tk for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2020 13:33:21 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 D5CCE207DE; Mon, 7 Sep 2020 13:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599485600; bh=hL47qDYxMDTVqevWnCXsSynbDvNsZ02kwtxd7Latxhs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fvgALk8ss2QOkJYpLJjiyYCZMa7pxqdDJc1c/FaRHbYUzBQBUc93wZ4V0B6+t0vM0 gxRZhV/5k6TKoazd4ug9LPb+q0OW89KUVqRKfa0bpSiOIoU7eXmFLi5DXtg5mQNdl5 l+zPu1G4omNWjGl/P8NK7gHg5yzapZFvWLqTCqvc= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFHGo-009m1C-3o; Mon, 07 Sep 2020 14:33:18 +0100 Date: Mon, 07 Sep 2020 14:33:17 +0100 Message-ID: <87r1rdlnj6.wl-maz@kernel.org> From: Marc Zyngier To: Andrew Scull Subject: Re: [PATCH v3 14/18] smccc: Cast arguments to unsigned long In-Reply-To: <20200903135307.251331-15-ascull@google.com> References: <20200903135307.251331-1-ascull@google.com> <20200903135307.251331-15-ascull@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: ascull@google.com, kvmarm@lists.cs.columbia.edu, james.morse@arm.com, suzuki.poulose@arm.com, julien.thierry.kdev@gmail.com, will@kernel.org, catalin.marinas@arm.com, kernel-team@android.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200907_093321_012048_62E3142D X-CRM114-Status: GOOD ( 22.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, Sudeep Holla , will@kernel.org, kvmarm@lists.cs.columbia.edu, julien.thierry.kdev@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 03 Sep 2020 14:53:03 +0100, Andrew Scull wrote: > > To avoid warning about implicit casting, make the casting explicit. This > allows, for example, pointers to be used as arguments as are used in the > KVM hyp interface. > > Cc: Sudeep Holla > Signed-off-by: Andrew Scull > --- > include/linux/arm-smccc.h | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index 15c706fb0a37..3bb109a35554 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -260,7 +260,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, > typeof(a1) __a1 = a1; \ > struct arm_smccc_res *___res = res; \ > register unsigned long r0 asm("r0") = (u32)a0; \ > - register unsigned long r1 asm("r1") = __a1; \ > + register unsigned long r1 asm("r1") = (unsigned long)__a1; \ Given the pain we go through to extract the type of each argument, it seems odd to end-up with casts everywhere. I'd rather keep the type system alive by having: register typeof(a1) r1 asm("r1") = __a1; Is there any reason why this doesn't work? Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel