From owner-freebsd-virtualization@freebsd.org Fri May 14 16:44:41 2021 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 7AF2064D7F8 for ; Fri, 14 May 2021 16:44:41 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "CN", Issuer "CN" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FhZBJ3DjSz4bqk for ; Fri, 14 May 2021 16:44:39 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800:0:0:0:0:a135]) by mx0.gentlemail.de (8.15.2/8.15.2) with ESMTP id 14EGiZKZ096957; Fri, 14 May 2021 18:44:36 +0200 (CEST) (envelope-from freebsd@omnilan.de) X-Authentication-Warning: mx0.gentlemail.de: Host ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800:0:0:0:0:a135] claimed to be mh0.gentlemail.de Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id E34669E9; Fri, 14 May 2021 18:44:34 +0200 (CEST) Subject: Re: FreeBSD 12.1 i386 on Hyper-V Fails to Mount Root To: Wei Hu , Chris Knight , "freebsd-virtualization@freebsd.org" References: From: Harry Schmalzbauer Organization: OmniLAN Message-ID: Date: Fri, 14 May 2021 18:44:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: inspected by milter-greylist-4.6.2 (mx0.gentlemail.de [IPv6:2a00:e10:2800:0:0:0:0:a130]); Fri, 14 May 2021 18:44:37 +0200 (CEST) for IP:'2a00:e10:2800::a135' DOMAIN:'ezra.dcm1.omnilan.net' HELO:'mh0.gentlemail.de' FROM:'freebsd@omnilan.de' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx0.gentlemail.de [IPv6:2a00:e10:2800:0:0:0:0:a130]); Fri, 14 May 2021 18:44:37 +0200 (CEST) X-Rspamd-Queue-Id: 4FhZBJ3DjSz4bqk X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-3.18 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_XAW(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[microsoft.com,gmail.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:e10:2800::a130:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:61157, ipnet:2a00:e10:2800::/38, country:DE]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.883]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[omnilan.de]; SPAMHAUS_ZRD(0.00)[2a00:e10:2800::a130:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MAILMAN_DEST(0.00)[freebsd-virtualization] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.34 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: Fri, 14 May 2021 16:44:41 -0000 Am 16.10.2020 um 11:35 schrieb Wei Hu via freebsd-virtualization: >> Howdy, >> >> Just started the upgrade process on some FreeBSD 11.4 VMs to FreeBSD 12.1 >> using freebsd-update. VMs are running on multiple Hyper-V 2012 R2 and 2019 >> systems, all systems with 2020-09 Cumulative Updates installed. >> The amd64 VMs are upgrading happily. >> The i386 VMs die a horrible death - the kernel throws the following error: >> >> vmbus0: cannot find free IDT vector >> >> shortly followed by mountroot failure due to the lack of storage device >> initialisation. >> Checked the FreeBSD 12.1 i386 ISO in case of environment pollution - same >> vmbus error, same lack of storage device initialisation failure. Ditto with >> the 12.2-RC2 i386 ISO. >> > Did you try 12.0? Maybe something changed in 12.x causes failure. > I386 is not well tested on Hyper-V. I will try to reproduce and take a look. The regression happened before 12.0. Today I stumbled across this problem too and tried 11.4 (/May 8th, 2020) /sucessfully, while 12.0 (/Oct 19th, 2018)/ is failing with i386 releases. One commit which is in 12 but not in 11.4 is r332489. Code path is like sys/dev/hyperv/vmbus/vmbus.c: vmbus_intr_setup(struct vmbus_softc *sc) {         int cpu;         CPU_FOREACH(cpu) {                 char buf[MAXCOMLEN + 1];                 cpuset_t cpu_mask;                 /* Allocate an interrupt counter for Hyper-V interrupt */                 snprintf(buf, sizeof(buf), "cpu%d:hyperv", cpu);                 intrcnt_add(buf, VMBUS_PCPU_PTR(sc, intr_cnt, cpu));                 /*                  * Setup taskqueue to handle events.  Task will be per-                  * channel.                  */                 VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast(                     "hyperv event", M_WAITOK, taskqueue_thread_enqueue,                     VMBUS_PCPU_PTR(sc, event_tq, cpu));                 if (vmbus_pin_evttask) {                         CPU_SETOF(cpu, &cpu_mask);                         taskqueue_start_threads_cpuset(                             VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET,                             &cpu_mask, "hvevent%d", cpu);                 } else {                         taskqueue_start_threads(                             VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET,                             "hvevent%d", cpu);                 }                 /*                  * Setup tasks and taskqueues to handle messages.                  */                 VMBUS_PCPU_GET(sc, message_tq, cpu) = taskqueue_create_fast(                     "hyperv msg", M_WAITOK, taskqueue_thread_enqueue,                     VMBUS_PCPU_PTR(sc, message_tq, cpu));                 CPU_SETOF(cpu, &cpu_mask);                 taskqueue_start_threads_cpuset(                     VMBUS_PCPU_PTR(sc, message_tq, cpu), 1, PI_NET, &cpu_mask,                     "hvmsg%d", cpu);                 TASK_INIT(VMBUS_PCPU_PTR(sc, message_task, cpu), 0,                     vmbus_msg_task, sc);         }         /*          * All Hyper-V ISR required resources are setup, now let's find a          * free IDT vector for Hyper-V ISR and set it up.          */         sc->vmbus_idtvec = lapic_ipi_alloc(pti ? IDTVEC(vmbus_isr_pti) :             IDTVEC(vmbus_isr));         if (sc->vmbus_idtvec < 0) {                 device_printf(sc->vmbus_dev, "cannot find free IDT vector\n");                 return ENXIO;         }         if (bootverbose) {                 device_printf(sc->vmbus_dev, "vmbus IDT vector %d\n",                     sc->vmbus_idtvec);         }         return 0; } In sys/dev/hyperv/vmbus/i386/vmbus_vector.S         SUPERALIGN_TEXT IDTVEC(vmbus_isr_pti) IDTVEC(vmbus_isr)         PUSH_FRAME         SET_KERNEL_SREGS         cld         KENTER         FAKE_MCOUNT(TF_EIP(%esp))         pushl   %esp         call    vmbus_handle_intr         add     $4, %esp         MEXITCOUNT         jmp     doreti amd64/i386 diff (problem doesn"t show up on amd64): --- sys/dev/hyperv/vmbus/i386/vmbus_vector.S    2021-05-14 18:04:58.527699000 +0200 +++ sys/dev/hyperv/vmbus/amd64/vmbus_vector.S   2021-01-23 13:00:56.902717000 +0100 @@ -38,15 +38,9 @@   */         .text         SUPERALIGN_TEXT -IDTVEC(vmbus_isr_pti) -IDTVEC(vmbus_isr) -       PUSH_FRAME -       SET_KERNEL_SREGS -       cld -       KENTER -       FAKE_MCOUNT(TF_EIP(%esp)) -       pushl   %esp +       INTR_HANDLER    vmbus_isr +       FAKE_MCOUNT(TF_RIP(%rsp)) +       movq    %rsp, %rdi         call    vmbus_handle_intr -       add     $4, %esp         MEXITCOUNT         jmp     doreti Unfortunately beyond my skills. Any news/ideas? Thanks, -harry