From: Thomas Gleixner <tglx@linutronix.de>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
x86@kernel.org, Hans Rosenfeld <hans.rosenfeld@amd.com>,
Borislav Petkov <borislav.petkov@amd.com>,
Andreas Herrmann <andreas.herrmann3@amd.com>,
Mike Travis <travis@sgi.com>
Subject: Re: [patch 3/3] x86: cache_info: Kill the atomic allocation in amd_init_l3_cache()
Date: Sun, 24 Jul 2011 18:13:38 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1107241812590.3136@ionos> (raw)
In-Reply-To: <20110724102734.GA17099@liondog.tnic>
On Sun, 24 Jul 2011, Borislav Petkov wrote:
> On Sun, Jul 24, 2011 at 09:46:09AM -0000, Thomas Gleixner wrote:
> >
> > /* only for L3, and not in virtualized environments */
> > - if (index < 3 || amd_nb_num() == 0)
> > + if (index < 3)
> > return;
>
> AFAICT, we still need the "amd_nb_num() == 0" check for xen because it
> doesn't export NB PCI devices to the guest, see f2b20e41...
>
> >
> > - /*
> > - * Strictly speaking, the amount in @size below is leaked since it is
> > - * never freed but this is done only on shutdown so it doesn't matter.
> > - */
> > - if (!l3_caches) {
> > - int size = amd_nb_num() * sizeof(struct amd_l3_cache);
> > -
> > - l3_caches = kzalloc(size, GFP_ATOMIC);
> > - if (!l3_caches)
> > - return;
> > - }
> > -
> > node = amd_get_nb_id(smp_processor_id());
> > -
> > - if (!l3_caches[node].nb) {
> > - l3_caches[node].nb = node_to_amd_nb(node);
> > - amd_calc_l3_indices(&l3_caches[node]);
> > - }
> > -
> > - this_leaf->l3 = &l3_caches[node];
> > + this_leaf->nb = node_to_amd_nb(node);
>
> although, on a second thought, node_to_amd_nb(node) should return NULL
> since the AMD NB caching code shouldnt've enumerated any NB devices and
>
> > + if (this_leaf->nb && !this_leaf->nb->l3_cache.indices)
> > + amd_calc_l3_indices(this_leaf->nb);
>
> this check should fail. Hm.
Right, that was my thought.
> Let me test the patchset on Monday to verify there are no other subtle
> interactions I haven't thought of right now.
Thanks,
tglx
next prev parent reply other threads:[~2011-07-24 16:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-24 9:46 [patch 0/3] x86: cache_info: Bugfix and cleanups AMD_NB related Thomas Gleixner
2011-07-24 9:46 ` [patch 2/3] x86: cache_info: Kill the moronic shadow struct Thomas Gleixner
2011-07-24 9:46 ` [patch 1/3] x86: cache_info: Remove bogus free of amd_l3_cache data Thomas Gleixner
2011-07-24 9:46 ` [patch 3/3] x86: cache_info: Kill the atomic allocation in amd_init_l3_cache() Thomas Gleixner
2011-07-24 10:27 ` Borislav Petkov
2011-07-24 16:13 ` Thomas Gleixner [this message]
2011-07-26 17:04 ` Borislav Petkov
2011-09-19 21:44 ` [patch 0/3] x86: cache_info: Bugfix and cleanups AMD_NB related Borislav Petkov
2011-09-20 8:35 ` Thomas Gleixner
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=alpine.LFD.2.02.1107241812590.3136@ionos \
--to=tglx@linutronix.de \
--cc=andreas.herrmann3@amd.com \
--cc=borislav.petkov@amd.com \
--cc=bp@alien8.de \
--cc=hans.rosenfeld@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=travis@sgi.com \
--cc=x86@kernel.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