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=-8.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 D918AC10F27 for ; Wed, 11 Mar 2020 14:59:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 98D3720575 for ; Wed, 11 Mar 2020 14:59:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ehQj8eQ4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98D3720575 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D4FC6B0003; Wed, 11 Mar 2020 10:59:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 25D946B0005; Wed, 11 Mar 2020 10:59:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 126166B0006; Wed, 11 Mar 2020 10:59:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id E9CD66B0003 for ; Wed, 11 Mar 2020 10:59:29 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BAAD64995E3 for ; Wed, 11 Mar 2020 14:59:29 +0000 (UTC) X-FDA: 76583390058.21.doll37_6ff57f14d7c53 X-HE-Tag: doll37_6ff57f14d7c53 X-Filterd-Recvd-Size: 7414 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Mar 2020 14:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583938768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lgPfisvUJxgIboiQdBSgS0Rxfxp4rz+XesJTHM+Uu7c=; b=ehQj8eQ49RaPDCdeNdP8dDXJ0MWimNqBnOlXm7l2xP2x0OZcJ+JDloskB4G3o8lUNbcgzn 3W8WD9HeAhWD+lvnxMbks1blJWBYRDXNkrg6DeiVNAOAE7EprJfRJr7gfSYJKtWr6nCSEX FEku8iu2Hhgq85skrzRwv8FwO2aMJ2c= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-eUiGQS9CNhKnpNHkw3qpyw-1; Wed, 11 Mar 2020 10:59:24 -0400 X-MC-Unique: eUiGQS9CNhKnpNHkw3qpyw-1 Received: by mail-qv1-f69.google.com with SMTP id a12so1495437qvv.8 for ; Wed, 11 Mar 2020 07:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3DotR7RA5jbkp7rML0qhSL26rD/VPOx/YjqQfV5c780=; b=axU1PThw5GxDnQ4dYwzrlYqaBydGXUEZp3e2sgpmhmlZZ96SsIOzX8zmSpOCwcIBsD 3oYr4BK2WluHUCYdLNLwRrzdy91xzkcCjwXzzJeEmH3x7u+zAlbxWBMXiquEQ6Kgc6sq YchuF1Br+yE3GF+t3ifsAKUZWRlNEU+yXAuqnmdQl1m9kyYDDG6Qy12Vp3gHg14UE4bS 4EIvsxEDLVzJpG2SrrwLe2mOiu1ff78zNc5zhTHmxtWZB7Z4/H9KUtPqoxt67UBhbtCu gt2BFrqqmydSqX5Bw+f3stXTuJf1gh9Zc4bUAjxWB7UawnYeLsKBEEE3rgZDfY+C27A3 KAhQ== X-Gm-Message-State: ANhLgQ05RpQVriJRLDrQMMqEYPzZpEt3D8fgvtmmO9xSBl8kfOZT/Wji KqLI5mGJKbmhB0/a4fJC3snN8XmuulUuvchUItDIl8GTbbG+zX+M+RgAc2ttHsm/mqK56qhzka2 OiZmMT5fdabs= X-Received: by 2002:ac8:4b45:: with SMTP id e5mr3093900qts.164.1583938764084; Wed, 11 Mar 2020 07:59:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvppgMvmZeR/2byMIcjqnGyQFrdY+/HaO8aGw6uKdkxh+u5bzwWpBPL2cUp4dqTslXuOybnzg== X-Received: by 2002:ac8:4b45:: with SMTP id e5mr3093879qts.164.1583938763733; Wed, 11 Mar 2020 07:59:23 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id p38sm9748751qtf.50.2020.03.11.07.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 07:59:22 -0700 (PDT) Date: Wed, 11 Mar 2020 10:59:21 -0400 From: Peter Xu To: kbuild test robot , Andrew Morton Cc: kbuild-all@lists.01.org, Johannes Weiner , Andrew Morton , Linux Memory Management List Subject: Re: [hnaz-linux-mm:master 90/340] arch/x86/mm/fault.c:1468:34: sparse: sparse: incorrect type in argument 1 (different base types) Message-ID: <20200311145921.GD479302@xz-x1> References: <202003111238.LoxsD1le%lkp@intel.com> MIME-Version: 1.0 In-Reply-To: <202003111238.LoxsD1le%lkp@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 11, 2020 at 12:30:41PM +0800, kbuild test robot wrote: > tree: https://github.com/hnaz/linux-mm master > head: 5d9ee416b5701096536c7a63c04dbe25012baa9e > commit: 79181dfcc4b8c2091126a8b3175957a598ae61e1 [90/340] x86/mm: use hel= per fault_signal_pending() > reproduce: > # apt-get install sparse > # sparse version: v0.6.1-174-g094d5a94-dirty > git checkout 79181dfcc4b8c2091126a8b3175957a598ae61e1 > make ARCH=3Dx86_64 allmodconfig > make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' >=20 > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot >=20 >=20 > sparse warnings: (new ones prefixed by >>) >=20 > >> arch/x86/mm/fault.c:1468:34: sparse: sparse: incorrect type in argumen= t 1 (different base types) @@ expected unsigned int fault_flags @@ go= t restricted vm_fault_t [assignedunsigned int fault_flags @@ > >> arch/x86/mm/fault.c:1468:34: sparse: expected unsigned int fault_fl= ags > >> arch/x86/mm/fault.c:1468:34: sparse: got restricted vm_fault_t [ass= igned] [usertype] fault > >> include/linux/sched/signal.h:381:16: sparse: sparse: restricted vm_fau= lt_t degrades to integer Hi, Andrew, I'm not sure whether this comes from the extra "-fdiagnostic-prefix" because I didn't encounter that, but if after the previous signal.h fixup squashed into patch "mm: Introduce fault_signal_pending()", then we have linux/mm_types.h included already, and it'll be pretty safe to just use vm_fault_t here. To be explicit, maybe another squash-in would work to the same patch: -------------8<------------- diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index c8e0e4f801e4..65ea429daaa2 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -377,7 +377,7 @@ static inline int signal_pending_state(long state, stru= ct task_struct *p) * instead, especially with the case where we've got interrupted with * a VM_FAULT_RETRY. */ -static inline bool fault_signal_pending(unsigned int fault_flags, +static inline bool fault_signal_pending(vm_fault_t fault_flags, struct pt_regs *regs) { return unlikely((fault_flags & VM_FAULT_RETRY) && ------------->8------------- So the whole fixup is (against "mm: Introduce fault_signal_pending()"): -------------8<------------- diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index fd64b135fd7b..4a0eafe3d932 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -154,7 +154,7 @@ static void __kprobes __do_page_fault(struct pt_regs *r= egs, unsigned long write, */ fault =3D handle_mm_fault(vma, address, flags); - if (fault_signal_pending(regs)) + if (fault_signal_pending(fault, regs)) return; perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 09d40ce6a162..65ea429daaa2 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -10,6 +10,8 @@ #include #include #include +#include +#include /* * Types defining task->signal and task->sighand and APIs using them: @@ -375,7 +377,7 @@ static inline int signal_pending_state(long state, stru= ct task_struct *p) * instead, especially with the case where we've got interrupted with * a VM_FAULT_RETRY. */ -static inline bool fault_signal_pending(unsigned int fault_flags, +static inline bool fault_signal_pending(vm_fault_t fault_flags, struct pt_regs *regs) { return unlikely((fault_flags & VM_FAULT_RETRY) && ------------->8------------- Thanks, --=20 Peter Xu From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0704466021041921286==" MIME-Version: 1.0 From: Peter Xu To: kbuild-all@lists.01.org Subject: Re: [hnaz-linux-mm:master 90/340] arch/x86/mm/fault.c:1468:34: sparse: sparse: incorrect type in argument 1 (different base types) Date: Wed, 11 Mar 2020 10:59:21 -0400 Message-ID: <20200311145921.GD479302@xz-x1> In-Reply-To: <202003111238.LoxsD1le%lkp@intel.com> List-Id: --===============0704466021041921286== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, Mar 11, 2020 at 12:30:41PM +0800, kbuild test robot wrote: > tree: https://github.com/hnaz/linux-mm master > head: 5d9ee416b5701096536c7a63c04dbe25012baa9e > commit: 79181dfcc4b8c2091126a8b3175957a598ae61e1 [90/340] x86/mm: use hel= per fault_signal_pending() > reproduce: > # apt-get install sparse > # sparse version: v0.6.1-174-g094d5a94-dirty > git checkout 79181dfcc4b8c2091126a8b3175957a598ae61e1 > make ARCH=3Dx86_64 allmodconfig > make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' > = > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot > = > = > sparse warnings: (new ones prefixed by >>) > = > >> arch/x86/mm/fault.c:1468:34: sparse: sparse: incorrect type in argumen= t 1 (different base types) @@ expected unsigned int fault_flags @@ go= t restricted vm_fault_t [assignedunsigned int fault_flags @@ > >> arch/x86/mm/fault.c:1468:34: sparse: expected unsigned int fault_fl= ags > >> arch/x86/mm/fault.c:1468:34: sparse: got restricted vm_fault_t [ass= igned] [usertype] fault > >> include/linux/sched/signal.h:381:16: sparse: sparse: restricted vm_fau= lt_t degrades to integer Hi, Andrew, I'm not sure whether this comes from the extra "-fdiagnostic-prefix" because I didn't encounter that, but if after the previous signal.h fixup squashed into patch "mm: Introduce fault_signal_pending()", then we have linux/mm_types.h included already, and it'll be pretty safe to just use vm_fault_t here. To be explicit, maybe another squash-in would work to the same patch: -------------8<------------- diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index c8e0e4f801e4..65ea429daaa2 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -377,7 +377,7 @@ static inline int signal_pending_state(long state, stru= ct task_struct *p) * instead, especially with the case where we've got interrupted with * a VM_FAULT_RETRY. */ -static inline bool fault_signal_pending(unsigned int fault_flags, +static inline bool fault_signal_pending(vm_fault_t fault_flags, struct pt_regs *regs) { return unlikely((fault_flags & VM_FAULT_RETRY) && ------------->8------------- So the whole fixup is (against "mm: Introduce fault_signal_pending()"): -------------8<------------- diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index fd64b135fd7b..4a0eafe3d932 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -154,7 +154,7 @@ static void __kprobes __do_page_fault(struct pt_regs *r= egs, unsigned long write, */ fault =3D handle_mm_fault(vma, address, flags); - if (fault_signal_pending(regs)) + if (fault_signal_pending(fault, regs)) return; perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 09d40ce6a162..65ea429daaa2 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -10,6 +10,8 @@ #include #include #include +#include +#include /* * Types defining task->signal and task->sighand and APIs using them: @@ -375,7 +377,7 @@ static inline int signal_pending_state(long state, stru= ct task_struct *p) * instead, especially with the case where we've got interrupted with * a VM_FAULT_RETRY. */ -static inline bool fault_signal_pending(unsigned int fault_flags, +static inline bool fault_signal_pending(vm_fault_t fault_flags, struct pt_regs *regs) { return unlikely((fault_flags & VM_FAULT_RETRY) && ------------->8------------- Thanks, -- = Peter Xu --===============0704466021041921286==--