From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D291248176 for ; Fri, 2 Jan 2026 15:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767369317; cv=none; b=h2h6l2Q5vdGmO+DxuGlw/93QOmwrMnRxdx01yBT4MmnhdYhP4kjyqHFdf2nDwzhHppdMswSDYrmlONr0KiNvbykujAKeSLOsnuyOTXnAhiQZ6a+iyixYOiLAv8gWsyz2p1QNfzl4gNrVzityB/HqhS3+PnfGo8wqCLfvz9lJMEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767369317; c=relaxed/simple; bh=Y0Hwi5z3RMPP/UnQPMuL5YEkscPe0NW5f+9+86I8E/0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=lCikAdpSE9dB8VIjmDImHSQFbULiSmTnHAhx99RzrbbIIovktXnKQgDMNpBJilgl6tahHTX9BjaTiYNayd4J2/AEnZO9lPFf79uLQDDbFH0gL7uK1gjMYAHLkR+arjnnQcclxxUQ2fdT3l3GcLvAGGiFkr4k9f5BW7JWMvZ5yA4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QL2R7cKd; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Nv+8lsyj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QL2R7cKd"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Nv+8lsyj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767369314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bcWgSJxKhh7rH3PGgygg+GR3a8mlwHXbCD1n/CcOlc8=; b=QL2R7cKdQd8B0gL0aAydN6HVPqsF2YOff27C+n7So4ZmRDsxzVz5jgANplRgFX8Uj3K67D 6e1zgJy+/84mHXTxR4Uj2DtPjrK8ZR6KN3BDfPFpImAJe/p35wtfAGtApMuaDX/G4WHcDn mueCQ4B9X1bwdIOuj8vJ+hx5kYf/t+M= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-454-ub_iVV_ZMF-ZuoWHphRFjQ-1; Fri, 02 Jan 2026 10:55:13 -0500 X-MC-Unique: ub_iVV_ZMF-ZuoWHphRFjQ-1 X-Mimecast-MFC-AGG-ID: ub_iVV_ZMF-ZuoWHphRFjQ_1767369312 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-477563a0c75so42123905e9.1 for ; Fri, 02 Jan 2026 07:55:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767369312; x=1767974112; darn=vger.kernel.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=bcWgSJxKhh7rH3PGgygg+GR3a8mlwHXbCD1n/CcOlc8=; b=Nv+8lsyjxTPgzjZGx4lcUx/lmqHRI1mXMr8Io2ADlhT6SbV9SGm39Ibwlm4Cs3pYJ+ ZWyn3Qo0Hi+dUPx6aqxYchh8hb7C01OlVMuhlCsaSKTFeqbIX9pyDCoewYHCFuVsq6mq +95wWOO3VNRXzwl6nUuG6W2dBR1fniDg7wL9J4DnpyTYaNiN2rPRF1VEDu7i+wu11IhW Y21yhxptkkJMape44/v9NXn8YNqhEMjLh5sN0KsP9Lv4rMXVpa5Fxl1dvuqdZodmRMMw C5aFh+O9jQdXYihYunI/n9n4iGPzev3NeSWjV3TwSb+Y1fwgBfzvQSewf64GE3n3KisX OSBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767369312; x=1767974112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bcWgSJxKhh7rH3PGgygg+GR3a8mlwHXbCD1n/CcOlc8=; b=pBpGKdNco+6jBJS44OQtymOWPkj3pSlQiALoq0cZpJ0v+y113wy6G9Ihw2rvqG9+e9 hP1qab9BO6/RXX/hhUnqCkb5arsoqwfS+tAgPJfAZmyc/YZTLD6wZKptwQm8YpmO5FL0 31A9kWceDhSnhEYNneF4vg179lWdxy6aufHMP7MQKvozH6hueGu2YqncpFgXfNHf6b/1 KnqAdCk3mOrSxjVE/4dwYXY9P4yFmhzYYRg7Kpql4a0HaZXK9oOtJDMwCJYhxEqogA8l cndmYWSV6hFW+pvbB7FOEdDbNHEdz0pfKoxtVFIgXO4FSKDUtT5ICWX9syo5HKsOOVbG msNw== X-Forwarded-Encrypted: i=1; AJvYcCXFi3nr/dE/7oGbW6+/LcSr5X1Fd3Z26gnN3joedxFbiyq4jopxZZCF98G4/QLNF8iBj7uR6TotsTU/RTA=@vger.kernel.org X-Gm-Message-State: AOJu0Yxh7QcH9PHu7CpE4hHWozSr/2838sffR3ZiS+9fz3/0muVKL9LI dtOjCTW4y/Q6cC6qiOAS7qrm0n9CMY3e+WzaKbQu+enciKmgq+ZGI5Du4YCNBr5wnZuXq7KcPD+ ZJTNlky8NtvDqxgbYD+4DoECZxv0kjP1C9//nEcQN10y18jbD3TIrB77c8O7EtSI3jw== X-Gm-Gg: AY/fxX6FXl8W51LqSAzGAOOeMo34LZNbgzHHk45eXPg/GOXnQhIJsrurRUgrHnpbHz2 xScYVgmFOBdZhaSfMnq/kRt6edL1DCxah2epS8XK2vJns+H9v3lTSeMbzRVd6kf8zy8eRVeyg2O LJE5RUGFBM4kPD+RSXtIZHsik58Y7F0rCjm1TrDDTmOPzrxouIh3g2kB4UjDHO67dBVPgoSpGl6 T16MyezVmqVqQDZ+XoScPuoa4pEohNi/KkZoipxRIAG3vzsaxdBMHcOKRREpwDdFU+dmGpSKk2N xMw9UG8zZrByaIuvpMKpgAhTE8q0q0qx96XpQc7Ux2fM7cee/1bF4nLEO2wDGEVWPaZsL4JY18e L/45CLg== X-Received: by 2002:a05:600c:3b2a:b0:477:7ab8:aba with SMTP id 5b1f17b1804b1-47d1953bd8bmr538060625e9.1.1767369312234; Fri, 02 Jan 2026 07:55:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKHKcquZ8Xxglk27XCbx2myAA+yEVZMb7oWD8RqkHQr0NzOPzJxHJWP4SDsCwraSgSeWL5Cw== X-Received: by 2002:a05:600c:3b2a:b0:477:7ab8:aba with SMTP id 5b1f17b1804b1-47d1953bd8bmr538060375e9.1.1767369311851; Fri, 02 Jan 2026 07:55:11 -0800 (PST) Received: from fedora (g3.ign.cz. [91.219.240.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47be2724fe8sm948276005e9.1.2026.01.02.07.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jan 2026 07:55:11 -0800 (PST) From: Vitaly Kuznetsov To: Mukesh Rathor , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com Subject: Re: [RFC][PATCH v0] x86/hyperv: Reserve 3 interrupt vectors used exclusively by mshv In-Reply-To: <20251231012100.681060-1-mrathor@linux.microsoft.com> References: <20251231012100.681060-1-mrathor@linux.microsoft.com> Date: Fri, 02 Jan 2026 16:55:10 +0100 Message-ID: <877bu0au1t.fsf@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Mukesh Rathor writes: > MSVC compiler used to compile the Microsoft Hyper-V hypervisor currently, > has an assert intrinsic that uses interrupt vector 0x29 to create an > exception. This will cause hypervisor to then crash and collect core. As > such, if this interrupt number is assigned to a device by linux and the > device generates it, hypervisor will crash. There are two other such > vectors hard coded in the hypervisor, 0x2C and 0x2D. > > Fortunately, the three vectors are part of the kernel driver space, and > that makes it feasible to reserve them early so they are not assigned > later. > > Signed-off-by: Mukesh Rathor > --- > arch/x86/kernel/cpu/mshyperv.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c > index 579fb2c64cfd..19d41f7434df 100644 > --- a/arch/x86/kernel/cpu/mshyperv.c > +++ b/arch/x86/kernel/cpu/mshyperv.c > @@ -478,6 +478,25 @@ int hv_get_hypervisor_version(union hv_hypervisor_version_info *info) > } > EXPORT_SYMBOL_GPL(hv_get_hypervisor_version); > > +/* > + * Reserve vectors hard coded in the hypervisor. If used outside, the hypervisor > + * will crash or hang or break into debugger. > + */ > +static void hv_reserve_irq_vectors(void) > +{ > + #define HYPERV_DBG_FASTFAIL_VECTOR 0x29 > + #define HYPERV_DBG_ASSERT_VECTOR 0x2C > + #define HYPERV_DBG_SERVICE_VECTOR 0x2D > + > + if (test_and_set_bit(HYPERV_DBG_ASSERT_VECTOR, system_vectors) || > + test_and_set_bit(HYPERV_DBG_SERVICE_VECTOR, system_vectors) || > + test_and_set_bit(HYPERV_DBG_FASTFAIL_VECTOR, system_vectors)) > + BUG(); Would it be less hackish to use sysvec_install() with a dummy handler for all three vectors instead? > + > + pr_info("Hyper-V:reserve vectors: %d %d %d\n", HYPERV_DBG_ASSERT_VECTOR, > + HYPERV_DBG_SERVICE_VECTOR, HYPERV_DBG_FASTFAIL_VECTOR); > +} > + > static void __init ms_hyperv_init_platform(void) > { > int hv_max_functions_eax, eax; > @@ -510,6 +529,9 @@ static void __init ms_hyperv_init_platform(void) > > hv_identify_partition_type(); > > + if (hv_root_partition()) > + hv_reserve_irq_vectors(); > + > if (cc_platform_has(CC_ATTR_SNP_SECURE_AVIC)) > ms_hyperv.hints |= HV_DEPRECATING_AEOI_RECOMMENDED; -- Vitaly