mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <namit@cs.technion.ac.il>
To: pbonzini@redhat.com
Cc: gleb@kernel.org, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	nadav.amit@gmail.com, Nadav Amit <namit@cs.technion.ac.il>
Subject: [PATCH] KVM: x86: cluster mode broadcast does not work
Date: Wed, 30 Jul 2014 10:03:05 +0300	[thread overview]
Message-ID: <1406703785-10023-1-git-send-email-namit@cs.technion.ac.il> (raw)

Local-apic enables cluster mode broadcast. As Intel SDM 10.6.2.2 says:
"Broadcast to all local APICs is achieved by setting all destination bits to
one." This patch enables cluster mode broadcast.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
---
 arch/x86/kvm/lapic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index efb1939..05c9a46 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -560,8 +560,8 @@ int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u8 mda)
 			result = 1;
 		break;
 	case APIC_DFR_CLUSTER:
-		if (((logical_id >> 4) == (mda >> 0x4))
-		    && (logical_id & mda & 0xf))
+		if ((((logical_id >> 4) == (mda >> 0x4))
+		    && (logical_id & mda & 0xf)) || mda == 0xff)
 			result = 1;
 		break;
 	default:
@@ -644,6 +644,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
 	} else {
 		u32 mda = irq->dest_id << (32 - map->ldr_bits);
 
+		if (irq->dest_id == 0xff &&
+		    kvm_apic_get_reg(src, APIC_DFR) == APIC_DFR_CLUSTER)
+			goto out; /* cluster mode broadcast */
+
 		dst = map->logical_map[apic_cluster_id(map, mda)];
 
 		bitmap = apic_logical_id(map, mda);
-- 
1.9.1


             reply	other threads:[~2014-07-30  7:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  7:03 Nadav Amit [this message]
2014-07-31 17:46 ` Nadav Amit

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=1406703785-10023-1-git-send-email-namit@cs.technion.ac.il \
    --to=namit@cs.technion.ac.il \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nadav.amit@gmail.com \
    --cc=pbonzini@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

all inboxes | Powered by JetHome®