From owner-freebsd-virtualization@freebsd.org Thu Mar 19 03:58:12 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 706D6279C09 for ; Thu, 19 Mar 2020 03:58:12 +0000 (UTC) (envelope-from jtubnor@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (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 48jY6B47mBz48FV for ; Thu, 19 Mar 2020 03:58:10 +0000 (UTC) (envelope-from jtubnor@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id e9so961739otr.12 for ; Wed, 18 Mar 2020 20:58:10 -0700 (PDT) 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=vR7qbuM3QOtVmpSIDWXVZM/3KjDvONW96XkJHm+vz/U=; b=K4gLtMVgv8nPB0a9FgrHwPEC2Kb/7aVQ15Tnmoup7fsvYzk36V5vkD4pJ4+IojoVT8 g95PquMy2gw8z2zs3UMDg770SdZ71CKov1dp7bA1kdSr2tvHAHgru7YU1cUFV6tDYs3g z/X7eFm0y+yNMPlutVfObZF2eKSTsiwtv81EMsngV06YWAavAshdnLcB51TZzHy7x8SI UZEmLRvaiN7T7ooueJLZHifborFVTm8DXV8i6QKVzGNiTuoUbGx866L8nRe1b95f2nH8 5gfK669PUav1wB3Y1Z1CD0F7V5rdfd6U0Y8NrOAHFPJc5DBLau53P0UrrKwNLjUCzsVb iUTA== X-Gm-Message-State: ANhLgQ0Qs9VkHXLOWcXOQmxCnFaDAcd/HFovJ1JzLktO2y3B8fAiXcLO au9ftqcVPSsQPlFSKJaYhYY23hneNG3b4mW4LVo= X-Google-Smtp-Source: ADFU+vvIYwu3dScVCtCparu7H/vY0p3GcqsUfLo12UtXGmET7FBkgV6lIrPVK8RPmAJaXK3/zIOKqy15hNARQqPGjoc= X-Received: by 2002:a9d:228:: with SMTP id 37mr813797otb.52.1584590288291; Wed, 18 Mar 2020 20:58:08 -0700 (PDT) MIME-Version: 1.0 References: <20200318175901.GI4213@funkthat.com> In-Reply-To: From: Jason Tubnor Date: Thu, 19 Mar 2020 14:57:57 +1100 Message-ID: Subject: Re: bhyve: passthrough SMART info from host nvme controller To: Wanpeng Qian Cc: John-Mark Gurney , FreeBSD virtualization X-Rspamd-Queue-Id: 48jY6B47mBz48FV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jtubnor@gmail.com designates 209.85.210.51 as permitted sender) smtp.mailfrom=jtubnor@gmail.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; DMARC_NA(0.00)[tubnor.net]; RWL_MAILSPIKE_GOOD(0.00)[51.210.85.209.rep.mailspike.net : 127.0.0.18]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[51.210.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.13)[ip: (-0.99), ipnet: 209.85.128.0/17(-2.97), asn: 15169(-1.65), country: US(-0.05)]; FORGED_SENDER(0.30)[jason@tubnor.net,jtubnor@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jason@tubnor.net,jtubnor@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:58:12 -0000 On Thu, 19 Mar 2020 at 14:09, Wanpeng Qian wrote: > > 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. So are you implying that it is safe for a guest to send such a call at anytime? For those that use bhyve for isolation, this sort of facility would be problematic not to mention insecure.