From: Pratik Sampat <psampat@linux.ibm.com>
To: Ram Pai <linuxram@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
mpe@ellerman.id.au, svaidy@linux.ibm.com, ego@linux.vnet.ibm.com,
pratik.sampat@in.ibm.com
Subject: Re: [RFC 1/3] powerpc/powernv: Interface to define support and preference for a SPR
Date: Mon, 6 Jan 2020 15:16:51 +0530 [thread overview]
Message-ID: <75611f4d-51f8-33ac-dcd5-0016bebee183@linux.ibm.com> (raw)
In-Reply-To: <20200103232457.GH5556@oc0525413822.ibm.com>
Hello Ram,
Thank you for your reviewing the patches.
>> +/* Interface for the stop state supported and preference */
>> +#define SELF_RESTORE_TYPE 0
>> +#define SELF_SAVE_TYPE 1
>> +
>> +#define NR_PREFERENCES 2
>> +#define PREFERENCE_SHIFT 8
>> +#define PREFERENCE_MASK 0xff
>> +
>> +#define UNSUPPORTED 0x0
>> +#define SELF_RESTORE_STRICT 0x01
>> +#define SELF_SAVE_STRICT 0x10
>> +
>> +/*
>> + * Bitmask defining the kind of preferences available.
>> + * Note : The higher to lower preference is from LSB to MSB, with a shift of
>> + * 8 bits.
> A minor comment.
>
> Is there a reason why shift is 8? Shift of 4 must be sufficient,
> and a mask of '0xf' should do. And SELF_SAVE_STRICT can be 0x2.
>
>
Yes, you're right! We could do away with using fewer bits here.
>> +/* Caching the lpcr & ptcr support to use later */
>> +static bool is_lpcr_self_save;
>> +static bool is_ptcr_self_save;
> I understand why you need to track the status of PTCR register.
> But its not clear, why LPCR register's save status need to be tracked?
>
Normally it does not but LPCR was previously unsupported in self-restore
and the kernel saved and restored its value in context. Now that we have
support for saving LPCR automatically I believe we leverage it and
make sure the kernel does not do redundant work.
>> +
>> +struct preferred_sprs {
>> + u64 spr;
>> + u32 preferred_mode;
>> + u32 supported_mode;
>> +};
>> +
>> +struct preferred_sprs preferred_sprs[] = {
>> + {
>> + .spr = SPRN_HSPRG0,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_LPCR,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_PTCR,
>> + .preferred_mode = PREFER_SAVE_RESTORE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_HMEER,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_HID0,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = P9_STOP_SPR_MSR,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = P9_STOP_SPR_PSSCR,
>> + .preferred_mode = PREFER_SAVE_RESTORE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_HID1,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_HID4,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + },
>> + {
>> + .spr = SPRN_HID5,
>> + .preferred_mode = PREFER_RESTORE_SAVE,
>> + .supported_mode = SELF_RESTORE_STRICT,
>> + }
>> +};
> What determines the list of registers tracked in this table?
>
>
> .snip..
>
This list is of the SPRs of all the registers that the kernel is interested in
at wakeup. It has been refactored out as a list from what the kernel used
previously in the kernel.
next prev parent reply other threads:[~2020-01-06 9:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-04 9:32 [RFC 0/3] Integrate Support for self-save and determine Pratik Rajesh Sampat
2019-12-04 9:32 ` [RFC 1/3] powerpc/powernv: Interface to define support and preference for a SPR Pratik Rajesh Sampat
2020-01-03 23:24 ` Ram Pai
2020-01-06 9:46 ` Pratik Sampat [this message]
2019-12-04 9:32 ` [RFC 2/3] powerpc/powernv: Introduce Self save support Pratik Rajesh Sampat
2019-12-04 9:32 ` [RFC 3/3] powerpc/powernv: Parse device tree, population of SPR support Pratik Rajesh Sampat
2020-01-03 23:05 ` [RFC 0/3] Integrate Support for self-save and determine Ram Pai
2020-01-06 9:45 ` Pratik Sampat
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=75611f4d-51f8-33ac-dcd5-0016bebee183@linux.ibm.com \
--to=psampat@linux.ibm.com \
--cc=ego@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxram@us.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=pratik.sampat@in.ibm.com \
--cc=svaidy@linux.ibm.com \
/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
all inboxes | Powered by JetHome®