* [PATCH 00/15] xen: arm: remove dummy.S
@ 2012-12-04 11:56 Ian Campbell
2012-12-04 11:56 ` [PATCH 01/15] xen: arm: define node_online_map Ian Campbell
` (17 more replies)
0 siblings, 18 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel
This was a short term hack to get something linking quickly, but its
usefulness has now passed.
This series replaces everything in here with proper functions. In many
cases these are still just stubs.
It seems to me that at least some of this stuff consists of x86-isms
which should instead be removed from the common code.
This highlights two large missing pieces of functionality: wallclock
time and cleaning up on domain destroy.
Ian.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 01/15] xen: arm: define node_online_map.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 02/15] xen: arm: make smp_send_state_dump a real function Ian Campbell
` (16 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
For now just initialise it as a single online node, which is what
asm-arm/numa.h assumes anyway.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 1 -
xen/arch/arm/smpboot.c | 3 +++
xen/include/asm-arm/numa.h | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 022338a..4abb30a 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -7,7 +7,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
x: mov pc, lr
/* SMP support */
-DUMMY(node_online_map);
DUMMY(smp_send_state_dump);
/* PIRQ support */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 6555ac6..351b559 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -38,6 +38,9 @@ EXPORT_SYMBOL(cpu_online_map);
cpumask_t cpu_possible_map;
EXPORT_SYMBOL(cpu_possible_map);
+/* Fake one node for now. See also include/asm-arm/numa.h */
+nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
+
/* Xen stack for bringing up the first CPU. */
static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
__attribute__((__aligned__(STACK_SIZE)));
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index 1b060e6..a1b1f58 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -1,7 +1,7 @@
#ifndef __ARCH_ARM_NUMA_H
#define __ARCH_ARM_NUMA_H
-/* Fake one node for now... */
+/* Fake one node for now. See also node_online_map. */
#define cpu_to_node(cpu) 0
#define node_to_cpumask(node) (cpu_online_map)
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 02/15] xen: arm: make smp_send_state_dump a real function
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
2012-12-04 11:56 ` [PATCH 01/15] xen: arm: define node_online_map Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 03/15] xen: arm: implement arch_get_info_guest Ian Campbell
` (15 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
It still doesn't do anything useful, but at least it isn't in dummy.S!
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 3 ---
xen/arch/arm/gic.c | 6 ++++++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 4abb30a..bfd948a 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -6,9 +6,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
.globl x; \
x: mov pc, lr
-/* SMP support */
-DUMMY(smp_send_state_dump);
-
/* PIRQ support */
DUMMY(alloc_pirq_struct);
DUMMY(nr_irqs_gsi);
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0c6fab9..416e8d8 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -330,6 +330,12 @@ void __init gic_init(void)
spin_unlock(&gic.lock);
}
+void smp_send_state_dump(unsigned int cpu)
+{
+ printk("WARNING: unable to send state dump request to CPU%d\n", cpu);
+ /* XXX TODO -- send an SGI */
+}
+
/* Set up the per-CPU parts of the GIC for a secondary CPU */
void __cpuinit gic_init_secondary_cpu(void)
{
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 03/15] xen: arm: implement arch_get_info_guest
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
2012-12-04 11:56 ` [PATCH 01/15] xen: arm: define node_online_map Ian Campbell
2012-12-04 11:56 ` [PATCH 02/15] xen: arm: make smp_send_state_dump a real function Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 04/15] xen: arm: implement arch_vcpu_reset Ian Campbell
` (14 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Untested, but basically the inverse of arch_set_info_guest.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/domctl.c | 17 +++++++++++++++++
xen/arch/arm/dummy.S | 1 -
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index cf16791..76f31ce 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -8,6 +8,7 @@
#include <xen/types.h>
#include <xen/lib.h>
#include <xen/errno.h>
+#include <xen/sched.h>
#include <public/domctl.h>
long arch_do_domctl(struct xen_domctl *domctl,
@@ -16,6 +17,22 @@ long arch_do_domctl(struct xen_domctl *domctl,
return -ENOSYS;
}
+void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
+{
+ struct vcpu_guest_context *ctxt = c.nat;
+ struct cpu_user_regs *regs = &c.nat->user_regs;
+
+ *regs = v->arch.cpu_info->guest_cpu_user_regs;
+
+ ctxt->sctlr = v->arch.sctlr;
+ ctxt->ttbr0 = v->arch.ttbr0;
+ ctxt->ttbr1 = v->arch.ttbr1;
+ ctxt->ttbcr = v->arch.ttbcr;
+
+ if ( !test_bit(_VPF_down, &v->pause_flags) )
+ ctxt->flags |= VGCF_online;
+}
+
/*
* Local variables:
* mode: C
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index bfd948a..5ac6af9 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -14,7 +14,6 @@ DUMMY(pirq_guest_unbind);
DUMMY(pirq_set_affinity);
/* VCPU */
-DUMMY(arch_get_info_guest);
DUMMY(arch_vcpu_reset);
NOP(update_vcpu_system_time);
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 04/15] xen: arm: implement arch_vcpu_reset.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (2 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 03/15] xen: arm: implement arch_get_info_guest Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 05/15] xen: remove nr_irqs_gsi from generic code Ian Campbell
` (13 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Untested.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/domain.c | 5 +++++
xen/arch/arm/dummy.S | 1 -
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c5292c7..b7b2d5c 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -515,6 +515,11 @@ int arch_set_info_guest(
return 0;
}
+void arch_vcpu_reset(struct vcpu *v)
+{
+ vcpu_end_shutdown_deferral(v);
+}
+
void arch_dump_domain_info(struct domain *d)
{
}
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 5ac6af9..66eb314 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -14,7 +14,6 @@ DUMMY(pirq_guest_unbind);
DUMMY(pirq_set_affinity);
/* VCPU */
-DUMMY(arch_vcpu_reset);
NOP(update_vcpu_system_time);
/* Grant Tables */
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 05/15] xen: remove nr_irqs_gsi from generic code
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (3 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 04/15] xen: arm: implement arch_vcpu_reset Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 13:43 ` Jan Beulich
2012-12-04 11:56 ` [PATCH 06/15] xen: arm: stub out pirq related functions Ian Campbell
` (12 subsequent siblings)
17 siblings, 1 reply; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Daniel De Graaf, Keir (Xen.org), Ian Campbell, Jan Beulich
The concept is X86 specific.
AFAICT the generic concept here is the number of physical IRQs which
the current hardware has, so call this nr_hw_irqs.
Also using "defined NR_IRQS" as a standin for x86 might have made
sense at one point but its just cleaner to push the necessary
definitions into asm/irq.h.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
xen/arch/arm/dummy.S | 1 -
xen/common/domain.c | 4 ++--
xen/include/asm-arm/irq.h | 3 +++
xen/include/asm-x86/irq.h | 4 ++++
xen/include/xen/irq.h | 8 --------
xen/xsm/flask/hooks.c | 4 ++--
6 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 66eb314..5d9bcff 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -8,7 +8,6 @@ x: mov pc, lr
/* PIRQ support */
DUMMY(alloc_pirq_struct);
-DUMMY(nr_irqs_gsi);
DUMMY(pirq_guest_bind);
DUMMY(pirq_guest_unbind);
DUMMY(pirq_set_affinity);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..d80461d 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -259,9 +259,9 @@ struct domain *domain_create(
atomic_inc(&d->pause_count);
if ( domid )
- d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
+ d->nr_pirqs = nr_hw_irqs + extra_domU_irqs;
else
- d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
+ d->nr_pirqs = nr_hw_irqs + extra_dom0_irqs;
if ( d->nr_pirqs > nr_irqs )
d->nr_pirqs = nr_irqs;
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index abde839..4facaf0 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -21,6 +21,9 @@ struct irq_cfg {
#define NR_IRQS 1024
#define nr_irqs NR_IRQS
+#define nr_irqs NR_IRQS
+#define nr_hw_irqs NR_IRQS
+
struct irq_desc;
struct irq_desc *__irq_to_desc(int irq);
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index 5eefb94..6ea5f53 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -11,6 +11,10 @@
#include <irq_vectors.h>
#include <asm/percpu.h>
+extern unsigned int nr_irqs_gsi;
+extern unsigned int nr_irqs;
+#define nr_hw_irqs nr_irqs_gsi
+
#define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
(1 << (irq)) & io_apic_irqs : \
(irq) < nr_irqs_gsi)
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 5973cce..7386358 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
#include <asm/irq.h>
-#ifdef NR_IRQS
-# define nr_irqs NR_IRQS
-# define nr_irqs_gsi NR_IRQS
-#else
-extern unsigned int nr_irqs_gsi;
-extern unsigned int nr_irqs;
-#endif
-
struct msi_desc;
/*
* This is the "IRQ descriptor", which contains various information
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 0ca10d0..595c31e 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
struct irq_desc *desc = irq_to_desc(irq);
if ( irq >= nr_irqs || irq < 0 )
return -EINVAL;
- if ( irq < nr_irqs_gsi ) {
+ if ( irq < nr_hw_irqs ) {
if (ad) {
AVC_AUDIT_DATA_INIT(ad, IRQ);
ad->irq = irq;
@@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
if ( rc )
return rc;
- if ( irq >= nr_irqs_gsi && msi ) {
+ if ( irq >= nr_hw_irqs && msi ) {
u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
AVC_AUDIT_DATA_INIT(&ad, DEV);
ad.device = machine_bdf;
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 06/15] xen: arm: stub out pirq related functions.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (4 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 05/15] xen: remove nr_irqs_gsi from generic code Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 07/15] xen: arm: stub out wallclock time Ian Campbell
` (11 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
On ARM we use GIC functionality to inject virtualised real interrupts
for h/w devices rather than evtchn-pirqs.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 6 ------
xen/arch/arm/irq.c | 29 +++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 5d9bcff..2110bf1 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -6,12 +6,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
.globl x; \
x: mov pc, lr
-/* PIRQ support */
-DUMMY(alloc_pirq_struct);
-DUMMY(pirq_guest_bind);
-DUMMY(pirq_guest_unbind);
-DUMMY(pirq_set_affinity);
-
/* VCPU */
NOP(update_vcpu_system_time);
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 72e83e6..a50281b 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -192,6 +192,35 @@ out_no_end:
}
/*
+ * pirq event channels. We don't use these on ARM, instead we use the
+ * features of the GIC to inject virtualised normal interrupts.
+ */
+struct pirq *alloc_pirq_struct(struct domain *d)
+{
+ return NULL;
+}
+
+/*
+ * These are all unreachable given an alloc_pirq_struct
+ * which returns NULL, all callers try to lookup struct pirq first
+ * which will fail.
+ */
+int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share)
+{
+ BUG();
+}
+
+void pirq_guest_unbind(struct domain *d, struct pirq *pirq)
+{
+ BUG();
+}
+
+void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
+{
+ BUG();
+}
+
+/*
* Local variables:
* mode: C
* c-set-style: "BSD"
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 07/15] xen: arm: stub out wallclock time.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (5 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 06/15] xen: arm: stub out pirq related functions Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 08/15] xen: arm: stub out steal_page Ian Campbell
` (10 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
We don't currently have much concept of wallclock time on ARM (for
either the hypervisor, dom0 or guests). For now just stub everything
out. Specifically domain_set_time_offset, update_vcpu_system_time and
wallclock_time.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 5 -----
xen/arch/arm/time.c | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 2110bf1..87159da 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -6,9 +6,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
.globl x; \
x: mov pc, lr
-/* VCPU */
-NOP(update_vcpu_system_time);
-
/* Grant Tables */
DUMMY(steal_page);
@@ -18,8 +15,6 @@ DUMMY(page_is_ram_type);
/* Other */
DUMMY(domain_get_maximum_gpfn);
DUMMY(domain_relinquish_resources);
-DUMMY(domain_set_time_offset);
DUMMY(dom_cow);
DUMMY(send_timer_event);
DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(wallclock_time);
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index b6d7015..ac606f7 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -25,6 +25,7 @@
#include <xen/mm.h>
#include <xen/softirq.h>
#include <xen/time.h>
+#include <xen/sched.h>
#include <asm/system.h>
/*
@@ -185,6 +186,23 @@ void udelay(unsigned long usecs)
isb();
}
+/* VCPU PV clock. */
+void update_vcpu_system_time(struct vcpu *v)
+{
+ /* XXX update shared_info->wc_* */
+}
+
+void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+{
+ d->time_offset_seconds = time_offset_seconds;
+ /* XXX update guest visible wallclock time */
+}
+
+struct tm wallclock_time(void)
+{
+ return (struct tm) { 0 };
+}
+
/*
* Local variables:
* mode: C
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 08/15] xen: arm: stub out steal_page.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (6 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 07/15] xen: arm: stub out wallclock time Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 09/15] xen: arm: stub page_is_ram_type Ian Campbell
` (9 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Callers handle the failure gracefully, can be called by
GNTTABOP_transfer, XENMEM_exchange or tmem.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 3 ---
xen/arch/arm/mm.c | 6 ++++++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 87159da..f5b0db7 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -6,9 +6,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
.globl x; \
x: mov pc, lr
-/* Grant Tables */
-DUMMY(steal_page);
-
/* Page Offlining */
DUMMY(page_is_ram_type);
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 855f83d..687eb55 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -435,6 +435,12 @@ int donate_page(struct domain *d, struct page_info *page, unsigned int memflags)
return -ENOSYS;
}
+int steal_page(
+ struct domain *d, struct page_info *page, unsigned int memflags)
+{
+ return -1;
+}
+
void share_xen_page_with_guest(struct page_info *page,
struct domain *d, int readonly)
{
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 09/15] xen: arm: stub page_is_ram_type.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (7 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 08/15] xen: arm: stub out steal_page Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 10/15] xen: arm: stub out domain_get_maximum_gpfn Ian Campbell
` (8 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Callers are VT-d (so x86 specific) and various bits of page offlining
support, which although it looks generic (and is in xen/common) does
things like diving into page_info->count_info which is not generic.
In any case on this is only reachable via XEN_SYSCTL_page_offline_op,
which clearly shouldn't be called on ARM just yet.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 3 ---
xen/arch/arm/mm.c | 6 ++++++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index f5b0db7..7e6f171 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -5,9 +5,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
#define NOP(x) \
.globl x; \
x: mov pc, lr
-
-/* Page Offlining */
-DUMMY(page_is_ram_type);
/* Other */
DUMMY(domain_get_maximum_gpfn);
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 687eb55..329b1d4 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -441,6 +441,12 @@ int steal_page(
return -1;
}
+int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
+{
+ ASSERT(0);
+ return 0;
+}
+
void share_xen_page_with_guest(struct page_info *page,
struct domain *d, int readonly)
{
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 10/15] xen: arm: stub out domain_get_maximum_gpfn
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (8 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 09/15] xen: arm: stub page_is_ram_type Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 11/15] xen: arm: stub domain_relinquish_resources Ian Campbell
` (7 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
It currently has no callers, so return ENOSYS until such a time as one
arrives.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 1 -
xen/arch/arm/mm.c | 5 +++++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 7e6f171..fd667e5 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -7,7 +7,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
x: mov pc, lr
/* Other */
-DUMMY(domain_get_maximum_gpfn);
DUMMY(domain_relinquish_resources);
DUMMY(dom_cow);
DUMMY(send_timer_event);
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 329b1d4..718f32d 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -447,6 +447,11 @@ int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
return 0;
}
+unsigned long domain_get_maximum_gpfn(struct domain *d)
+{
+ return -ENOSYS;
+}
+
void share_xen_page_with_guest(struct page_info *page,
struct domain *d, int readonly)
{
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 11/15] xen: arm: stub domain_relinquish_resources.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (9 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 10/15] xen: arm: stub out domain_get_maximum_gpfn Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 12/15] xen: arm: initialise dom_{xen,io,cow} Ian Campbell
` (6 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Currently unimplemented. Domain teardown in general needs looking at.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/domain.c | 7 +++++++
xen/arch/arm/dummy.S | 1 -
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index b7b2d5c..7bbad45 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -520,6 +520,13 @@ void arch_vcpu_reset(struct vcpu *v)
vcpu_end_shutdown_deferral(v);
}
+int domain_relinquish_resources(struct domain *d)
+{
+ /* XXX teardown pagetables, free pages etc */
+ ASSERT(0);
+ return 0;
+}
+
void arch_dump_domain_info(struct domain *d)
{
}
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index fd667e5..7189648 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -7,7 +7,6 @@ x: .word 0xe7f000f0 /* Undefined instruction */
x: mov pc, lr
/* Other */
-DUMMY(domain_relinquish_resources);
DUMMY(dom_cow);
DUMMY(send_timer_event);
DUMMY(share_xen_page_with_privileged_guests);
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 12/15] xen: arm: initialise dom_{xen,io,cow}
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (10 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 11/15] xen: arm: stub domain_relinquish_resources Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 14:17 ` [PATCH 12/15] xen: arm: initialise dom_{xen, io, cow} David Vrabel
2012-12-04 11:56 ` [PATCH 13/15] xen: arm: implement send_timer_event Ian Campbell
` (5 subsequent siblings)
17 siblings, 1 reply; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 1 -
xen/arch/arm/mm.c | 28 +++++++++++++++++++++++++++-
xen/arch/arm/setup.c | 2 ++
xen/include/asm-arm/setup.h | 2 ++
4 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 7189648..3fe4ba6 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -7,6 +7,5 @@ x: .word 0xe7f000f0 /* Undefined instruction */
x: mov pc, lr
/* Other */
-DUMMY(dom_cow);
DUMMY(send_timer_event);
DUMMY(share_xen_page_with_privileged_guests);
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 718f32d..d9c1ff7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -30,12 +30,13 @@
#include <xen/event.h>
#include <xen/guest_access.h>
#include <xen/domain_page.h>
+#include <xen/err.h>
#include <asm/page.h>
#include <asm/current.h>
#include <public/memory.h>
#include <xen/sched.h>
-struct domain *dom_xen, *dom_io;
+struct domain *dom_xen, *dom_io, *dom_cow;
/* Static start-of-day pagetables that we use before the allocators are up */
lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
@@ -206,6 +207,31 @@ void unmap_domain_page(const void *va)
local_irq_restore(flags);
}
+void __init arch_init_memory(void)
+{
+ /*
+ * Initialise our DOMID_XEN domain.
+ * Any Xen-heap pages that we will allow to be mapped will have
+ * their domain field set to dom_xen.
+ */
+ dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
+ BUG_ON(IS_ERR(dom_xen));
+
+ /*
+ * Initialise our DOMID_IO domain.
+ * This domain owns I/O pages that are within the range of the page_info
+ * array. Mappings occur at the priv of the caller.
+ */
+ dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
+ BUG_ON(IS_ERR(dom_io));
+
+ /*
+ * Initialise our COW domain.
+ * This domain owns sharable pages.
+ */
+ dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
+ BUG_ON(IS_ERR(dom_cow));
+}
/* Boot-time pagetable setup.
* Changes here may need matching changes in head.S */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 2076724..61bf47c 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -265,6 +265,8 @@ void __init start_xen(unsigned long boot_phys_offset,
rcu_init();
+ arch_init_memory();
+
local_irq_enable();
smp_prepare_cpus(cpus);
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 8769f66..5c84334 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -3,6 +3,8 @@
#include <public/version.h>
+void arch_init_memory(void);
+
void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx);
void arch_get_xen_caps(xen_capabilities_info_t *info);
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 13/15] xen: arm: implement send_timer_event.
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (11 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 12/15] xen: arm: initialise dom_{xen,io,cow} Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 14/15] xen: arm: implement share_xen_page_with_privileged_guests Ian Campbell
` (4 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 1 -
xen/arch/arm/time.c | 7 +++++++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 3fe4ba6..6d4b34f 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -7,5 +7,4 @@ x: .word 0xe7f000f0 /* Undefined instruction */
x: mov pc, lr
/* Other */
-DUMMY(send_timer_event);
DUMMY(share_xen_page_with_privileged_guests);
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index ac606f7..0f9335e 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -26,6 +26,7 @@
#include <xen/softirq.h>
#include <xen/time.h>
#include <xen/sched.h>
+#include <xen/event.h>
#include <asm/system.h>
/*
@@ -186,6 +187,12 @@ void udelay(unsigned long usecs)
isb();
}
+/* VCPU PV timers. */
+void send_timer_event(struct vcpu *v)
+{
+ send_guest_vcpu_virq(v, VIRQ_TIMER);
+}
+
/* VCPU PV clock. */
void update_vcpu_system_time(struct vcpu *v)
{
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 14/15] xen: arm: implement share_xen_page_with_privileged_guests
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (12 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 13/15] xen: arm: implement send_timer_event Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 15/15] xen: arm: remove now empty dummy.S Ian Campbell
` (3 subsequent siblings)
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/dummy.S | 3 ---
xen/arch/arm/mm.c | 6 ++++++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 6d4b34f..a48ec08 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -5,6 +5,3 @@ x: .word 0xe7f000f0 /* Undefined instruction */
#define NOP(x) \
.globl x; \
x: mov pc, lr
-
-/* Other */
-DUMMY(share_xen_page_with_privileged_guests);
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d9c1ff7..d97b3ea 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -506,6 +506,12 @@ void share_xen_page_with_guest(struct page_info *page,
spin_unlock(&d->page_alloc_lock);
}
+void share_xen_page_with_privileged_guests(
+ struct page_info *page, int readonly)
+{
+ share_xen_page_with_guest(page, dom_xen, readonly);
+}
+
static int xenmem_add_to_physmap_one(
struct domain *d,
uint16_t space,
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 15/15] xen: arm: remove now empty dummy.S
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (13 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 14/15] xen: arm: implement share_xen_page_with_privileged_guests Ian Campbell
@ 2012-12-04 11:56 ` Ian Campbell
2012-12-19 16:05 ` Ian Campbell
2012-12-06 12:09 ` [PATCH 00/15] xen: arm: remove dummy.S Tim Deegan
` (2 subsequent siblings)
17 siblings, 1 reply; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 11:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/Makefile | 1 -
xen/arch/arm/dummy.S | 7 -------
2 files changed, 0 insertions(+), 8 deletions(-)
delete mode 100644 xen/arch/arm/dummy.S
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index fd92b72..5867fff 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -1,6 +1,5 @@
subdir-y += lib
-obj-y += dummy.o
obj-y += early_printk.o
obj-y += entry.o
obj-y += domain.o
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
deleted file mode 100644
index a48ec08..0000000
--- a/xen/arch/arm/dummy.S
+++ /dev/null
@@ -1,7 +0,0 @@
-#define DUMMY(x) \
- .globl x; \
-x: .word 0xe7f000f0 /* Undefined instruction */
-
-#define NOP(x) \
- .globl x; \
-x: mov pc, lr
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 05/15] xen: remove nr_irqs_gsi from generic code
2012-12-04 11:56 ` [PATCH 05/15] xen: remove nr_irqs_gsi from generic code Ian Campbell
@ 2012-12-04 13:43 ` Jan Beulich
2012-12-04 13:49 ` Ian Campbell
0 siblings, 1 reply; 32+ messages in thread
From: Jan Beulich @ 2012-12-04 13:43 UTC (permalink / raw)
To: Ian Campbell; +Cc: Daniel De Graaf, Keir (Xen.org), xen-devel
>>> On 04.12.12 at 12:56, Ian Campbell <ian.campbell@citrix.com> wrote:
> The concept is X86 specific.
>
> AFAICT the generic concept here is the number of physical IRQs which
> the current hardware has, so call this nr_hw_irqs.
Hmm, I don't particularly like this name, as (at least to me) it
gives the appearance to include MSI ones, which isn't correct.
How about nr_fixed_irqs or nr_static_irqs or some such?
Jan
> Also using "defined NR_IRQS" as a standin for x86 might have made
> sense at one point but its just cleaner to push the necessary
> definitions into asm/irq.h.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Keir (Xen.org) <keir@xen.org>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
> xen/arch/arm/dummy.S | 1 -
> xen/common/domain.c | 4 ++--
> xen/include/asm-arm/irq.h | 3 +++
> xen/include/asm-x86/irq.h | 4 ++++
> xen/include/xen/irq.h | 8 --------
> xen/xsm/flask/hooks.c | 4 ++--
> 6 files changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
> index 66eb314..5d9bcff 100644
> --- a/xen/arch/arm/dummy.S
> +++ b/xen/arch/arm/dummy.S
> @@ -8,7 +8,6 @@ x: mov pc, lr
>
> /* PIRQ support */
> DUMMY(alloc_pirq_struct);
> -DUMMY(nr_irqs_gsi);
> DUMMY(pirq_guest_bind);
> DUMMY(pirq_guest_unbind);
> DUMMY(pirq_set_affinity);
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index 12c8e24..d80461d 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -259,9 +259,9 @@ struct domain *domain_create(
> atomic_inc(&d->pause_count);
>
> if ( domid )
> - d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
> + d->nr_pirqs = nr_hw_irqs + extra_domU_irqs;
> else
> - d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
> + d->nr_pirqs = nr_hw_irqs + extra_dom0_irqs;
> if ( d->nr_pirqs > nr_irqs )
> d->nr_pirqs = nr_irqs;
>
> diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
> index abde839..4facaf0 100644
> --- a/xen/include/asm-arm/irq.h
> +++ b/xen/include/asm-arm/irq.h
> @@ -21,6 +21,9 @@ struct irq_cfg {
> #define NR_IRQS 1024
> #define nr_irqs NR_IRQS
>
> +#define nr_irqs NR_IRQS
> +#define nr_hw_irqs NR_IRQS
> +
> struct irq_desc;
>
> struct irq_desc *__irq_to_desc(int irq);
> diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
> index 5eefb94..6ea5f53 100644
> --- a/xen/include/asm-x86/irq.h
> +++ b/xen/include/asm-x86/irq.h
> @@ -11,6 +11,10 @@
> #include <irq_vectors.h>
> #include <asm/percpu.h>
>
> +extern unsigned int nr_irqs_gsi;
> +extern unsigned int nr_irqs;
> +#define nr_hw_irqs nr_irqs_gsi
> +
> #define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
> (1 << (irq)) & io_apic_irqs : \
> (irq) < nr_irqs_gsi)
> diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
> index 5973cce..7386358 100644
> --- a/xen/include/xen/irq.h
> +++ b/xen/include/xen/irq.h
> @@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
>
> #include <asm/irq.h>
>
> -#ifdef NR_IRQS
> -# define nr_irqs NR_IRQS
> -# define nr_irqs_gsi NR_IRQS
> -#else
> -extern unsigned int nr_irqs_gsi;
> -extern unsigned int nr_irqs;
> -#endif
> -
> struct msi_desc;
> /*
> * This is the "IRQ descriptor", which contains various information
> diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
> index 0ca10d0..595c31e 100644
> --- a/xen/xsm/flask/hooks.c
> +++ b/xen/xsm/flask/hooks.c
> @@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct
> avc_audit_data *ad)
> struct irq_desc *desc = irq_to_desc(irq);
> if ( irq >= nr_irqs || irq < 0 )
> return -EINVAL;
> - if ( irq < nr_irqs_gsi ) {
> + if ( irq < nr_hw_irqs ) {
> if (ad) {
> AVC_AUDIT_DATA_INIT(ad, IRQ);
> ad->irq = irq;
> @@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int
> irq, void *data)
> if ( rc )
> return rc;
>
> - if ( irq >= nr_irqs_gsi && msi ) {
> + if ( irq >= nr_hw_irqs && msi ) {
> u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
> AVC_AUDIT_DATA_INIT(&ad, DEV);
> ad.device = machine_bdf;
> --
> 1.7.9.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 05/15] xen: remove nr_irqs_gsi from generic code
2012-12-04 13:43 ` Jan Beulich
@ 2012-12-04 13:49 ` Ian Campbell
2012-12-19 14:43 ` [PATCH] " Ian Campbell
0 siblings, 1 reply; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 13:49 UTC (permalink / raw)
To: Jan Beulich; +Cc: Daniel De Graaf, Keir (Xen.org), xen-devel@lists.xen.org
On Tue, 2012-12-04 at 13:43 +0000, Jan Beulich wrote:
> >>> On 04.12.12 at 12:56, Ian Campbell <ian.campbell@citrix.com> wrote:
> > The concept is X86 specific.
> >
> > AFAICT the generic concept here is the number of physical IRQs which
> > the current hardware has, so call this nr_hw_irqs.
>
> Hmm, I don't particularly like this name, as (at least to me) it
> gives the appearance to include MSI ones, which isn't correct.
Ah, I wondered about this then forgot to mention it.
> How about nr_fixed_irqs or nr_static_irqs or some such?
Static would be a nice counter to "dynamic" which is how I tend to think
of MSIs.
>
> Jan
>
> > Also using "defined NR_IRQS" as a standin for x86 might have made
> > sense at one point but its just cleaner to push the necessary
> > definitions into asm/irq.h.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Keir (Xen.org) <keir@xen.org>
> > Cc: Jan Beulich <JBeulich@suse.com>
> > Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> > ---
> > xen/arch/arm/dummy.S | 1 -
> > xen/common/domain.c | 4 ++--
> > xen/include/asm-arm/irq.h | 3 +++
> > xen/include/asm-x86/irq.h | 4 ++++
> > xen/include/xen/irq.h | 8 --------
> > xen/xsm/flask/hooks.c | 4 ++--
> > 6 files changed, 11 insertions(+), 13 deletions(-)
> >
> > diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
> > index 66eb314..5d9bcff 100644
> > --- a/xen/arch/arm/dummy.S
> > +++ b/xen/arch/arm/dummy.S
> > @@ -8,7 +8,6 @@ x: mov pc, lr
> >
> > /* PIRQ support */
> > DUMMY(alloc_pirq_struct);
> > -DUMMY(nr_irqs_gsi);
> > DUMMY(pirq_guest_bind);
> > DUMMY(pirq_guest_unbind);
> > DUMMY(pirq_set_affinity);
> > diff --git a/xen/common/domain.c b/xen/common/domain.c
> > index 12c8e24..d80461d 100644
> > --- a/xen/common/domain.c
> > +++ b/xen/common/domain.c
> > @@ -259,9 +259,9 @@ struct domain *domain_create(
> > atomic_inc(&d->pause_count);
> >
> > if ( domid )
> > - d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
> > + d->nr_pirqs = nr_hw_irqs + extra_domU_irqs;
> > else
> > - d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
> > + d->nr_pirqs = nr_hw_irqs + extra_dom0_irqs;
> > if ( d->nr_pirqs > nr_irqs )
> > d->nr_pirqs = nr_irqs;
> >
> > diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
> > index abde839..4facaf0 100644
> > --- a/xen/include/asm-arm/irq.h
> > +++ b/xen/include/asm-arm/irq.h
> > @@ -21,6 +21,9 @@ struct irq_cfg {
> > #define NR_IRQS 1024
> > #define nr_irqs NR_IRQS
> >
> > +#define nr_irqs NR_IRQS
> > +#define nr_hw_irqs NR_IRQS
> > +
> > struct irq_desc;
> >
> > struct irq_desc *__irq_to_desc(int irq);
> > diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
> > index 5eefb94..6ea5f53 100644
> > --- a/xen/include/asm-x86/irq.h
> > +++ b/xen/include/asm-x86/irq.h
> > @@ -11,6 +11,10 @@
> > #include <irq_vectors.h>
> > #include <asm/percpu.h>
> >
> > +extern unsigned int nr_irqs_gsi;
> > +extern unsigned int nr_irqs;
> > +#define nr_hw_irqs nr_irqs_gsi
> > +
> > #define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
> > (1 << (irq)) & io_apic_irqs : \
> > (irq) < nr_irqs_gsi)
> > diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
> > index 5973cce..7386358 100644
> > --- a/xen/include/xen/irq.h
> > +++ b/xen/include/xen/irq.h
> > @@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
> >
> > #include <asm/irq.h>
> >
> > -#ifdef NR_IRQS
> > -# define nr_irqs NR_IRQS
> > -# define nr_irqs_gsi NR_IRQS
> > -#else
> > -extern unsigned int nr_irqs_gsi;
> > -extern unsigned int nr_irqs;
> > -#endif
> > -
> > struct msi_desc;
> > /*
> > * This is the "IRQ descriptor", which contains various information
> > diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
> > index 0ca10d0..595c31e 100644
> > --- a/xen/xsm/flask/hooks.c
> > +++ b/xen/xsm/flask/hooks.c
> > @@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct
> > avc_audit_data *ad)
> > struct irq_desc *desc = irq_to_desc(irq);
> > if ( irq >= nr_irqs || irq < 0 )
> > return -EINVAL;
> > - if ( irq < nr_irqs_gsi ) {
> > + if ( irq < nr_hw_irqs ) {
> > if (ad) {
> > AVC_AUDIT_DATA_INIT(ad, IRQ);
> > ad->irq = irq;
> > @@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int
> > irq, void *data)
> > if ( rc )
> > return rc;
> >
> > - if ( irq >= nr_irqs_gsi && msi ) {
> > + if ( irq >= nr_hw_irqs && msi ) {
> > u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
> > AVC_AUDIT_DATA_INIT(&ad, DEV);
> > ad.device = machine_bdf;
> > --
> > 1.7.9.1
>
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 12/15] xen: arm: initialise dom_{xen, io, cow}
2012-12-04 11:56 ` [PATCH 12/15] xen: arm: initialise dom_{xen,io,cow} Ian Campbell
@ 2012-12-04 14:17 ` David Vrabel
2012-12-04 14:21 ` Ian Campbell
0 siblings, 1 reply; 32+ messages in thread
From: David Vrabel @ 2012-12-04 14:17 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
On 04/12/12 11:56, Ian Campbell wrote:
> +void __init arch_init_memory(void)
> +{
> + /*
> + * Initialise our DOMID_XEN domain.
> + * Any Xen-heap pages that we will allow to be mapped will have
> + * their domain field set to dom_xen.
> + */
> + dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
> + BUG_ON(IS_ERR(dom_xen));
> +
> + /*
> + * Initialise our DOMID_IO domain.
> + * This domain owns I/O pages that are within the range of the page_info
> + * array. Mappings occur at the priv of the caller.
> + */
> + dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
> + BUG_ON(IS_ERR(dom_io));
> +
> + /*
> + * Initialise our COW domain.
> + * This domain owns sharable pages.
> + */
> + dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
> + BUG_ON(IS_ERR(dom_cow));
> +}
This looks like a cut and paste from the x86 code. Should it be
refactored into a common function?
David
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 12/15] xen: arm: initialise dom_{xen, io, cow}
2012-12-04 14:17 ` [PATCH 12/15] xen: arm: initialise dom_{xen, io, cow} David Vrabel
@ 2012-12-04 14:21 ` Ian Campbell
0 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-04 14:21 UTC (permalink / raw)
To: David Vrabel; +Cc: xen-devel@lists.xen.org
On Tue, 2012-12-04 at 14:17 +0000, David Vrabel wrote:
> On 04/12/12 11:56, Ian Campbell wrote:
> > +void __init arch_init_memory(void)
> > +{
> > + /*
> > + * Initialise our DOMID_XEN domain.
> > + * Any Xen-heap pages that we will allow to be mapped will have
> > + * their domain field set to dom_xen.
> > + */
> > + dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
> > + BUG_ON(IS_ERR(dom_xen));
> > +
> > + /*
> > + * Initialise our DOMID_IO domain.
> > + * This domain owns I/O pages that are within the range of the page_info
> > + * array. Mappings occur at the priv of the caller.
> > + */
> > + dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
> > + BUG_ON(IS_ERR(dom_io));
> > +
> > + /*
> > + * Initialise our COW domain.
> > + * This domain owns sharable pages.
> > + */
> > + dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
> > + BUG_ON(IS_ERR(dom_cow));
> > +}
>
> This looks like a cut and paste from the x86 code. Should it be
> refactored into a common function?
Yes, I suppose it should. I guess this is the counterpoint to my
observation that there is x86 stuff in generic code ;-)
Ian.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (14 preceding siblings ...)
2012-12-04 11:56 ` [PATCH 15/15] xen: arm: remove now empty dummy.S Ian Campbell
@ 2012-12-06 12:09 ` Tim Deegan
2012-12-19 13:27 ` Ian Campbell
2012-12-18 17:14 ` Ian Campbell
2012-12-19 14:03 ` Ian Campbell
17 siblings, 1 reply; 32+ messages in thread
From: Tim Deegan @ 2012-12-06 12:09 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
At 11:56 +0000 on 04 Dec (1354622173), Ian Campbell wrote:
> This was a short term hack to get something linking quickly, but its
> usefulness has now passed.
>
> This series replaces everything in here with proper functions. In many
> cases these are still just stubs.
For the arch/arm parts,
Acked-by: Tim Deegan <tim@xen.org>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (15 preceding siblings ...)
2012-12-06 12:09 ` [PATCH 00/15] xen: arm: remove dummy.S Tim Deegan
@ 2012-12-18 17:14 ` Ian Campbell
2012-12-18 18:31 ` Stefano Stabellini
2012-12-19 14:03 ` Ian Campbell
17 siblings, 1 reply; 32+ messages in thread
From: Ian Campbell @ 2012-12-18 17:14 UTC (permalink / raw)
To: xen-devel; +Cc: Tim Deegan, Stefano Stabellini
Ping? Any comments on the ARM parts before I go through a rebase +
refresh cycle?
On Tue, 2012-12-04 at 11:56 +0000, Ian Campbell wrote:
> This was a short term hack to get something linking quickly, but its
> usefulness has now passed.
>
> This series replaces everything in here with proper functions. In many
> cases these are still just stubs.
>
> It seems to me that at least some of this stuff consists of x86-isms
> which should instead be removed from the common code.
>
> This highlights two large missing pieces of functionality: wallclock
> time and cleaning up on domain destroy.
>
> Ian.
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-18 17:14 ` Ian Campbell
@ 2012-12-18 18:31 ` Stefano Stabellini
2012-12-18 20:54 ` Ian Campbell
0 siblings, 1 reply; 32+ messages in thread
From: Stefano Stabellini @ 2012-12-18 18:31 UTC (permalink / raw)
To: Ian Campbell; +Cc: Stefano Stabellini, Tim (Xen.org), xen-devel
I don't have any comments, they all look pretty straightforward.
On Tue, 18 Dec 2012, Ian Campbell wrote:
> Ping? Any comments on the ARM parts before I go through a rebase +
> refresh cycle?
>
> On Tue, 2012-12-04 at 11:56 +0000, Ian Campbell wrote:
> > This was a short term hack to get something linking quickly, but its
> > usefulness has now passed.
> >
> > This series replaces everything in here with proper functions. In many
> > cases these are still just stubs.
> >
> > It seems to me that at least some of this stuff consists of x86-isms
> > which should instead be removed from the common code.
> >
> > This highlights two large missing pieces of functionality: wallclock
> > time and cleaning up on domain destroy.
> >
> > Ian.
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
>
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-18 18:31 ` Stefano Stabellini
@ 2012-12-18 20:54 ` Ian Campbell
2012-12-19 11:21 ` Stefano Stabellini
0 siblings, 1 reply; 32+ messages in thread
From: Ian Campbell @ 2012-12-18 20:54 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: Tim (Xen.org), xen-devel
On Tue, 2012-12-18 at 18:31 +0000, Stefano Stabellini wrote:
> I don't have any comments, they all look pretty straightforward.
Is that an Acked-by: Stefano on all 15?
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-18 20:54 ` Ian Campbell
@ 2012-12-19 11:21 ` Stefano Stabellini
0 siblings, 0 replies; 32+ messages in thread
From: Stefano Stabellini @ 2012-12-19 11:21 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel, Tim (Xen.org), Stefano Stabellini
On Tue, 18 Dec 2012, Ian Campbell wrote:
> On Tue, 2012-12-18 at 18:31 +0000, Stefano Stabellini wrote:
> > I don't have any comments, they all look pretty straightforward.
>
> Is that an Acked-by: Stefano on all 15?
>
Yes
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-06 12:09 ` [PATCH 00/15] xen: arm: remove dummy.S Tim Deegan
@ 2012-12-19 13:27 ` Ian Campbell
0 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-19 13:27 UTC (permalink / raw)
To: Tim Deegan; +Cc: xen-devel
On Thu, 2012-12-06 at 12:09 +0000, Tim Deegan wrote:
> At 11:56 +0000 on 04 Dec (1354622173), Ian Campbell wrote:
> > This was a short term hack to get something linking quickly, but its
> > usefulness has now passed.
> >
> > This series replaces everything in here with proper functions. In many
> > cases these are still just stubs.
>
> For the arch/arm parts,
>
> Acked-by: Tim Deegan <tim@xen.org>
I somehow missed this in my ping yesterday, sorry!
Ian.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 00/15] xen: arm: remove dummy.S
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
` (16 preceding siblings ...)
2012-12-18 17:14 ` Ian Campbell
@ 2012-12-19 14:03 ` Ian Campbell
17 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-19 14:03 UTC (permalink / raw)
To: xen-devel
On Tue, 2012-12-04 at 11:56 +0000, Ian Campbell wrote:
> This was a short term hack to get something linking quickly, but its
> usefulness has now passed.
>
> This series replaces everything in here with proper functions. In many
> cases these are still just stubs.
>
> It seems to me that at least some of this stuff consists of x86-isms
> which should instead be removed from the common code.
>
> This highlights two large missing pieces of functionality: wallclock
> time and cleaning up on domain destroy.
Applied 1..4,6..14 with Tim+Stefano's acks. Thanks.
5 was the patch which touched x86 which I need to refresh after Jan's
comment. 15 is the final removal of dummy.S which needs 5.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH] xen: remove nr_irqs_gsi from generic code
2012-12-04 13:49 ` Ian Campbell
@ 2012-12-19 14:43 ` Ian Campbell
2012-12-19 15:18 ` Keir Fraser
` (2 more replies)
0 siblings, 3 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-19 14:43 UTC (permalink / raw)
To: xen-devel; +Cc: Daniel De Graaf, Keir (Xen.org), Ian Campbell, Jan Beulich
The concept is X86 specific.
AFAICT the generic concept here is the number of physical IRQs which
the current hardware has, so call this nr_hw_irqs.
Also using "defined NR_IRQS" as a standin for x86 might have made
sense at one point but its just cleaner to push the necessary
definitions into asm/irq.h.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Keir (Xen.org) <keir@xen.org>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
--
v2: s/nr_hw_irqs/nr_static_irqs/g
---
xen/arch/arm/dummy.S | 2 --
xen/common/domain.c | 4 ++--
xen/include/asm-arm/irq.h | 3 +++
xen/include/asm-x86/irq.h | 4 ++++
xen/include/xen/irq.h | 8 --------
xen/xsm/flask/hooks.c | 4 ++--
6 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
index 6416f94..a214fbf 100644
--- a/xen/arch/arm/dummy.S
+++ b/xen/arch/arm/dummy.S
@@ -6,5 +6,3 @@ x: .word 0xe7f000f0 /* Undefined instruction */
.globl x; \
x: mov pc, lr
-/* PIRQ support */
-DUMMY(nr_irqs_gsi);
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 12c8e24..2f8ef00 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -259,9 +259,9 @@ struct domain *domain_create(
atomic_inc(&d->pause_count);
if ( domid )
- d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
+ d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
else
- d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
+ d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
if ( d->nr_pirqs > nr_irqs )
d->nr_pirqs = nr_irqs;
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index abde839..bd6b54a 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -21,6 +21,9 @@ struct irq_cfg {
#define NR_IRQS 1024
#define nr_irqs NR_IRQS
+#define nr_irqs NR_IRQS
+#define nr_static_irqs NR_IRQS
+
struct irq_desc;
struct irq_desc *__irq_to_desc(int irq);
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index 5eefb94..7f5da06 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -11,6 +11,10 @@
#include <irq_vectors.h>
#include <asm/percpu.h>
+extern unsigned int nr_irqs_gsi;
+extern unsigned int nr_irqs;
+#define nr_static_irqs nr_irqs_gsi
+
#define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
(1 << (irq)) & io_apic_irqs : \
(irq) < nr_irqs_gsi)
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 5973cce..7386358 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
#include <asm/irq.h>
-#ifdef NR_IRQS
-# define nr_irqs NR_IRQS
-# define nr_irqs_gsi NR_IRQS
-#else
-extern unsigned int nr_irqs_gsi;
-extern unsigned int nr_irqs;
-#endif
-
struct msi_desc;
/*
* This is the "IRQ descriptor", which contains various information
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 0ca10d0..782e28c 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
struct irq_desc *desc = irq_to_desc(irq);
if ( irq >= nr_irqs || irq < 0 )
return -EINVAL;
- if ( irq < nr_irqs_gsi ) {
+ if ( irq < nr_static_irqs ) {
if (ad) {
AVC_AUDIT_DATA_INIT(ad, IRQ);
ad->irq = irq;
@@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
if ( rc )
return rc;
- if ( irq >= nr_irqs_gsi && msi ) {
+ if ( irq >= nr_static_irqs && msi ) {
u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
AVC_AUDIT_DATA_INIT(&ad, DEV);
ad.device = machine_bdf;
--
1.7.9.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH] xen: remove nr_irqs_gsi from generic code
2012-12-19 14:43 ` [PATCH] " Ian Campbell
@ 2012-12-19 15:18 ` Keir Fraser
2012-12-19 15:31 ` Jan Beulich
2012-12-19 16:05 ` Ian Campbell
2 siblings, 0 replies; 32+ messages in thread
From: Keir Fraser @ 2012-12-19 15:18 UTC (permalink / raw)
To: Ian Campbell, xen-devel; +Cc: Daniel De Graaf, Jan Beulich
On 19/12/2012 14:43, "Ian Campbell" <ian.campbell@citrix.com> wrote:
> The concept is X86 specific.
>
> AFAICT the generic concept here is the number of physical IRQs which
> the current hardware has, so call this nr_hw_irqs.
>
> Also using "defined NR_IRQS" as a standin for x86 might have made
> sense at one point but its just cleaner to push the necessary
> definitions into asm/irq.h.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Keir (Xen.org) <keir@xen.org>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Keir Fraser <keir@xen.org>
> --
> v2: s/nr_hw_irqs/nr_static_irqs/g
> ---
> xen/arch/arm/dummy.S | 2 --
> xen/common/domain.c | 4 ++--
> xen/include/asm-arm/irq.h | 3 +++
> xen/include/asm-x86/irq.h | 4 ++++
> xen/include/xen/irq.h | 8 --------
> xen/xsm/flask/hooks.c | 4 ++--
> 6 files changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
> index 6416f94..a214fbf 100644
> --- a/xen/arch/arm/dummy.S
> +++ b/xen/arch/arm/dummy.S
> @@ -6,5 +6,3 @@ x: .word 0xe7f000f0 /* Undefined instruction */
> .globl x; \
> x: mov pc, lr
>
> -/* PIRQ support */
> -DUMMY(nr_irqs_gsi);
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index 12c8e24..2f8ef00 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -259,9 +259,9 @@ struct domain *domain_create(
> atomic_inc(&d->pause_count);
>
> if ( domid )
> - d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
> + d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
> else
> - d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
> + d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
> if ( d->nr_pirqs > nr_irqs )
> d->nr_pirqs = nr_irqs;
>
> diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
> index abde839..bd6b54a 100644
> --- a/xen/include/asm-arm/irq.h
> +++ b/xen/include/asm-arm/irq.h
> @@ -21,6 +21,9 @@ struct irq_cfg {
> #define NR_IRQS 1024
> #define nr_irqs NR_IRQS
>
> +#define nr_irqs NR_IRQS
> +#define nr_static_irqs NR_IRQS
> +
> struct irq_desc;
>
> struct irq_desc *__irq_to_desc(int irq);
> diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
> index 5eefb94..7f5da06 100644
> --- a/xen/include/asm-x86/irq.h
> +++ b/xen/include/asm-x86/irq.h
> @@ -11,6 +11,10 @@
> #include <irq_vectors.h>
> #include <asm/percpu.h>
>
> +extern unsigned int nr_irqs_gsi;
> +extern unsigned int nr_irqs;
> +#define nr_static_irqs nr_irqs_gsi
> +
> #define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
> (1 << (irq)) & io_apic_irqs : \
> (irq) < nr_irqs_gsi)
> diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
> index 5973cce..7386358 100644
> --- a/xen/include/xen/irq.h
> +++ b/xen/include/xen/irq.h
> @@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
>
> #include <asm/irq.h>
>
> -#ifdef NR_IRQS
> -# define nr_irqs NR_IRQS
> -# define nr_irqs_gsi NR_IRQS
> -#else
> -extern unsigned int nr_irqs_gsi;
> -extern unsigned int nr_irqs;
> -#endif
> -
> struct msi_desc;
> /*
> * This is the "IRQ descriptor", which contains various information
> diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
> index 0ca10d0..782e28c 100644
> --- a/xen/xsm/flask/hooks.c
> +++ b/xen/xsm/flask/hooks.c
> @@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct
> avc_audit_data *ad)
> struct irq_desc *desc = irq_to_desc(irq);
> if ( irq >= nr_irqs || irq < 0 )
> return -EINVAL;
> - if ( irq < nr_irqs_gsi ) {
> + if ( irq < nr_static_irqs ) {
> if (ad) {
> AVC_AUDIT_DATA_INIT(ad, IRQ);
> ad->irq = irq;
> @@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int
> irq, void *data)
> if ( rc )
> return rc;
>
> - if ( irq >= nr_irqs_gsi && msi ) {
> + if ( irq >= nr_static_irqs && msi ) {
> u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
> AVC_AUDIT_DATA_INIT(&ad, DEV);
> ad.device = machine_bdf;
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] xen: remove nr_irqs_gsi from generic code
2012-12-19 14:43 ` [PATCH] " Ian Campbell
2012-12-19 15:18 ` Keir Fraser
@ 2012-12-19 15:31 ` Jan Beulich
2012-12-19 16:05 ` Ian Campbell
2 siblings, 0 replies; 32+ messages in thread
From: Jan Beulich @ 2012-12-19 15:31 UTC (permalink / raw)
To: Ian Campbell; +Cc: Daniel De Graaf, Keir (Xen.org), xen-devel
>>> On 19.12.12 at 15:43, Ian Campbell <ian.campbell@citrix.com> wrote:
> The concept is X86 specific.
>
> AFAICT the generic concept here is the number of physical IRQs which
> the current hardware has, so call this nr_hw_irqs.
>
> Also using "defined NR_IRQS" as a standin for x86 might have made
> sense at one point but its just cleaner to push the necessary
> definitions into asm/irq.h.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Keir (Xen.org) <keir@xen.org>
> Cc: Jan Beulich <JBeulich@suse.com>
> Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
> --
> v2: s/nr_hw_irqs/nr_static_irqs/g
> ---
> xen/arch/arm/dummy.S | 2 --
> xen/common/domain.c | 4 ++--
> xen/include/asm-arm/irq.h | 3 +++
> xen/include/asm-x86/irq.h | 4 ++++
> xen/include/xen/irq.h | 8 --------
> xen/xsm/flask/hooks.c | 4 ++--
> 6 files changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S
> index 6416f94..a214fbf 100644
> --- a/xen/arch/arm/dummy.S
> +++ b/xen/arch/arm/dummy.S
> @@ -6,5 +6,3 @@ x: .word 0xe7f000f0 /* Undefined instruction */
> .globl x; \
> x: mov pc, lr
>
> -/* PIRQ support */
> -DUMMY(nr_irqs_gsi);
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index 12c8e24..2f8ef00 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -259,9 +259,9 @@ struct domain *domain_create(
> atomic_inc(&d->pause_count);
>
> if ( domid )
> - d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
> + d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
> else
> - d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
> + d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
> if ( d->nr_pirqs > nr_irqs )
> d->nr_pirqs = nr_irqs;
>
> diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
> index abde839..bd6b54a 100644
> --- a/xen/include/asm-arm/irq.h
> +++ b/xen/include/asm-arm/irq.h
> @@ -21,6 +21,9 @@ struct irq_cfg {
> #define NR_IRQS 1024
> #define nr_irqs NR_IRQS
>
> +#define nr_irqs NR_IRQS
> +#define nr_static_irqs NR_IRQS
> +
> struct irq_desc;
>
> struct irq_desc *__irq_to_desc(int irq);
> diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
> index 5eefb94..7f5da06 100644
> --- a/xen/include/asm-x86/irq.h
> +++ b/xen/include/asm-x86/irq.h
> @@ -11,6 +11,10 @@
> #include <irq_vectors.h>
> #include <asm/percpu.h>
>
> +extern unsigned int nr_irqs_gsi;
> +extern unsigned int nr_irqs;
> +#define nr_static_irqs nr_irqs_gsi
> +
> #define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
> (1 << (irq)) & io_apic_irqs : \
> (irq) < nr_irqs_gsi)
> diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
> index 5973cce..7386358 100644
> --- a/xen/include/xen/irq.h
> +++ b/xen/include/xen/irq.h
> @@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
>
> #include <asm/irq.h>
>
> -#ifdef NR_IRQS
> -# define nr_irqs NR_IRQS
> -# define nr_irqs_gsi NR_IRQS
> -#else
> -extern unsigned int nr_irqs_gsi;
> -extern unsigned int nr_irqs;
> -#endif
> -
> struct msi_desc;
> /*
> * This is the "IRQ descriptor", which contains various information
> diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
> index 0ca10d0..782e28c 100644
> --- a/xen/xsm/flask/hooks.c
> +++ b/xen/xsm/flask/hooks.c
> @@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct
> avc_audit_data *ad)
> struct irq_desc *desc = irq_to_desc(irq);
> if ( irq >= nr_irqs || irq < 0 )
> return -EINVAL;
> - if ( irq < nr_irqs_gsi ) {
> + if ( irq < nr_static_irqs ) {
> if (ad) {
> AVC_AUDIT_DATA_INIT(ad, IRQ);
> ad->irq = irq;
> @@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int
> irq, void *data)
> if ( rc )
> return rc;
>
> - if ( irq >= nr_irqs_gsi && msi ) {
> + if ( irq >= nr_static_irqs && msi ) {
> u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
> AVC_AUDIT_DATA_INIT(&ad, DEV);
> ad.device = machine_bdf;
> --
> 1.7.9.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] xen: remove nr_irqs_gsi from generic code
2012-12-19 14:43 ` [PATCH] " Ian Campbell
2012-12-19 15:18 ` Keir Fraser
2012-12-19 15:31 ` Jan Beulich
@ 2012-12-19 16:05 ` Ian Campbell
2 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-19 16:05 UTC (permalink / raw)
To: xen-devel@lists.xen.org; +Cc: Daniel De Graaf, Keir (Xen.org), Jan Beulich
On Wed, 2012-12-19 at 14:43 +0000, Ian Campbell wrote:
> The concept is X86 specific.
>
> AFAICT the generic concept here is the number of physical IRQs which
> the current hardware has, so call this nr_hw_irqs.
I corrected this to:
AFAICT the generic concept here is the number of static physical IRQs
which the current hardware has, so call this nr_static_irqs.
> Also using "defined NR_IRQS" as a standin for x86 might have made
> sense at one point but its just cleaner to push the necessary
> definitions into asm/irq.h.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Keir (Xen.org) <keir@xen.org>
> Cc: Jan Beulich <JBeulich@suse.com>
Applied with Keir + Jan's ack.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 15/15] xen: arm: remove now empty dummy.S
2012-12-04 11:56 ` [PATCH 15/15] xen: arm: remove now empty dummy.S Ian Campbell
@ 2012-12-19 16:05 ` Ian Campbell
0 siblings, 0 replies; 32+ messages in thread
From: Ian Campbell @ 2012-12-19 16:05 UTC (permalink / raw)
To: xen-devel@lists.xen.org
On Tue, 2012-12-04 at 11:56 +0000, Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Applied with Tim + Stefano's Ack now that the nr_irqs_gsi thing is in.
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2012-12-19 16:05 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 11:56 [PATCH 00/15] xen: arm: remove dummy.S Ian Campbell
2012-12-04 11:56 ` [PATCH 01/15] xen: arm: define node_online_map Ian Campbell
2012-12-04 11:56 ` [PATCH 02/15] xen: arm: make smp_send_state_dump a real function Ian Campbell
2012-12-04 11:56 ` [PATCH 03/15] xen: arm: implement arch_get_info_guest Ian Campbell
2012-12-04 11:56 ` [PATCH 04/15] xen: arm: implement arch_vcpu_reset Ian Campbell
2012-12-04 11:56 ` [PATCH 05/15] xen: remove nr_irqs_gsi from generic code Ian Campbell
2012-12-04 13:43 ` Jan Beulich
2012-12-04 13:49 ` Ian Campbell
2012-12-19 14:43 ` [PATCH] " Ian Campbell
2012-12-19 15:18 ` Keir Fraser
2012-12-19 15:31 ` Jan Beulich
2012-12-19 16:05 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 06/15] xen: arm: stub out pirq related functions Ian Campbell
2012-12-04 11:56 ` [PATCH 07/15] xen: arm: stub out wallclock time Ian Campbell
2012-12-04 11:56 ` [PATCH 08/15] xen: arm: stub out steal_page Ian Campbell
2012-12-04 11:56 ` [PATCH 09/15] xen: arm: stub page_is_ram_type Ian Campbell
2012-12-04 11:56 ` [PATCH 10/15] xen: arm: stub out domain_get_maximum_gpfn Ian Campbell
2012-12-04 11:56 ` [PATCH 11/15] xen: arm: stub domain_relinquish_resources Ian Campbell
2012-12-04 11:56 ` [PATCH 12/15] xen: arm: initialise dom_{xen,io,cow} Ian Campbell
2012-12-04 14:17 ` [PATCH 12/15] xen: arm: initialise dom_{xen, io, cow} David Vrabel
2012-12-04 14:21 ` Ian Campbell
2012-12-04 11:56 ` [PATCH 13/15] xen: arm: implement send_timer_event Ian Campbell
2012-12-04 11:56 ` [PATCH 14/15] xen: arm: implement share_xen_page_with_privileged_guests Ian Campbell
2012-12-04 11:56 ` [PATCH 15/15] xen: arm: remove now empty dummy.S Ian Campbell
2012-12-19 16:05 ` Ian Campbell
2012-12-06 12:09 ` [PATCH 00/15] xen: arm: remove dummy.S Tim Deegan
2012-12-19 13:27 ` Ian Campbell
2012-12-18 17:14 ` Ian Campbell
2012-12-18 18:31 ` Stefano Stabellini
2012-12-18 20:54 ` Ian Campbell
2012-12-19 11:21 ` Stefano Stabellini
2012-12-19 14:03 ` Ian Campbell
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).