Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1996697lfo; Sat, 28 May 2022 13:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5PJMLJ2UxeYNohS6vHR+b9xJTLq5Zcs5d5bxBI1Q9h86J3PHDFtlqwB7i23YS/Q10x7t+ X-Received: by 2002:a17:903:2352:b0:163:5f7d:cd0d with SMTP id c18-20020a170903235200b001635f7dcd0dmr18076303plh.35.1653768565722; Sat, 28 May 2022 13:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653768565; cv=none; d=google.com; s=arc-20160816; b=Sv0UpPQYnJQsn5mLT9cVV3dkj7JI+HrZbXcMzcrDXKaoWaAwPsNr46VOOCSjZsgQXK 8P+atgLN53hxA2V7BiS8Duk3rXkxxQz2xIpt3UZyIqNyMx60s3/vcvdiBgR06LYEhfw9 CL8LUNEywzkEufnbpYJRQQJo0DN1Q1+0ZOJqWGmYsPpB3g8fJDkFLVB5bsUKl9cxHKoX pObQrQ2Qk6cvGF8oKNvOyY+2sv8oH+jFwaEQmDOz5LN4Af8/GQu92m7lYAGLb21GE3Rr M3zFhPKfyOtKRYAaB7SPN4cmW6tF9Pdms0qBj9RfxkI5ddS0Wa9HTPCTFMREE68cw/bA 7LPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7O1uQ+fH+2XXGslA87taPYDC1XWUf/dTk1Y3Qhf6ShM=; b=xyIQ9Q7UU0KlDEurhg4T56ULKjNDpjXOi1YzHELBMa8y7t8QZLTBxzoK/Q1RBuKK+b C1nW0aNr05AA2fyF7wsmp3O6bydng76nt6UYQ3xdO77QSu18V5DzbS/ttJeNeZZ8lYmn BbGcQB7r4iVIxg6lPHU5EO+UC8rd27OaM7xeO/hbDvO2uiBmicMlrfQQTVHEqHYl5VY5 Tw2bkx5zBBUlsV0MP5Zzjf907B5z2ZfKZILaxn5wbB3IS7K5cELBdHOTsyGbHM7YiSRz WT8XQ7Ajx+eA6dGwJLKsmqewVaZqsEuRMDmc3Vk14g24vc1zgFNpdX283Qnzre3KJi7v U9qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S9sf7MGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a13-20020a170902eccd00b00153b2d16643si10130696plh.587.2022.05.28.13.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S9sf7MGV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A6D4611CA1B; Sat, 28 May 2022 12:23:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231752AbiE1Ibc (ORCPT + 99 others); Sat, 28 May 2022 04:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiE1Ibb (ORCPT ); Sat, 28 May 2022 04:31:31 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41737FD04 for ; Sat, 28 May 2022 01:31:30 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id l30so4847295lfj.3 for ; Sat, 28 May 2022 01:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7O1uQ+fH+2XXGslA87taPYDC1XWUf/dTk1Y3Qhf6ShM=; b=S9sf7MGVfYMKJbQDhgSR5GGPkUWpQAX5oswKyimagyCx6H26gGLhckjIbTepBkj1pr lbOpS7F3TN1+hyUWFSAROcl4lgoovVHAA6/jhReCz1lnN9lK1vOr8Cj3EwCFQRjCElph prOF/2X2MTQ9igvHewJoZ/V/BSBSUDYUQFC8wxcCSXWQZpMPLBuNi+QnAVQHk6yd8g0m kHv9TX5fW8CBlqy0ng1b4l47QW/DzB1VJ3ttq47Ua0oyjsGHCIpTrShggvHZKXKGqCLm otPxBSjdSQRlOSrHTg35y7f7JOQNOgXPbhQZ/urUUwu8RDsi1lmuGkgsxVevstVHEy2F 3h0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7O1uQ+fH+2XXGslA87taPYDC1XWUf/dTk1Y3Qhf6ShM=; b=JA8LEdLGXhJNi4UikAvJhBJSvlVEFbCFrgta1w1bi/wAlemOne15UlJ2Mtm2ykon6f 9RLk9J+V8/IIuAn0qchDJValJYvFoKBpV4CL8DSco2b60ok2nkWgxy2X2ohDrBTe/J4X 2g0upn1drFLFmQh8D8a8uQEjMAbCC1pMyWoothPiRCHRCzgaLpLeR6UF35U6RLUMEQTB rrM7yc4LnnNWzzeEW3FO+h4so5CDph3Zh43BbwwzP8tBQpRZRLrLOK9JPwEdnYbBPx4Q hzcmXqpNaM6vjBlSSEVnODQuETfVAvkZDH7hnwU6N1XzlkzDzzka0Ja4cqNpG995xQm9 NDiA== X-Gm-Message-State: AOAM53202sUWMDSXLtOU+z2KYu5yhMbBXk/Jc11ZnmYAx9MjzgG0Pcv4 Ara+VXQQj9oipmO9ONdVds12Mux77fq5MsGwMwuJPKQYR1+Dkw== X-Received: by 2002:a05:6512:1156:b0:478:79b1:583c with SMTP id m22-20020a056512115600b0047879b1583cmr19288721lfg.206.1653726688169; Sat, 28 May 2022 01:31:28 -0700 (PDT) MIME-Version: 1.0 References: <000000000000d0437b05dffdd1de@google.com> <36f4745f-0e47-4f49-8f4e-ff7544f163d8n@googlegroups.com> In-Reply-To: From: Dmitry Vyukov Date: Sat, 28 May 2022 10:31:16 +0200 Message-ID: Subject: Re: [syzbot] riscv/fixes test error: lost connection to test machine To: Alexandre Ghiti Cc: Alexandre Ghiti , syzkaller-bugs , syzbot , Albert Ou , LKML , linux-riscv , Palmer Dabbelt , Paul Walmsley Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 28 May 2022 at 10:09, Alexandre Ghiti wrote: > > On 5/27/22 19:12, Dmitry Vyukov wrote: > > On Fri, 27 May 2022 at 19:04, Dmitry Vyukov wrote: > >> On Fri, 27 May 2022 at 16:01, Alexandre Ghiti > >> wrote: > >>> On Friday, May 27, 2022 at 3:55:24 PM UTC+2 Dmitry Vyukov wrote: > >>>> On Fri, 27 May 2022 at 15:50, Alexandre Ghiti > >>>> wrote: > >>>>> On Friday, May 27, 2022 at 3:02:01 PM UTC+2 Dmitry Vyukov wrote: > >>>>>> On Fri, 27 May 2022 at 14:55, syzbot > >>>>>> wrote: > >>>>>>> Hello, > >>>>>>> > >>>>>>> syzbot found the following issue on: > >>>>>>> > >>>>>>> HEAD commit: c932edeaf6d6 riscv: dts: microchip: fix gpio1 reg pr= operty.. > >>>>>>> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/lin= ux.git fixes > >>>>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=3D1418a= dd5f00000 > >>>>>>> kernel config: https://syzkaller.appspot.com/x/.config?x=3Daa6b57= 02bdf14a17 > >>>>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=3D2c5da6a= 0a16a0c4f34aa > >>>>>>> compiler: riscv64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110= , GNU ld (GNU Binutils for Debian) 2.35.2 > >>>>>>> userspace arch: riscv64 > >>>>>>> > >>>>>>> IMPORTANT: if you fix the issue, please add the following tag to = the commit: > >>>>>>> Reported-by: syzbot+2c5da6...@syzkaller.appspotmail.com > >>>>>> The CONFIG_KASAN_VMALLOC allows riscv kernel to boot, but now Go > >>>>>> processes started crashing with: > >>>>>> > >>>>>> 1970/01/01 00:06:55 fuzzer started > >>>>>> runtime: lfstack.push invalid packing: node=3D0xffffff5908a940 cnt= =3D0x1 > >>>>>> packed=3D0xffff5908a9400001 -> node=3D0xffff5908a940 > >>>>>> fatal error: lfstack.push > >>>>>> runtime stack: > >>>>>> runtime.throw({0x30884c, 0xc}) > >>>>>> /usr/local/go/src/runtime/panic.go:1198 +0x60 > >>>>>> runtime.(*lfstack).push(0xdb3850, 0xffffff5908a940) > >>>>>> /usr/local/go/src/runtime/lfstack.go:30 +0x1a8 > >>>>>> > >>>>>> Go runtime tries to shove some data into the upper 16 bits of poin= ters > >>>>>> assuming they are unused. > >>>>>> However, the original pointer node=3D0xffffff5908a940 suggest risc= v now > >>>>>> has 56-bit users-space address space? > >>>>> > >>>>> Yes, sv57 was merged recently. > >>>>> > >>>>>> Documentation/riscv/vm-layout.rst claims 48-bit pointers: > >>>>>> " > >>>>>> The RISC-V privileged architecture document states that the 64bit = addresses > >>>>>> "must have bits 63=E2=80=9348 all equal to bit 47, or else a page-= fault exception will > >>>>>> occur.": > >>>>> > >>>>> Thanks for pointing that, I extracted that from the specification b= efore sv57 was specified, I'll fix that. > >>>>> > >>>>> The current kernel code will use sv57 as it is supported and advert= ised by qemu, and to my knowledge, you can't downgrade to sv48 unless by re= -compiling qemu using the following: > >>>>> > >>>>> diff --git a/target/riscv/csr.c b/target/riscv/csr.c > >>>>> index 6dbe9b541f..a64b50ed75 100644 > >>>>> --- a/target/riscv/csr.c > >>>>> +++ b/target/riscv/csr.c > >>>>> @@ -637,7 +637,7 @@ static const char valid_vm_1_10_64[16] =3D { > >>>>> [VM_1_10_MBARE] =3D 1, > >>>>> [VM_1_10_SV39] =3D 1, > >>>>> [VM_1_10_SV48] =3D 1, > >>>>> - [VM_1_10_SV57] =3D 1 > >>>>> + [VM_1_10_SV57] =3D 0 > >>>>> }; > >>>>> > >>>>> /* Machine Information Registers */ > >>>>> > >>>>>> ... > >>>>>> 0000000000000000 | 0 | 0000003fffffffff | 256 GB | > >>>>>> user-space virtual memory, different per mm > >>>>>> " > >>>> There is no kernel config to force SV48/39, right? > >>> > >>> No, we rely on what the hardware advertises, if it supports sv57, we'= ll go for sv57, if not, we'll try sv48...etc. I had some patches to force t= he downgrade by using the device tree but they never got merged though. > >> +original CC list > >> > >> FTR sent Go runtime change to support SV57: > >> https://go-review.googlesource.com/c/go/+/409055 > > > > > > Is CONFIG_CMDLINE broken on riscv? > > I am running with: > > > > CONFIG_CMDLINE=3D"earlyprintk=3Dserial net.ifnames=3D0 > > sysctl.kernel.hung_task_all_cpu_backtrace=3D1 ima_policy=3Dtcb > > nf-conntrack-ftp.ports=3D20000 nf-conntrack-tftp.ports=3D20000 > > nf-conntrack-sip.ports=3D20000 nf-conntrack-irc.ports=3D20000 > > nf-conntrack-sane.ports=3D20000 binder.debug_mask=3D0 > > rcupdate.rcu_expedited=3D1 no_hash_pointers page_owner=3Don > > sysctl.vm.nr_hugepages=3D4 sysctl.vm.nr_overcommit_hugepages=3D4 > > secretmem.enable=3D1 sysctl.max_rcu_stall_to_panic=3D1 > > msr.allow_writes=3Doff dummy_hcd.num=3D2 smp.csd_lock_timeout=3D300000 > > watchdog_thresh=3D165 workqueue.watchdog_thresh=3D420 > > sysctl.net.core.netdev_unregister_timeout_secs=3D420 panic_on_warn=3D1" > > > This command line is 608-character long, but we are still stuck with the > default COMMAND_LINE_SIZE to 512, I imagine that it is the problem. I > had proposed a patch last year to bump that to 1024, but it never got > merged > https://lore.kernel.org/lkml/CAEn-LTqTXCEC=3DbXTvGyo8SNL0JMWRKtiSwQB7R=3D= Pc4uhxZUruA@mail.gmail.com/T/#m4b45019dc0f5573f2a50c1f6007c5109fa35efff risc-v maintainers, please merge it now. I would even suggest 2048: git grep "define COMMAND_LINE_SIZE" arch/ arch/alpha/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 256 arch/arc/include/asm/setup.h:#define COMMAND_LINE_SIZE 256 arch/arm/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 1024 arch/arm64/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 2048 arch/ia64/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 2048 arch/m68k/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 256 arch/microblaze/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 256 arch/mips/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 4096 arch/parisc/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 1024 arch/powerpc/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 2048 arch/s390/include/asm/setup.h:#define COMMAND_LINE_SIZE CONFIG_COMMAND_LINE= _SIZE arch/sparc/include/uapi/asm/setup.h:# define COMMAND_LINE_SIZE 2048 arch/sparc/include/uapi/asm/setup.h:# define COMMAND_LINE_SIZE 256 arch/um/include/asm/setup.h:#define COMMAND_LINE_SIZE 4096 arch/x86/include/asm/setup.h:#define COMMAND_LINE_SIZE 2048 arch/xtensa/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 256 It's also interesting how the kernel handles overflow. Imagine one adds that_critical_security_feature=3D1 to the end of an existing long line.