aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-07-04 19:49:32 +0200
committerFelix Fietkau <nbd@nbd.name>2018-07-11 20:59:05 +0200
commit41a1c1af4bbf18cb5f3a4dfd1fb988317da9aa2d (patch)
tree703b91ca16db7d261d472eefb420b353b18e6e3e
parente07ad61aec86f271f407e80601e0d759e024b0df (diff)
downloadupstream-41a1c1af4bbf18cb5f3a4dfd1fb988317da9aa2d.tar.gz
upstream-41a1c1af4bbf18cb5f3a4dfd1fb988317da9aa2d.tar.bz2
upstream-41a1c1af4bbf18cb5f3a4dfd1fb988317da9aa2d.zip
kernel: adjust bridge port isolate patch to match upstream attribute naming
Newer kernels have a patch that implements compatible functionality directly. Adjust the attribute of our own patch in preparation for dropping it later Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--target/linux/generic/hack-4.14/641-bridge_port_isolate.patch4
-rw-r--r--target/linux/generic/hack-4.9/641-bridge_port_isolate.patch4
-rw-r--r--target/linux/generic/pending-3.18/642-bridge_port_isolate.patch25
3 files changed, 9 insertions, 24 deletions
diff --git a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch
index 538dbd16b09..43e71ee2ff7 100644
--- a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch
+++ b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch
@@ -62,7 +62,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI);
BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD);
BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD);
-+BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE);
++BRPORT_ATTR_FLAG(isolated, BR_ISOLATE_MODE);
#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&brport_attr_proxyarp_wifi,
&brport_attr_multicast_flood,
&brport_attr_broadcast_flood,
-+ &brport_attr_isolate_mode,
++ &brport_attr_isolated,
NULL
};
diff --git a/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch
index 0d0b2c73ffe..c545fa17ef8 100644
--- a/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch
+++ b/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch
@@ -62,7 +62,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP);
BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI);
BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD);
-+BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE);
++BRPORT_ATTR_FLAG(isolated, BR_ISOLATE_MODE);
#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
&brport_attr_proxyarp,
&brport_attr_proxyarp_wifi,
&brport_attr_multicast_flood,
-+ &brport_attr_isolate_mode,
++ &brport_attr_isolated,
NULL
};
diff --git a/target/linux/generic/pending-3.18/642-bridge_port_isolate.patch b/target/linux/generic/pending-3.18/642-bridge_port_isolate.patch
index d231f881b9c..47f8eb160b2 100644
--- a/target/linux/generic/pending-3.18/642-bridge_port_isolate.patch
+++ b/target/linux/generic/pending-3.18/642-bridge_port_isolate.patch
@@ -15,34 +15,19 @@ Isolating individual bridge ports
struct bridge_mcast_own_query ip4_own_query;
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
-@@ -171,6 +171,22 @@ BRPORT_ATTR_FLAG(root_block, BR_ROOT_BLO
+@@ -170,6 +170,7 @@ BRPORT_ATTR_FLAG(bpdu_guard, BR_BPDU_GUA
+ BRPORT_ATTR_FLAG(root_block, BR_ROOT_BLOCK);
BRPORT_ATTR_FLAG(learning, BR_LEARNING);
BRPORT_ATTR_FLAG(unicast_flood, BR_FLOOD);
++BRPORT_ATTR_FLAG(isolated, BR_ISOLATE_MODE);
-+static ssize_t show_isolate_mode(struct net_bridge_port *p, char *buf)
-+{
-+ int isolate_mode = (p->flags & BR_ISOLATE_MODE) ? 1 : 0;
-+ return sprintf(buf, "%d\n", isolate_mode);
-+}
-+static ssize_t store_isolate_mode(struct net_bridge_port *p, unsigned long v)
-+{
-+ if (v)
-+ p->flags |= BR_ISOLATE_MODE;
-+ else
-+ p->flags &= ~BR_ISOLATE_MODE;
-+ return 0;
-+}
-+static BRPORT_ATTR(isolate_mode, S_IRUGO | S_IWUSR,
-+ show_isolate_mode, store_isolate_mode);
-+
#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
- {
-@@ -213,6 +229,7 @@ static const struct brport_attribute *br
+@@ -213,6 +214,7 @@ static const struct brport_attribute *br
&brport_attr_multicast_router,
&brport_attr_multicast_fast_leave,
#endif
-+ &brport_attr_isolate_mode,
++ &brport_attr_isolated,
NULL
};
ighlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * Copyright (C) IBM Corp. 2005, 2006
 *
 * Authors: Jimi Xenidis <jimix@watson.ibm.com>
 */

#include <xen/config.h>
#include <xen/types.h>
#include <xen/sched.h>
#include <xen/lib.h>
#include <xen/event.h>
#include <xen/irq.h>
#include <public/xen.h>
#include <asm/current.h>
#include <asm/hardirq.h>
#include <asm/mpic.h>
#include "mpic_init.h"
#include "exceptions.h"

#undef DEBUG
#ifdef DEBUG
#define DBG(fmt...) printk(fmt)
#else
#define DBG(fmt...)
#endif

int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1};

unsigned long io_apic_irqs;
int ioapic_ack_new = 1;

static struct hw_interrupt_type *hc_irq;

/* deliver_ee: called with interrupts off when resuming every vcpu */
void deliver_ee(struct cpu_user_regs *regs)
{
    const ulong srr_mask = ~(MSR_IR | MSR_DR | MSR_FE0 | MSR_FE1 | MSR_EE |
                             MSR_RI |
                             MSR_BE | MSR_FP | MSR_PMM | MSR_PR | MSR_SE);

    BUG_ON(mfmsr() & MSR_EE);
    BUG_ON(regs->msr & MSR_HV);

    if (!local_events_need_delivery())
        return;

    /* XXX OS error: EE was set but RI was not. We could trigger a machine
     * check, or kill the domain... for now just crash Xen so we notice. */
    BUG_ON(!(regs->msr & MSR_RI));

    regs->srr0 = regs->pc;
    /* zero SRR1[33:36] and SRR1[42:47] */
    regs->srr1 = regs->msr & ~0x00000000783f0000;
    regs->pc = 0x500;
    regs->msr &= srr_mask;
    regs->msr |= MSR_SF | MSR_ME;

    DBG("<HV: pc=0x%lx, msr=0x%lx\n", regs->pc, regs->msr);
}

void do_external(struct cpu_user_regs *regs)
{
    int vec;

    BUG_ON(!(regs->msr & MSR_EE));
    BUG_ON(mfmsr() & MSR_EE);

    vec = xen_mpic_get_irq(regs);

    if (vec != -1) {
        DBG("EE:0x%lx isrc: %d\n", regs->msr, vec);
        regs->entry_vector = vec;
        do_IRQ(regs);

        BUG_ON(mfmsr() & MSR_EE);
    }
}

static int xen_local_irq(unsigned int irq)
{
    irq_desc_t *desc;
    unsigned int vector;

    vector = irq_to_vector(irq);
    desc = &irq_desc[vector];

    return !(desc->status & IRQ_GUEST);
}

static unsigned int xen_startup_irq(unsigned int irq)
{
    DBG("%s(%d)\n", __func__, irq);
    if (xen_local_irq(irq)) {