linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	jailhouse-dev@googlegroups.com
Subject: [PATCH v2 01/12] x86/apic: Install an empty physflat_init_apic_ldr
Date: Mon, 27 Nov 2017 09:11:43 +0100	[thread overview]
Message-ID: <f9867d294cdae4d45ed89d3a2e6adb524f4f6794.1511770314.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1511770314.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1511770314.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

As the comment already stated, there is no need for setting up LDR (and
DFR) in physflat mode as it remains unused (see SDM, 10.6.2.1).
flat_init_apic_ldr only served as a placeholder for a nop operation so
far, causing no harm.

That will change when running over the Jailhouse hypervisor. Here we
must not touch LDR in a way that destroys the mapping originally set up
by the Linux root cell. Jailhouse enforces this setting in order to
efficiently validate any IPI requests sent by a cell.

Avoid a needless clash caused by flat_init_apic_ldr by installing a true
nop handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 arch/x86/kernel/apic/apic_flat_64.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index aa85690e9b64..226a6ab22b35 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -218,6 +218,15 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 	return 0;
 }
 
+static void physflat_init_apic_ldr(void)
+{
+	/*
+	 * LDR and DFR are not involved in physflat mode, rather:
+	 * "In physical destination mode, the destination processor is
+	 * specified by its local APIC ID [...]." (Intel SDM, 10.6.2.1)
+	 */
+}
+
 static void physflat_send_IPI_allbutself(int vector)
 {
 	default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
@@ -251,8 +260,7 @@ static struct apic apic_physflat __ro_after_init = {
 	.dest_logical			= 0,
 	.check_apicid_used		= NULL,
 
-	/* not needed, but shouldn't hurt: */
-	.init_apic_ldr			= flat_init_apic_ldr,
+	.init_apic_ldr			= physflat_init_apic_ldr,
 
 	.ioapic_phys_id_map		= NULL,
 	.setup_apic_routing		= NULL,
-- 
2.12.3

  reply	other threads:[~2017-11-27  8:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  8:11 [PATCH v2 00/12] x86: Add support for running as secondary Jailhouse guest Jan Kiszka
2017-11-27  8:11 ` Jan Kiszka [this message]
2018-01-14 20:34   ` [tip:x86/platform] x86/apic: Install an empty physflat_init_apic_ldr tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 02/12] x86: Control warm reset setup via legacy feature flag Jan Kiszka
2018-01-14 20:34   ` [tip:x86/platform] x86/platform: " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 03/12] x86: Introduce and use MP IRQ trigger and polarity defines Jan Kiszka
2018-01-14 20:34   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 04/12] x86/jailhouse: Add infrastructure for running in non-root cell Jan Kiszka
2018-01-14 20:35   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 05/12] x86/jailhouse: Enable APIC and SMP support Jan Kiszka
2018-01-14 20:36   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 06/12] x86/jailhouse: Enable PMTIMER Jan Kiszka
2018-01-14 20:36   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 07/12] x86/jailhouse: Set up timekeeping Jan Kiszka
2018-01-14 20:37   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 08/12] x86/jailhouse: Avoid access of unsupported platform resources Jan Kiszka
2018-01-14 20:37   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 09/12] x86/jailhouse: Silence ACPI warning Jan Kiszka
2018-01-14 20:37   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 10/12] x86/jailhouse: Halt instead of failing to restart Jan Kiszka
2018-01-14 20:38   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 11/12] x86/jailhouse: Wire up IOAPIC for legacy UART ports Jan Kiszka
2018-01-14 20:38   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2017-11-27  8:11 ` [PATCH v2 12/12] x86/jailhouse: Initialize PCI support Jan Kiszka
2018-01-14 20:39   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-01-22 22:26   ` [PATCH v2 12/12] " Bjorn Helgaas
2018-01-23  7:49     ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9867d294cdae4d45ed89d3a2e6adb524f4f6794.1511770314.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=hpa@zytor.com \
    --cc=jailhouse-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).