From patchwork Fri Jul 29 16:28:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9252687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A663560757 for ; Fri, 29 Jul 2016 16:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 983B9283E1 for ; Fri, 29 Jul 2016 16:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C971283E3; Fri, 29 Jul 2016 16:32:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44B7B283E1 for ; Fri, 29 Jul 2016 16:32:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTAfS-0003i8-2a; Fri, 29 Jul 2016 16:29:46 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTAfQ-0003gd-JM for xen-devel@lists.xenproject.org; Fri, 29 Jul 2016 16:29:44 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 14/B6-05127-7748B975; Fri, 29 Jul 2016 16:29:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRWlGSWpSXmKPExsXitHRDpG55y+x wg31TlCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozr3SdZCq4JVGxuW83WwHibu4uRg0NCwF/i +VGhLkZODjYBHYmLc3eygYRFBFQkbu81ADGZBcolZtyIB6kQFkiU2HDjHAuIzSKgKnHu/SY2E JtXwEViwcXrrCC2hICuxMNzv1lBWjkFXCX+r6oGMYWAShqaQiGqBSVOznwCNoVZQFOidftvdg hbXqJ562xmEFtIQFGif94DNogTuSX+dttPYOSfhaR7FpLuWUi6FzAyr2LUKE4tKkst0jU01ks qykzPKMlNzMzRNTQw1ctNLS5OTE/NSUwq1kvOz93ECAw8BiDYwfhvm+chRkkOJiVR3gUrZoUL 8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuC93TQ7XEiwKDU9tSItMwcYAzBpCQ4eJRHeLY1Aad7ig sTc4sx0iNQpRkUpcV79ZqCEAEgiozQPrg0Wd5cYZaWEeRmBDhHiKUgtys0sQZV/xSjOwagkzM sMMoUnM68EbvoroMVMQIuLY2eALC5JREhJNTDqtuy3YfTqOPZ9so37RE81VulPZoz6h9omJYn dv72uMX+C1rKXDNtvCU3Y3fjyyQY2l0jt2ZNYlyxpU/Vx+X7nhkZM85S2G3rPd3rfCYu/ej1w Z/HTRKlfFwMjPbYW3lLKTJ10ZqmXoMErac2ZRuf/phhKL1gVxHP8lF3rdcX1yfe6f15zEDdTY inOSDTUYi4qTgQA4wvambYCAAA= X-Env-Sender: prvs=011b0443a=roger.pau@citrix.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1469809781!15677055!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4013 invoked from network); 29 Jul 2016 16:29:43 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 29 Jul 2016 16:29:43 -0000 X-IronPort-AV: E=Sophos;i="5.28,440,1464652800"; d="scan'208";a="369281721" From: Roger Pau Monne To: Date: Fri, 29 Jul 2016 18:28:58 +0200 Message-ID: <1469809747-11176-4-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) In-Reply-To: <1469809747-11176-1-git-send-email-roger.pau@citrix.com> References: <1469809747-11176-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Andrew Cooper , Jan Beulich , Roger Pau Monne Subject: [Xen-devel] [PATCH RFC 03/12] xen/x86: allow the emulated APICs to be enbled for the hardware domain X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Allow the used of both the emulated local APIC and IO APIC for the hardware domain. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/domain.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 1133ea2..4d47228 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -545,25 +545,31 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, } else { - if ( (config->emulation_flags & ~XEN_X86_EMU_ALL) != 0 ) + uint32_t emflags = config->emulation_flags; + + if ( (emflags & ~XEN_X86_EMU_ALL) != 0 ) { printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n", - d->domain_id, config->emulation_flags); + d->domain_id, emflags); return -EINVAL; } + if ( is_hardware_domain(d) ) - config->emulation_flags |= XEN_X86_EMU_PIT; - if ( config->emulation_flags != 0 && - (config->emulation_flags != - (is_hvm_domain(d) ? XEN_X86_EMU_ALL : XEN_X86_EMU_PIT)) ) + emflags |= XEN_X86_EMU_PIT; + + if ( (is_hardware_domain(d) ? + (is_hvm_domain(d) && emflags != + (XEN_X86_EMU_PIT|XEN_X86_EMU_LAPIC|XEN_X86_EMU_IOAPIC)) : + (emflags && (is_hvm_domain(d) ? (emflags != XEN_X86_EMU_ALL) : + (emflags != XEN_X86_EMU_PIT)))) ) { printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation " "with the current selection of emulators: %#x\n", d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", - config->emulation_flags); + emflags); return -EOPNOTSUPP; } - d->arch.emulation_flags = config->emulation_flags; + d->arch.emulation_flags = emflags; } if ( has_hvm_container_domain(d) )