2

I'm a learner of OS, and trying to write a kernel.

I googled for "AMD x2APIC" and found out some of the information about EPYC 7002 series seems like to support it.

But I cannot find the relative documentation.

So I would like to ask if the recent AMD processors support it, and if yes, where I can find documentation.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Shore
  • 827
  • 9
  • 24
  • https://sudonull.com/post/8076-Interrupts-from-external-devices-in-the-x86-system-Part-1-The-evolution-of-interrupt-controllers looks relevant, and links an Intel doc: https://www.intel.com/content/dam/doc/specification-update/64-architecture-x2apic-specification.pdf. If AMD's implementation is compatible with Intel, just follow Intel's x2APIC spec. – Peter Cordes Apr 03 '20 at 08:45

1 Answers1

6

Yes, the same as in Intel's CPUs.
You use cpuid (CPUID_Fn00000001_ECX) to check for it

CPUID_Fn00000001_ECX

and the Core::X86::Msr::APIC_BAR MSR to enable it:

Core::X86::Msr::APIC_BAR

Just like you would with Intel's CPUs.


The x2APIC specification is here.

Margaret Bloom
  • 41,768
  • 5
  • 78
  • 124
  • So AMD follows intel, that's why they do not have their own doc?? – Shore Apr 07 '20 at 03:12
  • 2
    @Shore x2APIC is an open specification, it was written by Intel but it's not tied to Intel's CPUs. AMD adopted it because it is not interested in developing its own xAPIC alternative. But, for one thing, the 64-bit extension was written by AMD and Intel followed. It's not good to create too many different architectures. – Margaret Bloom Apr 07 '20 at 15:29