Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp362014rdh; Sat, 23 Sep 2023 13:59:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF57eR4dXEiVx7eRPh5spNF+T7o7NVzBOUXErrF6B2pv4Ce2pdV9M19hLqOttjquNb0g9Ov X-Received: by 2002:a17:902:db09:b0:1c4:65d5:34ce with SMTP id m9-20020a170902db0900b001c465d534cemr9957531plx.31.1695502742578; Sat, 23 Sep 2023 13:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695502742; cv=none; d=google.com; s=arc-20160816; b=nael0HhNDVXB0i1vI17863Zn0XHSuU4JOZhMfTOlINf2DLZ7ICyWWuFANufyZJRXXP KtCotc3BsfT67HDgqVnABjCOcXvk9pYBkb2BXiPCm9pX/3V4RB0a6lcPud0YZt3uPrjh ccur4tVwHEjn/MsmiLLl2QZ2+rGlTrm7XJUWQpn75xciAsxAGGBPAylBQNz6mN365I4w I5S3u9uaWb0r+9hmCqPKcV9LKFQRE3lm5Z5L3ZaCgMxS8qrfj2++ekgyrJqwZmcjEdGU L0ZZw3yV/69gTjDuBtfE94p66u4p1rAyXTdKBu+7R303aSmgj0u3hNhrTKfrTzoTWlT6 aAng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+JQqm/IVrcsmgTAsdrlxoxSmuKKq2qQmGkyMVhE/DVg=; fh=7cKcmja+wSF156/sJzgPObjvbgYVSn97YHIMiFc8P7Y=; b=d+fJ/hOpcf9lZb1rACZJMqqLXsatNzVDi29UpY0suuKNTDE81+vQgGetV+YMYaRNFO anex0OKuy2egpRzDkph4YFdSDxeVCcHDgS7VxQ3M8Mrr9GwVeEmFv1R3BIUBS1oEkckV qyshoRu0KAGXaEpG3mvSA9kB7QGm4NbbDRYb8wHf4bs0U352tv2y9ZthMyeusz8+vLzh qXbhxD3bnY734AL91L2KlZN3Y4gXyEAW7alE5rd+y2amuT1ktuG7lE+Idco8Cin4jLXv n9tNXqzApvpnoNIpT8rzezNt+AcoQmeUHE6GZxRGlRSN1mDYHaUsSvXdtFtYHskt3QPD 3nnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n9-20020a170902e54900b001c45e1f034esi6970509plf.141.2023.09.23.13.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 13:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4C9078156F75; Sat, 23 Sep 2023 13:59:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbjIWU6x (ORCPT + 99 others); Sat, 23 Sep 2023 16:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjIWU6v (ORCPT ); Sat, 23 Sep 2023 16:58:51 -0400 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF7F11B; Sat, 23 Sep 2023 13:58:45 -0700 (PDT) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-690b7cb71aeso3210625b3a.0; Sat, 23 Sep 2023 13:58:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695502725; x=1696107525; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+JQqm/IVrcsmgTAsdrlxoxSmuKKq2qQmGkyMVhE/DVg=; b=UGIg9F5slJfMRHCYX1pX5KQXdFa7no/Q9AyUjB1ERYfdPPPrUsMqaZqqySv19y474U SDvpvFI1LzMnrai+cbvuhFx0dcFK54Djgn2BRQ+rN9qqBYQk6wr7hzpWXOQ3syue9+Bs c45BpRjDaUshOOxtTpuuMO38jVqMd2VVIF/Rl5CnxHnZrwxTIvNWrLdod4mjWpT2S6/U tnI1sk5fSOodft/sPcQdvm9ImqIFzSI9kva0OWTR4V++7S9R9iaPzOYjTy7KjIEBwMv1 vlAbnfpMMXOMSl9Xp0n2x2NcIwoi66fCwv+7foAWoKv3F0VhNDPAXN8ZkYlbO62Ek1Ii W85w== X-Gm-Message-State: AOJu0YxsaDqXcNcFYlFEf1D59FHzCYQaWsWI4YqXrkDUXZBrkseajc80 r1M6FKvJL7tOIFredXBSQkU= X-Received: by 2002:a05:6a00:32cc:b0:68f:c8b4:1a2b with SMTP id cl12-20020a056a0032cc00b0068fc8b41a2bmr9179930pfb.17.1695502724656; Sat, 23 Sep 2023 13:58:44 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id z22-20020aa791d6000000b0068a0c403636sm5309505pfa.192.2023.09.23.13.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 13:58:43 -0700 (PDT) Date: Sat, 23 Sep 2023 20:58:00 +0000 From: Wei Liu To: Greg KH Cc: Nuno Das Neves , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, patches@lists.linux.dev, mikelley@microsoft.com, kys@microsoft.com, wei.liu@kernel.org, haiyangz@microsoft.com, decui@microsoft.com, apais@linux.microsoft.com, Tianyu.Lan@microsoft.com, ssengar@linux.microsoft.com, mukeshrathor@microsoft.com, stanislav.kinsburskiy@gmail.com, jinankjain@linux.microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, will@kernel.org, catalin.marinas@arm.com Subject: Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V Message-ID: References: <1695407915-12216-1-git-send-email-nunodasneves@linux.microsoft.com> <1695407915-12216-16-git-send-email-nunodasneves@linux.microsoft.com> <2023092318-starter-pointing-9388@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023092318-starter-pointing-9388@gregkh> X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 23 Sep 2023 13:59:00 -0700 (PDT) Greg, thank you for looking at the code. On Sat, Sep 23, 2023 at 09:56:13AM +0200, Greg KH wrote: > On Fri, Sep 22, 2023 at 11:38:35AM -0700, Nuno Das Neves wrote: > > +static int __init mshv_vtl_init(void) > > +{ > > + int ret; > > + > > + tasklet_init(&msg_dpc, mshv_vtl_sint_on_msg_dpc, 0); > > + init_waitqueue_head(&fd_wait_queue); > > + > > + if (mshv_vtl_get_vsm_regs()) { > > + pr_emerg("%s: Unable to get VSM capabilities !!\n", __func__); > > + BUG(); > > + } > > > So you crash the whole kernel if someone loads this module on a non-mshv > system? > > That seems quite excessive and hostile :( > I agree this can be more lenient. It should be safe to just return an error code (ENODEV) and let user space decide the next action. Saurabh, let me know what you think. Thanks, Wei. > Or am I somehow reading this incorrectly? > > thanks, > > greg k-h >