Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: Mushahid Hussain <mushi.shar@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Why does kernel has different commandline options to disable Local APIC and I/O APIC?
Date: Thu, 5 Oct 2023 18:01:21 +0100	[thread overview]
Message-ID: <CADaYRJvBonttk9S4fOCuHJb7O61tkYUZPomiT9Q9LQhPAWmqGw@mail.gmail.com> (raw)

I see that "noapic" and "nolapic" command line options are handled differently.

"noapic" is handled in function "disable_ioapic_support()" which does following:

```

void disable_ioapic_support(void)
{
#ifdef CONFIG_PCI
    noioapicquirk = 1;
    noioapicreroute = -1;
#endif
    skip_ioapic_setup = 1;
}

```


however, nolapic is handled in a different function, which sets
different variables:

```

/*
 * APIC command line parameters
 */
static int __init setup_disableapic(char *arg)
{
    disable_apic = 1;
    setup_clear_cpu_cap(X86_FEATURE_APIC);
    return 0;
}
```


I can also see that there's check to call "disable_ioapic_support" if
local APIC is disabled:

```

/**
 * setup_local_APIC - setup the local APIC
 *
 * Used to setup local APIC while initializing BSP or bringin up APs.
 * Always called with preemption disabled.
 */
void setup_local_APIC(void)
{
    int cpu = smp_processor_id();
    unsigned int value, queued;
    int i, j, acked = 0;
    unsigned long long tsc = 0, ntsc;
    long long max_loops = cpu_khz ? cpu_khz : 1000000;

    if (cpu_has_tsc)
        rdtscll(tsc);

    if (disable_apic) {
        disable_ioapic_support();
        return;
    }

```


but I don't see anywhere that kernel disabled Local APIC if "noapic"
commandline option is passed. Shouldn't Local APIC be disabled as
well, when there's a commandline option "noapic" to disable APIC? As
per my understand, at least IOAPIC is needed for local APICs to
function? If IO APIC is disabled, should Local APICs be also disabled?

-- 
Mushahid Hussain

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

                 reply	other threads:[~2023-10-05 17:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADaYRJvBonttk9S4fOCuHJb7O61tkYUZPomiT9Q9LQhPAWmqGw@mail.gmail.com \
    --to=mushi.shar@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).