Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40756
b: refs/heads/master
c: b765103
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Nov 6, 2006
1 parent ae29f53 commit 973e4fb
Show file tree
Hide file tree
Showing 26 changed files with 190 additions and 99 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6af0f5f83169ef215b4579834ddfb2691e8a7bff
refs/heads/master: b7651030a56b9aa80e9cb43b4c8bb28b89c42359
3 changes: 0 additions & 3 deletions trunk/arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ config WARN_STACK_SIZE
This allows you to specify the maximum frame size a function may
have without the compiler complaining about it.

config ARCH_POPULATES_NODE_MAP
def_bool y

source "mm/Kconfig"

comment "I/O subsystem configuration"
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/s390/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ CONFIG_PACK_STACK=y
CONFIG_CHECK_STACK=y
CONFIG_STACK_GUARD=256
# CONFIG_WARN_STACK is not set
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
Expand Down
55 changes: 42 additions & 13 deletions trunk/arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct {
#define CHUNK_READ_WRITE 0
#define CHUNK_READ_ONLY 1
volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
unsigned long __initdata zholes_size[MAX_NR_ZONES];
static unsigned long __initdata memory_end;

/*
Expand Down Expand Up @@ -357,6 +358,21 @@ void machine_power_off(void)
*/
void (*pm_power_off)(void) = machine_power_off;

static void __init
add_memory_hole(unsigned long start, unsigned long end)
{
unsigned long dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT;

if (end <= dma_pfn)
zholes_size[ZONE_DMA] += end - start + 1;
else if (start > dma_pfn)
zholes_size[ZONE_NORMAL] += end - start + 1;
else {
zholes_size[ZONE_DMA] += dma_pfn - start + 1;
zholes_size[ZONE_NORMAL] += end - dma_pfn;
}
}

static int __init early_parse_mem(char *p)
{
memory_end = memparse(p, &p);
Expand Down Expand Up @@ -434,7 +450,7 @@ setup_lowcore(void)
lc->extended_save_area_addr = (__u32)
__alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0);
/* enable extended save area */
ctl_set_bit(14, 29);
__ctl_set_bit(14, 29);
}
#endif
set_prefix((u32)(unsigned long) lc);
Expand Down Expand Up @@ -478,6 +494,7 @@ setup_memory(void)
{
unsigned long bootmap_size;
unsigned long start_pfn, end_pfn, init_pfn;
unsigned long last_rw_end;
int i;

/*
Expand Down Expand Up @@ -533,27 +550,39 @@ setup_memory(void)
/*
* Register RAM areas with the bootmem allocator.
*/
last_rw_end = start_pfn;

for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
unsigned long start_chunk, end_chunk, pfn;
unsigned long start_chunk, end_chunk;

if (memory_chunk[i].type != CHUNK_READ_WRITE)
continue;
start_chunk = PFN_DOWN(memory_chunk[i].addr);
end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1;
end_chunk = min(end_chunk, end_pfn);
if (start_chunk >= end_chunk)
continue;
add_active_range(0, start_chunk, end_chunk);
pfn = max(start_chunk, start_pfn);
for (; pfn <= end_chunk; pfn++)
page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY);
start_chunk = (memory_chunk[i].addr + PAGE_SIZE - 1);
start_chunk >>= PAGE_SHIFT;
end_chunk = (memory_chunk[i].addr + memory_chunk[i].size);
end_chunk >>= PAGE_SHIFT;
if (start_chunk < start_pfn)
start_chunk = start_pfn;
if (end_chunk > end_pfn)
end_chunk = end_pfn;
if (start_chunk < end_chunk) {
/* Initialize storage key for RAM pages */
for (init_pfn = start_chunk ; init_pfn < end_chunk;
init_pfn++)
page_set_storage_key(init_pfn << PAGE_SHIFT,
PAGE_DEFAULT_KEY);
free_bootmem(start_chunk << PAGE_SHIFT,
(end_chunk - start_chunk) << PAGE_SHIFT);
if (last_rw_end < start_chunk)
add_memory_hole(last_rw_end, start_chunk - 1);
last_rw_end = end_chunk;
}
}

psw_set_key(PAGE_DEFAULT_KEY);

free_bootmem_with_active_regions(0, max_pfn);
reserve_bootmem(0, PFN_PHYS(start_pfn));
if (last_rw_end < end_pfn - 1)
add_memory_hole(last_rw_end, end_pfn - 1);

/*
* Reserve the bootmem bitmap itself as well. We do this in two
Expand Down
32 changes: 22 additions & 10 deletions trunk/arch/s390/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void show_mem(void)
printk("%d pages swap cached\n",cached);
}

extern unsigned long __initdata zholes_size[];
/*
* paging_init() sets up the page tables
*/
Expand All @@ -100,15 +101,16 @@ void __init paging_init(void)
unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE;
static const int ssm_mask = 0x04000000L;
unsigned long ro_start_pfn, ro_end_pfn;
unsigned long max_zone_pfns[MAX_NR_ZONES];
unsigned long zones_size[MAX_NR_ZONES];

ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata);
ro_end_pfn = PFN_UP((unsigned long)&__end_rodata);

memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
max_zone_pfns[ZONE_DMA] = max_low_pfn;
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(max_zone_pfns);
memset(zones_size, 0, sizeof(zones_size));
zones_size[ZONE_DMA] = max_low_pfn;
free_area_init_node(0, &contig_page_data, zones_size,
__pa(PAGE_OFFSET) >> PAGE_SHIFT,
zholes_size);

/* unmap whole virtual address space */

Expand Down Expand Up @@ -168,16 +170,26 @@ void __init paging_init(void)
unsigned long pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) |
_KERN_REGION_TABLE;
static const int ssm_mask = 0x04000000L;
unsigned long zones_size[MAX_NR_ZONES];
unsigned long dma_pfn, high_pfn;
unsigned long ro_start_pfn, ro_end_pfn;
unsigned long max_zone_pfns[MAX_NR_ZONES];

memset(zones_size, 0, sizeof(zones_size));
dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT;
high_pfn = max_low_pfn;
ro_start_pfn = PFN_DOWN((unsigned long)&__start_rodata);
ro_end_pfn = PFN_UP((unsigned long)&__end_rodata);

memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
max_zone_pfns[ZONE_DMA] = PFN_DOWN(MAX_DMA_ADDRESS);
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(max_zone_pfns);
if (dma_pfn > high_pfn)
zones_size[ZONE_DMA] = high_pfn;
else {
zones_size[ZONE_DMA] = dma_pfn;
zones_size[ZONE_NORMAL] = high_pfn - dma_pfn;
}

/* Initialize mem_map[]. */
free_area_init_node(0, &contig_page_data, zones_size,
__pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);

/*
* map whole physical memory to virtual memory (identity mapping)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/gigaset/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
} else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
skb_reserve(bcs->skb, HW_HDR_LEN);
else {
gig_dbg(DEBUG_INIT, "could not allocate skb\n");
warn("could not allocate skb\n");
bcs->inputstate |= INS_skip_frame;
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/misc/lkdtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[])

struct scan_control;

unsigned long jp_shrink_page_list(struct list_head *page_list,
struct scan_control *sc)
unsigned long jp_shrink_inactive_list(unsigned long max_scan,
struct zone *zone, struct scan_control *sc)
{
lkdtm_handler();
jprobe_return();
Expand Down Expand Up @@ -297,8 +297,8 @@ int lkdtm_module_init(void)
lkdtm.entry = (kprobe_opcode_t*) jp_ll_rw_block;
break;
case MEM_SWAPOUT:
lkdtm.kp.symbol_name = "shrink_page_list";
lkdtm.entry = (kprobe_opcode_t*) jp_shrink_page_list;
lkdtm.kp.symbol_name = "shrink_inactive_list";
lkdtm.entry = (kprobe_opcode_t*) jp_shrink_inactive_list;
break;
case TIMERADD:
lkdtm.kp.symbol_name = "hrtimer_start";
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ config SGI_IOC3_ETH_HW_TX_CSUM

config MIPS_SIM_NET
tristate "MIPS simulator Network device (EXPERIMENTAL)"
depends on NETDEVICES && MIPS_SIM && EXPERIMENTAL
depends on MIPS_SIM && EXPERIMENTAL
help
The MIPSNET device is a simple Ethernet network device which is
emulated by the MIPS Simulator.
Expand Down Expand Up @@ -2467,7 +2467,7 @@ config ISERIES_VETH

config RIONET
tristate "RapidIO Ethernet over messaging driver support"
depends on NETDEVICES && RAPIDIO
depends on RAPIDIO

config RIONET_TX_SIZE
int "Number of outbound queue entries"
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0034"
#define DRV_VERSION "EHEA_0043"

#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
Expand Down Expand Up @@ -105,9 +105,6 @@
#define EHEA_BCMC_VLANID_ALL 0x01
#define EHEA_BCMC_VLANID_SINGLE 0x00

/* Use this define to kmallocate pHYP control blocks */
#define H_CB_ALIGNMENT 4096

#define EHEA_CACHE_LINE 128

/* Memory Regions */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ehea/ehea_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
data[i++] = port->port_res[0].swqe_refill_th;
data[i++] = port->resets;

cb6 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb6 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb6) {
ehea_error("no mem for cb6");
return;
Expand Down
26 changes: 13 additions & 13 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)

memset(stats, 0, sizeof(*stats));

cb2 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb2 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb2) {
ehea_error("no mem for cb2");
goto out;
Expand Down Expand Up @@ -586,8 +586,8 @@ int ehea_sense_port_attr(struct ehea_port *port)
u64 hret;
struct hcp_ehea_port_cb0 *cb0;

cb0 = kzalloc(H_CB_ALIGNMENT, GFP_ATOMIC); /* May be called via */
if (!cb0) { /* ehea_neq_tasklet() */
cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC); /* May be called via */
if (!cb0) { /* ehea_neq_tasklet() */
ehea_error("no mem for cb0");
ret = -ENOMEM;
goto out;
Expand Down Expand Up @@ -670,7 +670,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
u64 hret;
int ret = 0;

cb4 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb4 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb4) {
ehea_error("no mem for cb4");
ret = -ENOMEM;
Expand Down Expand Up @@ -985,7 +985,7 @@ static int ehea_configure_port(struct ehea_port *port)
struct hcp_ehea_port_cb0 *cb0;

ret = -ENOMEM;
cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb0)
goto out;

Expand Down Expand Up @@ -1443,7 +1443,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
goto out;
}

cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb0) {
ehea_error("no mem for cb0");
ret = -ENOMEM;
Expand Down Expand Up @@ -1501,7 +1501,7 @@ static void ehea_promiscuous(struct net_device *dev, int enable)
if ((enable && port->promisc) || (!enable && !port->promisc))
return;

cb7 = kzalloc(H_CB_ALIGNMENT, GFP_ATOMIC);
cb7 = kzalloc(PAGE_SIZE, GFP_ATOMIC);
if (!cb7) {
ehea_error("no mem for cb7");
goto out;
Expand Down Expand Up @@ -1870,7 +1870,7 @@ static void ehea_vlan_rx_register(struct net_device *dev,

port->vgrp = grp;

cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb1) {
ehea_error("no mem for cb1");
goto out;
Expand Down Expand Up @@ -1899,7 +1899,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
int index;
u64 hret;

cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb1) {
ehea_error("no mem for cb1");
goto out;
Expand Down Expand Up @@ -1935,7 +1935,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
if (port->vgrp)
port->vgrp->vlan_devices[vid] = NULL;

cb1 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb1) {
ehea_error("no mem for cb1");
goto out;
Expand Down Expand Up @@ -1968,7 +1968,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
u64 dummy64 = 0;
struct hcp_modify_qp_cb0* cb0;

cb0 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb0) {
ret = -ENOMEM;
goto out;
Expand Down Expand Up @@ -2269,7 +2269,7 @@ int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
u64 hret;
int ret;

cb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb) {
ret = -ENOMEM;
goto out;
Expand Down Expand Up @@ -2340,7 +2340,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
goto out;

/* Enable Jumbo frames */
cb4 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
cb4 = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!cb4) {
ehea_error("no mem for cb4");
} else {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ehea/ehea_phyp.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle,
const u8 pagesize, const u8 queue_type,
const u64 log_pageaddr, const u64 count)
{
if ((count > 1) && (log_pageaddr & 0xfff)) {
if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) {
ehea_error("not on pageboundary");
return H_PARAMETER;
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/ehea/ehea_phyp.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ static inline u32 get_longbusy_msecs(int long_busy_ret_code)
static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel,
u64 paddr_user)
{
epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE);
/* To support 64k pages we must round to 64k page boundary */
epas->kernel.addr = ioremap((paddr_kernel & PAGE_MASK), PAGE_SIZE) +
(paddr_kernel & ~PAGE_MASK);
epas->user.addr = paddr_user;
}

static inline void hcp_epas_dtor(struct h_epas *epas)
{
if (epas->kernel.addr)
iounmap(epas->kernel.addr);
iounmap((void __iomem*)((u64)epas->kernel.addr & PAGE_MASK));

epas->user.addr = 0;
epas->kernel.addr = 0;
Expand Down
Loading

0 comments on commit 973e4fb

Please sign in to comment.