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

Re: [XEN PATCH v2 13/15] x86/ioreq: guard VIO_realmode_completion with CONFIG_VMX


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Sergiy Kibrik <sergiy_kibrik@xxxxxxxx>
  • Date: Fri, 31 May 2024 11:05:00 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=s9tF0rt+SyqLrQlBLDjA2AhwTEJNKlTC9BNsmMaHhNA=; b=cH3/eg4OonlmShqQTfG9C0DZldr4NNFyNwAFC5rGTsVza06f+OJnjhOBCB2PT98enTHhadD8Y/XTcUJRrwwNNTIaBjHFMAufuOVy+ERZW6I3JirwZBYpaT+Bxci0AdvsTocTya19aJT84Y0R0Rzw5TbVYjGHH8a7hBMq+eppw5oAUhd8DWWRtfJf1xeTpzRiKcuLoqdYFZ9weBiT5opnoYmQymj65+oUeghcMPEhKmO09n97BBcdMqQ3HofC7cPzw4t/GVDtpo5b7m9RyYG+DVS4Tx9Fl6Gy/7zm+Slc9KSDR8Kc+YutVbkwT5BdW2bkfheajOxOg86QWTn8+v92pg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vp6yV8MsnM3nl3DbwOMEN9f5mS8CZc8AZSDoroDmiMuEMwOfys1ubxU8TlGP9+dkxTa2qUgUMUIpahnq+IHZDDhV+9sAQudOgBfNhsprgCojt5qD72EwJhZzpYiV0p4pe3bHmj16m4H80owEc/NM7b/5OTJJW50kXAkp1y6fmpIc6jFen1TrsDBx56sIsd5v7HJC9vMoCn7NZIqBA0wBhdKHjjpWwYJGJUyfVcWvdpB/G5USQPrbA53sJY1T3cxSSAa413RS7R/2H8nImgkGjBr1O1cMFBSdJYZhGomSZelHSWsnQmgs/reit+aAKTm59vwIN+cz4BkYlfk3GGTKTQ==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 31 May 2024 08:05:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

16.05.24 15:11, Jan Beulich:
On 15.05.2024 11:24, Sergiy Kibrik wrote:
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2667,7 +2667,9 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt 
*hvmemul_ctxt,
          break;
case VIO_mmio_completion:
+#ifdef CONFIG_VMX
      case VIO_realmode_completion:
+#endif
          BUILD_BUG_ON(sizeof(hvio->mmio_insn) < 
sizeof(hvmemul_ctxt->insn_buf));
          hvio->mmio_insn_bytes = hvmemul_ctxt->insn_buf_bytes;
          memcpy(hvio->mmio_insn, hvmemul_ctxt->insn_buf, 
hvio->mmio_insn_bytes);

This change doesn't buy us anything, does it?

why not? Code won't compile w/o it.
Or do you mean hiding the whole VIO_realmode_completion enum under CONFIG_VMX wasn't really useful?

--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -33,6 +33,7 @@ bool arch_vcpu_ioreq_completion(enum vio_completion 
completion)
  {
      switch ( completion )
      {
+#ifdef CONFIG_VMX
      case VIO_realmode_completion:
      {
          struct hvm_emulate_ctxt ctxt;
@@ -43,6 +44,7 @@ bool arch_vcpu_ioreq_completion(enum vio_completion 
completion)
break;
      }
+#endif
default:
          ASSERT_UNREACHABLE();

And while this change is needed for the goal of the series, I wonder whether
it wouldn't better be arch_vcpu_ioreq_completion() as whole that then gets
stubbed out.


I'll post a patch to this thread to confirm whether I got your point correctly.

 -Sergiy



 


Rackspace

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