Removed already obsolete patch.smp-pge-pic-poll

Small cleanup in apic.cc/apic.h
I would like to test patch.apic-mrieker so I need more clean apic code
This commit is contained in:
Stanislav Shwartsman 2005-02-08 18:41:33 +00:00
parent a57464cb54
commit c1284af614
3 changed files with 7 additions and 133 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: apic.cc,v 1.38 2005-02-01 21:17:51 sshwarts Exp $
// $Id: apic.cc,v 1.39 2005-02-08 18:41:27 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#define NEED_CPU_REG_SHORTCUTS 1
@ -102,11 +102,6 @@ void bx_generic_apic_c::read (Bit32u addr, void *data, unsigned len)
}
}
void bx_generic_apic_c::startup_msg (Bit32u vector)
{
BX_PANIC(("startup message sent to an I/O APIC"));
}
/* apic_mask is the bitmask of apics allowed to arbitrate here */
int bx_generic_apic_c::apic_bus_arbitrate(Bit32u apic_mask)
{
@ -185,7 +180,7 @@ Bit32u bx_generic_apic_c::get_delivery_bitmask (Bit8u dest, Bit8u dest_mode)
mask = 0xff;
} else BX_PANIC(("bx_generic_apic_c::deliver: illegal physical destination %02x", dest));
} else {
// logical destination. call match_logical_addr for each APIC.
// logical destination. call match_logical_addr for each local APIC.
if (dest == 0) return 0;
for (int i=0; i<BX_LOCAL_APIC_NUM; i++) {
if (local_apic_index[i]->match_logical_addr(dest))
@ -281,7 +276,7 @@ bx_bool bx_local_apic_c::deliver (Bit8u dest, Bit8u dest_mode, Bit8u delivery_mo
// the base class.
Bit32u deliver_bitmask = get_delivery_bitmask (dest, dest_mode);
int found_focus = 0;
int broadcast = deliver_bitmask == BX_CPU_C::cpu_online_map;
int broadcast = (deliver_bitmask == BX_CPU_C::cpu_online_map);
if (broadcast)
BX_INFO(("Broadcast IPI for vector %#x delivery_mode %#x", vector, delivery_mode));
@ -335,9 +330,8 @@ bx_bool bx_local_apic_c::deliver (Bit8u dest, Bit8u dest_mode, Bit8u delivery_mo
}
bx_local_apic_c::bx_local_apic_c(BX_CPU_C *mycpu)
: bx_generic_apic_c ()
: bx_generic_apic_c (), cpu(mycpu)
{
cpu = mycpu;
hwreset ();
INTR = 0;
}
@ -521,10 +515,9 @@ void bx_local_apic_c::write (Bit32u addr, Bit32u *data, unsigned len)
BX_PANIC(("APIC: W(init timer count): count=0"));
// This should trigger the counter to start. If already started,
// restart from the new start value.
//fprintf(stderr, "APIC: W(Initial Count Register) = %u\n", *data);
// fprintf(stderr, "APIC: W(Initial Count Register) = %u\n", *data);
timer_current = timer_initial;
timer_active = true;
//timer_divide_counter = 0; // KPL: delete this field.
Bit32u timervec = lvt[APIC_LVT_TIMER];
bx_bool continuous = (timervec & 0x20000) > 0;
ticksInitial = bx_pc_system.getTicksTotal(); // Take a reading.
@ -568,7 +561,7 @@ void bx_local_apic_c::startup_msg (Bit32u vector)
cpu->debug_trap &= ~0x80000000;
cpu->dword.eip = 0;
cpu->load_seg_reg (&cpu->sregs[BX_SEG_REG_CS], vector*0x100);
BX_INFO(("%s started up at 0x%x by APIC", cpu->name, cpu->dword.eip));
BX_INFO(("%s started up at %04X:%08X by APIC", cpu->name, vector*0x100, cpu->dword.eip));
} else {
BX_INFO(("%s started up by APIC, but was not halted at the time", cpu->name));
}

View File

@ -63,7 +63,6 @@ public:
void read (Bit32u addr, void *data, unsigned len);
virtual void read_aligned(Bit32u address, Bit32u *data, unsigned len) = 0;
virtual void write(Bit32u address, Bit32u *value, unsigned len) = 0;
virtual void startup_msg (Bit32u vector);
virtual Bit32u get_delivery_bitmask (Bit8u dest, Bit8u dest_mode);
virtual bx_bool deliver (Bit8u destination, Bit8u dest_mode, Bit8u delivery_mode, Bit8u vector, Bit8u polarity, Bit8u trig_mode);
virtual bx_bool match_logical_addr (Bit8u address) = 0;
@ -148,7 +147,7 @@ public:
virtual char *get_name();
virtual void write (Bit32u addr, Bit32u *data, unsigned len);
virtual void read_aligned(Bit32u address, Bit32u *data, unsigned len);
virtual void startup_msg (Bit32u vector);
void startup_msg (Bit32u vector);
// on local APIC, trigger means raise the CPU's INTR line. For now
// I also have to raise pc_system.INTR but that should be replaced
// with the cpu-specific INTR signals.

View File

@ -1,118 +0,0 @@
From zwane@linux.realnet.co.sz Thu Mar 28 11:59:40 2002
Date: Thu, 21 Mar 2002 08:21:29 +0200 (SAST)
From: Zwane Mwaikambo <zwane@linux.realnet.co.sz>
To: Bochs Devel <bochs-developers@lists.sourceforge.net>
Subject: [Bochs-developers] [PATCH] bochs_smp_pge_pic_poll
This patch is to get us a bit closer in booting linux 2.4 SMP
(tested with 4-way) with all the bells and whistles. This was tested with
2.5.7-pre1, the PGE part of it we just play along and try follow
the global page semantics (avoid flushing global pages in specific
places) and is required for PPro+ kernels in linux. The PIC poll code
allows polling mode, in this mode we don't have to do anything and let
the host OS do everything.
Zwane
diff -ur bochs-1.3-zm1/cpu/cpu.h /build/source/bochs-1.3/cpu/cpu.h
--- bochs-1.3-zm1/cpu/cpu.h Wed Mar 20 06:59:07 2002
+++ /build/source/bochs-1.3/cpu/cpu.h Wed Mar 20 22:26:31 2002
@@ -871,6 +871,7 @@
struct {
bx_TLB_entry entry[BX_TLB_SIZE];
} TLB;
+ Boolean skip_global_pages;
#endif
struct {
diff -ur bochs-1.3-zm1/cpu/paging.cc /build/source/bochs-1.3/cpu/paging.cc
--- bochs-1.3-zm1/cpu/paging.cc Wed Oct 3 15:10:37 2001
+++ /build/source/bochs-1.3/cpu/paging.cc Wed Mar 20 23:09:51 2002
@@ -358,6 +358,7 @@
#if BX_USE_TLB
unsigned i;
unsigned wp, us_combined, rw_combined, us_current, rw_current;
+ skip_global_pages = false;
for (i=0; i<BX_TLB_SIZE; i++) {
BX_CPU_THIS_PTR TLB.entry[i].lpf = BX_INVALID_TLB_ENTRY;
@@ -403,9 +404,20 @@
BX_CPU_C::TLB_flush(void)
{
#if BX_USE_TLB
+ Bit32u pte;
for (unsigned i=0; i<BX_TLB_SIZE; i++) {
- BX_CPU_THIS_PTR TLB.entry[i].lpf = BX_INVALID_TLB_ENTRY;
+ /* don't invalidate if Global (8) bit set */
+ if (skip_global_pages) {
+ BX_CPU_THIS_PTR mem->read_physical(this,
+ BX_CPU_THIS_PTR TLB.entry[i].pte_addr,
+ 4, &pte);
+ /* check if the global bit is set for this pte */
+ if (pte & (1<<8))
+ continue;
}
+
+ BX_CPU_THIS_PTR TLB.entry[i].lpf = BX_INVALID_TLB_ENTRY;
+ }
#endif // #if BX_USE_TLB
invalidate_prefetch_q();
diff -ur bochs-1.3-zm1/cpu/proc_ctrl.cc /build/source/bochs-1.3/cpu/proc_ctrl.cc
--- bochs-1.3-zm1/cpu/proc_ctrl.cc Mon Mar 11 08:07:35 2002
+++ /build/source/bochs-1.3/cpu/proc_ctrl.cc Wed Mar 20 22:42:19 2002
@@ -504,17 +504,14 @@
#else
// Protected mode: #GP(0) if attempt to write a 1 to
// any reserved bit of CR4
+ if ((val_32 >> 10) & 0x7ff)
+ exception(BX_GP_EXCEPTION, 0, 0);
- BX_INFO(("MOV_CdRd: ignoring write to CR4 of 0x%08x",
- val_32));
- if (val_32) {
- BX_INFO(("MOV_CdRd: (CR4) write of 0x%08x not supported!",
- val_32));
- }
- // Only allow writes of 0 to CR4 for now.
- // Writes to bits in CR4 should not be 1s as CPUID
- // returns not-supported for all of these features.
- BX_CPU_THIS_PTR cr4 = 0;
+ BX_CPU_THIS_PTR cr4 = val_32;
+ // this also has the side effect of flushing the tlb
+ // including pages marked as global.
+ TLB_flush();
+ skip_global_pages = (val_32 & (1<<4)) ? true: false;
#endif
break;
default:
@@ -1032,6 +1029,7 @@
model = 1; // Pentium Pro
stepping = 3; // ???
features |= (1<<4); // implement TSC
+ features |= (1<<13); // support PGE
# if BX_SUPPORT_APIC
features |= (1<<9); // APIC on chip
# endif
diff -ur bochs-1.3-zm1/iodev/pic.cc /build/source/bochs-1.3/iodev/pic.cc
--- bochs-1.3-zm1/iodev/pic.cc Tue Nov 27 20:15:39 2001
+++ /build/source/bochs-1.3/iodev/pic.cc Thu Mar 21 07:11:02 2002
@@ -243,7 +243,10 @@
poll = (value & 0x04) >> 2;
read_op = (value & 0x03);
if (poll)
- BX_PANIC(("pic:master:OCW3: poll bit set"));
+ /* if we're in polling mode, the os executive has to do all the work,
+ * linux 2.4 does this for the timer interrupt on systems with an IOAPIC
+ */
+ return;
if (read_op == 0x02) /* read IRR */
BX_PIC_THIS s.master_pic.read_reg_select = 0;
else if (read_op == 0x03) /* read ISR */
_______________________________________________
bochs-developers mailing list
bochs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-developers