From owner-freebsd-virtualization@freebsd.org Thu Mar 19 03:09:57 2020 Return-Path: Delivered-To: freebsd-virtualization@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 BDB20278807 for ; Thu, 19 Mar 2020 03:09:57 +0000 (UTC) (envelope-from wanpengqian@gmail.com) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 48jX2X53KHz4Vmx for ; Thu, 19 Mar 2020 03:09:56 +0000 (UTC) (envelope-from wanpengqian@gmail.com) Received: by mail-qv1-xf36.google.com with SMTP id cz10so291461qvb.0 for ; Wed, 18 Mar 2020 20:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G0Kcm4lGHc/3RzmvjrCL4DUSGGU0m0vOnQT9PIfYFs0=; b=O/BQiIxe1Yb8T9bsiLWDyZElu8iqpp2H7q93ih7+/a7N78h7FvPfd63/7L1qS4Y2Dl 7SG6YwYvxQiG/TG+1AYVsTjgh4O1sG2aqnUAmJJVHVzQvULTz0XaeUEV+xpEsGcsuPBq ppmY0tvRMI9lEWdipS0kfU8VuffqeWkZ1ZcoV3lAiRtYk7IEX8dlG5I3psT+vFAgml62 yw+HNXOSgO7xh58CDjh6JuNm8tRHH/geEIZTCVCkcriJ8t3SB20Fy57GYirOUUA9i8q4 guKDkao+uWClpqtRRqfgiDLIXN+j8Db0ZN/wGSOUqQ+5wHGknrF7PhSQElzpY692qbm3 2xUg== 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=G0Kcm4lGHc/3RzmvjrCL4DUSGGU0m0vOnQT9PIfYFs0=; b=eZUz98hptfelpaisyZhvswcVZJSByqcjG4Qft4Gesb2ZspP+2fi4FPPzN6aX/Gio3p 87y/yNFhRX1VdealU2h7kvn94LqRqDjV3ScACT8+C5WvzblIfndGe+FYgLGRWtOhJ321 bm+K4OZl8eOnMyS+c1epsag3HiRkJYi8o6PMSQmQLZgaayTF5lKlip7G5BLA9/nHI0Nr 9vaoCIgHNimtlw3ekujoicO9BWcZZtLONBkUw4EKNi3eOOelOTmgkACjE6id5UbRY2CS J/PDSpGuH0g+ws4wyh/9oF0Mv/FyiEM61FUjtQ44IUUvKmRMB9hh1uiF402VWfgkcPtP jCUA== X-Gm-Message-State: ANhLgQ3BbfU2XCH/e5FKEYdnEAP0ZK2re3uwthk6cDTH0iSrpAWpB6KW 77k6xnvrntGYsDs+QW8Y4+wezo206fDZCsZvFhYYJul6aHw= X-Google-Smtp-Source: ADFU+vvm04ADjYqvNlhWE236FK2Z/jI50aSjf6EZAyYU5E7Jll+x7CzqMHi/FJlwEKUGuAFg2mtcD2eNJT2WqVk4STo= X-Received: by 2002:a0c:d603:: with SMTP id c3mr1051795qvj.45.1584587395600; Wed, 18 Mar 2020 20:09:55 -0700 (PDT) MIME-Version: 1.0 References: <20200318175901.GI4213@funkthat.com> In-Reply-To: <20200318175901.GI4213@funkthat.com> From: Wanpeng Qian Date: Thu, 19 Mar 2020 12:09:37 +0900 Message-ID: Subject: Re: bhyve: passthrough SMART info from host nvme controller To: John-Mark Gurney Cc: FreeBSD virtualization Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48jX2X53KHz4Vmx X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=O/BQiIxe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of wanpengqian@gmail.com designates 2607:f8b0:4864:20::f36 as permitted sender) smtp.mailfrom=wanpengqian@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[6.3.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; IP_SCORE(0.00)[ip: (-6.16), ipnet: 2607:f8b0::/32(-1.85), asn: 15169(-1.65), country: US(-0.05)]; 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]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2020 03:09:57 -0000 > Can't you do what something like pci_passthru.c does in passthru_init, > and open /dev/nvme0 in pci_nvme_init? Yes, you are correct. but that will make /dev/nvme0 keep open all the time. I just thinking when guest fire a logpage command, open the /dev/nvme0 and get the SMART info. then close /dev/nvme0. On Thu, Mar 19, 2020 at 2:59 AM John-Mark Gurney wrote: > > Wanpeng Qian wrote this message on Wed, Mar 18, 2020 at 13:05 +0900: > > But currently bhyve has Capsicum capability, I cannot > > open /dev/nvme0 within pci_nvme.c without extra code. > > (currently I just disable the Capsicum capability) > > > > any feedback? > > Can't you do what something like pci_passthru.c does in passthru_init, > and open /dev/nvme0 in pci_nvme_init? > > Or am I missing something? > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not."