Re: [kvm-unit-tests PATCH v5 12/29] powerpc/sprs: Avoid taking async interrupts caused by register fuzzing

2023-12-19 Thread Thomas Huth
On 16/12/2023 14.42, Nicholas Piggin wrote: Storing certain values in some registers can cause asynchronous interrupts that can crash the test case, for example decrementer or PMU interrupts. Change the msleep to mdelay which does not enable MSR[EE] and so avoids the problem. This allows

Re: [kvm-unit-tests PATCH v5 11/29] powerpc/sprs: Don't fail changed SPRs that are used by the test harness

2023-12-19 Thread Thomas Huth
I guess you could even squash this into the previous patch. Anyway: Reviewed-by: Thomas Huth

Re: [kvm-unit-tests PATCH v5 10/29] powerpc/sprs: Specify SPRs with data rather than code

2023-12-18 Thread Thomas Huth
not being used at the moment for completeness, but also the code might one day be reused for a hypervisor-privileged test. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- powerpc/sprs.c | 643 ++--- 1 file changed, 450 insertions(+), 193 deletions

Re: [kvm-unit-tests PATCH v5 09/29] powerpc: Fix interrupt stack alignment

2023-12-18 Thread Thomas Huth
insertions(+) Reviewed-by: Thomas Huth

Re: [kvm-unit-tests PATCH v5 08/29] powerpc: Require KVM for the TM test

2023-12-18 Thread Thomas Huth
..e71140aa 100644 --- a/powerpc/unittests.cfg +++ b/powerpc/unittests.cfg @@ -65,6 +65,7 @@ file = emulator.elf [h_cede_tm] file = tm.elf +accel = kvm smp = 2,threads=2 extra_params = -machine cap-htm=on -append "h_cede_tm" groups = h_cede_tm Reviewed-by: Thomas Huth

Re: [kvm-unit-tests PATCH v5 07/29] powerpc: Add a migration stress tester

2023-12-18 Thread Thomas Huth
On 16/12/2023 14.42, Nicholas Piggin wrote: This performs 1000 migrations a tight loop to flush out simple issues in the multiple-migration code. Signed-off-by: Nicholas Piggin --- powerpc/Makefile.common | 1 + powerpc/migrate.c | 64 + 2

Re: [kvm-unit-tests PATCH v5 06/29] powerpc: Quiet QEMU TCG pseries capability warnings

2023-12-18 Thread Thomas Huth
fixed in QEMU instead (e.g. by providing a different CPU model for TCG mode). Anyway, for the time being: Reviewed-by: Thomas Huth

Re: [PATCH 18/26] KVM: s390: Stop adding virt/kvm to the arch include path

2023-09-18 Thread Thomas Huth
include $(srctree)/virt/kvm/Makefile.kvm -ccflags-y := -Ivirt/kvm -Iarch/s390/kvm +ccflags-y := -Iarch/s390/kvm kvm-y += kvm-s390.o intercept.o interrupt.o priv.o sigp.o kvm-y += diag.o gaccess.o guestdbg.o vsie.o pv.o Reviewed-by: Thomas Huth

Re: [kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld

2023-08-14 Thread Thomas Huth
On 27/06/2023 00.34, Sean Christopherson wrote: On Fri, Jun 23, 2023, Thomas Huth wrote: On 23/06/2023 16.24, Sean Christopherson wrote: On Fri, Jun 23, 2023, Thomas Huth wrote: Newer versions of ld (from binutils 2.40) complain on s390x and x86: ld: warning: s390x/cpu.o: missing

Re: [kvm-unit-tests v4 00/12] powerpc: updates, P10, PNV support

2023-07-03 Thread Thomas Huth
On 08/06/2023 09.58, Nicholas Piggin wrote: Posting again, a couple of patches were merged and accounted for review comments from last time. Sorry for not being very responsive ... it's been a busy month. Anyway, I've now merged the first 5 patches and the VPA test since they look fine to

Re: [kvm-unit-tests v4 03/12] powerpc: Abstract H_CEDE calls into a sleep functions

2023-07-03 Thread Thomas Huth
On 08/06/2023 09.58, Nicholas Piggin wrote: This consolidates several implementations, and it no longer leaves MSR[EE] enabled after the decrementer interrupt is handled, but rather disables it on return. The handler no longer allows a continuous ticking, but rather dec has to be re-armed and

Re: [kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld

2023-06-23 Thread Thomas Huth
On 23/06/2023 16.24, Sean Christopherson wrote: On Fri, Jun 23, 2023, Thomas Huth wrote: Newer versions of ld (from binutils 2.40) complain on s390x and x86: ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack ld: NOTE: This behaviour

[kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld

2023-06-23 Thread Thomas Huth
these warnings by using "-z noexecstack" for linking (which should not have any real influence on the kvm-unit-tests since the information from the ELF header is not used here anyway, so it's just cosmetics). Signed-off-by: Thomas Huth --- Makefile | 2 +- 1 file changed, 1 insertion(+),

[kvm-unit-tests PATCH 1/2] Rework the common LDFLAGS to become more useful again

2023-06-23 Thread Thomas Huth
ditionally to the linker. Signed-off-by: Thomas Huth --- Makefile| 2 +- arm/Makefile.common | 2 +- powerpc/Makefile.common | 2 +- s390x/Makefile | 2 +- x86/Makefile.common | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Make

[kvm-unit-tests PATCH 0/2] Rework LDFLAGS and link with noexecstack

2023-06-23 Thread Thomas Huth
t-tests, I had to discover that the common LDFLAGS are hardly used anywhere, so the first patch cleans up that problem first before adding the new flag in the second patch. Thomas Huth (2): Rework the common LDFLAGS to become more useful again Link with "-z noexecstack" to avoi

Re: [kvm-unit-tests v4 02/12] powerpc: Add some checking to exception handler install

2023-06-21 Thread Thomas Huth
xception handler installed twice %#x\n", trap); + abort(); } + handlers[trap].func = func; + handlers[trap].data = data; } void do_handle_exception(struct pt_regs *regs) Reviewed-by: Thomas Huth

Re: [kvm-unit-tests v4 01/12] powerpc: Report instruction address and MSR in unhandled exception error

2023-06-21 Thread Thomas Huth
On 08/06/2023 09.58, Nicholas Piggin wrote: Signed-off-by: Nicholas Piggin --- Since v3: - New patch lib/powerpc/processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/powerpc/processor.c b/lib/powerpc/processor.c index ec85b9d8..05b4b04f 100644 ---

Re: [PATCH] KVM: PPC: remove unneeded variable

2023-06-21 Thread Thomas Huth
  return r; +    /* Indicate we want to get back into the guest */ +    return 1;  }  /* MMU Notifiers */ Please make sure to CC: linuxppc-dev@lists.ozlabs.org when sending patches for KVM on ppc. Reviewed-by: Thomas Huth

Re: [kvm-unit-tests v3 11/13] powerpc: Discover runtime load address dynamically

2023-04-04 Thread Thomas Huth
the address With s/addreses/addresses/ : Acked-by: Thomas Huth

Re: [kvm-unit-tests v3 10/13] powerpc: Add support for more interrupts including HV interrupts

2023-04-04 Thread Thomas Huth
/ HSRR type interrupts which will be used in a later change. Signed-off-by: Nicholas Piggin --- powerpc/cstart64.S | 79 ++ 1 file changed, 65 insertions(+), 14 deletions(-) Acked-by: Thomas Huth

Re: [kvm-unit-tests v3 09/13] powerpc: Expand exception handler vector granularity

2023-04-04 Thread Thomas Huth
On 27/03/2023 14.45, Nicholas Piggin wrote: Exception handlers are currently indexed in units of 0x100, but powerpc can have vectors that are aligned to as little as 0x20 bytes. Increase granularity of the handler functions before adding support for thse vectors. s/thse/those/ Thomas

Re: [kvm-unit-tests v3 08/13] powerpc/spapr_vpa: Add basic VPA tests

2023-04-04 Thread Thomas Huth
On 27/03/2023 14.45, Nicholas Piggin wrote: The VPA is an optional memory structure shared between the hypervisor and operating system, defined by PAPR. This test defines the structure and adds registration, deregistration, and a few simple sanity tests. [Thanks to Thomas Huth for suggesting

Re: [kvm-unit-tests v3 07/13] powerpc/sprs: Specify SPRs with data rather than code

2023-04-04 Thread Thomas Huth
bugs which really motivated me to improve the SPR coverage. --- Since v2: - Merged with "Indirect SPR accessor functions" patch. powerpc/sprs.c | 643 ++--- 1 file changed, 450 insertions(+), 193 deletions(-) Acked-by: Thomas Huth

Re: [kvm-unit-tests v3 03/13] powerpc: Add some checking to exception handler install

2023-03-27 Thread Thomas Huth
On 27/03/2023 14.45, Nicholas Piggin wrote: Check to ensure exception handlers are not being overwritten or invalid exception numbers are used. Signed-off-by: Nicholas Piggin --- Since v2: - New patch lib/powerpc/processor.c | 12 1 file changed, 12 insertions(+) diff --git

Re: [kvm-unit-tests v2 10/10] powerpc/sprs: Test hypervisor registers on powernv machine

2023-03-23 Thread Thomas Huth
continue; if (!strcmp(sprs[i].name, "MMCR0")) { @@ -546,7 +563,7 @@ int main(int argc, char **argv) for (i = 0; i < 1024; i++) { bool pass = true; - if (!(sprs[i].access & SPR_OS_READ)) + if (!spr_read_perms(i)) continue; if (sprs[i].width == 32) { Acked-by: Thomas Huth

Re: [kvm-unit-tests v2 09/10] powerpc: Support powernv machine with QEMU TCG

2023-03-23 Thread Thomas Huth
On 20/03/2023 08.03, Nicholas Piggin wrote: This is a basic first pass at powernv support using OPAL (skiboot) firmware. The ACCEL is a bit clunky, now defaulting to tcg for powernv machine. It also does not yet run in the run_tests.sh batch process, more work is needed to exclude certain tests

Re: [kvm-unit-tests v2 07/10] powerpc/spapr_vpa: Add basic VPA tests

2023-03-23 Thread Thomas Huth
On 20/03/2023 08.03, Nicholas Piggin wrote: The VPA is a(n optional) memory structure shared between the hypervisor and operating system, defined by PAPR. This test defines the structure and adds registration, deregistration, and a few simple sanity tests. Signed-off-by: Nicholas Piggin ---

Re: [kvm-unit-tests v2 06/10] powerpc/sprs: Specify SPRs with data rather than code

2023-03-23 Thread Thomas Huth
On 20/03/2023 08.03, Nicholas Piggin wrote: A significant rework that builds an array of 'struct spr', where each element describes an SPR. This makes various metadata about the SPR like name and access type easier to carry and use. Hypervisor privileged registers are described despite not

Re: [kvm-unit-tests v2 03/10] powerpc: abstract H_CEDE calls into a sleep functions

2023-03-23 Thread Thomas Huth
On 20/03/2023 08.03, Nicholas Piggin wrote: This consolidates several implementations, and it no longer leaves MSR[EE] enabled after the decrementer interrupt is handled, but rather disables it on return. The handler no longer allows a continuous ticking, but rather dec has to be re-armed and

Re: [kvm-unit-tests v2 04/10] powerpc: Add ISA v3.1 (POWER10) support to SPR test

2023-03-23 Thread Thomas Huth
case 0x80: /* POWER10 */ + get_sprs_book3s_31(v); + break; } } Looks like I accidentally replied to v1 a couple of minutes ago... I meant to reply here: Reviewed-by: Thomas Huth

Re: [kvm-unit-tests PATCH 4/7] powerpc: Add ISA v3.1 (POWER10) support to SPR test

2023-03-23 Thread Thomas Huth
On 17/03/2023 13.36, Nicholas Piggin wrote: This is a very basic detection that does not include all new SPRs. Signed-off-by: Nicholas Piggin --- powerpc/sprs.c | 22 ++ 1 file changed, 22 insertions(+) Reviewed-by: Thomas Huth

Re: [kvm-unit-tests v2 02/10] powerpc: add local variant of SPR test

2023-03-23 Thread Thomas Huth
On 20/03/2023 08.03, Nicholas Piggin wrote: This adds the non-migration variant of the SPR test to the matrix, which can be simpler to run and debug. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- powerpc/unittests.cfg | 4 1 file changed, 4 insertions(+) diff --git

Re: [kvm-unit-tests v2 01/10] MAINTAINERS: Update powerpc list

2023-03-23 Thread Thomas Huth
tion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 649de50..b545a45 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -79,7 +79,7 @@ M: Laurent Vivier M: Thomas Huth S: Maintained L: k...@vger.kernel.org -L: kvm-...@vger.kernel.org +L: linuxppc-dev@lists.ozlabs.org F: powerpc

Re: [kvm-unit-tests PATCH 3/7] powerpc: abstract H_CEDE calls into a sleep() function

2023-03-17 Thread Thomas Huth
On 17/03/2023 13.36, Nicholas Piggin wrote: This consolidates several implementations, and it no longer leaves MSR[EE] enabled after the decrementer interrupt is handled, but rather disables it on return. The handler no longer allows a continuous ticking, but rather dec has to be re-armed and

Re: [kvm-unit-tests PATCH 2/7] powerpc: add local variant of SPR test

2023-03-17 Thread Thomas Huth
/powerpc/unittests.cfg index 1e74948..3e41598 100644 --- a/powerpc/unittests.cfg +++ b/powerpc/unittests.cfg @@ -68,5 +68,9 @@ groups = h_cede_tm [sprs] file = sprs.elf +groups = sprs + +[sprs-migration] +file = sprs.elf extra_params = -append '-w' groups = migration Reviewed-by: Thomas

Re: [PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-08 Thread Thomas Huth
On 08/02/2023 12.51, Steven Price wrote: On 08/02/2023 08:49, Cornelia Huck wrote: On Wed, Feb 08 2023, Gavin Shan wrote: On 2/7/23 9:09 PM, Thomas Huth wrote: Oh, drat, I thought I had checked all return statements ... this must have fallen through the cracks, sorry! Anyway

Re: [PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-07 Thread Thomas Huth
On 07/02/2023 01.09, Gavin Shan wrote: Hi Thomas, On 2/3/23 8:42 PM, Thomas Huth wrote: This function only returns normal integer values, so there is no need to declare its return value as "long". Signed-off-by: Thomas Huth ---   arch/arm64/include/asm/kvm_host.h | 4 ++--   arch

Re: [PATCH 2/7] KVM: x86: Improve return type handling in kvm_vm_ioctl_get_nr_mmu_pages()

2023-02-07 Thread Thomas Huth
On 03/02/2023 18.48, Sean Christopherson wrote: On Fri, Feb 03, 2023, Thomas Huth wrote: kvm_vm_ioctl_get_nr_mmu_pages() tries to return a "unsigned long" value, but its caller only stores ther return value in an "int" - which is also what all the other kvm_vm_ioctl_*() fun

Re: [PATCH 3/7] KVM: Move KVM_GET_NR_MMU_PAGES into the deprecation section

2023-02-03 Thread Thomas Huth
On 03/02/2023 11.16, Nicholas Piggin wrote: On Fri Feb 3, 2023 at 7:42 PM AEST, Thomas Huth wrote: The KVM_GET_NR_MMU_PAGES ioctl is quite questionable on 64-bit hosts since it fails to return the full 64 bits of the value that can be set with the corresponding KVM_SET_NR_MMU_PAGES call

[PATCH 1/7] KVM: Standardize on "int" return types instead of "long" in kvm_main.c

2023-02-03 Thread Thomas Huth
ill uses "long" in unnecessary spots, though, which can cause a little bit of confusion and unnecessary size casts. Let's change these spots to use "int" types, too. Signed-off-by: Thomas Huth --- virt/kvm/kvm_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletio

[PATCH 7/7] KVM: Change return type of kvm_arch_vm_ioctl() to "int"

2023-02-03 Thread Thomas Huth
All kvm_arch_vm_ioctl() implementations now only deal with "int" types as return values, so we can change the return type of these functions to use "int" instead of "long". Signed-off-by: Thomas Huth --- arch/arm64/kvm/arm.c | 3 +-- arch/mips/kvm/mips.c

[PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-03 Thread Thomas Huth
This function only returns normal integer values, so there is no need to declare its return value as "long". Signed-off-by: Thomas Huth --- arch/arm64/include/asm/kvm_host.h | 4 ++-- arch/arm64/kvm/guest.c| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --

[PATCH 5/7] KVM: s390: Use "int" as return type for kvm_s390_get/set_skeys()

2023-02-03 Thread Thomas Huth
These two functions only return normal integers, so it does not make sense to declare the return type as "long" here. Signed-off-by: Thomas Huth --- arch/s390/kvm/kvm-s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kv

[PATCH 3/7] KVM: Move KVM_GET_NR_MMU_PAGES into the deprecation section

2023-02-03 Thread Thomas Huth
and kvmtool which I checked), so it's better to move it to the deprecation section in kvm.h to make it clear for developers that this also should not be used in new code in the future anymore. Signed-off-by: Thomas Huth --- include/uapi/linux/kvm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH 4/7] KVM: PPC: Standardize on "int" return types in the powerpc KVM code

2023-02-03 Thread Thomas Huth
re to avoid casting the values back and forth between the two types. Signed-off-by: Thomas Huth --- arch/powerpc/include/asm/kvm_ppc.h | 14 +++--- arch/powerpc/kvm/book3s_64_mmu_hv.c | 14 +++--- arch/powerpc/kvm/book3s_64_vio.c| 4 ++-- arch/powerpc/kvm/book3s_hv.c

[PATCH 2/7] KVM: x86: Improve return type handling in kvm_vm_ioctl_get_nr_mmu_pages()

2023-02-03 Thread Thomas Huth
not work here. It's better to adjust the return type, add a sanity check and return an error instead if the value is too big. Signed-off-by: Thomas Huth --- arch/x86/kvm/x86.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.

[PATCH 0/7] KVM: Standardize on "int" return types instead of "long"

2023-02-03 Thread Thomas Huth
roblems (see second patch). Thus let's standardize on using "int" for return values in these functions to avoid such problems in the future. Thomas Huth (7): KVM: Standardize on "int" return types instead of "long" in kvm_main.c KVM: x86: Improve return type

Re: serial hang in qemu-system-ppc64 -M pseries

2022-04-27 Thread Thomas Huth
On 27/04/2022 17.27, Thomas Huth wrote: On 26/04/2022 12.26, Rob Landley wrote: When I cut and paste 80-ish characters of text into the Linux serial console, it reads 16 characters and stops. When I hit space, it reads another 16 characters, and if I keep at it will eventually catch up

Re: serial hang in qemu-system-ppc64 -M pseries

2022-04-27 Thread Thomas Huth
On 26/04/2022 12.26, Rob Landley wrote: When I cut and paste 80-ish characters of text into the Linux serial console, it reads 16 characters and stops. When I hit space, it reads another 16 characters, and if I keep at it will eventually catch up without losing data. If I type, every character

Re: [PATCH v2 1/7] KVM: s390: clean up redundant 'kvm_run' parameters

2020-04-26 Thread Thomas Huth
On 23/04/2020 13.00, Christian Borntraeger wrote: > > > On 23.04.20 12:58, Tianjia Zhang wrote: >> >> >> On 2020/4/23 18:39, Cornelia Huck wrote: >>> On Thu, 23 Apr 2020 11:01:43 +0800 >>> Tianjia Zhang wrote: >>> On 2020/4/23 0:04, Cornelia Huck wrote: > On Wed, 22 Apr 2020 17:58:04

Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-18 Thread Thomas Huth
On 18/09/2019 22.54, Greg Kurz wrote: > On Wed, 18 Sep 2019 18:44:36 +0200 > Greg Kurz wrote: > >> On Wed, 11 Sep 2019 21:52:35 +0200 >> Thomas Huth wrote: >> >>> After the kfree()s haven been removed in the previous >>> commit 9798f4ea71ea

[PATCH] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-11 Thread Thomas Huth
After the kfree()s haven been removed in the previous commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"), the code can be simplified even more to simply always "return ret" now. Signed-off-by: Thomas Huth --- arch/powerpc/kvm/book3s_xive.c| 5 +--

[PATCH] powerpc: Replace GPL boilerplate with SPDX identifiers

2019-08-28 Thread Thomas Huth
The FSF does not reside in "675 Mass Ave, Cambridge" anymore... let's simply use proper SPDX identifiers instead. Signed-off-by: Thomas Huth --- arch/powerpc/include/uapi/asm/spu_info.h | 14 -- arch/powerpc/kernel/eeh_driver.c | 18 +- ar

Re: [PATCH] powerpc/configs: Enable CONFIG_USB_XHCI_HCD by default

2019-04-07 Thread Thomas Huth
On 12/02/2019 00.31, David Gibson wrote: > On Mon, 11 Feb 2019 12:37:12 +0100 > Thomas Huth wrote: > >> Recent versions of QEMU provide a XHCI device by default these >> days instead of an old-fashioned OHCI device: >> >> https://git.qemu.org/?p=qemu.git;a=

[PATCH] powerpc/configs: Enable CONFIG_USB_XHCI_HCD by default

2019-02-11 Thread Thomas Huth
by default, too. Signed-off-by: Thomas Huth --- arch/powerpc/configs/pseries_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index ea79c51..62e12f6 100644 --- a/arch/powerpc/configs/pseries_defconfig

Re: [PATCH] KVM: PPC: fix oops when checking KVM_CAP_PPC_HTM

2017-09-18 Thread Thomas Huth
XTENSION, 0x84) = 1 >> ioctl(3, KVM_CREATE_VM, 0x2)= 5 <== PR >> ioctl(5, KVM_CHECK_EXTENSION, 0x84) = 0 >> >> The hv_enabled variable is set as follows: >> >> /* Assume we're using HV mode when the HV module is loaded */ >> int hv_enabled = kvmppc_hv_ops ? 1 : 0; >> >> if (kvm) { >> /* >> * Hooray - we know which VM type we're running on. Depend on >> * that rather than the guess above. >> */ >> hv_enabled = is_kvmppc_hv_enabled(kvm); >> } >> >> so we're good. :) > > Oh, sorry, missed that bit. In that case. > > Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> LGTM, too: Reviewed-by: Thomas Huth <th...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [PATCH v3] KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs

2017-04-25 Thread Thomas Huth
On 05.04.2017 15:58, Thomas Huth wrote: > According to the PowerISA 2.07, mtspr and mfspr should not always > generate an illegal instruction exception when being used with an > undefined SPR, but rather treat the instruction as a NOP or inject a > privilege exception in som

[PATCH v3] KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs

2017-04-05 Thread Thomas Huth
into a ratelimited print statement, so that the guest can not flood the dmesg log of the host by issueing lots of illegal mtspr/mfspr instruction here. Signed-off-by: Thomas Huth <th...@redhat.com> --- v3: - Make sure that we do not advance the program counter after we've already changed

[PATCH v2] KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs

2017-04-04 Thread Thomas Huth
into a ratelimited print statement, so that the guest can not flood the dmesg log of the host by issueing lots of illegal mtspr/mfspr instruction here. Signed-off-by: Thomas Huth <th...@redhat.com> --- v2: - Inject illegal instruction program interrupt instead of emulation assist int

Re: [PATCH] KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs

2017-04-04 Thread Thomas Huth
On 04.04.2017 08:25, Paul Mackerras wrote: > On Mon, Apr 03, 2017 at 01:23:15PM +0200, Thomas Huth wrote: >> According to the PowerISA 2.07, mtspr and mfspr should not generate >> an illegal instruction exception when being used with an undefined SPR, >> but rather treat the

[PATCH] KVM: PPC: Book3S PR: Do not always inject facility unavailable exceptions

2017-04-03 Thread Thomas Huth
st vCPU is not in PR mode, we should follow the behavior that is described in chapter "4.4.4 Move To/From System Register Instructions" instead and treat the instruction as a NOP. Signed-off-by: Thomas Huth <th...@redhat.com> --- arch/powerpc/kvm/book3s_pr.c | 28

[PATCH] KVM: PPC: Book3S PR: Do not fail emulation with mtspr/mfspr for unknown SPRs

2017-04-03 Thread Thomas Huth
the printk here into a ratelimited print statement, so that the guest can not flood the dmesg log of the host by issueing lots of illegal mtspr/mfspr instruction here. Signed-off-by: Thomas Huth <th...@redhat.com> --- arch/powerpc/kvm/book3s.c | 1 + arch/powerpc/kvm/book3s_emulate.

[PATCH] KVM: PPC: Book3S PR: Refactor program interrupt related code into separate function

2017-01-25 Thread Thomas Huth
nstruction emulation into a separate function instead. Signed-off-by: Thomas Huth <th...@redhat.com> --- arch/powerpc/kvm/book3s_pr.c | 130 +-- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/b

[PATCH] ibmveth: Add a proper check for the availability of the checksum features

2017-01-23 Thread Thomas Huth
not occur if the feature is just missing. Signed-off-by: Thomas Huth <th...@redhat.com> --- drivers/net/ethernet/ibm/ibmveth.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index a831f94

Re: [PATCH 05/11] KVM: PPC: Book3S HV: Adjust nine checks for null pointers

2017-01-23 Thread Thomas Huth
On 20.01.2017 19:23, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 20 Jan 2017 11:25:48 +0100 > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > The script "checkpatch.pl" pointed information out like

Re: [PATCH 06/11] powerpc/kvm: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size

2016-12-18 Thread Thomas Huth
On 19.12.2016 01:48, David Gibson wrote: > On Fri, Dec 16, 2016 at 01:44:57PM +0100, Thomas Huth wrote: >> On 15.12.2016 06:53, David Gibson wrote: >>> The KVM_PPC_ALLOCATE_HTAB ioctl() is used to set the size of hashed page >>> table (HPT) that userspace expects a gu

Re: [PATCH 08/11] powerpc/kvm: KVM-HV HPT resizing stub implementation

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:54, David Gibson wrote: > This patch adds a stub (always failing) implementation of the ioctl()s > for the HPT resizing PAPR extension. > > Signed-off-by: David Gibson > --- > arch/powerpc/include/asm/kvm_ppc.h | 4 >

Re: [PATCH 01/11] powerpc/kvm: Reserve capabilities and ioctls for HPT resizing

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:53, David Gibson wrote: > This adds a new powerpc-specific KVM_CAP_SPAPR_RESIZE_HPT capability to > advertise whether KVM is capable of handling the PAPR extensions for > resizing the hashed page table during guest runtime. > > At present, HPT resizing is possible with KVM PR

Re: [PATCH 07/11] powerpc/kvm: Create kvmppc_unmap_hpte_helper()

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:54, David Gibson wrote: > The kvm_unmap_rmapp() function, called from certain MMU notifiers, is used > to force all guest mappings of a particular host page to be set ABSENT, and > removed from the reverse mappings. > > For HPT resizing, we will have some cases where we want to

Re: [PATCH 06/11] powerpc/kvm: Allow KVM_PPC_ALLOCATE_HTAB ioctl() to change HPT size

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:53, David Gibson wrote: > The KVM_PPC_ALLOCATE_HTAB ioctl() is used to set the size of hashed page > table (HPT) that userspace expects a guest VM to have, and is also used to > clear that HPT when necessary (e.g. guest reboot). > > At present, once the ioctl() is called for the

Re: [PATCH 05/11] powerpc/kvm: Split HPT allocation from activation

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:53, David Gibson wrote: > Currently, kvmppc_alloc_hpt() both allocates a new hashed page table (HPT) > and sets it up as the active page table for a VM. For the upcoming HPT > resize implementation we're going to want to allocate HPTs separately from > activating them. > > So,

Re: [PATCH 04/11] powerpc/kvm: Don't store values derivable from HPT order

2016-12-16 Thread Thomas Huth
/* Now skip invalid entries while we can */ > - while (i < kvm->arch.hpt.npte && > + while (i < kvmppc_hpt_npte(>arch.hpt) && > hdr.n_invalid < 0x && > record_hpte(flags, hptp, hpte, revp, 0, first_pass)) { > /* found an invalid entry */ Dito, you could use a local variable to store the value from kvmppc_hpt_npte() Anyway, apart from these nits, patch looks fine to me, so: Reviewed-by: Thomas Huth <th...@redhat.com>

Re: [PATCH 01/11] powerpc/kvm: Reserve capabilities and ioctls for HPT resizing

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:53, David Gibson wrote: > This adds a new powerpc-specific KVM_CAP_SPAPR_RESIZE_HPT capability to > advertise whether KVM is capable of handling the PAPR extensions for > resizing the hashed page table during guest runtime. > > At present, HPT resizing is possible with KVM PR

Re: [PATCH 03/11] powerpc/kvm: Gather HPT related variables into sub-structure

2016-12-16 Thread Thomas Huth
On 15.12.2016 06:53, David Gibson wrote: > Currently, the powerpc kvm_arch structure contains a number of variables > tracking the state of the guest's hashed page table (HPT) in KVM HV. This > patch gathers them all together into a single kvm_hpt_info substructure. > This makes life more

Re: [PATCH 02/11] powerpc/kvm: Rename kvm_alloc_hpt() for clarity

2016-12-16 Thread Thomas Huth
_SYMBOL_GPL(kvm_alloc_hpt); > +EXPORT_SYMBOL_GPL(kvm_alloc_hpt_cma); > > -void kvm_release_hpt(struct page *page, unsigned long nr_pages) > +void kvm_free_hpt_cma(struct page *page, unsigned long nr_pages) > { > cma_release(kvm_cma, page, nr_pages); > } > -EXPORT_SYMBOL_GPL(kvm_release_hpt); > +EXPORT_SYMBOL_GPL(kvm_free_hpt_cma); > > /** > * kvm_cma_reserve() - reserve area for kvm hash pagetable Reviewed-by: Thomas Huth <th...@redhat.com>

[PATCH] KVM: PPC: Book3s PR: Allow access to unprivileged MMCR2 register

2016-09-21 Thread Thomas Huth
n, we have to support register 769 in KVM-PR, too. Fixes: 8dd75ccb571f3c92c48014b3dabd3d51a115ab41 Cc: sta...@vger.kernel.org # v3.10+ Signed-off-by: Thomas Huth <th...@redhat.com> --- arch/powerpc/include/asm/reg.h| 1 + arch/powerpc/kvm/book3s_emulate.c | 2 ++ 2 files changed, 3 insertion

Re: [PATCH] powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call

2016-06-08 Thread Thomas Huth
On 08.06.2016 12:44, Michael Ellerman wrote: > On Wed, 2016-06-08 at 11:14 +1000, Balbir Singh wrote: >> On 31/05/16 20:32, Michael Ellerman wrote: >>> On Tue, 2016-05-31 at 12:19 +0200, Thomas Huth wrote: >>>> On 31.05.2016 12:04, Michael Ellerman wrote: >>&

Re: [PATCH] powerpc: Fix IBM_ARCH_VEC_NRCORES_OFFSET value

2016-06-08 Thread Thomas Huth
+" to the patch since the commit 7cc851039d64 did have that as well. And sorry for breaking this! Reviewed-by: Thomas Huth <th...@redhat.com> ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call

2016-06-08 Thread Thomas Huth
On 08.06.2016 03:14, Balbir Singh wrote: > > On 31/05/16 20:32, Michael Ellerman wrote: >> On Tue, 2016-05-31 at 12:19 +0200, Thomas Huth wrote: >>> On 31.05.2016 12:04, Michael Ellerman wrote: >>>> On Tue, 2016-05-31 at 07:51 +0200, Thomas Huth wrote: &

Re: [PATCH] powerpc/pseries: Add POWER8NVL support to ibm,client-architecture-support call

2016-05-31 Thread Thomas Huth
On 31.05.2016 12:04, Michael Ellerman wrote: > On Tue, 2016-05-31 at 07:51 +0200, Thomas Huth wrote: > >> If we do not provide the PVR for POWER8NVL, a guest on this >> system currently ends up in PowerISA 2.06 compatibility mode on >> KVM, since QEMU does not provide a ge

[PATCH] powerpc/pseries: Add POWER8NVL support to ibm, client-architecture-support call

2016-05-30 Thread Thomas Huth
ashes when using code compiled explicitly for POWER8 (e.g. with the "-mcpu=power8" option of GCC). Signed-off-by: Thomas Huth <th...@redhat.com> --- arch/powerpc/kernel/prom_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerp

Re: powerpc/pseries: start rtasd before PCI probing

2016-05-23 Thread Thomas Huth
/rtasd.c | 19 ++- > 1 file changed, 14 insertions(+), 5 deletions(-) By the way, same is true for device UNplugging: When unplugging devices in QEMU while the firmware is still running, they are never properly removed from the guest. I've checked it, and you

Re: [PATCH] kvm-pr: manage illegal instructions

2016-05-19 Thread Thomas Huth
On 18.05.2016 12:53, Thomas Huth wrote: > On 18.05.2016 12:18, Thomas Huth wrote: >> On 17.05.2016 19:49, Laurent Vivier wrote: >>> >>> >>> On 17/05/2016 10:37, Alexander Graf wrote: >>>> On 05/17/2016 10:35 AM, Laurent Vivier wrote: >&

Re: [PATCH] kvm-pr: manage illegal instructions

2016-05-18 Thread Thomas Huth
On 18.05.2016 12:53, Thomas Huth wrote: > On 18.05.2016 12:18, Thomas Huth wrote: >> On 17.05.2016 19:49, Laurent Vivier wrote: >>> >>> >>> On 17/05/2016 10:37, Alexander Graf wrote: >>>> On 05/17/2016 10:35 AM, Laurent Vivier wrote: >&

Re: [PATCH] kvm-pr: manage illegal instructions

2016-05-18 Thread Thomas Huth
On 18.05.2016 12:18, Thomas Huth wrote: > On 17.05.2016 19:49, Laurent Vivier wrote: >> >> >> On 17/05/2016 10:37, Alexander Graf wrote: >>> On 05/17/2016 10:35 AM, Laurent Vivier wrote: >>>> >>>> On 12/05/2016 16:23, Laurent Vivier wrote:

Re: [PATCH] kvm-pr: manage illegal instructions

2016-05-18 Thread Thomas Huth
On 17.05.2016 19:49, Laurent Vivier wrote: > > > On 17/05/2016 10:37, Alexander Graf wrote: >> On 05/17/2016 10:35 AM, Laurent Vivier wrote: >>> >>> On 12/05/2016 16:23, Laurent Vivier wrote: On 12/05/2016 11:27, Alexander Graf wrote: > On 05/12/2016 11:10 AM, Laurent Vivier wrote:

[PATCH] powerpc: Use privileged SPR number for MMCR2

2016-05-12 Thread Thomas Huth
We are already using the privileged versions of MMCR0, MMCR1 and MMCRA in the kernel, so for MMCR2, we should better use the privileged versions, too, to be consistent. Suggested-by: Paul Mackerras <pau...@ozlabs.org> Signed-off-by: Thomas Huth <th...@redhat.com> --- arch/powerpc

[PATCH] powerpc: Fix definition of SIAR and SDAR registers

2016-05-12 Thread Thomas Huth
-by: Thomas Huth <th...@redhat.com> --- arch/powerpc/include/asm/reg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index f5f4c66..ce3e1b7 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/i

Re: [PATCH] powerpc: Fix definition of SIAR register

2016-05-12 Thread Thomas Huth
On 12.05.2016 06:57, Paul Mackerras wrote: > On Mon, Apr 25, 2016 at 10:15:47AM +0200, Alexander Graf wrote: >> +#define SPRN_SIAR796 >> >> I'm sure there's a reason (iSeries?) we used the r/o version before. Better >> introduce a new constant that gives us rw access and use that in the

Re: [PATCH] kvm-pr: manage illegal instructions

2016-05-09 Thread Thomas Huth
On 21.04.2016 11:25, Thomas Huth wrote: > On 15.03.2016 21:18, Laurent Vivier wrote: >> While writing some instruction tests for kvm-unit-tests for powerpc, >> I've found that illegal instructions are not managed correctly with kvm-pr, >> while it is fine with kvm-hv.

Re: [PATCH] powerpc: Fix definition of SIAR register

2016-04-25 Thread Thomas Huth
On 25.04.2016 10:15, Alexander Graf wrote: > > >> Am 25.04.2016 um 10:08 schrieb Madhavan Srinivasan >> <ma...@linux.vnet.ibm.com>: >> >> >> >>> On Friday 08 April 2016 09:24 PM, Thomas Huth wrote: >>> The SIAR register is available

Re: [PATCH] powerpc: Fix definition of SIAR register

2016-04-25 Thread Thomas Huth
On 08.04.2016 17:54, Thomas Huth wrote: > The SIAR register is available twice, one time as SPR 780 (unprivileged, > but read-only), and one time as SPR 796 (privileged, but read and write). > The Linux kernel code currently uses SPR 780 - and while this is OK for > read

Re: [PATCH] kvm-pr: manage illegal instructions

2016-04-21 Thread Thomas Huth
kvmppc_set_gpr(vcpu, 3, EV_UNIMPLEMENTED); > kvmppc_set_pc(vcpu, kvmppc_get_pc(vcpu) + 4); > emulated = EMULATE_DONE; > + } else { > + kvmppc_core_queue_program(vcpu, SRR1_PROGILL); > +

Re: [PATCH v2] kvm-pr: manage single-step mode

2016-04-11 Thread Thomas Huth
RUPT_MACHINE_CHECK and BOOK3S_INTERRUPT_TRACE > > arch/powerpc/kvm/book3s_pr.c | 32 +++- > 1 file changed, 31 insertions(+), 1 deletion(-) Reviewed-by: Thomas Huth <th...@redhat.com> ___ Linuxppc-dev mailing

[PATCH] powerpc: Fix definition of SIAR register

2016-04-08 Thread Thomas Huth
tries to write to this register, too (see the mtspr in book3s_hv_rmhandlers.S), the contents of this register sometimes get lost for the guests, e.g. during migration of a VM. To fix this issue, simply switch to the other SPR numer 796 instead. Signed-off-by: Thomas Huth <th...@redhat.com> ---

Re: [PATCH] kvm-pr: manage single-step mode

2016-04-08 Thread Thomas Huth
On 08.04.2016 08:58, Laurent Vivier wrote: > > > On 08/04/2016 08:23, Thomas Huth wrote: >> On 22.03.2016 15:53, Laurent Vivier wrote: >>> Until now, when we connect gdb to the QEMU gdb-server, the >>> single-step mode is not managed. >>>

Re: [PATCH] kvm-pr: manage single-step mode

2016-04-08 Thread Thomas Huth
On 22.03.2016 15:53, Laurent Vivier wrote: > Until now, when we connect gdb to the QEMU gdb-server, the > single-step mode is not managed. > > This patch adds this, only for kvm-pr: > > If KVM_GUESTDBG_SINGLESTEP is set, we enable single-step trace bit in the > MSR (MSR_SE) just before the

Re: [PATCH v2] KVM: PPC: Exit guest upon fatal machine check exception

2015-12-16 Thread Thomas Huth
On 16/12/15 06:56, Aravinda Prasad wrote: > This patch modifies KVM to cause a guest exit with > KVM_EXIT_NMI instead of immediately delivering a 0x200 > interrupt to guest upon machine check exception in > guest address. Exiting the guest enables QEMU to build > error log and deliver machine

Re: [PATCH] powerpc/cell: Remove the Cell QPACE code.

2015-11-26 Thread Thomas Huth
On 26/11/15 01:59, Rashmica Gupta wrote: > All users of QPACE have upgraded to QPACE2 so remove the Cell QPACE code. > > Signed-off-by: Rashmica Gupta > --- > arch/powerpc/boot/Makefile| 2 - > arch/powerpc/configs/ppc64_defconfig | 1 - >

Re: [PATCH] powerpc/cell: Remove the Cell QPACE code.

2015-11-26 Thread Thomas Huth
On 26/11/15 13:09, Michael Ellerman wrote: > On Thu, 2015-11-26 at 11:47 +0100, Thomas Huth wrote: > >> On 26/11/15 01:59, Rashmica Gupta wrote: > >>> All users of QPACE have upgraded to QPACE2 so remove the Cell QPACE code. >>> >>> Signed-

<    1   2   3   >