From d1863495b0e6ca8710dd5211614317de72819c16 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Thu, 24 Oct 2019 00:03:49 +0200 Subject: [PATCH] minor fix --- README.md | 2 +- common/nanoBench.c | 2 +- kernel/nb_km.c | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ab86b1..7270e72 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ The config file contains the required information for configuring the programmab The assembler code sequence may use and modify any general-purpose or vector registers (unless the `-loop` or `-no_mem` options are used), including the stack pointer. There is no need to restore the registers to their original values at the end. -R14, RDI, RSI, RSP, and RBP are initialized with addresses in the middle of dedicated physically-contiguous memory areas (of 1 MB each), that can be freely modified by the assembler code. When using the kernel module, the size of the memory area that R14 points to can be increased using the `set-R14-size.sh` script; more details on this can be found [here](tools/CacheAnalyzer#prerequisites). +R14, RDI, RSI, RSP, and RBP are initialized with addresses in the middle of dedicated memory areas (of 1 MB each), that can be freely modified by the assembler code. When using the kernel module, the size of the memory area that R14 points to can be increased using the `set-R14-size.sh` script; more details on this can be found [here](tools/CacheAnalyzer#prerequisites). All other registers have initially undefined values. They can, however, be initialized as shown in the following example. diff --git a/common/nanoBench.c b/common/nanoBench.c index 02d9fc1..5bb1b5e 100644 --- a/common/nanoBench.c +++ b/common/nanoBench.c @@ -142,7 +142,7 @@ void parse_counter_configs() { continue; } - pfc_configs[n_pfc_configs].invalid = 0; + pfc_configs[n_pfc_configs] = (struct pfc_config){0}; char* config_str = strsep(&line, " \t"); diff --git a/kernel/nb_km.c b/kernel/nb_km.c index da4fda2..9ecfe79 100644 --- a/kernel/nb_km.c +++ b/kernel/nb_km.c @@ -130,9 +130,12 @@ static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr, ch ssize_t count = 0; for (int i=0; i PAGE_SIZE) { + return PAGE_SIZE-1; } } return count;