[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/nsvm: Fix L2 VINTR intercept merging when only Xen intercepts L1


  • To: ross.lagerwall@xxxxxxxxxx
  • From: Stephen Cheng <stephen.cheng@xxxxxxxxxx>
  • Date: Fri, 6 Nov 2026 11:27:25 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TW4Zg6wX/9RAL3RGKBL/cmC3vJcYfoyPIF48ABGX0hY=; b=hf+H409WxGoKAF/9+9URcIVNVO4g8fmgNNS6jTlq3UtZ4WnObJBMUdxy+b/duEeJCRqT/r09bWrWZSkYlwvS2RrplJijwFClUvlmJJPaYW0lhhfhlMQNHrwo5Ar8ebDzGXN5TN9XSVQaFm2IpLriHeE4v5njU0SpBY5WSROYM0e7wibr6TB/hgXkE9WipjNqKRB7q/DKTPlX/EW1GNvAf+arsXvGqov9DyqQS2zH/0v+7pXjAqqwqhybmHcacneNRWo5Jl3RFqcheJxanPZ8QNAjoHnYh4CVOKPvZVWaI9EDoXEfD+XLIT87FTMW6P2EgI74jdKfnBBolegdhPVAoA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ydGM83LXAQNI+iaTbglh+G7pmEqmPjkjah1G6+1ceywS9JobBhMqyP2VwXS6wG7lDj8opmzLIL9O6gZUjVEKypKJq9P5ZwF3UNE6xsihJA3983BFO3e3H1baLj/p4z9uOuOJ7k9K0dh6lRShjVij+YAPllKfzSWPRGr6/iWJgAnWL7upS2HBMBwhM8IgiSkWqlkKz36E9O1hFkzfn51kTmM9/9bO813KtYICW5PHUjR9GTDb0/OnEft2C8k92hIkvDVxUSbiN+I2EuEx7WqgoC09lpnrsZQOjTnY47gppMfdjVOuYJCTv5aIq4M7HXHzSvFT6cwOF8rQm3YfV8XwFw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: abdelkareem.abdelsaamad@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, jason.andryuk@xxxxxxx, jbeulich@xxxxxxxx, roger@xxxxxxxxxxxxxx, teddy.astie@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stephen Cheng <stephen.cheng@xxxxxxxxxx>
  • Delivery-date: Fri, 06 Nov 2026 03:29:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05/11/2026 14:16, Ross Lagerwall wrote:
> If L0 wants to inject an interrupt but the VINTR intercept is not enabled, how
> would it detect when it can inject the interrupt? In particular, if VMCB(1-2)
> has V_INTR_MASKING=0 and L2 sets EFLAGS.IF=1, the interrupt should be
> delivered but L0 won't notice.

Thanks, you are right. I missed this case.

But I think the current code does not handle this case either. L0's
dummy V_IRQ is not copied into VMCB(0-2). The V_IRQ in VMCB(0-2) comes
from VMCB(1-2). So the merged VINTR intercept only fires when L1 itself
has a V_IRQ pending for L2. If L1 has nothing pending, L0 also does not
notice when L2 sets EFLAGS.IF today. And when the intercept does fire,
the VMEXIT_VINTR handler clears L1's V_IRQ. This is the bug this patch
wants to fix.

My suggestion for this patch is to only remove the intercept when
ns_hostflags.vintrmask && !ns_hostflags.rflagsif. In this case no L1
interrupt can be delivered while L2 runs, so L0 does not need the
window. For the other cases, Xen needs to put its dummy V_IRQ into
VMCB(0-2) together with the intercept, and restore L1's V_IRQ later if
L1 had one.

Please drop my Reviewed-by for now.

Stephen



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.