summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Expand)AuthorAgeFilesLines
* mkimage/getline.h - Mac OS X 10.7 (Lion) fixLars-Peter Clausen2011-08-051-0/+22
* host/include/getline.h - Mac OS X 10.7 (Lion) fixLars-Peter Clausen2011-08-051-1/+1
* tools/quilt: fix spurious calls to the configure and Makefile targets (#8462)Felix Fietkau2011-08-011-0/+18
* autotools.mk: implement PKG_FIXUP:=patch-libtool This change allows to apply ...Jo-Philipp Wich2011-08-013-0/+401
* quilt: make it possible to override the path to getopt (based on patch from #...Felix Fietkau2011-07-311-1/+4
* squashfs4: fix a compile error on big-endian systems (patch from #9842)Felix Fietkau2011-07-311-1/+1
* squashfs4: add missing include for freebsd (patch from #9842)Felix Fietkau2011-07-311-1/+4
* pkg-config: fix prefixFelix Fietkau2011-07-241-1/+1
* firmware-utils: rename the devname variable in mkwrgimg to avoid a clash with...Felix Fietkau2011-07-081-4/+4
* tools/firmware-utils: add yet another buffalo toolGabor Juhos2011-07-062-0/+180
* tools/firmware-utils: allow to create buffalo image from two filesGabor Juhos2011-07-062-17/+111
* tools/firmware-utils: allow to create buffalo tags w/o hw versionGabor Juhos2011-07-061-1/+3
* tools/firmware-utils: add new firmware tool for the DIR-300-B1 boardGabor Juhos2011-07-042-0/+241
* tools: always build mpc, now that older gcc versions have been eliminated, fi...Felix Fietkau2011-07-021-2/+1
* padjffs2: fix a compiler warning that makes the build fail because of -WerrorFelix Fietkau2011-07-021-1/+1
* tools: create a new tool for more efficient jffs2 paddingGabor Juhos2011-07-024-1/+207
* add a portable version of sys/sysmacros.h and and let the kernel use the host...Felix Fietkau2011-07-022-1/+58
* move mkelfimage from tools/ to package/ as it needs a proper i386 toolchain -...Felix Fietkau2011-07-023-35/+1
* use u-boot 2011.06 as sourceImre Kaloz2011-07-011-3/+3
* firmware-utils: fix build on big endian systemsHauke Mehrtens2011-06-211-1/+1
* tools/firmware-utils: fix buffalo csum calculationGabor Juhos2011-06-132-2/+4
* tools/firmware-utils: add support for hd_id tag into mkdniimgGabor Juhos2011-05-311-4/+13
* tools/firmware-utils: add buffalo specific fw toolsGabor Juhos2011-05-315-0/+1177
* * adds mkelfimageJohn Crispin2011-05-173-1/+35
* bcm63xx: Add firmware helpers for T-Home Speedport W 303VFlorian Fainelli2011-05-113-0/+379
* quilt: fix building with dash `test x == x` gives a syntax error with dash (s...Jo-Philipp Wich2011-05-021-2/+6
* bcm63xx: Move the OpenWrt rootfs length fieldDaniel Dickinson2011-04-154-35/+2
* ipkg-utils: use (g)stat instead of "du -b" to find package size, fixes Darwin...Jo-Philipp Wich2011-04-131-1/+1
* missing-macros: add GTKDOC_REBASE macro needed by some newer packages Signed-...Jo-Philipp Wich2011-04-122-2/+3
* firmware-utils: fix endianness bugs in firmware generation program.Hauke Mehrtens2011-04-091-12/+29
* make the build system a bit more silent without V=99Felix Fietkau2011-04-041-1/+1
* m4: update to version 1.4.16Hauke Mehrtens2011-04-031-2/+2
* xz: update to version 5.0.2Hauke Mehrtens2011-04-033-139/+2
* lzma-old: do not install $(STAGING_DIR_HOST)/bin/lzmaFelix Fietkau2011-04-031-4/+1
* tools/squashfs4: update to version 4.2 (adds support for xz compression)Felix Fietkau2011-04-0311-2378/+1027
* tools/cmake: update to version 2.8.4Alexandros C. Couloumbis2011-03-241-2/+2
* ipkg-utils: utilize the tar -p flag to preserve permissions (#7667)Jo-Philipp Wich2011-03-211-0/+12
* firmware-utils/mktplinkfw: add support for the TP-Link TL-WA901ND v2 boardGabor Juhos2011-03-131-0/+9
* tools/xz: add some upstream patchesAlexandros C. Couloumbis2011-03-102-0/+137
* package xfce-macros, required for autoreconf in xfce4 packagesJo-Philipp Wich2011-03-092-1/+34
* bison: fix compilation with stub intl headerJo-Philipp Wich2011-03-041-0/+15
* tools/xz: update to version 5.0.1Alexandros C. Couloumbis2011-03-031-2/+2
* mklibs: fix some long standing libpthread symbol link issues, mostly related ...Felix Fietkau2011-02-282-3/+65
* mklibs: properly fix library linking - the relinking in some instances used s...Felix Fietkau2011-02-281-16/+24
* tools/e2fsprogs: move uuid/uuid.h into a subdirectory, it conflicts with a sy...Felix Fietkau2011-02-203-0/+6
* squashfs4: make the lzma parameters configurable, and change the defaults for...Felix Fietkau2011-02-132-11/+91
* brcm47xx: fix error when build firmware on x86_64 host (closes #7672)Hauke Mehrtens2011-02-121-11/+14
* the url isn't valid for some timeImre Kaloz2011-02-111-1/+1
* libtool: fix misspelled procedure name...Jo-Philipp Wich2011-02-031-0/+22
* tools/mpc: add dependency on mpfrFelix Fietkau2011-02-011-1/+1
="cp"> #include <xen/sched.h> #include <asm/pgtable.h> int valid_mm_mode[8] = { GUEST_PHYS, /* (it, dt, rt) -> (0, 0, 0) */ INV_MODE, INV_MODE, GUEST_PHYS, /* (it, dt, rt) -> (0, 1, 1) */ INV_MODE, GUEST_PHYS, /* (it, dt, rt) -> (1, 0, 1) */ INV_MODE, GUEST_VIRT, /* (it, dt, rt) -> (1, 1, 1).*/ }; /* * Special notes: * - Index by it/dt/rt sequence * - Only existing mode transitions are allowed in this table * - RSE is placed at lazy mode when emulating guest partial mode * - If gva happens to be rr0 and rr4, only allowed case is identity * mapping (gva=gpa), or panic! (How?) */ int mm_switch_table[8][8] = { /* 2004/09/12(Kevin): Allow switch to self */ /* * (it,dt,rt): (0,0,0) -> (1,1,1) * This kind of transition usually occurs in the very early * stage of Linux boot up procedure. Another case is in efi * and pal calls. (see "arch/ia64/kernel/head.S") * * (it,dt,rt): (0,0,0) -> (0,1,1) * This kind of transition is found when OSYa exits efi boot * service. Due to gva = gpa in this case (Same region), * data access can be satisfied though itlb entry for physical * emulation is hit. */ SW_SELF,0, 0, SW_NOP, 0, 0, 0, SW_P2V, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* * (it,dt,rt): (0,1,1) -> (1,1,1) * This kind of transition is found in OSYa. * * (it,dt,rt): (0,1,1) -> (0,0,0) * This kind of transition is found in OSYa */ SW_NOP, 0, 0, SW_SELF,0, 0, 0, SW_P2V, /* (1,0,0)->(1,1,1) */ 0, 0, 0, 0, 0, 0, 0, SW_P2V, /* * (it,dt,rt): (1,0,1) -> (1,1,1) * This kind of transition usually occurs when Linux returns * from the low level TLB miss handlers. * (see "arch/ia64/kernel/ivt.S") */ 0, 0, 0, 0, 0, SW_SELF,0, SW_P2V, 0, 0, 0, 0, 0, 0, 0, 0, /* * (it,dt,rt): (1,1,1) -> (1,0,1) * This kind of transition usually occurs in Linux low level * TLB miss handler. (see "arch/ia64/kernel/ivt.S") * * (it,dt,rt): (1,1,1) -> (0,0,0) * This kind of transition usually occurs in pal and efi calls, * which requires running in physical mode. * (see "arch/ia64/kernel/head.S") * (1,1,1)->(1,0,0) */ SW_V2P, 0, 0, 0, SW_V2P, SW_V2P, 0, SW_SELF, }; void physical_mode_init(VCPU *vcpu) { UINT64 psr; struct domain * d = vcpu->domain; vcpu->arch.old_rsc = 0; vcpu->arch.mode_flags = GUEST_IN_PHY; } extern u64 get_mfn(domid_t domid, u64 gpfn, u64 pages); #if 0 void physical_itlb_miss_domn(VCPU *vcpu, u64 vadr) { u64 psr; IA64_PSR vpsr; u64 mppn,gppn,mpp1,gpp1; struct domain *d; static u64 test=0; d=vcpu->domain; if(test) panic("domn physical itlb miss happen\n"); else test=1; vpsr.val=vmx_vcpu_get_psr(vcpu); gppn=(vadr<<1)>>13; mppn = get_mfn(DOMID_SELF,gppn,1); mppn=(mppn<<12)|(vpsr.cpl<<7); gpp1=0; mpp1 = get_mfn(DOMID_SELF,gpp1,1); mpp1=(mpp1<<12)|(vpsr.cpl<<7); // if(vadr>>63) // mppn |= PHY_PAGE_UC; // else // mppn |= PHY_PAGE_WB; mpp1 |= PHY_PAGE_WB; psr=ia64_clear_ic(); ia64_itr(0x1, IA64_TEMP_PHYSICAL, vadr&(~0xfff), (mppn|PHY_PAGE_WB), 24); ia64_srlz_i(); ia64_itr(0x2, IA64_TEMP_PHYSICAL, vadr&(~0xfff), (mppn|PHY_PAGE_WB), 24); ia64_stop(); ia64_srlz_i(); ia64_itr(0x1, IA64_TEMP_PHYSICAL+1, vadr&(~0x8000000000000fffUL), (mppn|PHY_PAGE_WB), 24); ia64_srlz_i(); ia64_itr(0x2, IA64_TEMP_PHYSICAL+1, vadr&(~0x8000000000000fffUL), (mppn|PHY_PAGE_WB), 24); ia64_stop(); ia64_srlz_i(); ia64_itr(0x1, IA64_TEMP_PHYSICAL+2, gpp1&(~0xfff), mpp1, 28); ia64_srlz_i(); ia64_itr(0x2, IA64_TEMP_PHYSICAL+2, gpp1&(~0xfff), mpp1, 28); ia64_stop(); ia64_srlz_i(); ia64_set_psr(psr); ia64_srlz_i(); return; } #endif void physical_itlb_miss_dom0(VCPU *vcpu, u64 vadr) { u64 psr; IA64_PSR vpsr; u64 mppn,gppn; vpsr.val=vmx_vcpu_get_psr(vcpu); gppn=(vadr<<1)>>13; mppn = get_mfn(DOMID_SELF,gppn,1); mppn=(mppn<<12)|(vpsr.cpl<<7); // if(vadr>>63) // mppn |= PHY_PAGE_UC; // else mppn |= PHY_PAGE_WB; psr=ia64_clear_ic(); ia64_itc(1,vadr&(~0xfff),mppn,EMUL_PHY_PAGE_SHIFT); ia64_set_psr(psr); ia64_srlz_i(); return; } void physical_itlb_miss(VCPU *vcpu, u64 vadr) { physical_itlb_miss_dom0(vcpu, vadr); } void physical_dtlb_miss(VCPU *vcpu, u64 vadr) { u64 psr; IA64_PSR vpsr; u64 mppn,gppn; // if(vcpu->domain!=dom0) // panic("dom n physical dtlb miss happen\n"); vpsr.val=vmx_vcpu_get_psr(vcpu); gppn=(vadr<<1)>>13; mppn = get_mfn(DOMID_SELF,gppn,1); mppn=(mppn<<12)|(vpsr.cpl<<7); if(vadr>>63) mppn |= PHY_PAGE_UC; else mppn |= PHY_PAGE_WB; psr=ia64_clear_ic(); ia64_itc(2,vadr&(~0xfff),mppn,EMUL_PHY_PAGE_SHIFT); ia64_set_psr(psr); ia64_srlz_i(); return; } void vmx_init_all_rr(VCPU *vcpu) { VMX(vcpu,vrr[VRN0]) = 0x38; VMX(vcpu,vrr[VRN1]) = 0x138; VMX(vcpu,vrr[VRN2]) = 0x238; VMX(vcpu,vrr[VRN3]) = 0x338; VMX(vcpu,vrr[VRN4]) = 0x438; VMX(vcpu,vrr[VRN5]) = 0x538; VMX(vcpu,vrr[VRN6]) = 0x660; VMX(vcpu,vrr[VRN7]) = 0x760; #if 0 VMX(vcpu,mrr5) = vmx_vrrtomrr(vcpu, 0x38); VMX(vcpu,mrr6) = vmx_vrrtomrr(vcpu, 0x60); VMX(vcpu,mrr7) = vmx_vrrtomrr(vcpu, 0x60); #endif } void vmx_load_all_rr(VCPU *vcpu) { unsigned long psr; ia64_rr phy_rr; local_irq_save(psr); /* WARNING: not allow co-exist of both virtual mode and physical * mode in same region */ if (is_physical_mode(vcpu)) { if (vcpu->arch.mode_flags & GUEST_PHY_EMUL) panic("Unexpected domain switch in phy emul\n"); phy_rr.rrval = vcpu->domain->arch.metaphysical_rr0; phy_rr.ps = EMUL_PHY_PAGE_SHIFT; phy_rr.ve = 1; ia64_set_rr((VRN0 << VRN_SHIFT), phy_rr.rrval); phy_rr.rrval = vcpu->domain->arch.metaphysical_rr4; phy_rr.ps = EMUL_PHY_PAGE_SHIFT; phy_rr.ve = 1; ia64_set_rr((VRN4 << VRN_SHIFT), phy_rr.rrval); } else { ia64_set_rr((VRN0 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN0]))); ia64_set_rr((VRN4 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN4]))); } /* rr567 will be postponed to last point when resuming back to guest */ ia64_set_rr((VRN1 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN1]))); ia64_set_rr((VRN2 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN2]))); ia64_set_rr((VRN3 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN3]))); ia64_set_rr((VRN5 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN5]))); ia64_set_rr((VRN6 << VRN_SHIFT), vmx_vrrtomrr(vcpu, VMX(vcpu, vrr[VRN6]))); extern void * pal_vaddr; vmx_switch_rr7(vmx_vrrtomrr(vcpu,VMX(vcpu, vrr[VRN7])),(void *)vcpu->domain->shared_info, (void *)vcpu->arch.privregs, ( void *)vcpu->arch.vtlb->ts->vhpt->hash, pal_vaddr ); ia64_set_pta(vcpu->arch.arch_vmx.mpta); ia64_srlz_d(); ia64_set_psr(psr); ia64_srlz_i(); } void switch_to_physical_rid(VCPU *vcpu) { UINT64 psr; ia64_rr phy_rr; /* Save original virtual mode rr[0] and rr[4] */ psr=ia64_clear_ic(); phy_rr.rrval = vcpu->domain->arch.metaphysical_rr0; phy_rr.ps = EMUL_PHY_PAGE_SHIFT; phy_rr.ve = 1; ia64_set_rr(VRN0<<VRN_SHIFT, phy_rr.rrval); ia64_srlz_d(); phy_rr.rrval = vcpu->domain->arch.metaphysical_rr4; phy_rr.ps = EMUL_PHY_PAGE_SHIFT; phy_rr.ve = 1; ia64_set_rr(VRN4<<VRN_SHIFT, phy_rr.rrval); ia64_srlz_d(); ia64_set_psr(psr); ia64_srlz_i(); return; } void switch_to_virtual_rid(VCPU *vcpu) { UINT64 psr; ia64_rr mrr; psr=ia64_clear_ic(); mrr=vmx_vcpu_rr(vcpu,VRN0<<VRN_SHIFT); ia64_set_rr(VRN0<<VRN_SHIFT, vmx_vrrtomrr(vcpu, mrr.rrval)); ia64_srlz_d(); mrr=vmx_vcpu_rr(vcpu,VRN4<<VRN_SHIFT); ia64_set_rr(VRN4<<VRN_SHIFT, vmx_vrrtomrr(vcpu, mrr.rrval)); ia64_srlz_d(); ia64_set_psr(psr); ia64_srlz_i(); return; } static int mm_switch_action(IA64_PSR opsr, IA64_PSR npsr) { return mm_switch_table[MODE_IND(opsr)][MODE_IND(npsr)]; } void switch_mm_mode(VCPU *vcpu, IA64_PSR old_psr, IA64_PSR new_psr) { int act; REGS * regs=vcpu_regs(vcpu); act = mm_switch_action(old_psr, new_psr); switch (act) { case SW_V2P: vcpu->arch.old_rsc = regs->ar_rsc; switch_to_physical_rid(vcpu); /* * Set rse to enforced lazy, to prevent active rse save/restor when * guest physical mode. */ regs->ar_rsc &= ~(IA64_RSC_MODE); vcpu->arch.mode_flags |= GUEST_IN_PHY; break; case SW_P2V: switch_to_virtual_rid(vcpu); /* * recover old mode which is saved when entering * guest physical mode */ regs->ar_rsc = vcpu->arch.old_rsc; vcpu->arch.mode_flags &= ~GUEST_IN_PHY; break; case SW_SELF: printf("Switch to self-0x%lx!!! MM mode doesn't change...\n", old_psr.val); break; case SW_NOP: printf("No action required for mode transition: (0x%lx -> 0x%lx)\n", old_psr.val, new_psr.val); break; default: /* Sanity check */ printf("old: %lx, new: %lx\n", old_psr.val, new_psr.val); panic("Unexpected virtual <--> physical mode transition"); break; } return; } /* * In physical mode, insert tc/tr for region 0 and 4 uses * RID[0] and RID[4] which is for physical mode emulation. * However what those inserted tc/tr wants is rid for * virtual mode. So original virtual rid needs to be restored * before insert. * * Operations which required such switch include: * - insertions (itc.*, itr.*) * - purges (ptc.* and ptr.*) * - tpa * - tak * - thash?, ttag? * All above needs actual virtual rid for destination entry. */ void check_mm_mode_switch (VCPU *vcpu, IA64_PSR old_psr, IA64_PSR new_psr) { if ( (old_psr.dt != new_psr.dt ) || (old_psr.it != new_psr.it ) || (old_psr.rt != new_psr.rt ) ) { switch_mm_mode (vcpu, old_psr, new_psr); } return 0; } /* * In physical mode, insert tc/tr for region 0 and 4 uses * RID[0] and RID[4] which is for physical mode emulation. * However what those inserted tc/tr wants is rid for * virtual mode. So original virtual rid needs to be restored * before insert. * * Operations which required such switch include: * - insertions (itc.*, itr.*) * - purges (ptc.* and ptr.*) * - tpa * - tak * - thash?, ttag? * All above needs actual virtual rid for destination entry. */ void prepare_if_physical_mode(VCPU *vcpu) { if (is_physical_mode(vcpu)) { vcpu->arch.mode_flags |= GUEST_PHY_EMUL; switch_to_virtual_rid(vcpu); } return; } /* Recover always follows prepare */ void recover_if_physical_mode(VCPU *vcpu) { if (is_physical_mode(vcpu)) { vcpu->arch.mode_flags &= ~GUEST_PHY_EMUL; switch_to_physical_rid(vcpu); } return; }