* [PATCH v2 0/3] x86/mtrr: basic cleanups
@ 2017-01-19 5:24 Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 1/3] x86/mtrr: drop positive_have_wrcomb() Doug Goldstein
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Doug Goldstein @ 2017-01-19 5:24 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Doug Goldstein, Jan Beulich
Retained the parts that were not objected to by plans to disable mtrrs on
PVH containers.
Doug Goldstein (3):
x86/mtrr: drop positive_have_wrcomb()
x86/mtrr: drop unused func prototypes and struct
x86/mtrr: convert use_intel_if u32 to bool
xen/arch/x86/cpu/mtrr/generic.c | 7 +------
xen/arch/x86/cpu/mtrr/mtrr.h | 21 ++-------------------
2 files changed, 3 insertions(+), 25 deletions(-)
base-commit: 12ec20c732a63f26dc243a847343b8b796c2d88c
--
git-series 0.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/3] x86/mtrr: drop positive_have_wrcomb()
2017-01-19 5:24 [PATCH v2 0/3] x86/mtrr: basic cleanups Doug Goldstein
@ 2017-01-19 5:24 ` Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 2/3] x86/mtrr: drop unused func prototypes and struct Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 3/3] x86/mtrr: convert use_intel_if u32 to bool Doug Goldstein
2 siblings, 0 replies; 5+ messages in thread
From: Doug Goldstein @ 2017-01-19 5:24 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Doug Goldstein, Jan Beulich
The only call to have_wrcomb() was always to the generic implementation.
positive_have_wrcomb() was unused.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Retaining ACK from <57B480FD0200007800106B2B@prv-mh.provo.novell.com>
---
---
xen/arch/x86/cpu/mtrr/generic.c | 5 -----
xen/arch/x86/cpu/mtrr/mtrr.h | 2 --
2 files changed, 7 deletions(-)
diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index b7d3293..8d4537a 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -557,11 +557,6 @@ static int generic_have_wrcomb(void)
return (config & (1ULL << 10));
}
-int positive_have_wrcomb(void)
-{
- return 1;
-}
-
/* generic structure...
*/
const struct mtrr_ops generic_mtrr_ops = {
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index 53d369d..ec168f9 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -31,8 +31,6 @@ extern int generic_validate_add_page(unsigned long base, unsigned long size,
extern const struct mtrr_ops generic_mtrr_ops;
-extern int positive_have_wrcomb(void);
-
/* library functions for processor-specific routines */
struct set_mtrr_context {
unsigned long flags;
--
git-series 0.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] x86/mtrr: drop unused func prototypes and struct
2017-01-19 5:24 [PATCH v2 0/3] x86/mtrr: basic cleanups Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 1/3] x86/mtrr: drop positive_have_wrcomb() Doug Goldstein
@ 2017-01-19 5:24 ` Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 3/3] x86/mtrr: convert use_intel_if u32 to bool Doug Goldstein
2 siblings, 0 replies; 5+ messages in thread
From: Doug Goldstein @ 2017-01-19 5:24 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Doug Goldstein, Jan Beulich
These weren't used so drop them.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Retained R-b from <57B481840200007800106B2E@prv-mh.provo.novell.com>
---
xen/arch/x86/cpu/mtrr/mtrr.h | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index ec168f9..bb57def 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -31,18 +31,6 @@ extern int generic_validate_add_page(unsigned long base, unsigned long size,
extern const struct mtrr_ops generic_mtrr_ops;
-/* library functions for processor-specific routines */
-struct set_mtrr_context {
- unsigned long flags;
- unsigned long cr4val;
- uint64_t deftype;
- u32 ccr3;
-};
-
-void set_mtrr_done(struct set_mtrr_context *ctxt);
-void set_mtrr_cache_disable(struct set_mtrr_context *ctxt);
-void set_mtrr_prepare_save(struct set_mtrr_context *ctxt);
-
void get_mtrr_state(void);
extern void set_mtrr_ops(const struct mtrr_ops *);
@@ -56,6 +44,3 @@ extern const struct mtrr_ops *mtrr_if;
extern unsigned int num_var_ranges;
void mtrr_state_warn(void);
-
-extern int amd_init_mtrr(void);
-extern int cyrix_init_mtrr(void);
--
git-series 0.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] x86/mtrr: convert use_intel_if u32 to bool
2017-01-19 5:24 [PATCH v2 0/3] x86/mtrr: basic cleanups Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 1/3] x86/mtrr: drop positive_have_wrcomb() Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 2/3] x86/mtrr: drop unused func prototypes and struct Doug Goldstein
@ 2017-01-19 5:24 ` Doug Goldstein
2017-01-19 9:17 ` Jan Beulich
2 siblings, 1 reply; 5+ messages in thread
From: Doug Goldstein @ 2017-01-19 5:24 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Doug Goldstein, Jan Beulich
This field is always only 1 currently but may allow 0 in the future so
convert it to a bool to provide proper range checking by the compiler.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
xen/arch/x86/cpu/mtrr/generic.c | 2 +-
xen/arch/x86/cpu/mtrr/mtrr.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/cpu/mtrr/generic.c b/xen/arch/x86/cpu/mtrr/generic.c
index 8d4537a..104baf9 100644
--- a/xen/arch/x86/cpu/mtrr/generic.c
+++ b/xen/arch/x86/cpu/mtrr/generic.c
@@ -560,7 +560,7 @@ static int generic_have_wrcomb(void)
/* generic structure...
*/
const struct mtrr_ops generic_mtrr_ops = {
- .use_intel_if = 1,
+ .use_intel_if = true,
.set_all = generic_set_all,
.get = generic_get_mtrr,
.get_free_region = generic_get_free_region,
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index bb57def..ae4aad9 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -9,7 +9,7 @@
struct mtrr_ops {
u32 vendor;
- u32 use_intel_if;
+ bool use_intel_if;
// void (*init)(void);
void (*set)(unsigned int reg, unsigned long base,
unsigned long size, mtrr_type type);
@@ -39,7 +39,7 @@ extern u64 size_or_mask, size_and_mask;
extern const struct mtrr_ops *mtrr_if;
#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
-#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
+#define use_intel() (mtrr_if && mtrr_if->use_intel_if == true)
extern unsigned int num_var_ranges;
--
git-series 0.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 3/3] x86/mtrr: convert use_intel_if u32 to bool
2017-01-19 5:24 ` [PATCH v2 3/3] x86/mtrr: convert use_intel_if u32 to bool Doug Goldstein
@ 2017-01-19 9:17 ` Jan Beulich
0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2017-01-19 9:17 UTC (permalink / raw)
To: Doug Goldstein; +Cc: Andrew Cooper, xen-devel
>>> On 19.01.17 at 06:24, <cardoe@cardoe.com> wrote:
> @@ -39,7 +39,7 @@ extern u64 size_or_mask, size_and_mask;
> extern const struct mtrr_ops *mtrr_if;
>
> #define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
> -#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
> +#define use_intel() (mtrr_if && mtrr_if->use_intel_if == true)
With the "== true" here dropped (which can be done while
committing)
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-01-19 9:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19 5:24 [PATCH v2 0/3] x86/mtrr: basic cleanups Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 1/3] x86/mtrr: drop positive_have_wrcomb() Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 2/3] x86/mtrr: drop unused func prototypes and struct Doug Goldstein
2017-01-19 5:24 ` [PATCH v2 3/3] x86/mtrr: convert use_intel_if u32 to bool Doug Goldstein
2017-01-19 9:17 ` Jan Beulich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.