From owner-freebsd-current@freebsd.org Wed Dec 30 18:04:51 2020 Return-Path: Delivered-To: freebsd-current@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 742284CA900; Wed, 30 Dec 2020 18:04:51 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (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 4D5fM64MMCz4Spm; Wed, 30 Dec 2020 18:04:50 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: by mail-yb1-xb32.google.com with SMTP id x2so15464711ybt.11; Wed, 30 Dec 2020 10:04:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=opHY58yAjiiMUVrWfnz7SpdcNjJO7ECfzt5SHKr6b8w=; b=GRllFZHOdUg9dTDn5zAstThKHTLVzV/GtBKyiK4xTLicPIX4Ip49pGEjR8mI52JtWg R7qImP7GsweCT05SR/HgxhKqJ1QMJg5lUrb3PV1cefWHN7azK/iBXriPEReYkiDi+Acc SbvuavUyEG/tIxFDItsZcQ3EpvfZ2uhFWK8uTpNnAJqks5/OSkKW/XXGNyS9RsIWRYgE 24aYF2+/FrbBKByRxifl79tcE9IdI+HE1O5Pps6tw+1IvBBp6VyxtDLjQw9e00jbkRX5 eAfUU8z72mcProqibMIq9dIM9mZm5rnZ6aLdovhUnHqgfFX7X5C8wa2ATLtLSVbzSAYL JMLA== X-Gm-Message-State: AOAM532a8WFjTDxwVOirq+/ciFMOso0D1DUVdt/6tgIVS592SB+E5CuY ohbirSncBXYcmfXfT8p6xhAnk+7KpdIA0ZzYzuU= X-Google-Smtp-Source: ABdhPJyRhCA5s0AvVkK4E1wyTpU9Wob3PwdnKYYeZIznTIWga7iHRbBa9cdNE91zmYrbGjr+aF5Cqhfa2WGoReApftw= X-Received: by 2002:a5b:b49:: with SMTP id b9mr73025295ybr.310.1609351489683; Wed, 30 Dec 2020 10:04:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Chuck Tuffli Date: Wed, 30 Dec 2020 10:04:38 -0800 Message-ID: Subject: Re: Intel TigerLake NVMe vmd: Adding Support & Debugging a Patch To: Neel Chauhan Cc: freebsd-hackers@freebsd.org, FreeBSD-Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D5fM64MMCz4Spm X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(1.00)[0.998]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::b32:from]; TO_DN_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::b32:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b32:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers,freebsd-current]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 18:04:51 -0000 On Tue, Dec 29, 2020 at 6:30 PM Neel Chauhan wrote: > > Hi freebsd-hackers@, CC'd freebsd-current@, > > I hope you all had a wonderful holiday season. > > I recently got a HP Spectre x360 13t-aw200 which is an Intel > TigerLake-based laptop. It has the Intel "Evo" branding and an "Optane" > SSD which I disabled (so I can get a "second" SSD). > > On the Spectre, the NVMe is not detected: https://imgur.com/a/ighTwHQ > > I don't know if it is HP or Intel, but the VMD IDs device id is > 8086:9a0b. I'm guessing Intel since Dell laptops (XPS, Vostro) also have > this device ID [1]. > > Sadly, NVMe RAID is forced on this laptop. > > I wrote a rough patch to add the device IDs, and the patch is below: FWIW, that is the same change I would have made. Peeking at the Linux vmd driver, it doesn't appear to do anything special for 8086:9a0b as compared to the 8086:2a0c device the FreeBSD driver already supports. That said, the Linux driver reads a capability register to determine the bus number start (vmd_bus_number_start()) which I don't see in the FreeBSD driver. This is curious because, looking at the "lspci all" output from the XPS link you provided, the NVMe device shows up in PCI domain 0x1000 (i.e. not 0x0000). Which (and I have no direct experience with this device or code) only happens if the bus number start function returns 0x0. What is the output from # pciconf -rb pci0:0:14:0 0x40:0x48 --chuck