graydon@... wrote:
> hi,
>
> attached is another go at the model-specific x86 backend cleanup
> patch, in further preparation for landing the P4 patch. it applies to
> the cvs head, builds and runs on my P4 with RTC mode; but that's not
> saying much. If someone with a ppro / athlon could confirm the changes
> did not disrupt those backends I'd appreciate it. there is some chance
> of that, with the moving-around of things.
>
> differences from last round of this patch:
>
> - some more constification
> - fixed some spacing / formatting
> - removed model-fetch call from within NMI, assume it's set
> - move MSR addresses to contiguous arrays to remain more
> cache friendly during frequent NMIs
>
> any further comments / suggestions?
>
> --- module/x86/op_nmi.c Sat Sep 7 14:19:39 2002
> +++ module/x86/op_nmi.c Fri Sep 20 10:49:55 2002
[...]
> +static int pmc_init(void)
> +{
> + int err = 0;
> + if ((err = smp_call_function(pmc_save_registers, NULL, 0, 1))) {
> + smp_call_function(pmc_restore_registers, NULL, 0, 1);
don't restore: if save fail, save can be done only partially and anyway
we don't change anything in msr.
But I think it doesn't explain my problem at module load:
general protection fault: 0000
CPU: 0
EIP: 0010:[<d8961b95>] Not tainted
EFLAGS: 00010246
eax: cb0cd520 ebx: 00000000 ecx: 00000002 edx: d8962980
esi: 00000000 edi: cb0cd520 ebp: c142e320 esp: c2953efc
ds: 0018 es: 0018 ss: 0018
Process oprofiled (pid: 5006, stackpage=c2953000)
Stack: d89653fc 00000000 d89658c0 c142e320 d89658c0 cb0cd520 d8960dbb
d89659c0
d8960dcb 00000000 d89600d6 00000000 c26ce6e0 cb924bc0 d895fd6b
00000000
c0130882 cb924bc0 c26ce6e0 c26ce6e0 cb924bc0 ffffffe9 c012f955
cb924bc0
Call Trace: [<d89653fc>] [<d89658c0>] [<d89658c0>] [<d8960dbb>]
[<d89659c0>]
[<d8960dcb>] [<d89600d6>] [<d895fd6b>] [<c0130882>] [<c012f955>]
[<c012f86a>]
[<c012fb9a>] [<c010853f>]
Code: 0f 32 25 00 00 20 00 0f 30 43 83 fb 01 7e ee 8b 44 24 1c 31
00002b1c <ppro_setup_ctrs>:
2b1c: 83 ec 08 sub $0x8,%esp
2b1f: 55 push %ebp
2b20: 57 push %edi
2b21: 56 push %esi
2b22: 53 push %ebx
2b23: 8b 44 24 1c mov 0x1c(%esp,1),%eax
2b27: 31 db xor %ebx,%ebx
2b29: 8b 40 08 mov 0x8(%eax),%eax
2b2c: 89 44 24 14 mov %eax,0x14(%esp,1)
2b30: 89 c7 mov %eax,%edi
2b32: 8b 0c 9f mov (%edi,%ebx,4),%ecx
--> 2b35: 0f 32 rdmsr
2b37: 25 00 00 20 00 and $0x200000,%eax
2b3c: 0f 30 wrmsr
2b3e: 43 inc %ebx
2b3f: 83 fb 01 cmp $0x1,%ebx
2b42: 7e ee jle 2b32static void
ppro_setup_ctrs(struct op_msrs const * const msrs)
{
uint low, high;
int i;
/* clear all counters */
for (i = 0 ; i < PPRO_NUM_CONTROLS; ++i) {
-->
PPRO_CTRL_READ (low, high, msrs, i);
i == %ebx = 0, msr number == %ecx = 2 ??
It can occur if init is not done but I don't notice any obvious
error in code.
regards,
Phil
|