Page MenuHomeFreeBSD

D15339.1794887747.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D15339.1794887747.diff

Index: sys/powerpc/include/platform.h
===================================================================
--- sys/powerpc/include/platform.h
+++ sys/powerpc/include/platform.h
@@ -48,6 +48,7 @@
/* Documentation for these functions is in platform_if.m */
void mem_regions(struct mem_region **, int *, struct mem_region **, int *);
+int mem_region_add(struct mem_region *);
vm_offset_t platform_real_maxaddr(void);
u_long platform_timebase_freq(struct cpuref *);
Index: sys/powerpc/powerpc/platform.c
===================================================================
--- sys/powerpc/powerpc/platform.c
+++ sys/powerpc/powerpc/platform.c
@@ -71,6 +71,18 @@
static struct mem_region aregions[PHYS_AVAIL_SZ];
static int npregions, naregions;
+int
+mem_region_add(struct mem_region *mr)
+{
+ if (npregions == PHYS_AVAIL_SZ)
+ return (FALSE);
+
+ pregions[npregions].mr_start = mr->mr_start;
+ pregions[npregions].mr_size = mr->mr_size;
+ npregions++;
+ return (TRUE);
+}
+
/*
* Memory region utilities: determine if two regions overlap,
* and merge two overlapping regions into one
Index: sys/powerpc/pseries/mmu_phyp.c
===================================================================
--- sys/powerpc/pseries/mmu_phyp.c
+++ sys/powerpc/pseries/mmu_phyp.c
@@ -41,6 +41,7 @@
#include <dev/ofw/openfirm.h>
#include <machine/ofw_machdep.h>
+#include <machine/platform.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@@ -118,6 +119,8 @@
uint64_t vsid;
phandle_t dev, node, root;
int idx, len, res;
+ struct mem_region *phys, mr;
+ int physsz;
rm_init(&mphyp_eviction_lock, "pte eviction");
@@ -216,6 +219,15 @@
/* Test for broken versions of KVM that don't conform to the spec */
if (phyp_hcall(H_CLEAR_MOD, 0, 0) == H_FUNCTION)
brokenkvm = 1;
+
+ /* After MMU is up, add 0xC000...0000 range as valid physical mem */
+ mem_regions(&phys, &physsz, NULL, NULL);
+ for (idx = 0; idx < physsz; idx++) {
+ mr.mr_start = 0xC000000000000000ULL + phys[idx].mr_start;
+ mr.mr_size = phys[idx].mr_size;
+ if (mem_region_add(&mr) == FALSE)
+ break;
+ }
}
static void

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 17, 3:55 AM (30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41792564
Default Alt Text
D15339.1794887747.diff (2 KB)

Event Timeline