Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2399514ioo; Sat, 28 May 2022 12:24:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNVRXEnhNCQM3+hJg1P36NxW3P04fK4VaZECtVAm3fJnMlyADVYrVwHD6zpBXeTyjstBpo X-Received: by 2002:a05:6a00:23ce:b0:50d:823f:981 with SMTP id g14-20020a056a0023ce00b0050d823f0981mr50782166pfc.10.1653765862076; Sat, 28 May 2022 12:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653765862; cv=none; d=google.com; s=arc-20160816; b=O9KXeu8qb5WMtslZFHloTE/v7xxL1srYdq+ERH24cnL7ry9ezvO0jbT/Nqroslbkzq Jxkfh1bSWArwZS3UVmBLDk8ZwL7zSc5nxW8+RC04lYlYImM8IhE1pWuy8VJHuAxb4Rgt 699hUoB4c7yVLkzlikPyHGR02/BcGlfUSEbTtpGcy8ST8zsziiSmIAXcqG1ui6SJSnxU OlaY8nL48TCE/r/cgcfIGG0z+mF74QBeA/X+BAwieQC+uDaQtiJ5ZcTPXLjTm3834EQ9 MTbjRMzQd2haO3/yvZ4uWAs4St2XxwauqURHO3+PbIiQLZqFQi4tDldg196dCRWV17w2 HG5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=+JGtDgYp2DeExhgY3BMzdxxuOwFDkDKhT0Bkt0NowsE=; b=mI3y64Oh1p6y6O2MRjOtqJ1ASQmdG0AIhBLO1lK0wwqPaU3Ta0kFRGxxTo1vuiVchX +xYFQ4uZl1/QSyBzsKy1N0hMG8IS9SPs8ETQCtct2aTL5UuOGNKTCdEyVcX1KHquH9v+ bYXRd9237uJktXFuwHX54NStxgb4ocmdKUpwh0McEFmGxc80X7UKcC7iT7PL65SNWJZ3 Kt/KDgw9P4eCKd43ElfQnQQc2yJWFL/Q938D5LGrZs3XzKL+NbnWSZT6mc4bi6Jj+/44 y/NdTXaRIvFDH83QCnjCS7UClqk/msw0gB7w1NQ8C3ErIZjlIs9F85ReH0MFIh61HiRz DaTA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f4-20020a17090a9b0400b001e290a8c473si4034980pjp.96.2022.05.28.12.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:24:22 -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; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 239EC35DEA; Sat, 28 May 2022 11:54:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230477AbiE1IDe (ORCPT + 99 others); Sat, 28 May 2022 04:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbiE1IDc (ORCPT ); Sat, 28 May 2022 04:03:32 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62284219 for ; Sat, 28 May 2022 01:03:29 -0700 (PDT) Received: (Authenticated sender: alex@ghiti.fr) by mail.gandi.net (Postfix) with ESMTPSA id DCC9E24000A; Sat, 28 May 2022 08:03:23 +0000 (UTC) Message-ID: Date: Sat, 28 May 2022 10:03:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [syzbot] riscv/fixes test error: lost connection to test machine Content-Language: en-US To: Dmitry Vyukov , Alexandre Ghiti Cc: syzkaller-bugs , syzbot , Albert Ou , LKML , linux-riscv , Palmer Dabbelt , Paul Walmsley References: <000000000000d0437b05dffdd1de@google.com> <36f4745f-0e47-4f49-8f4e-ff7544f163d8n@googlegroups.com> From: Alexandre Ghiti In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 5/27/22 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 property.. >>>>>> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes >>>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=1418add5f00000 >>>>>> kernel config: https://syzkaller.appspot.com/x/.config?x=aa6b5702bdf14a17 >>>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=2c5da6a0a16a0c4f34aa >>>>>> 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=0xffffff5908a940 cnt=0x1 >>>>> packed=0xffff5908a9400001 -> node=0xffff5908a940 >>>>> 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 pointers >>>>> assuming they are unused. >>>>> However, the original pointer node=0xffffff5908a940 suggest riscv 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–48 all equal to bit 47, or else a page-fault exception will >>>>> occur.": >>>> >>>> Thanks for pointing that, I extracted that from the specification before sv57 was specified, I'll fix that. >>>> >>>> The current kernel code will use sv57 as it is supported and advertised 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] = { >>>> [VM_1_10_MBARE] = 1, >>>> [VM_1_10_SV39] = 1, >>>> [VM_1_10_SV48] = 1, >>>> - [VM_1_10_SV57] = 1 >>>> + [VM_1_10_SV57] = 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 the 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 Thank you for that, I'll pull that into Ubuntu when merged. Do you know if any other programming language does the same and would need a fix too? > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv