From owner-freebsd-arm@freebsd.org Sun Dec 6 11:51:33 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4A3847AA18 for ; Sun, 6 Dec 2020 11:51:33 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CplCT3tGdz3nZW for ; Sun, 6 Dec 2020 11:51:33 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm1-x32d.google.com with SMTP id g185so11039784wmf.3 for ; Sun, 06 Dec 2020 03:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mbPM9ZiFs1tuHraQ/TgK7uAHyqU76cHElnM9LurRzuo=; b=FiPfoTjyz4Z0vcO4REIVQ8hRj/yhnrSUC6MCGXjXJxFavvpEykVaL1If0OtwW5rDCo YFbQ2s92Gl4hRxYn0xIeA8fskHiIXplqoq/ibYRpUWCIPtjXuhY2604kQOyzcBA8Xnpj lqGCe8f9VDSn9IbpmHIpaS+ZFzL6/uebqjkiMTgbUK6wOyF2b5HGwzu8YHfuHYksI68k F273hLdt0odNbvqG+LwGRLEnrHOx9TjsxemXjAqChOkHRZVKRmlSk7AHYoRb4RdvulXR KAciRp9C7AyrXI8iG+Q94d2vOMXIcmGXwqkEEeKsodmWhHq8z0EWGukM5GRwB7uXxJ9s 5PcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=mbPM9ZiFs1tuHraQ/TgK7uAHyqU76cHElnM9LurRzuo=; b=Z3MVgxAazrQng2sfIWD1edyAR/7CebtSaqVD6KwBMC24zilXtz8UiNrjEp07Ip52BR EYPSElsdZtYFGZYIb/+Y2l/Sj+9zU8M1sXQBqSYy11UGNT431XYAZXNBnve6hO6UccT3 kQUTKZLukg4nmhQLXiDLmWy8mdjWkeKM4mIJBhhN45VGTXSJt8CqZLpSLcYs9iZHo5gn EV67zCt4/oikIGYdAvJeqJG6EI32kbzzZVBU4FQb/Qf4giSMbL8z+QfN4hCA8yQP2h2f uHhYeOMzWeAj+g0TBZAQ4cosCkDCuXf37lLeQnKRe4pXOE59Yg1csl1PILOR0ntlWC4r ktRw== X-Gm-Message-State: AOAM533CH5u42MsA2t6ZyVqcj/BkrTV4BOUDOGMSq07bD/tReyQ13MjB /19qq+y4ohJhT40YXseGck8RDOSWOpg= X-Google-Smtp-Source: ABdhPJyXtX0MU3Q6bv5oicZtj96I7ybzyzF0gWVj40/L0KyZ3VA63ToIn34Kg70cuuHH7Ud/gPWlyQ== X-Received: by 2002:a1c:3987:: with SMTP id g129mr13068649wma.86.1607255491188; Sun, 06 Dec 2020 03:51:31 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id j14sm10427334wrs.49.2020.12.06.03.51.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Dec 2020 03:51:30 -0800 (PST) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: ThunderX Panic after r368370 To: Mark Millard Cc: Marcel Flores , freebsd-arm@freebsd.org References: <1C3442ED-278E-45B8-9206-0DD24FCBC237@brickporch.com> <4331eee0-74a6-565c-3bec-0051415b2bc1@freebsd.org> <56F0E9EB-0B78-4B0B-830A-48F8AFC5ABE1@yahoo.com> Message-ID: <91654fc4-8734-d8a7-5309-0400f418438a@freebsd.org> Date: Sun, 6 Dec 2020 12:51:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <56F0E9EB-0B78-4B0B-830A-48F8AFC5ABE1@yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CplCT3tGdz3nZW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2020 11:51:33 -0000 On 06.12.2020 10:47, Mark Millard wrote: > > > On 2020-Dec-6, at 00:17, Michal Meloun wrote: > >> On 06.12.2020 3:21, Marcel Flores wrote: >>> Hi All, >>> Looks like the ThunderX started panicking at boot after r368370: >>> https://reviews.freebsd.org/rS368370 >>> From a verbose boot, it looks like it bails in gic0 redistributor setup(?): >>> gic0: CPU29 Re-Distributor woke up >>> gic0: CPU24 enabled CPU interface via system registers >>> gic0: CPU17 enabled CPU interface via system registers >>> gic0: CPU29 enabled CPU interface via system registers >>> done >>> Full Verbose boot: >>> https://gist.github.com/mesflores/f026122495c8494d041bce04d30b15bb >>> I'm not really familiar with the details of the commit, but happy to test >>> anything if anyone has any ideas. >> >> >> Hi Marcel >> are you able to get crashdump and do backtrace? >> https://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html#kerneldebug-obtain >> and >> https://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-gdb.html >> If not, I'll make some debug patch. >> >> It's weird, even though GIC is potentially affected by my patch, in this case the cpuid numbering was not changed. > > (I've no access to a ThunderX. I just looked for my own curiosity. > Sorry if this is obvious and so is noise.) > > When I looked at the code it appeared to be the last "->" in > the following that was dereferencing the nullptr value (via [x8] > in assembler notation): > > static uint64_t > its_cmd_prepare(struct its_cmd *cmd, struct its_cmd_desc *desc) > { > uint64_t target; > uint8_t cmd_type; > u_int size; > > cmd_type = desc->cmd_type; > target = ITS_TARGET_NONE; > > switch (cmd_type) { > case ITS_CMD_MOVI: /* Move interrupt ID to another collection */ > target = desc->cmd_desc_movi.col->col_target; > . . . > > In other words: it appeared to me that the above desc->cmd_desc_movi.col > evaluated as 0 when used in what was reported. > This is very probably right analysis. But problem is that cmd_desc_movi.col should not be NULL, is initialized in its_cmd_movi from sc->sc_its_cols which should be allocated in gicv3_its_attach(). Marcel, can you, please also try this debug patch? https://github.com/strejda/freebsd/commit/a25ed736644b05672e3e813891af213c280daac3 Unfortunately, I have only single socket board with GIv3, Honeycomb, but it still boots fine. Thanks, Michal